diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-12-12 05:45:35 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-12-12 05:45:35 +0100 |
commit | 2e4e8a00b27182a155cb10f0a00e44977bfcd5cf (patch) | |
tree | 86afd1b7ceb834dbb3cedf8d55c3ac0734947333 /error.c | |
parent | 7a4cfb9e546c496792d3fe0c61c822c66ad0128f (diff) | |
download | pcitool-2e4e8a00b27182a155cb10f0a00e44977bfcd5cf.tar.gz pcitool-2e4e8a00b27182a155cb10f0a00e44977bfcd5cf.tar.bz2 pcitool-2e4e8a00b27182a155cb10f0a00e44977bfcd5cf.tar.xz pcitool-2e4e8a00b27182a155cb10f0a00e44977bfcd5cf.zip |
multithread preprocessing of ipecamera frames and code reorganization
Diffstat (limited to 'error.c')
-rw-r--r-- | error.c | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -0,0 +1,27 @@ +#define _PCILIB_ERROR_C + +#include <stdio.h> +#include <stdarg.h> + +#include "error.h" + +static void pcilib_print_error(const char *msg, ...) { + va_list va; + + va_start(va, msg); + vprintf(msg, va); + va_end(va); + printf("\n"); +} + +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, ...), void (*warn)(const char *msg, ...)) { + if (err) pcilib_error = err; + else pcilib_error = pcilib_print_error; + if (warn) pcilib_warning = warn; + else pcilib_warning = pcilib_print_error; + + return 0; +} |