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
00025
00026
00027 extern MacroContext rpmGlobalMacroContext;
00028
00029
00030 extern MacroContext rpmCLIMacroContext;
00031
00032
00038
00039
00040 extern const char * macrofiles;
00041
00042
00046 #define RMIL_DEFAULT -15
00047 #define RMIL_MACROFILES -13
00048 #define RMIL_RPMRC -11
00049
00050 #define RMIL_CMDLINE -7
00051 #define RMIL_TARBALL -5
00052 #define RMIL_SPEC -3
00053 #define RMIL_OLDSPEC -1
00054 #define RMIL_GLOBAL 0
00055
00056 #ifdef __cplusplus
00057 extern "C" {
00058 #endif
00059
00065 void rpmDumpMacroTable ( MacroContext mc,
00066 FILE * fp)
00067
00068 ;
00069
00080 int expandMacros ( void * spec, MacroContext mc,
00081 char * sbuf,
00082 size_t slen)
00083
00084 ;
00085
00095 void addMacro ( MacroContext mc, const char * n,
00096 const char * o,
00097 const char * b, int level)
00098
00099 ;
00100
00106 void delMacro ( MacroContext mc, const char * n)
00107
00108 ;
00109
00117 int rpmDefineMacro ( MacroContext mc, const char * macro,
00118 int level)
00119
00120 ;
00121
00127 void rpmLoadMacros ( MacroContext mc, int level)
00128
00129 ;
00130
00136 void rpmInitMacros ( MacroContext mc, const char * macrofiles)
00137
00138
00139 ;
00140
00145 void rpmFreeMacros ( MacroContext mc)
00146
00147 ;
00148
00149 typedef enum rpmCompressedMagic_e {
00150 COMPRESSED_NOT = 0,
00151 COMPRESSED_OTHER = 1,
00152 COMPRESSED_BZIP2 = 2,
00153 COMPRESSED_ZIP = 3
00154 } rpmCompressedMagic;
00155
00162 int isCompressed (const char * file,
00163 rpmCompressedMagic * compressed)
00164
00165 ;
00166
00172 char * rpmExpand ( const char * arg, ...)
00173
00174 ;
00175
00181
00182 char * rpmCleanPath ( char * path)
00183 ;
00184
00190
00191 const char * rpmGetPath ( const char * path, ...)
00192
00193 ;
00194
00195
00206
00207 const char * rpmGenPath ( const char * urlroot,
00208 const char * urlmdir,
00209 const char * urlfile)
00210
00211 ;
00212
00213
00221 int rpmExpandNumeric (const char * arg)
00222
00223 ;
00224
00225 #ifdef __cplusplus
00226 }
00227 #endif
00228
00229 #endif