Go to the documentation of this file.00001 #ifndef _H_MACRO_
00002 #define _H_MACRO_
00003
00007 typedef struct MacroEntry_s * MacroEntry;
00008 typedef struct MacroContext_s * MacroContext;
00009
00010 #if defined(_MACRO_INTERNAL)
00011
00012 struct MacroEntry_s {
00013 struct MacroEntry_s *prev;
00014 const char *name;
00015 const char *opts;
00016 const char *body;
00017 int used;
00018 short level;
00019 unsigned short flags;
00020 };
00021
00023 struct MacroContext_s {
00024
00025 MacroEntry *macroTable;
00026 int macrosAllocated;
00027 int firstFree;
00028 };
00029 #endif
00030
00031
00032
00033 extern MacroContext rpmGlobalMacroContext;
00034
00035
00036 extern MacroContext rpmCLIMacroContext;
00037
00043
00044 extern const char * rpmMacrofiles;
00045
00046
00050 #define RMIL_DEFAULT -15
00051 #define RMIL_MACROFILES -13
00052 #define RMIL_RPMRC -11
00053
00054 #define RMIL_CMDLINE -7
00055 #define RMIL_TARBALL -5
00056 #define RMIL_SPEC -3
00057 #define RMIL_OLDSPEC -1
00058 #define RMIL_GLOBAL 0
00059
00060 #ifdef __cplusplus
00061 extern "C" {
00062 #endif
00063
00069 void rpmDumpMacroTable( MacroContext mc, FILE * fp)
00070
00071 ;
00072
00081 int
00082 rpmGetMacroEntries( MacroContext mc, void * _mire,
00083 int used, const char *** avp)
00084
00085 ;
00086
00092 int rpmSecuritySaneFile(const char *filename)
00093 ;
00094
00102 int rpmGlob(const char * patterns, int * argcPtr,
00103 const char *** argvPtr)
00104
00105 ;
00106
00117 int expandMacros( void * spec, MacroContext mc,
00118 char * sbuf, size_t slen)
00119
00120 ;
00121
00131 void addMacro( MacroContext mc, const char * n,
00132 const char * o, const char * b, int level)
00133
00134 ;
00135
00141 void delMacro( MacroContext mc, const char * n)
00142
00143 ;
00144
00152 int rpmDefineMacro( MacroContext mc, const char * macro, int level)
00153
00154 ;
00155
00162 int rpmUndefineMacro( MacroContext mc, const char * macro)
00163
00164 ;
00165
00171 void rpmLoadMacros( MacroContext mc, int level)
00172
00173 ;
00174
00180 int rpmLoadMacroFile( MacroContext mc, const char * fn)
00181
00182
00183 ;
00184
00190 void rpmInitMacros( MacroContext mc, const char * macrofiles)
00191
00192
00193 ;
00194
00199 void rpmFreeMacros( MacroContext mc)
00200
00201 ;
00202
00203 typedef enum rpmCompressedMagic_e {
00204 COMPRESSED_NOT = 0,
00205 COMPRESSED_OTHER = 1,
00206 COMPRESSED_BZIP2 = 2,
00207 COMPRESSED_ZIP = 3,
00208 COMPRESSED_LZOP = 4,
00209 COMPRESSED_LZMA = 5,
00210 COMPRESSED_XZ = 6
00211 } rpmCompressedMagic;
00212
00219 int isCompressed(const char * file, rpmCompressedMagic * compressed)
00220
00221 ;
00222
00228 char * rpmExpand( const char * arg, ...)
00229 #if defined(__GNUC__) && __GNUC__ >= 4
00230
00231 __attribute__((sentinel))
00232 #endif
00233
00234 ;
00235
00242 char * rpmMCExpand( MacroContext mc, const char * arg, ...)
00243 #if defined(__GNUC__) && __GNUC__ >= 4
00244
00245 __attribute__((sentinel))
00246 #endif
00247
00248 ;
00249
00255
00256 char * rpmCleanPath( char * path)
00257 ;
00258
00264
00265 const char * rpmGetPath( const char * path, ...)
00266 #if defined(__GNUC__) && __GNUC__ >= 4
00267
00268 __attribute__((sentinel))
00269 #endif
00270
00271 ;
00272
00273
00284
00285 const char * rpmGenPath( const char * urlroot,
00286 const char * urlmdir,
00287 const char * urlfile)
00288
00289 ;
00290
00291
00299 int rpmExpandNumeric (const char * arg)
00300
00301 ;
00302
00303 #ifdef __cplusplus
00304 }
00305 #endif
00306
00307 #endif