Main Page   Modules   Compound List   File List   Compound Members   File Members   Related Pages  

rpmio/rpmmacro.h

Go to the documentation of this file.
00001 #ifndef _H_MACRO_
00002 #define _H_MACRO_
00003 
00009 typedef /*@abstract@*/ struct MacroEntry {
00010     struct MacroEntry *prev;
00011     const char *name;   
00012     const char *opts;   
00013     const char *body;   
00014     int used;           
00015     int level;          
00016 } MacroEntry;
00017 
00019 typedef /*@abstract@*/ struct MacroContext {
00020     MacroEntry **macroTable;    
00021     int         macrosAllocated;
00022     int         firstFree;      
00023 } MacroContext;
00024 
00028 #define RMIL_DEFAULT    -15
00029 #define RMIL_MACROFILES -13
00030 #define RMIL_RPMRC      -11
00031 
00032 #define RMIL_CMDLINE    -7
00033 #define RMIL_TARBALL    -5
00034 #define RMIL_SPEC       -3
00035 #define RMIL_OLDSPEC    -1
00036 #define RMIL_GLOBAL     0
00037 
00038 #ifdef __cplusplus
00039 extern "C" {
00040 #endif
00041 
00047 void    rpmDumpMacroTable       (MacroContext * mc, FILE * fp);
00048 
00059 int     expandMacros    (void * spec, MacroContext * mc, char * sbuf,
00060                                 size_t sbuflen);
00061 
00071 void    addMacro        (MacroContext * mc, const char * n, const char * o,
00072                                 const char * b, int level);
00073 
00079 void    delMacro        (MacroContext * mc, const char * n);
00080 
00088 int     rpmDefineMacro  (MacroContext * mc, const char * macro, int level);
00089 
00095 void    rpmLoadMacros   (MacroContext *mc, int level);
00096 
00102 void    rpmInitMacros   (MacroContext * mc, const char * macrofiles);
00103 
00108 void    rpmFreeMacros   (MacroContext * mc);
00109 
00110 typedef enum rpmCompressedMagic_e {
00111     COMPRESSED_NOT              = 0,    
00112     COMPRESSED_OTHER            = 1,    
00113     COMPRESSED_BZIP2            = 2,    
00114     COMPRESSED_ZIP              = 3     
00115 } rpmCompressedMagic;
00116 
00123 int     isCompressed    (const char * file, rpmCompressedMagic * compressed);
00124 
00130 char *  rpmExpand       (const char * arg, ...);
00131 
00137 char *  rpmCleanPath    (char * path);
00138 
00144 const char *rpmGetPath  (const char * path, ...);
00145 
00156 const char *rpmGenPath  (const char * root, const char * mdir,
00157                                 const char * file);
00158 
00166 int     rpmExpandNumeric (const char * arg);
00167 
00168 #ifdef __cplusplus
00169 }
00170 #endif
00171 
00172 #endif  /* _H_ MACRO_ */

Generated at Mon May 21 08:53:41 2001 for rpm by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001