Main Page   Modules   Data Structures   File List   Data Fields   Globals   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_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 /*@abstract@*/ struct MacroContext_s {
00020 /*@owned@*//*@null@*/ MacroEntry *macroTable;   
00021     int macrosAllocated;
00022     int firstFree;      
00023 } * MacroContext;
00024 
00025 /*@-redecl@*/
00026 /*@checked@*/
00027 extern MacroContext rpmGlobalMacroContext;
00028 
00029 /*@checked@*/
00030 extern MacroContext rpmCLIMacroContext;
00031 /*@=redecl@*/
00032 
00038 /*@-redecl@*/
00039 /*@observer@*/ /*@checked@*/
00040 extern const char * macrofiles;
00041 /*@=redecl@*/
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       (/*@null@*/ MacroContext mc,
00066                                         /*@null@*/ FILE * fp)
00067         /*@globals rpmGlobalMacroContext, fileSystem @*/
00068         /*@modifies *fp, fileSystem @*/;
00069 
00080 int     expandMacros    (/*@null@*/ void * spec, /*@null@*/ MacroContext mc,
00081                                 /*@in@*/ /*@out@*/ char * sbuf,
00082                                 size_t slen)
00083         /*@globals rpmGlobalMacroContext, h_errno, fileSystem @*/
00084         /*@modifies *sbuf, rpmGlobalMacroContext, fileSystem @*/;
00085 
00095 void    addMacro        (/*@null@*/ MacroContext mc, const char * n,
00096                                 /*@null@*/ const char * o,
00097                                 /*@null@*/ const char * b, int level)
00098         /*@globals rpmGlobalMacroContext @*/
00099         /*@modifies mc, rpmGlobalMacroContext @*/;
00100 
00106 void    delMacro        (/*@null@*/ MacroContext mc, const char * n)
00107         /*@globals rpmGlobalMacroContext @*/
00108         /*@modifies mc, rpmGlobalMacroContext @*/;
00109 
00117 int     rpmDefineMacro  (/*@null@*/ MacroContext mc, const char * macro,
00118                                 int level)
00119         /*@globals rpmGlobalMacroContext, h_errno @*/
00120         /*@modifies mc, rpmGlobalMacroContext @*/;
00121 
00127 void    rpmLoadMacros   (/*@null@*/ MacroContext mc, int level)
00128         /*@globals rpmGlobalMacroContext @*/
00129         /*@modifies rpmGlobalMacroContext @*/;
00130 
00136 void    rpmInitMacros   (/*@null@*/ MacroContext mc, const char * macrofiles)
00137         /*@globals rpmGlobalMacroContext, rpmCLIMacroContext,
00138                 h_errno, fileSystem, internalState @*/
00139         /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/;
00140 
00145 void    rpmFreeMacros   (/*@null@*/ MacroContext mc)
00146         /*@globals rpmGlobalMacroContext @*/
00147         /*@modifies mc, rpmGlobalMacroContext @*/;
00148 
00149 typedef enum rpmCompressedMagic_e {
00150     COMPRESSED_NOT              = 0,    
00151     COMPRESSED_OTHER            = 1,    
00152     COMPRESSED_BZIP2            = 2,    
00153     COMPRESSED_ZIP              = 3     
00154 } rpmCompressedMagic;
00155 
00162 int     isCompressed    (const char * file,
00163                                 /*@out@*/ rpmCompressedMagic * compressed)
00164         /*@globals h_errno, fileSystem, internalState @*/
00165         /*@modifies *compressed, fileSystem, internalState @*/;
00166 
00172 char * rpmExpand        (/*@null@*/ const char * arg, ...)
00173         /*@globals rpmGlobalMacroContext, h_errno @*/
00174         /*@modifies rpmGlobalMacroContext @*/;
00175 
00181 /*@null@*/
00182 char * rpmCleanPath     (/*@returned@*/ /*@null@*/ char * path)
00183         /*@modifies *path @*/;
00184 
00190 /*@-redecl@*/ /* LCL: shrug */
00191 const char * rpmGetPath (/*@null@*/ const char * path, ...)
00192         /*@globals rpmGlobalMacroContext, h_errno @*/
00193         /*@modifies rpmGlobalMacroContext @*/;
00194 /*@=redecl@*/
00195 
00206 /*@-redecl@*/ /* LCL: shrug */
00207 const char * rpmGenPath (/*@null@*/ const char * urlroot,
00208                         /*@null@*/ const char * urlmdir,
00209                         /*@null@*/ const char * urlfile)
00210         /*@globals rpmGlobalMacroContext, h_errno @*/
00211         /*@modifies rpmGlobalMacroContext @*/;
00212 /*@=redecl@*/
00213 
00221 int     rpmExpandNumeric (const char * arg)
00222         /*@globals rpmGlobalMacroContext, h_errno @*/
00223         /*@modifies rpmGlobalMacroContext @*/;
00224 
00225 #ifdef __cplusplus
00226 }
00227 #endif
00228 
00229 #endif  /* _H_ MACRO_ */

Generated on Tue Dec 21 15:36:59 2004 for rpm by doxygen1.2.18