summaryrefslogtreecommitdiffstats
path: root/host/project.h
diff options
context:
space:
mode:
authorJames McKenzie <git@madingley.org>2015-08-03 10:34:07 +0100
committerJames McKenzie <git@madingley.org>2015-08-03 10:34:07 +0100
commit061430973e82995368d27ff9081391f9475da3c7 (patch)
tree62ac12e6cff789050ca17f00ac70d85de75e3efd /host/project.h
parent23e5d273ef3e11c8ad463c632daa5a52684bc5bb (diff)
downloadcandlestick-061430973e82995368d27ff9081391f9475da3c7.tar.gz
candlestick-061430973e82995368d27ff9081391f9475da3c7.tar.bz2
candlestick-061430973e82995368d27ff9081391f9475da3c7.zip
fish
Diffstat (limited to 'host/project.h')
-rw-r--r--host/project.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/host/project.h b/host/project.h
new file mode 100644
index 0000000..2302570
--- /dev/null
+++ b/host/project.h
@@ -0,0 +1,38 @@
+#include <libusb.h>
+#include <stdio.h>
+#include <malloc.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <libusb.h>
+
+#ifdef HAVE_ERR
+# include <err.h>
+#else
+# include <errno.h>
+# include <string.h>
+# define warnx(...) do {\
+ fprintf(stderr, __VA_ARGS__);\
+ fprintf(stderr, "\n"); } while (0)
+# define errx(eval, ...) do {\
+ warnx(__VA_ARGS__);\
+ exit(eval); } while (0)
+# define warn(...) do {\
+ fprintf(stderr, "%s: ", strerror(errno));\
+ warnx(__VA_ARGS__); } while (0)
+# define err(eval, ...) do {\
+ warn(__VA_ARGS__);\
+ exit(eval); } while (0)
+#endif /* HAVE_ERR */
+
+
+#ifdef HAVE_SYSEXITS_H
+# include <sysexits.h>
+#else
+# define EX_OK 0 /* successful termination */
+# define EX_USAGE 64 /* command line usage error */
+# define EX_SOFTWARE 70 /* internal software error */
+# define EX_IOERR 74 /* input/output error */
+#endif /* HAVE_SYSEXITS_H */
+
+