rpm: rpmcli.h Source File

rpm 4.11.1-rc1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

rpmcli.h
Go to the documentation of this file.
1 #ifndef H_RPMCLI
2 #define H_RPMCLI
3
8 #include <popt.h>
9
10 #include <rpm/rpmlib.h>
11 #include <rpm/rpmurl.h>
12 #include <rpm/rpmmacro.h>
13 #include <rpm/rpmcallback.h>
14 #include <rpm/rpmts.h>
15 #include <rpm/rpmfi.h>
16 #include <rpm/rpmvf.h>
17 #include <rpm/argv.h>
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
26 extern struct poptOption rpmcliAllPoptTable[];
27
28 extern const char * rpmcliPipeOutput;
29
30 extern const char * rpmcliRcfile;
31
32 extern const char * rpmcliRootDir;
33
41 poptContext
42 rpmcliInit(int argc, char *const argv[], struct poptOption * optionsTable);
43
48 void rpmcliConfigured(void);
49
55 poptContext
56 rpmcliFini(poptContext optCon);
57
61 #define RPMCLI_POPT_NODEPS -1025
62 #define RPMCLI_POPT_FORCE -1026
63 #define RPMCLI_POPT_NOMD5 -1027
64 #define RPMCLI_POPT_NOFILEDIGEST -1027 /* same as obsolete RPMCLI_POPT_NOMD5 */
65 #define RPMCLI_POPT_NOSCRIPTS -1028
66 #define RPMCLI_POPT_NOSIGNATURE -1029
67 #define RPMCLI_POPT_NODIGEST -1030
68 #define RPMCLI_POPT_NOHDRCHK -1031
69 #define RPMCLI_POPT_NOCONTEXTS -1032
70
71 /* ==================================================================== */
78 enum rpmQVSources_e {
79 RPMQV_PACKAGE = 0,
80 RPMQV_PATH,
81 RPMQV_ALL,
82 RPMQV_RPM,
83 RPMQV_GROUP,
84 RPMQV_WHATPROVIDES,
85 RPMQV_WHATREQUIRES,
86 RPMQV_TRIGGEREDBY,
87 RPMQV_DBOFFSET,
88 RPMQV_SPECRPMS,
89 RPMQV_SPECFILE = RPMQV_SPECRPMS,
90 RPMQV_PKGID,
91 RPMQV_HDRID,
92 RPMQV_TID,
93 RPMQV_SPECSRPM,
94 };
95
96 typedef rpmFlags rpmQVSources;
97
102 enum rpmQueryFlags_e {
103 QUERY_FOR_DEFAULT = 0,
104 QUERY_MD5 = (1 << 0),
105 QUERY_FILEDIGEST = (1 << 0),
106 QUERY_SIZE = (1 << 1),
107 QUERY_LINKTO = (1 << 2),
108 QUERY_USER = (1 << 3),
109 QUERY_GROUP = (1 << 4),
110 QUERY_MTIME = (1 << 5),
111 QUERY_MODE = (1 << 6),
112 QUERY_RDEV = (1 << 7),
113 /* bits 8-14 unused, reserved for rpmVerifyAttrs */
114 QUERY_CONTEXTS = (1 << 15),
115 QUERY_FILES = (1 << 16),
116 QUERY_DEPS = (1 << 17),
117 QUERY_SCRIPT = (1 << 18),
118 QUERY_DIGEST = (1 << 19),
119 QUERY_SIGNATURE = (1 << 20),
120 QUERY_PATCHES = (1 << 21),
121 QUERY_HDRCHK = (1 << 22),
122 QUERY_FOR_LIST = (1 << 23),
123 QUERY_FOR_STATE = (1 << 24),
124 QUERY_FOR_DOCS = (1 << 25),
125 QUERY_FOR_CONFIG = (1 << 26),
126 QUERY_FOR_DUMPFILES = (1 << 27),
127 QUERY_FOR_LICENSE = (1 << 28)
128 };
129
130 typedef rpmFlags rpmQueryFlags;
131
132 #define _QUERY_FOR_BITS \
133 (QUERY_FOR_LIST|QUERY_FOR_STATE|QUERY_FOR_DOCS|QUERY_FOR_CONFIG|\
134 QUERY_FOR_LICENSE|QUERY_FOR_DUMPFILES)
135
139 extern rpmQueryFlags rpmcliQueryFlags;
140
143 typedef struct rpmQVKArguments_s * QVA_t;
144
153 typedef int (*QVF_t) (QVA_t qva, rpmts ts, Header h);
154
163 typedef int (*QSpecF_t) (rpmts ts, QVA_t qva, const char * arg);
164
168 struct rpmQVKArguments_s {
169 rpmQVSources qva_source;
170 int qva_sourceCount;
171 rpmQueryFlags qva_flags;
172 rpmfileAttrs qva_fflags;
174 QVF_t qva_showPackage;
175 QSpecF_t qva_specQuery;
176 char * qva_queryFormat;
177 char qva_mode;
185 };
186
189 extern struct rpmQVKArguments_s rpmQVKArgs;
190
193 extern struct poptOption rpmQVSourcePoptTable[];
194
197 extern struct poptOption rpmQueryPoptTable[];
198
201 extern struct poptOption rpmVerifyPoptTable[];
202
207 void rpmDisplayQueryTags(FILE * fp);
208
217 int showQueryPackage(QVA_t qva, rpmts ts, Header h);
218
226 int rpmcliArgIter(rpmts ts, QVA_t qva, ARGV_const_t argv);
227
236 int rpmcliQuery(rpmts ts, QVA_t qva, ARGV_const_t argv);
237
245 int showVerifyPackage(QVA_t qva, rpmts ts, Header h);
246
255 int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd, const char * fn);
256
265 int rpmcliVerify(rpmts ts, QVA_t qva, ARGV_const_t argv);
266
267 /* ==================================================================== */
269 /* --- install/upgrade/erase modes */
270
274 enum rpmInstallFlags_e {
275 INSTALL_NONE = 0,
276 INSTALL_PERCENT = (1 << 0),
277 INSTALL_HASH = (1 << 1),
278 INSTALL_NODEPS = (1 << 2),
279 INSTALL_NOORDER = (1 << 3),
280 INSTALL_LABEL = (1 << 4),
281 INSTALL_UPGRADE = (1 << 5),
282 INSTALL_FRESHEN = (1 << 6),
283 INSTALL_INSTALL = (1 << 7),
284 INSTALL_ERASE = (1 << 8),
285 INSTALL_ALLMATCHES = (1 << 9)
286 };
287
288 typedef rpmFlags rpmInstallFlags;
289
293 #define UNINSTALL_NONE INSTALL_NONE
294 #define UNINSTALL_NODEPS INSTALL_NODEPS
295 #define UNINSTALL_ALLMATCHES INSTALL_ALLMATCHES
296
311 void * rpmShowProgress(const void * arg,
312 const rpmCallbackType what,
313 const rpm_loff_t amount,
314 const rpm_loff_t total,
315 fnpyKey key,
316 void * data);
317
326 int rpmInstallSource(rpmts ts, const char * arg,
327 char ** specFilePtr,
328 char ** cookie);
329
330
334 struct rpmInstallArguments_s {
335 rpmtransFlags transFlags;
336 rpmprobFilterFlags probFilter;
337 rpmInstallFlags installInterfaceFlags;
338 int numRelocations;
339 int noDeps;
340 int incldocs;
341 rpmRelocation * relocations;
342 char * prefix;
343 };
344
354 int rpmInstall(rpmts ts, struct rpmInstallArguments_s * ia, ARGV_t fileArgv);
355
364 int rpmErase(rpmts ts, struct rpmInstallArguments_s * ia, ARGV_const_t argv);
365
368 extern struct rpmInstallArguments_s rpmIArgs;
369
372 extern struct poptOption rpmInstallPoptTable[];
373
374 /* ==================================================================== */
382 int rpmcliImportPubkeys(rpmts ts, ARGV_const_t argv);
383
390 int rpmcliVerifySignatures(rpmts ts, ARGV_const_t argv);
391
392 #ifdef __cplusplus
393 }
394 #endif
395
396 #endif /* H_RPMCLI */