summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-03-14 12:16:51 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-03-14 12:16:51 +0100
commit30998baf652d4e66a92cd912519f9358be2cf628 (patch)
treee217ac116dde77b182df5683bdfb657f925461ff
parent6f7f9467f76b21d418de8a4dafeac1ec4516e8d5 (diff)
downloadipecamera-30998baf652d4e66a92cd912519f9358be2cf628.tar.gz
ipecamera-30998baf652d4e66a92cd912519f9358be2cf628.tar.bz2
ipecamera-30998baf652d4e66a92cd912519f9358be2cf628.tar.xz
ipecamera-30998baf652d4e66a92cd912519f9358be2cf628.zip
Set warning handler
-rw-r--r--cli.c2
-rw-r--r--pci.c3
-rw-r--r--pcilib.h2
3 files changed, 4 insertions, 3 deletions
diff --git a/cli.c b/cli.c
index 6301a01..5ab0962 100644
--- a/cli.c
+++ b/cli.c
@@ -655,7 +655,7 @@ int main(int argc, char **argv) {
else Usage(argc, argv, NULL);
}
- pcilib_set_error_handler(&Error);
+ pcilib_set_error_handler(&Error, &Error);
handle = pcilib_open(fpga_device, model);
if (handle < 0) Error("Failed to open FPGA device: %s", fpga_device);
diff --git a/pci.c b/pci.c
index 1ee99ce..c6c37c9 100644
--- a/pci.c
+++ b/pci.c
@@ -52,8 +52,9 @@ static void pcilib_print_error(const char *msg, ...) {
void (*pcilib_error)(const char *msg, ...) = pcilib_print_error;
void (*pcilib_warning)(const char *msg, ...) = pcilib_print_error;
-int pcilib_set_error_handler(void (*err)(const char *msg, ...)) {
+int pcilib_set_error_handler(void (*err)(const char *msg, ...), void (*warn)(const char *msg, ...)) {
pcilib_error = err;
+ pcilib_warning = warn;
}
pcilib_t *pcilib_open(const char *device, pcilib_model_t model) {
diff --git a/pcilib.h b/pcilib.h
index b1288a8..7924128 100644
--- a/pcilib.h
+++ b/pcilib.h
@@ -103,7 +103,7 @@ typedef struct {
extern pcilib_model_description_t pcilib_model[];
#endif /* ! _PCILIB_PCI_C */
-int pcilib_set_error_handler(void (*err)(const char *msg, ...));
+int pcilib_set_error_handler(void (*err)(const char *msg, ...), void (*warn)(const char *msg, ...));
pcilib_model_t pcilib_get_model(pcilib_t *ctx);