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 short level;
00016 unsigned short flags;
00017 } * MacroEntry;
00018
00020 typedef struct MacroContext_s {
00021
00022 MacroEntry *macroTable;
00023 int macrosAllocated;
00024 int firstFree;
00025 } * MacroContext;
00026
00027
00028
00029 extern MacroContext rpmGlobalMacroContext;
00030
00031
00032 extern MacroContext rpmCLIMacroContext;
00033
00039
00040 extern const char * rpmMacrofiles;
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, FILE * fp)
00066
00067 ;
00068
00076 int rpmGlob(const char * patterns, int * argcPtr,
00077 const char *** argvPtr)
00078
00079 ;
00080
00091 int expandMacros( void * spec, MacroContext mc,
00092 char * sbuf, size_t slen)
00093
00094 ;
00095
00105 void addMacro( MacroContext mc, const char * n,
00106 const char * o, const char * b, int level)
00107
00108 ;
00109
00115 void delMacro( MacroContext mc, const char * n)
00116
00117 ;
00118
00126 int rpmDefineMacro( MacroContext mc, const char * macro, int level)
00127
00128 ;
00129
00135 void rpmLoadMacros( MacroContext mc, int level)
00136
00137 ;
00138
00144 int rpmLoadMacroFile( MacroContext mc, const char * fn)
00145
00146
00147 ;
00148
00154 void rpmInitMacros( MacroContext mc, const char * macrofiles)
00155
00156
00157 ;
00158
00163 void rpmFreeMacros( MacroContext mc)
00164
00165 ;
00166
00167 typedef enum rpmCompressedMagic_e {
00168 COMPRESSED_NOT = 0,
00169 COMPRESSED_OTHER = 1,
00170 COMPRESSED_BZIP2 = 2,
00171 COMPRESSED_ZIP = 3,
00172 COMPRESSED_LZOP = 4,
00173 COMPRESSED_LZMA = 5
00174 } rpmCompressedMagic;
00175
00182 int isCompressed(const char * file, rpmCompressedMagic * compressed)
00183
00184 ;
00185
00191 char * rpmExpand( const char * arg, ...)
00192
00193 ;
00194
00200
00201 char * rpmCleanPath( char * path)
00202 ;
00203
00209
00210 const char * rpmGetPath( const char * path, ...)
00211
00212 ;
00213
00214
00225
00226 const char * rpmGenPath( const char * urlroot,
00227 const char * urlmdir,
00228 const char * urlfile)
00229
00230 ;
00231
00232
00240 int rpmExpandNumeric (const char * arg)
00241
00242 ;
00243
00244 #ifdef __cplusplus
00245 }
00246 #endif
00247
00248 #endif