forked from yanhan/powaur
/
powaur.h
123 lines (102 loc) · 1.86 KB
/
powaur.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#ifndef POWAUR_POWAUR_H
#define POWAUR_POWAUR_H
enum {
PW_OP_INVAL = 0,
PW_OP_MAIN,
PW_OP_SYNC,
PW_OP_QUERY,
PW_OP_GET,
PW_OP_MAINTAINER,
PW_OP_BACKUP,
PW_OP_CRAWL,
PW_OP_LISTAUR
};
enum {
OPT_DEBUG = 1000,
OPT_SORT_VOTE,
OPT_VERBOSE,
OPT_TARGET_DIR,
OPT_RESOLVE_DEPS,
OPT_MAXTHREADS,
OPT_COLOR,
OPT_NOCOLOR,
OPT_CHECK_ONLY,
OPT_NOCONFIRM
};
enum pwloglevel_t {
PW_LOG_NORM = 1,
PW_LOG_INFO = (1 << 1),
PW_LOG_WARNING = (1 << 2),
PW_LOG_ERROR = (1 << 3),
PW_LOG_DEBUG = (1 << 4),
PW_LOG_VDEBUG = (1 << 5)
};
enum pkgfrom_t {
PKG_FROM_UNKNOWN = 0,
PKG_FROM_LOCAL,
PKG_FROM_SYNC,
PKG_FROM_AUR
};
enum _pw_errno_t {
PW_ERR_OK = 0,
/* Initialization errors */
PW_ERR_INIT_CONFIG,
PW_ERR_INIT_ENV,
PW_ERR_INIT_HANDLE,
PW_ERR_INIT_DIR,
PW_ERR_INIT_LOCALDB,
/* Command parsing errors */
PW_ERR_OP_UNKNOWN,
PW_ERR_OP_MULTI,
PW_ERR_OP_NULL,
/* /etc/pacman.conf parsing errors */
PW_ERR_PM_CONF_OPEN,
PW_ERR_PM_CONF_PARSE,
/* Fatal errors */
PW_ERR_ACCESS,
/* libalpm errors */
PW_ERR_ALPM_RELOAD,
PW_ERR_LOCALDB_NULL,
PW_ERR_LOCALDB_CACHE_NULL,
/* General errors */
PW_ERR_MEMORY,
/* Path related errors */
PW_ERR_GETCWD,
PW_ERR_RESTORECWD,
PW_ERR_CHDIR,
PW_ERR_PATH_RESOLVE,
/* File related errors */
PW_ERR_ISDIR,
PW_ERR_FOPEN,
PW_ERR_FILE_EXTRACT,
PW_ERR_OPENDIR,
PW_ERR_STAT,
/* Fork errors */
PW_ERR_FORK_FAILED,
PW_ERR_WAITPID_FAILED,
PW_ERR_WAITPID_CONFUSED,
PW_ERR_WAITPID_SIGNAL,
/* pthreads errors */
PW_ERR_PTHREAD_CREATE,
PW_ERR_PTHREAD_JOIN,
/* libarchive errors */
PW_ERR_ARCHIVE_CREATE,
PW_ERR_ARCHIVE_OPEN,
PW_ERR_ARCHIVE_ENTRY,
PW_ERR_ARCHIVE_EXTRACT,
/* cURL errors */
PW_ERR_CURL_INIT,
PW_ERR_CURL_DOWNLOAD,
/* Download errors */
PW_ERR_DL_UNKNOWN,
/* NULL target list */
PW_ERR_TARGETS_NULL
};
enum dumplvl_t {
DUMP_Q,
DUMP_Q_SEARCH,
DUMP_Q_INFO,
DUMP_S_SEARCH,
DUMP_S_INFO
};
#endif