rpm: /srv/include/rpm/rpmmacro.h Source File

rpm 4.20.1 The RPM Package Manager

Loading...
Searching...
No Matches
rpmmacro.h
Go to the documentation of this file.
1#ifndef _H_MACRO_
2#define _H_MACRO_
3
10#include <stdio.h>
11#include <stddef.h>
12
13#include <rpm/rpmutil.h>
14#include <rpm/rpmfileutil.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20typedef struct rpmMacroEntry_s * rpmMacroEntry;
21
22typedef struct rpmMacroContext_s * rpmMacroContext;
23
24typedef struct rpmMacroBuf_s *rpmMacroBuf;
25
26typedef void (*macroFunc)(rpmMacroBuf mb, rpmMacroEntry me, ARGV_t argv, size_t *parsed);
27
28extern rpmMacroContext rpmGlobalMacroContext;
29
30extern rpmMacroContext rpmCLIMacroContext;
31
37extern const char * macrofiles;
38
42#define RMIL_BUILTIN -20
43#define RMIL_DEFAULT -15
44#define RMIL_MACROFILES -13
45#define RMIL_RPMRC -11
46
47#define RMIL_CMDLINE -7
48#define RMIL_TARBALL -5
49#define RMIL_SPEC -3
50#define RMIL_OLDSPEC -1
51#define RMIL_GLOBAL 0
52
53/* Deprecated compatibility wrappers */
54#define addMacro(_mc, _n, _o, _b, _l) rpmPushMacro(_mc, _n, _o, _b, _l)
55#define delMacro(_mc, _n) rpmPopMacro(_mc, _n)
56
57/* rpm expression parser flags */
58#define RPMEXPR_EXPAND (1 << 0)
60/* rpm macro expansion flags */
61#define RPMEXPAND_EXPAND_ARGS (1 << 0)
62#define RPMEXPAND_KEEP_QUOTED (1 << 1)
63#define RPMEXPAND_HAVE_QUOTED (1 << 2)
65 enum rpmMacroFlags_e {
66 RPMMACRO_DEFAULT = 0,
67 RPMMACRO_LITERAL = (1 << 0),
68};
69typedef rpmFlags rpmMacroFlags;
70
76 void rpmDumpMacroTable (rpmMacroContext mc,
77 FILE * fp);
78
87 int rpmExpandMacros (rpmMacroContext mc, const char * sbuf,
88 char ** obuf, int flags);
89
99 int rpmExpandThisMacro (rpmMacroContext mc, const char *n,
100 ARGV_const_t args,
101 char ** obuf, int flags);
102
112 int rpmPushMacro (rpmMacroContext mc, const char * n,
113 const char * o,
114 const char * b, int level);
115
126 int rpmPushMacroFlags (rpmMacroContext mc, const char * n,
127 const char * o,
128 const char * b, int level,
129 rpmMacroFlags flags);
130
144 int rpmPushMacroAux(rpmMacroContext mc,
145 const char * n, const char * o,
146 macroFunc f, void *priv, int nargs,
147 int level, rpmMacroFlags flags);
148
154 void *rpmMacroEntryPriv(rpmMacroEntry me);
155
161 void rpmMacroBufAppend(rpmMacroBuf mb, char c);
162
168 void rpmMacroBufAppendStr(rpmMacroBuf mb, const char *str);
169
176RPM_GNUC_PRINTF(3, 4)
177void rpmMacroBufErr(rpmMacroBuf mb, int error, const char *fmt, ...);
178
185 int rpmPopMacro (rpmMacroContext mc, const char * n);
186
194 int rpmDefineMacro (rpmMacroContext mc, const char * macro,
195 int level);
196
203 int rpmMacroIsDefined(rpmMacroContext mc, const char *n);
204
211 int rpmMacroIsParametric(rpmMacroContext mc, const char *n);
212
218 void rpmLoadMacros (rpmMacroContext mc, int level);
219
225 int rpmLoadMacroFile(rpmMacroContext mc, const char * fn);
226
232 void rpmInitMacros (rpmMacroContext mc, const char * macrofiles);
233
238 void rpmFreeMacros (rpmMacroContext mc);
239
245 char * rpmExpand (const char * arg, ...) RPM_GNUC_NULL_TERMINATED;
246
254 int rpmExpandNumeric (const char * arg);
255
265const char *rpmConfigDir(void);
266
273 int rpmExprBoolFlags(const char * expr, int flags);
274
281 char * rpmExprStrFlags(const char * expr, int flags);
282
288 int rpmExprBool(const char * expr);
289
295 char * rpmExprStr(const char * expr);
296
297#ifdef __cplusplus
298}
299#endif
300
301#endif /* _H_ MACRO_ */
rpmPushMacroFlags
int rpmPushMacroFlags(rpmMacroContext mc, const char *n, const char *o, const char *b, int level, rpmMacroFlags flags)
rpmFreeMacros
void rpmFreeMacros(rpmMacroContext mc)
rpmExprStrFlags
char * rpmExprStrFlags(const char *expr, int flags)
rpmConfigDir
const char * rpmConfigDir(void)
rpmLoadMacroFile
int rpmLoadMacroFile(rpmMacroContext mc, const char *fn)
rpmMacroBufErr
void rpmMacroBufErr(rpmMacroBuf mb, int error, const char *fmt,...)
rpmLoadMacros
void rpmLoadMacros(rpmMacroContext mc, int level)
rpmExpandNumeric
int rpmExpandNumeric(const char *arg)
rpmExprBoolFlags
int rpmExprBoolFlags(const char *expr, int flags)
rpmPopMacro
int rpmPopMacro(rpmMacroContext mc, const char *n)
rpmExprStr
char * rpmExprStr(const char *expr)
rpmInitMacros
void rpmInitMacros(rpmMacroContext mc, const char *macrofiles)
rpmMacroBufAppend
void rpmMacroBufAppend(rpmMacroBuf mb, char c)
rpmExpandMacros
int rpmExpandMacros(rpmMacroContext mc, const char *sbuf, char **obuf, int flags)
rpmDefineMacro
int rpmDefineMacro(rpmMacroContext mc, const char *macro, int level)
rpmPushMacro
int rpmPushMacro(rpmMacroContext mc, const char *n, const char *o, const char *b, int level)
rpmExpand
char * rpmExpand(const char *arg,...) RPM_GNUC_NULL_TERMINATED
rpmMacroEntryPriv
void * rpmMacroEntryPriv(rpmMacroEntry me)
rpmMacroBufAppendStr
void rpmMacroBufAppendStr(rpmMacroBuf mb, const char *str)
rpmExpandThisMacro
int rpmExpandThisMacro(rpmMacroContext mc, const char *n, ARGV_const_t args, char **obuf, int flags)
rpmDumpMacroTable
void rpmDumpMacroTable(rpmMacroContext mc, FILE *fp)
rpmExprBool
int rpmExprBool(const char *expr)
rpmPushMacroAux
int rpmPushMacroAux(rpmMacroContext mc, const char *n, const char *o, macroFunc f, void *priv, int nargs, int level, rpmMacroFlags flags)
macrofiles
const char * macrofiles
rpmfileutil.h
rpmMacroIsParametric
int rpmMacroIsParametric(rpmMacroContext mc, const char *n)
rpmMacroIsDefined
int rpmMacroIsDefined(rpmMacroContext mc, const char *n)
rpmMacroFlags_e
rpmMacroFlags_e
Definition rpmmacro.h:65
RPMMACRO_LITERAL
@ RPMMACRO_LITERAL
Definition rpmmacro.h:67
rpmutil.h