rpmio/rpmmacro.h -
struct MacroContext_s
struct MacroEntry_s
#define RMIL_DEFAULT -15
Markers for sources of macros added throughout rpm.
#define RMIL_MACROFILES -13
#define RMIL_RPMRC -11
#define RMIL_CMDLINE -7
#define RMIL_TARBALL -5
#define RMIL_SPEC -3
#define RMIL_OLDSPEC -1
#define RMIL_GLOBAL 0
typedef MacroEntry_s * MacroEntry
typedef MacroContext_s * MacroContext
typedef enum rpmCompressedMagic_e rpmCompressedMagic
enum rpmCompressedMagic_e { COMPRESSED_NOT = 0, COMPRESSED_OTHER = 1, COMPRESSED_BZIP2 = 2, COMPRESSED_ZIP = 3 }
void rpmDumpMacroTable (MacroContext mc, FILE *fp)
Print macros to file stream.
int expandMacros (void *spec, MacroContext mc, char *sbuf, size_t slen)
Expand macro into buffer.
void addMacro (MacroContext mc, const char *n, const char *o, const char *b, int level)
Add macro to context.
void delMacro (MacroContext mc, const char *n)
Delete macro from context.
int rpmDefineMacro (MacroContext mc, const char *macro, int level)
Define macro in context.
void rpmLoadMacros (MacroContext mc, int level)
Load macros from specific context into global context.
void rpmInitMacros (MacroContext mc, const char *macrofiles)
Initialize global macro context from set of macrofile(s).
void rpmFreeMacros (MacroContext mc)
Destroy macro context.
int isCompressed (const char *file, rpmCompressedMagic *compressed)
Return type of compression used in file.
char * rpmExpand (const char *arg,...)
Return (malloc'ed) concatenated macro expansion(s).
char * rpmCleanPath (char *path)
Canonicalize file path.
const char * rpmGetPath (const char *path,...)
Return (malloc'ed) expanded, canonicalized, file path.
const char * rpmGenPath (const char *urlroot, const char *urlmdir, const char *urlfile)
Merge 3 args into path, any or all of which may be a url.
int rpmExpandNumeric (const char *arg)
Return macro expansion as a numeric value.
MacroContext rpmGlobalMacroContext
MacroContext rpmCLIMacroContext
const char * macrofiles
Definition in file rpmmacro.h.
Definition at line 50 of file rpmmacro.h.
Referenced by main(), and rpmInitMacros().
Markers for sources of macros added throughout rpm.
Definition at line 46 of file rpmmacro.h.
Referenced by doAddMacro(), main(), setVar(), and setVarDefault().
Definition at line 54 of file rpmmacro.h.
Definition at line 47 of file rpmmacro.h.
Referenced by rpmInitMacros().
Definition at line 53 of file rpmmacro.h.
Referenced by handlePreambleTag().
Definition at line 48 of file rpmmacro.h.
Referenced by doReadRC(), parseSpec(), and rpmRebuildTargetVars().
Definition at line 52 of file rpmmacro.h.
Referenced by addSource(), doScript(), doSetupMacro(), generateDepends(), handlePreambleTag(), and parseSpec().
Definition at line 51 of file rpmmacro.h.
Referenced by buildForTarget().
The structure used to store the set of macros in a context.
The structure used to store a macro.
Referenced by buildForTarget(), doFoo(), doPatch(), doUntar(), and isCompressed().
Enumeration values:
Definition at line 151 of file rpmmacro.h.
Add macro to context.
Deprecated: Use rpmDefineMacro().
Parameters:
Definition at line 1490 of file macro.c.
References expandMacroTable(), findEntry(), MacroContext_s::firstFree, MacroContext_s::macrosAllocated, MacroContext_s::macroTable, pushMacro(), rpmGlobalMacroContext, and sortMacroTable().
Referenced by addSource(), buildForTarget(), do_verifyGPGSignature(), doAddMacro(), doDefine(), doReadRC(), doScript(), doSetupMacro(), expandMacro(), generateDepends(), grabArgs(), handlePreambleTag(), main(), makeGPGSignature(), makePGPSignature(), parseSpec(), rpmInstallLoadMacros(), rpmLoadMacros(), rpmRebuildTargetVars(), setVar(), setVarDefault(), and verifyPGPSignature().
Delete macro from context.
Parameters:
Definition at line 1516 of file macro.c.
References findEntry(), popMacro(), rpmGlobalMacroContext, and sortMacroTable().
Referenced by doDelMacro(), doScript(), doUndefine(), generateDepends(), handlePreambleTag(), makeGPGSignature(), makePGPSignature(), parseSpec(), rpmRebuildTargetVars(), and verifyPGPSignature().
Expand macro into buffer.
Deprecated: Use rpmExpand().
Todo: Eliminate from API.
Parameters:
Return values:
Parameters:
Returns: 0 on success
Definition at line 1451 of file macro.c.
References _, alloca(), MacroBuf_s::depth, MacroBuf_s::expand_trace, expandMacro(), MacroBuf_s::macro_trace, MacroBuf_s::mc, MacroBuf_s::nb, print_expand_trace, print_macro_trace, RPMERR_BADSPEC, rpmError, rpmGlobalMacroContext, MacroBuf_s::s, MacroBuf_s::spec, and MacroBuf_s::t.
Referenced by addFileToTagAux(), copyNextLine(), processPackageFiles(), rpmExpand(), and rpmGetPath().
Return type of compression used in file.
Parameters:
Return values:
Returns: 0 on success, 1 on I/O error
Definition at line 1668 of file macro.c.
References _, COMPRESSED_BZIP2, COMPRESSED_NOT, COMPRESSED_OTHER, COMPRESSED_ZIP, Fclose(), Ferror(), Fopen(), Fread(), Fstrerror(), rpmCompressedMagic, RPMERR_BADSPEC, and rpmError.
Referenced by buildForTarget(), doFoo(), doPatch(), and doUntar().
Canonicalize file path.
Parameters:
Returns: canonicalized path (malloc'ed)
Definition at line 1768 of file macro.c.
References begin.
Referenced by doLookup(), openDatabase(), rpmdbMoveDatabase(), rpmdbRemoveDatabase(), rpmGetPath(), and rpmQueryVerify().
Define macro in context.
Parameters:
Returns:
Todo:
Document.
Definition at line 1532 of file macro.c.
References alloca(), doDefine(), MacroBuf_s::mc, and rpmGlobalMacroContext.
Referenced by main(), rpmdbRebuild(), and rpmInitMacros().
Print macros to file stream.
Parameters:
Definition at line 200 of file macro.c.
References _, MacroEntry_s::body, MacroContext_s::firstFree, MacroEntry_s::level, MacroContext_s::macroTable, MacroEntry_s::name, MacroEntry_s::opts, rpmGlobalMacroContext, and MacroEntry_s::used.
Referenced by expandMacro(), and rpmShowRC().
Return (malloc'ed) concatenated macro expansion(s).
Parameters:
Returns: macro expansion (malloc'ed)
Definition at line 1718 of file macro.c.
References expandMacros(), stpcpy(), and xstrdup().
Referenced by checkForValidArchitectures(), checkPassPhrase(), cpio_doio(), dbiTagsInit(), do_verifyGPGSignature(), do_wait_for_lock(), doPrimary(), doScript(), doSetupMacro(), fillOutMainPackage(), generateDepends(), i18nTag(), ignoreDep(), main(), makeGPGSignature(), makePGPSignature(), newRpmdb(), packageBinaries(), parseForRegexLang(), parseForRegexMultiLib(), parseSpec(), processPackageFiles(), rdToken(), readLine(), rpmdbSetIteratorRE(), rpmExpandNumeric(), rpmGetPassPhrase(), rpmLookupSignatureType(), rpmReadConfigFiles(), rpmRollback(), runScript(), skipFiles(), urlFind(), verifyGPGSignature(), verifyPGPSignature(), and writeRPM().
Return macro expansion as a numeric value.
Boolean values ('Y' or 'y' returns 1, 'N' or 'n' returns 0) are permitted as well. An undefined macro returns 0.
Parameters:
Returns: numeric value
Definition at line 1741 of file macro.c.
References _free(), and rpmExpand().
Referenced by dbiOpen(), genCpioListAndHeader(), main(), newRpmdb(), openDatabase(), parseRCPOT(), parseSpec(), processPackageFiles(), rpmdbInit(), rpmdbOpen(), rpmdbRebuild(), rpmdbVerify(), rpmLeadVersion(), and skipFiles().
Destroy macro context.
Parameters:
Definition at line 1641 of file macro.c.
References _free(), MacroEntry_s::body, MacroContext_s::firstFree, MacroContext_s::macroTable, MacroEntry_s::name, MacroEntry_s::opts, MacroEntry_s::prev, and rpmGlobalMacroContext.
Referenced by build(), and main().
Merge 3 args into path, any or all of which may be a url.
The leading part of the first URL encountered is used for the result, other URL prefixes are discarded, permitting a primitive form of URL inheiritance.
Parameters:
Returns: expanded, merged, canonicalized path (malloc'ed)
Definition at line 1887 of file macro.c.
References _free(), alloca(), rpmGetPath(), URL_IS_DASH, and urlPath().
Referenced by buildForTarget(), db1close(), db1open(), db3close(), db3open(), db_init(), doScript(), doSetupMacro(), generateDepends(), handlePreambleTag(), makeTempFile(), parsePreamble(), processBinaryFile(), processPackageFiles(), psmStage(), rpmInstall(), and rpmInstallSourcePackage().
Return (malloc'ed) expanded, canonicalized, file path.
Parameters:
Returns: canonicalized path (malloc'ed)
Definition at line 1856 of file macro.c.
References expandMacros(), rpmCleanPath(), stpcpy(), and xstrdup().
Referenced by addFileToTagAux(), addSource(), buildForTarget(), checkSpec(), db3close(), db3open(), doPatch(), doReadRC(), doRmSource(), doUntar(), newRpmdb(), packageBinaries(), packageSources(), parseFiles(), parseForSimple(), parseSpec(), processPackageFiles(), processSourceFiles(), psmStage(), readIcon(), rpmdbRebuild(), rpmDetectPGPVersion(), rpmErase(), rpmGenPath(), rpmGetFilesystemUsage(), rpmInstall(), and verifyPGPSignature().
Initialize global macro context from set of macrofile(s).
Parameters:
Definition at line 1568 of file macro.c.
References _free(), Fclose(), Ferror(), Fopen(), getenv(), max_macro_depth, rdcl(), RMIL_CMDLINE, RMIL_MACROFILES, rpmCLIMacroContext, rpmDefineMacro(), rpmGlobalMacroContext, rpmLoadMacros(), SKIPBLANK, and xstrdup().
Load macros from specific context into global context.
Parameters:
Definition at line 1547 of file macro.c.
References addMacro(), MacroEntry_s::body, MacroContext_s::firstFree, MacroContext_s::macroTable, MacroEntry_s::name, MacroEntry_s::opts, and rpmGlobalMacroContext.
Referenced by rpmInitMacros().
Definition at line 30 of file rpmmacro.h.
Referenced by rpmInitMacros().
Definition at line 27 of file rpmmacro.h.
Referenced by addMacro(), delMacro(), expandMacros(), findEntry(), rpmDefineMacro(), rpmDumpMacroTable(), rpmFreeMacros(), rpmInitMacros(), and rpmLoadMacros().
Generated automatically by Doxygen for rpm from the source code.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |