rpm 4.15.1

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_DEFAULT -15
39 #define RMIL_MACROFILES -13
40 #define RMIL_RPMRC -11
41
42 #define RMIL_CMDLINE -7
43 #define RMIL_TARBALL -5
44 #define RMIL_SPEC -3
45 #define RMIL_OLDSPEC -1
46 #define RMIL_GLOBAL 0
47
48 /* Deprecated compatibility wrappers */
49 #define addMacro(_mc, _n, _o, _b, _l) rpmPushMacro(_mc, _n, _o, _b, _l)
50 #define delMacro(_mc, _n) rpmPopMacro(_mc, _n)
51
57 void rpmDumpMacroTable (rpmMacroContext mc,
58 FILE * fp);
59
68 int rpmExpandMacros (rpmMacroContext mc, const char * sbuf,
69 char ** obuf, int flags);
70
80 int rpmPushMacro (rpmMacroContext mc, const char * n,
81 const char * o,
82 const char * b, int level);
83
90 int rpmPopMacro (rpmMacroContext mc, const char * n);
91
99 int rpmDefineMacro (rpmMacroContext mc, const char * macro,
100 int level);
101
107 void rpmLoadMacros (rpmMacroContext mc, int level);
108
114 int rpmLoadMacroFile(rpmMacroContext mc, const char * fn);
115
121 void rpmInitMacros (rpmMacroContext mc, const char * macrofiles);
122
127 void rpmFreeMacros (rpmMacroContext mc);
128
134 char * rpmExpand (const char * arg, ...) RPM_GNUC_NULL_TERMINATED;
135
143 int rpmExpandNumeric (const char * arg);
144
154 const char *rpmConfigDir(void);
155
161 int rpmExprBool(const char * expr);
162
168 char * rpmExprStr(const char * expr);
169
170
171 #ifdef __cplusplus
172 }
173 #endif
174
175 #endif /* _H_ MACRO_ */
rpmLoadMacros
void rpmLoadMacros(rpmMacroContext mc, int level)
rpmExprStr
char * rpmExprStr(const char *expr)
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)
rpmInitMacros
void rpmInitMacros(rpmMacroContext mc, const char *macrofiles)
RPM_GNUC_NULL_TERMINATED
#define RPM_GNUC_NULL_TERMINATED
Definition: rpmutil.h:49
rpmExpand
char * rpmExpand(const char *arg,...) RPM_GNUC_NULL_TERMINATED
rpmExprBool
int rpmExprBool(const char *expr)
rpmMacroContext
struct rpmMacroContext_s * rpmMacroContext
Definition: rpmmacro.h:22
rpmMacroEntry
struct rpmMacroEntry_s * rpmMacroEntry
Definition: rpmmacro.h:20
rpmCLIMacroContext
rpmMacroContext rpmCLIMacroContext
rpmExpandNumeric
int rpmExpandNumeric(const char *arg)
macrofiles
const char * macrofiles
rpmPopMacro
int rpmPopMacro(rpmMacroContext mc, const char *n)
rpmDumpMacroTable
void rpmDumpMacroTable(rpmMacroContext mc, FILE *fp)
rpmLoadMacroFile
int rpmLoadMacroFile(rpmMacroContext mc, const char *fn)
rpmFreeMacros
void rpmFreeMacros(rpmMacroContext mc)
rpmExpandMacros
int rpmExpandMacros(rpmMacroContext mc, const char *sbuf, char **obuf, int flags)
rpmConfigDir
const char * rpmConfigDir(void)
rpmGlobalMacroContext
rpmMacroContext rpmGlobalMacroContext