summaryrefslogtreecommitdiffstats
path: root/pcilib/error.h
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2015-04-24 05:35:48 +0200
committerSuren A. Chilingaryan <csa@suren.me>2015-04-24 05:35:48 +0200
commitdcd8ad63316eac672492bc18112bbbb52811c3fc (patch)
tree321ed207442ebfe9b1feb8375de03847ed2e2de3 /pcilib/error.h
parent5f6fb4e4e77f121e0756744df8498520d4deddb8 (diff)
downloadpcitool-dcd8ad63316eac672492bc18112bbbb52811c3fc.tar.gz
pcitool-dcd8ad63316eac672492bc18112bbbb52811c3fc.tar.bz2
pcitool-dcd8ad63316eac672492bc18112bbbb52811c3fc.tar.xz
pcitool-dcd8ad63316eac672492bc18112bbbb52811c3fc.zip
More structural changes to get ready for stand-alone event engines
Diffstat (limited to 'pcilib/error.h')
-rw-r--r--pcilib/error.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/pcilib/error.h b/pcilib/error.h
new file mode 100644
index 0000000..d923d3f
--- /dev/null
+++ b/pcilib/error.h
@@ -0,0 +1,32 @@
+#ifndef _PCILIB_ERROR_H
+#define _PCILIB_ERROR_H
+
+#include <errno.h>
+
+enum {
+ PCILIB_ERROR_SUCCESS = 0,
+ PCILIB_ERROR_MEMORY = ENOMEM,
+ PCILIB_ERROR_INVALID_REQUEST = EBADR,
+ PCILIB_ERROR_INVALID_ADDRESS = EFAULT,
+ PCILIB_ERROR_INVALID_BANK = ENOENT,
+ PCILIB_ERROR_INVALID_DATA = EILSEQ,
+ PCILIB_ERROR_INVALID_STATE = EBADFD,
+ PCILIB_ERROR_INVALID_ARGUMENT = EINVAL,
+ PCILIB_ERROR_TIMEOUT = ETIME,
+ PCILIB_ERROR_FAILED = EBADE,
+ PCILIB_ERROR_VERIFY = EREMOTEIO,
+ PCILIB_ERROR_NOTSUPPORTED = ENOTSUP,
+ PCILIB_ERROR_NOTFOUND = ESRCH,
+ PCILIB_ERROR_OUTOFRANGE = ERANGE,
+ PCILIB_ERROR_NOTAVAILABLE = ENAVAIL,
+ PCILIB_ERROR_NOTINITIALIZED = EBADFD,
+ PCILIB_ERROR_TOOBIG = EFBIG,
+ PCILIB_ERROR_OVERWRITTEN = ESTALE,
+ PCILIB_ERROR_BUSY = EBUSY
+} pcilib_errot_t;
+
+void pcilib_print_error(const char *msg, ...);
+extern void (*pcilib_error)(const char *msg, ...);
+extern void (*pcilib_warning)(const char *msg, ...);
+
+#endif /* _PCILIB_ERROR_H */