diff options
-rw-r--r-- | cli.c | 2 | ||||
-rw-r--r-- | pci.c | 3 | ||||
-rw-r--r-- | pcilib.h | 2 |
3 files changed, 4 insertions, 3 deletions
@@ -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); @@ -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) { @@ -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); |