Go to the documentation of this file.00001 #ifndef _H_MACRO_
00002 #define _H_MACRO_
00003
00004 #include <mire.h>
00005
00009 typedef struct MacroEntry_s * MacroEntry;
00010 typedef struct MacroContext_s * MacroContext;
00011
00012 #if defined(_MACRO_INTERNAL)
00013
00014 struct MacroEntry_s {
00015 struct MacroEntry_s *prev;
00016 const char *name;
00017 const char *opts;
00018 const char *body;
00019 int used;
00020 short level;
00021 unsigned short flags;
00022 };
00023
00025 struct MacroContext_s {
00026
00027 MacroEntry *macroTable;
00028 int macrosAllocated;
00029 int firstFree;
00030 };
00031 #endif
00032
00033
00034
00035 extern MacroContext rpmGlobalMacroContext;
00036
00037
00038 extern MacroContext rpmCLIMacroContext;
00039
00045
00046 extern const char * rpmMacrofiles;
00047
00048
00052 #define RMIL_DEFAULT -15
00053 #define RMIL_MACROFILES -13
00054 #define RMIL_RPMRC -11
00055
00056 #define RMIL_CMDLINE -7
00057 #define RMIL_TARBALL -5
00058 #define RMIL_SPEC -3
00059 #define RMIL_OLDSPEC -1
00060 #define RMIL_GLOBAL 0
00061
00062 #ifdef __cplusplus
00063 extern "C" {
00064 #endif
00065
00071 void rpmDumpMacroTable( MacroContext mc, FILE * fp)
00072
00073 ;
00074
00083 int
00084 rpmGetMacroEntries( MacroContext mc, miRE mire,
00085 int used, const char *** avp)
00086
00087 ;
00088
00094 int rpmSecuritySaneFile(const char *filename)
00095 ;
00096
00104 int rpmGlob(const char * patterns, int * argcPtr,
00105 const char *** argvPtr)
00106
00107 ;
00108
00119 int expandMacros( void * spec, MacroContext mc,
00120 char * sbuf, size_t slen)
00121
00122 ;
00123
00133 void addMacro( MacroContext mc, const char * n,
00134 const char * o, const char * b, int level)
00135
00136 ;
00137
00143 void delMacro( MacroContext mc, const char * n)
00144
00145 ;
00146
00154 int rpmDefineMacro( MacroContext mc, const char * macro, int level)
00155
00156 ;
00157
00164 int rpmUndefineMacro( MacroContext mc, const char * macro)
00165
00166 ;
00167
00173 void rpmLoadMacros( MacroContext mc, int level)
00174
00175 ;
00176
00182 int rpmLoadMacroFile( MacroContext mc, const char * fn)
00183
00184
00185 ;
00186
00192 void rpmInitMacros( MacroContext mc, const char * macrofiles)
00193
00194
00195 ;
00196
00201 void rpmFreeMacros( MacroContext mc)
00202
00203 ;
00204
00205 typedef enum rpmCompressedMagic_e {
00206 COMPRESSED_NOT = 0,
00207 COMPRESSED_OTHER = 1,
00208 COMPRESSED_BZIP2 = 2,
00209 COMPRESSED_ZIP = 3,
00210 COMPRESSED_LZOP = 4,
00211 COMPRESSED_LZMA = 5,
00212 COMPRESSED_XZ = 6
00213 } rpmCompressedMagic;
00214
00221 int isCompressed(const char * file, rpmCompressedMagic * compressed)
00222
00223 ;
00224
00230 char * rpmExpand( const char * arg, ...)
00231
00232 ;
00233
00239
00240 char * rpmCleanPath( char * path)
00241 ;
00242
00248
00249 const char * rpmGetPath( const char * path, ...)
00250
00251 ;
00252
00253
00264
00265 const char * rpmGenPath( const char * urlroot,
00266 const char * urlmdir,
00267 const char * urlfile)
00268
00269 ;
00270
00271
00279 int rpmExpandNumeric (const char * arg)
00280
00281 ;
00282
00283 #ifdef __cplusplus
00284 }
00285 #endif
00286
00287 #endif