rpm  4.11.1-rc1
rpmmacro.h
Go to the documentation of this file.
1 #ifndef _H_MACRO_
2 #define _H_MACRO_
3 
8 #include <stdio.h>
9 #include <stddef.h>
10 
11 #include <rpm/rpmutil.h>
12 #include <rpm/rpmfileutil.h>
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 typedef struct rpmMacroEntry_s * rpmMacroEntry;
19 
20 typedef struct rpmMacroContext_s * rpmMacroContext;
21 
22 extern rpmMacroContext rpmGlobalMacroContext;
23 
24 extern rpmMacroContext rpmCLIMacroContext;
25 
31 extern const char * macrofiles;
32 
36 #define RMIL_DEFAULT -15
37 #define RMIL_MACROFILES -13
38 #define RMIL_RPMRC -11
39 
40 #define RMIL_CMDLINE -7
41 #define RMIL_TARBALL -5
42 #define RMIL_SPEC -3
43 #define RMIL_OLDSPEC -1
44 #define RMIL_GLOBAL 0
45 
51 void rpmDumpMacroTable (rpmMacroContext mc,
52  FILE * fp);
53 
64 int expandMacros (void * spec, rpmMacroContext mc,
65  char * sbuf,
66  size_t slen);
67 
77 void addMacro (rpmMacroContext mc, const char * n,
78  const char * o,
79  const char * b, int level);
80 
86 void delMacro (rpmMacroContext mc, const char * n);
87 
95 int rpmDefineMacro (rpmMacroContext mc, const char * macro,
96  int level);
97 
103 void rpmLoadMacros (rpmMacroContext mc, int level);
104 
110 int rpmLoadMacroFile(rpmMacroContext mc, const char * fn);
111 
117 void rpmInitMacros (rpmMacroContext mc, const char * macrofiles);
118 
123 void rpmFreeMacros (rpmMacroContext mc);
124 
130 char * rpmExpand (const char * arg, ...) RPM_GNUC_NULL_TERMINATED;
131 
139 int rpmExpandNumeric (const char * arg);
140 
150 const char *rpmConfigDir(void);
151 
152 #ifdef __cplusplus
153 }
154 #endif
155 
156 #endif /* _H_ MACRO_ */