Improve pkghash_remove algorithm
[pacman-ng.git] / src / pacman / conf.h
blob92c379fc14940519b37ade5c9ec10773ef3ee465
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 char *print_format;
36 /* unfortunately, we have to keep track of paths both here and in the library
37 * because they can come from both the command line or config file, and we
38 * need to ensure we get the order of preference right. */
39 char *configfile;
40 char *rootdir;
41 char *dbpath;
42 char *logfile;
43 /* TODO how to handle cachedirs? */
45 unsigned short op_q_isfile;
46 unsigned short op_q_info;
47 unsigned short op_q_list;
48 unsigned short op_q_foreign;
49 unsigned short op_q_unrequired;
50 unsigned short op_q_deps;
51 unsigned short op_q_explicit;
52 unsigned short op_q_owns;
53 unsigned short op_q_search;
54 unsigned short op_q_changelog;
55 unsigned short op_q_upgrade;
56 unsigned short op_q_check;
58 unsigned short op_s_clean;
59 unsigned short op_s_downloadonly;
60 unsigned short op_s_info;
61 unsigned short op_s_sync;
62 unsigned short op_s_search;
63 unsigned short op_s_upgrade;
65 unsigned short group;
66 pmtransflag_t flags;
67 unsigned short noask;
68 unsigned int ask;
70 /* conf file options */
71 unsigned short chomp; /* I Love Candy! */
72 unsigned short showsize; /* show individual package sizes */
73 /* When downloading, display the amount downloaded, rate, ETA, and percent
74 * downloaded of the total download list */
75 unsigned short totaldownload;
76 unsigned short cleanmethod; /* select -Sc behavior */
77 alpm_list_t *holdpkg;
78 alpm_list_t *syncfirst;
79 char *xfercommand;
80 } config_t;
82 /* Operations */
83 enum {
84 PM_OP_MAIN = 1,
85 PM_OP_REMOVE,
86 PM_OP_UPGRADE,
87 PM_OP_QUERY,
88 PM_OP_SYNC,
89 PM_OP_DEPTEST,
90 PM_OP_DATABASE
93 /* Long Operations */
94 enum {
95 OP_NOCONFIRM = 1000,
96 OP_CONFIG,
97 OP_IGNORE,
98 OP_DEBUG,
99 OP_NOPROGRESSBAR,
100 OP_NOSCRIPTLET,
101 OP_ASK,
102 OP_CACHEDIR,
103 OP_ASDEPS,
104 OP_LOGFILE,
105 OP_IGNOREGROUP,
106 OP_NEEDED,
107 OP_ASEXPLICIT,
108 OP_ARCH,
109 OP_PRINTFORMAT
112 /* clean method */
113 enum {
114 PM_CLEAN_KEEPINST = 1,
115 PM_CLEAN_KEEPCUR = (1 << 1)
118 /* global config variable */
119 extern config_t *config;
121 config_t *config_new(void);
122 int config_free(config_t *oldconfig);
124 #endif /* _PM_CONF_H */
126 /* vim: set ts=2 sw=2 noet: */