00001 #ifndef _H_MACRO_
00002 #define _H_MACRO_
00003
00008 #include <stdio.h>
00009 #include <stdlib.h>
00010
00012 typedef struct MacroEntry_s {
00013 struct MacroEntry_s *prev;
00014 const char *name;
00015 const char *opts;
00016 const char *body;
00017 int used;
00018 int level;
00019 } * MacroEntry;
00020
00022 typedef struct MacroContext_s {
00023 MacroEntry *macroTable;
00024 int macrosAllocated;
00025 int firstFree;
00026 } * MacroContext;
00027
00028
00029
00030 extern MacroContext rpmGlobalMacroContext;
00031
00032
00033 extern MacroContext rpmCLIMacroContext;
00034
00035
00041
00042
00043 extern const char * macrofiles;
00044
00045
00049 #define RMIL_DEFAULT -15
00050 #define RMIL_MACROFILES -13
00051 #define RMIL_RPMRC -11
00052
00053 #define RMIL_CMDLINE -7
00054 #define RMIL_TARBALL -5
00055 #define RMIL_SPEC -3
00056 #define RMIL_OLDSPEC -1
00057 #define RMIL_GLOBAL 0
00058
00059 #ifdef __cplusplus
00060 extern "C" {
00061 #endif
00062
00068 void rpmDumpMacroTable ( MacroContext mc,
00069 FILE * fp)
00070
00071 ;
00072
00080 int rpmGlob(const char * patterns, int * argcPtr,
00081 const char *** argvPtr)
00082
00083 ;
00084
00095 int expandMacros ( void * spec, MacroContext mc,
00096 char * sbuf,
00097 size_t slen)
00098
00099 ;
00100
00110 void addMacro ( MacroContext mc, const char * n,
00111 const char * o,
00112 const char * b, int level)
00113
00114 ;
00115
00121 void delMacro ( MacroContext mc, const char * n)
00122
00123 ;
00124
00132 int rpmDefineMacro ( MacroContext mc, const char * macro,
00133 int level)
00134
00135 ;
00136
00142 void rpmLoadMacros ( MacroContext mc, int level)
00143
00144 ;
00145
00151 int rpmLoadMacroFile( MacroContext mc, const char * fn)
00152
00153
00154 ;
00155
00161 void rpmInitMacros ( MacroContext mc, const char * macrofiles)
00162
00163
00164 ;
00165
00170 void rpmFreeMacros ( MacroContext mc)
00171
00172 ;
00173
00174 typedef enum rpmCompressedMagic_e {
00175 COMPRESSED_NOT = 0,
00176 COMPRESSED_OTHER = 1,
00177 COMPRESSED_BZIP2 = 2,
00178 COMPRESSED_ZIP = 3,
00179 COMPRESSED_LZMA = 4
00180 } rpmCompressedMagic;
00181
00188 int isCompressed (const char * file,
00189 rpmCompressedMagic * compressed)
00190
00191 ;
00192
00198 char * rpmExpand ( const char * arg, ...)
00199
00200 ;
00201
00207
00208 char * rpmCleanPath ( char * path)
00209 ;
00210
00216
00217 const char * rpmGetPath ( const char * path, ...)
00218
00219 ;
00220
00221
00232
00233 const char * rpmGenPath ( const char * urlroot,
00234 const char * urlmdir,
00235 const char * urlfile)
00236
00237 ;
00238
00239
00247 int rpmExpandNumeric (const char * arg)
00248
00249 ;
00250
00251 #ifdef __cplusplus
00252 }
00253 #endif
00254
00255 #endif