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 ;
00070
00081 int expandMacros ( void * spec, MacroContext mc,
00082 char * sbuf,
00083 size_t slen)
00084
00085
00086 ;
00087
00097 void addMacro ( MacroContext mc, const char * n,
00098 const char * o,
00099 const char * b, int level)
00100
00101 ;
00102
00108 void delMacro ( MacroContext mc, const char * n)
00109
00110 ;
00111
00119 int rpmDefineMacro ( MacroContext mc, const char * macro,
00120 int level)
00121
00122 ;
00123
00129 void rpmLoadMacros ( MacroContext mc, int level)
00130
00131 ;
00132
00138 void rpmInitMacros ( MacroContext mc, const char * macrofiles)
00139
00140
00141 ;
00142
00147 void rpmFreeMacros ( MacroContext mc)
00148
00149 ;
00150
00151 typedef enum rpmCompressedMagic_e {
00152 COMPRESSED_NOT = 0,
00153 COMPRESSED_OTHER = 1,
00154 COMPRESSED_BZIP2 = 2,
00155 COMPRESSED_ZIP = 3
00156 } rpmCompressedMagic;
00157
00164 int isCompressed (const char * file,
00165 rpmCompressedMagic * compressed)
00166
00167 ;
00168
00174 char * rpmExpand ( const char * arg, ...)
00175
00176 ;
00177
00183
00184 char * rpmCleanPath ( char * path)
00185 ;
00186
00192
00193 const char * rpmGetPath ( const char * path, ...)
00194
00195 ;
00196
00197
00208
00209 const char * rpmGenPath ( const char * urlroot,
00210 const char * urlmdir,
00211 const char * urlfile)
00212
00213 ;
00214
00215
00223 int rpmExpandNumeric (const char * arg)
00224
00225 ;
00226
00227 #ifdef __cplusplus
00228 }
00229 #endif
00230
00231 #endif