vfs: check userland buffers before reading them.
[haiku.git] / src / bin / pkgman / pkgman.h
blobc061fd9d39aa6de7d7fb93e851a3b9e3f6c62ba5
1 /*
2 * Copyright 2011, Oliver Tappe <zooey@hirschkaefer.de>
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef PKGMAN_H
6 #define PKGMAN_H
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include <string.h>
13 #include <String.h>
16 extern const char* kProgramName;
18 #define DIE(result, msg...) \
19 do { \
20 fprintf(stderr, "*** " msg); \
21 fprintf(stderr, " : %s\n", strerror(result)); \
22 exit(5); \
23 } while(0)
25 #define ERROR(result, msg...) \
26 do { \
27 fprintf(stderr, "*** " msg); \
28 fprintf(stderr, " : %s\n", strerror(result)); \
29 } while(0)
31 #define WARN(result, msg...) \
32 do { \
33 fprintf(stderr, "* " msg); \
34 fprintf(stderr, " : %s\n", strerror(result)); \
35 } while(0)
38 void print_usage_and_exit(bool error);
41 extern const BString kCommandCategoryPackages;
42 extern const BString kCommandCategoryRepositories;
43 extern const BString kCommandCategoryOther;
46 #endif // PKGMAN_H