00001 #ifndef _H_MACRO_
00002 #define _H_MACRO_
00003
00009 typedef struct MacroEntry_s {
00010 struct MacroEntry_s *prev;
00011 const char *name;
00012 const char *opts;
00013 const char *body;
00014 int used;
00015 int level;
00016 } * MacroEntry;
00017
00019 typedef struct MacroContext_s {
00020 MacroEntry *macroTable;
00021 int macrosAllocated;
00022 int firstFree;
00023 } * MacroContext;
00024
00028 #define RMIL_DEFAULT -15
00029 #define RMIL_MACROFILES -13
00030 #define RMIL_RPMRC -11
00031
00032 #define RMIL_CMDLINE -7
00033 #define RMIL_TARBALL -5
00034 #define RMIL_SPEC -3
00035 #define RMIL_OLDSPEC -1
00036 #define RMIL_GLOBAL 0
00037
00038 #ifdef __cplusplus
00039 extern "C" {
00040 #endif
00041
00047 void rpmDumpMacroTable ( MacroContext mc,
00048 FILE * fp)
00049 ;
00050
00061 int expandMacros ( void * spec, MacroContext mc,
00062 char * sbuf,
00063 size_t sbuflen)
00064 ;
00065
00075 void addMacro ( MacroContext mc, const char * n,
00076 const char * o,
00077 const char * b, int level)
00078 ;
00079
00085 void delMacro ( MacroContext mc, const char * n)
00086 ;
00087
00095 int rpmDefineMacro ( MacroContext mc, const char * macro,
00096 int level)
00097 ;
00098
00104 void rpmLoadMacros ( MacroContext mc, int level)
00105 ;
00106
00112 void rpmInitMacros ( MacroContext mc, const char * macrofiles)
00113 ;
00114
00119 void rpmFreeMacros ( MacroContext mc)
00120 ;
00121
00122 typedef enum rpmCompressedMagic_e {
00123 COMPRESSED_NOT = 0,
00124 COMPRESSED_OTHER = 1,
00125 COMPRESSED_BZIP2 = 2,
00126 COMPRESSED_ZIP = 3
00127 } rpmCompressedMagic;
00128
00135 int isCompressed (const char * file,
00136 rpmCompressedMagic * compressed)
00137 ;
00138
00144 char * rpmExpand ( const char * arg, ...)
00145 ;
00146
00152 char * rpmCleanPath ( char * path)
00153 ;
00154
00160
00161 const char * rpmGetPath ( const char * path, ...)
00162 ;
00163
00164
00175
00176 const char * rpmGenPath ( const char * root,
00177 const char * mdir,
00178 const char * file)
00179 ;
00180
00181
00189 int rpmExpandNumeric (const char * arg)
00190 ;
00191
00192 #ifdef __cplusplus
00193 }
00194 #endif
00195
00196 #endif