pkgdelta: implement requirments for delta generation
[pacman-ng.git] / src / pacman / conf.h
blob42f25298392ab69b211ece6d992f5b3888d8e424
1 /*
2 * conf.h
4 * Copyright (c) 2006-2011 Pacman Development Team <pacman-dev@archlinux.org>
5 * Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef _PM_CONF_H
21 #define _PM_CONF_H
23 #include <alpm.h>
25 typedef struct __config_t {
26 unsigned short op;
27 unsigned short quiet;
28 unsigned short verbose;
29 unsigned short version;
30 unsigned short help;
31 unsigned short noconfirm;
32 unsigned short noprogressbar;
33 unsigned short logmask;
34 unsigned short print;
35 unsigned short checkspace;
36 unsigned short usesyslog;
37 unsigned short usedelta;
38 char *arch;
39 char *print_format;
40 /* unfortunately, we have to keep track of paths both here and in the library
41 * because they can come from both the command line or config file, and we
42 * need to ensure we get the order of preference right. */
43 char *configfile;
44 char *rootdir;
45 char *dbpath;
46 char *logfile;
47 char *gpgdir;
48 alpm_list_t *cachedirs;
50 unsigned short op_q_isfile;
51 unsigned short op_q_info;
52 unsigned short op_q_list;
53 unsigned short op_q_foreign;
54 unsigned short op_q_unrequired;
55 unsigned short op_q_deps;
56 unsigned short op_q_explicit;
57 unsigned short op_q_owns;
58 unsigned short op_q_search;
59 unsigned short op_q_changelog;
60 unsigned short op_q_upgrade;
61 unsigned short op_q_check;
63 unsigned short op_s_clean;
64 unsigned short op_s_downloadonly;
65 unsigned short op_s_info;
66 unsigned short op_s_sync;
67 unsigned short op_s_search;
68 unsigned short op_s_upgrade;
70 unsigned short group;
71 unsigned short noask;
72 unsigned int ask;
73 alpm_transflag_t flags;
74 alpm_siglevel_t siglevel;
76 /* conf file options */
77 /* I Love Candy! */
78 unsigned short chomp;
79 /* format target pkg lists as table */
80 unsigned short verbosepkglists;
81 /* When downloading, display the amount downloaded, rate, ETA, and percent
82 * downloaded of the total download list */
83 unsigned short totaldownload;
84 /* select -Sc behavior */
85 unsigned short cleanmethod;
86 alpm_list_t *holdpkg;
87 alpm_list_t *syncfirst;
88 alpm_list_t *ignorepkg;
89 alpm_list_t *ignoregrp;
90 alpm_list_t *noupgrade;
91 alpm_list_t *noextract;
92 char *xfercommand;
94 /* our connection to libalpm */
95 alpm_handle_t *handle;
97 alpm_list_t *explicit_adds;
98 alpm_list_t *explicit_removes;
99 } config_t;
101 /* Operations */
102 enum {
103 PM_OP_MAIN = 1,
104 PM_OP_REMOVE,
105 PM_OP_UPGRADE,
106 PM_OP_QUERY,
107 PM_OP_SYNC,
108 PM_OP_DEPTEST,
109 PM_OP_DATABASE
112 /* Long Operations */
113 enum {
114 OP_NOCONFIRM = 1000,
115 OP_CONFIG,
116 OP_IGNORE,
117 OP_DEBUG,
118 OP_NOPROGRESSBAR,
119 OP_NOSCRIPTLET,
120 OP_ASK,
121 OP_CACHEDIR,
122 OP_ASDEPS,
123 OP_LOGFILE,
124 OP_IGNOREGROUP,
125 OP_NEEDED,
126 OP_ASEXPLICIT,
127 OP_ARCH,
128 OP_PRINTFORMAT,
129 OP_GPGDIR,
130 OP_DBONLY
133 /* clean method */
134 enum {
135 PM_CLEAN_KEEPINST = 1,
136 PM_CLEAN_KEEPCUR = (1 << 1)
139 /* global config variable */
140 extern config_t *config;
142 config_t *config_new(void);
143 int config_free(config_t *oldconfig);
145 int config_set_arch(const char *arch);
146 int parseconfig(const char *file);
147 #endif /* _PM_CONF_H */
149 /* vim: set ts=2 sw=2 noet: */