summaryrefslogtreecommitdiffstats
path: root/host/project.h
diff options
context:
space:
mode:
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 */
+
+