rpm  4.10.0
rpmmacro.h
Go to the documentation of this file.
00001 #ifndef _H_MACRO_
00002 #define _H_MACRO_
00003 
00008 #include <stdio.h>
00009 #include <stddef.h>
00010 
00011 #include <rpm/rpmutil.h>
00012 #include <rpm/rpmfileutil.h>
00013 
00014 #ifdef __cplusplus
00015 extern "C" {
00016 #endif
00017 
00018 typedef struct rpmMacroEntry_s * rpmMacroEntry;
00019 
00020 typedef struct rpmMacroContext_s * rpmMacroContext;
00021 
00022 extern rpmMacroContext rpmGlobalMacroContext;
00023 
00024 extern rpmMacroContext rpmCLIMacroContext;
00025 
00031 extern const char * macrofiles;
00032 
00036 #define RMIL_DEFAULT    -15
00037 #define RMIL_MACROFILES -13
00038 #define RMIL_RPMRC      -11
00039 
00040 #define RMIL_CMDLINE    -7
00041 #define RMIL_TARBALL    -5
00042 #define RMIL_SPEC       -3
00043 #define RMIL_OLDSPEC    -1
00044 #define RMIL_GLOBAL     0
00045 
00051 void    rpmDumpMacroTable       (rpmMacroContext mc,
00052                                         FILE * fp);
00053 
00064 int     expandMacros    (void * spec, rpmMacroContext mc,
00065                                 char * sbuf,
00066                                 size_t slen);
00067 
00077 void    addMacro        (rpmMacroContext mc, const char * n,
00078                                 const char * o,
00079                                 const char * b, int level);
00080 
00086 void    delMacro        (rpmMacroContext mc, const char * n);
00087 
00095 int     rpmDefineMacro  (rpmMacroContext mc, const char * macro,
00096                                 int level);
00097 
00103 void    rpmLoadMacros   (rpmMacroContext mc, int level);
00104 
00110 int     rpmLoadMacroFile(rpmMacroContext mc, const char * fn);
00111 
00117 void    rpmInitMacros   (rpmMacroContext mc, const char * macrofiles);
00118 
00123 void    rpmFreeMacros   (rpmMacroContext mc);
00124 
00130 char * rpmExpand        (const char * arg, ...) RPM_GNUC_NULL_TERMINATED;
00131 
00139 int     rpmExpandNumeric (const char * arg);
00140 
00150 const char *rpmConfigDir(void);
00151 
00152 #ifdef __cplusplus
00153 }
00154 #endif
00155 
00156 #endif  /* _H_ MACRO_ */