rpm 4.19.1.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
17 extern "C" {
18#endif
19
20 typedef struct rpmMacroEntry_s * rpmMacroEntry;
21
22 typedef struct rpmMacroContext_s * rpmMacroContext;
23
24 extern rpmMacroContext rpmGlobalMacroContext;
25
26 extern rpmMacroContext rpmCLIMacroContext;
27
33 extern const char * macrofiles;
34
38#define RMIL_BUILTIN -20
39#define RMIL_DEFAULT -15
40#define RMIL_MACROFILES -13
41#define RMIL_RPMRC -11
42
43#define RMIL_CMDLINE -7
44#define RMIL_TARBALL -5
45#define RMIL_SPEC -3
46#define RMIL_OLDSPEC -1
47#define RMIL_GLOBAL 0
48
49/* Deprecated compatibility wrappers */
50#define addMacro(_mc, _n, _o, _b, _l) rpmPushMacro(_mc, _n, _o, _b, _l)
51#define delMacro(_mc, _n) rpmPopMacro(_mc, _n)
52
53/* rpm expression parser flags */
54#define RPMEXPR_EXPAND (1 << 0)
56/* rpm macro expansion flags */
57#define RPMEXPAND_EXPAND_ARGS (1 << 0)
59 typedef enum rpmMacroFlags_e {
60 RPMMACRO_DEFAULT = 0,
61 RPMMACRO_LITERAL = (1 << 0),
62} rpmMacroFlags;
63
69 void rpmDumpMacroTable (rpmMacroContext mc,
70 FILE * fp);
71
80 int rpmExpandMacros (rpmMacroContext mc, const char * sbuf,
81 char ** obuf, int flags);
82
92 int rpmExpandThisMacro (rpmMacroContext mc, const char *n,
93 ARGV_const_t args,
94 char ** obuf, int flags);
95
105 int rpmPushMacro (rpmMacroContext mc, const char * n,
106 const char * o,
107 const char * b, int level);
108
119 int rpmPushMacroFlags (rpmMacroContext mc, const char * n,
120 const char * o,
121 const char * b, int level,
122 rpmMacroFlags flags);
123
130 int rpmPopMacro (rpmMacroContext mc, const char * n);
131
139 int rpmDefineMacro (rpmMacroContext mc, const char * macro,
140 int level);
141
148 int rpmMacroIsDefined(rpmMacroContext mc, const char *n);
149
156 int rpmMacroIsParametric(rpmMacroContext mc, const char *n);
157
163 void rpmLoadMacros (rpmMacroContext mc, int level);
164
170 int rpmLoadMacroFile(rpmMacroContext mc, const char * fn);
171
177 void rpmInitMacros (rpmMacroContext mc, const char * macrofiles);
178
183 void rpmFreeMacros (rpmMacroContext mc);
184
190 char * rpmExpand (const char * arg, ...) RPM_GNUC_NULL_TERMINATED;
191
199 int rpmExpandNumeric (const char * arg);
200
210const char *rpmConfigDir(void);
211
218 int rpmExprBoolFlags(const char * expr, int flags);
219
226 char * rpmExprStrFlags(const char * expr, int flags);
227
233 int rpmExprBool(const char * expr);
234
240 char * rpmExprStr(const char * expr);
241
242#ifdef __cplusplus
243}
244#endif
245
246#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)
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)
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
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)
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:59
RPMMACRO_LITERAL
@ RPMMACRO_LITERAL
Definition rpmmacro.h:61
rpmutil.h