Go to the source code of this file.
Data Structures | |
struct | MacroEntry_s |
struct | MacroContext_s |
Defines | |
#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 |
Typedefs | |
typedef MacroEntry_s * | MacroEntry |
typedef MacroContext_s * | MacroContext |
typedef enum rpmCompressedMagic_e | rpmCompressedMagic |
Enumerations | |
enum | rpmCompressedMagic_e { COMPRESSED_NOT = 0, COMPRESSED_OTHER = 1, COMPRESSED_BZIP2 = 2, COMPRESSED_ZIP = 3 } |
Functions | |
void | rpmDumpMacroTable (MacroContext mc, FILE *fp) |
Print macros to file stream. | |
int | rpmGlob (const char *patterns, int *argcPtr, const char ***argvPtr) |
Return URL path(s) from a (URL prefixed) pattern glob. | |
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. | |
int | rpmLoadMacroFile (MacroContext mc, const char *fn) |
Load macro context from a macro file. | |
void | rpmInitMacros (MacroContext mc, const char *macrofiles) |
Initialize 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. | |
Variables | |
MacroContext | rpmGlobalMacroContext |
MacroContext | rpmCLIMacroContext |
const char * | macrofiles |
Definition in file rpmmacro.h.
|
Definition at line 50 of file rpmmacro.h. Referenced by ftsCacheUpdate(), rpmcliAllArgCallback(), and rpmInitMacros(). |
|
Markers for sources of macros added throughout rpm.
Definition at line 46 of file rpmmacro.h. Referenced by main(), rpmtsOpenSDB(), setDefaults(), setPathDefault(), and setVarDefault(). |
|
Definition at line 54 of file rpmmacro.h. Referenced by expandMacro(). |
|
Definition at line 47 of file rpmmacro.h. Referenced by rpmLoadMacroFile(). |
|
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(), 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. Referenced by addMacro(), delMacro(), doUndefine(), expandMacros(), expandMacroTable(), findEntry(), freeArgs(), rpmDefineMacro(), rpmDumpMacroTable(), rpmFreeMacros(), rpmInitMacros(), rpmLoadMacroFile(), rpmLoadMacros(), and sortMacroTable(). |
|
The structure used to store a macro. Referenced by addMacro(), compareMacroName(), delMacro(), expandMacro(), expandMacroTable(), findEntry(), freeArgs(), grabArgs(), popMacro(), pushMacro(), rpmDumpMacroTable(), rpmFreeMacros(), and rpmLoadMacros(). |
|
Referenced by buildForTarget(), doFoo(), doPatch(), and doUntar(). |
|
Definition at line 171 of file rpmmacro.h. |
|
Add macro to context.
Definition at line 1853 of file macro.c. References expandMacroTable(), findEntry(), MacroContext_s::firstFree, MacroContext, MacroEntry, MacroContext_s::macrosAllocated, MacroContext_s::macroTable, pushMacro(), and sortMacroTable(). Referenced by addSource(), buildForTarget(), doDefine(), doReadRC(), doScript(), doSetupMacro(), expandMacro(), grabArgs(), handlePreambleTag(), main(), makeGPGSignature(), makePGPSignature(), parseSpec(), rpmInstallLoadMacros(), rpmLoadMacros(), rpmPlatform(), rpmrc_AddMacro(), rpmRebuildTargetVars(), rpmtsOpenSDB(), setDefaults(), setPathDefault(), and setVarDefault(). |
|
Delete macro from context.
Definition at line 1879 of file macro.c. References findEntry(), MacroContext, MacroEntry, popMacro(), and sortMacroTable(). Referenced by doScript(), doUndefine(), handlePreambleTag(), makeGPGSignature(), makePGPSignature(), parseSpec(), rpmrc_DelMacro(), rpmRebuildTargetVars(), and rpmtsOpenSDB(). |
|
Expand macro into buffer.
Definition at line 1818 of file macro.c. References _, alloca(), expandMacro(), MacroBuf, MacroContext, RPMERR_BADSPEC, and rpmError. Referenced by addFileToTagAux(), copyNextLine(), processPackageFiles(), rpmExpand(), and rpmGetPath(). |
|
Return type of compression used in file.
Definition at line 2038 of file macro.c. References _, Fclose(), FD_t, Ferror(), Fopen(), Fread(), Fstrerror(), magic, RPMERR_BADSPEC, and rpmError. Referenced by buildForTarget(), doFoo(), doPatch(), and doUntar(). |
|
Canonicalize file path.
Definition at line 2140 of file macro.c. Referenced by doLookup(), relocateFileList(), rpmdbMoveDatabase(), rpmdbRemoveDatabase(), rpmGetPath(), and rpmQueryVerify(). |
|
Define macro in context.
Definition at line 1895 of file macro.c. References alloca(), doDefine(), MacroBuf, and MacroContext. Referenced by ftsCacheUpdate(), rpmcliAllArgCallback(), rpmdbRebuild(), and rpmLoadMacroFile(). |
|
Print macros to file stream.
Definition at line 209 of file macro.c. References _, MacroEntry_s::body, MacroContext_s::firstFree, MacroEntry_s::level, MacroContext, MacroEntry, MacroContext_s::macroTable, MacroEntry_s::name, MacroEntry_s::opts, and MacroEntry_s::used. Referenced by expandMacro(), and rpmShowRC(). |
|
Return (malloc'ed) concatenated macro expansion(s).
Definition at line 2090 of file macro.c. References expandMacros(), stpcpy(), and xstrdup(). Referenced by buildHost(), checkFiles(), checkForValidArchitectures(), checkPassPhrase(), cpio_doio(), db3New(), dbiTagsInit(), defaultMachine(), doPrimary(), doScript(), doSetupMacro(), fillOutMainPackage(), i18nTag(), ignoreDep(), initGlobs(), main(), makeGPGSignature(), makePGPSignature(), newRpmdb(), open_dso(), packageBinaries(), parseForRegexLang(), parseSpec(), rdToken(), readLine(), rpmcliAllArgCallback(), rpmcliQuery(), rpmdbSetIteratorRE(), rpmExpandNumeric(), rpmfcExec(), rpmfcExpandAppend(), rpmfcGenerateDependsHelper(), rpmGetPassPhrase(), rpmLookupSignatureType(), rpmPlatform(), rpmReadConfigFiles(), rpmRollback(), rpmts_IDTXglob(), rpmtsFindPubkey(), rpmtsSolve(), runScript(), skipFiles(), urlFind(), 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.
Definition at line 2113 of file macro.c. References _free(), and rpmExpand(). Referenced by build(), checkFiles(), dbiOpen(), genCpioListAndHeader(), main(), newRpmdb(), parseRCPOT(), parseSpec(), processPackageFiles(), relocateFileList(), rpmcliQuery(), rpmcliVerify(), rpmdbInit(), rpmdbOpen(), rpmdbRebuild(), rpmdbVerify(), rpmErase(), rpmfcELF(), rpmfcGenerateDepends(), rpmInstall(), rpmLeadVersion(), rpmRollback(), rpmts_Create(), rpmts_init(), rpmtsCreate(), rpmtsOpenSDB(), and skipFiles(). |
|
Destroy macro context.
Definition at line 2011 of file macro.c. References _free(), MacroEntry_s::body, MacroContext_s::firstFree, MacroContext, MacroEntry, MacroContext_s::macroTable, MacroEntry_s::name, MacroEntry_s::opts, and MacroEntry_s::prev. |
|
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.
Definition at line 2259 of file macro.c. References _free(), alloca(), rpmGetPath(), and urlPath(). Referenced by buildForTarget(), db3close(), db3open(), db_init(), doScript(), doSetupMacro(), handlePreambleTag(), makeTempFile(), processBinaryFile(), processMetadataFile(), processPackageFiles(), rpmInstall(), rpmInstallSourcePackage(), and rpmpsmStage(). |
|
Return (malloc'ed) expanded, canonicalized, file path.
Definition at line 2228 of file macro.c. References expandMacros(), rpmCleanPath(), stpcpy(), and xstrdup(). Referenced by addFileToTagAux(), addSource(), buildForTarget(), db3close(), db3open(), doPatch(), doReadRC(), doRmSource(), doUntar(), genCpioListAndHeader(), newRpmdb(), packageBinaries(), packageSources(), parseFiles(), parseForSimple(), parseSpec(), processPackageFiles(), processSourceFiles(), readIcon(), rpmcliQuery(), rpmcliVerify(), rpmdbRebuild(), rpmDetectPGPVersion(), rpmfiNew(), rpmGenPath(), rpmGetFilesystemUsage(), rpmInstall(), rpmpsmStage(), rpmsxParse(), rpmts_Run(), rpmtsOpenDB(), rpmtsOpenSDB(), runScript(), and setPathDefault(). |
|
Return URL path(s) from a (URL prefixed) pattern glob. glob pattern
Definition at line 1678 of file macro.c. References _free(), argv, Glob(), Glob_error(), Glob_pattern_p(), Globfree(), setlocale, URL_IS_DASH, URL_IS_FTP, URL_IS_HTTP, URL_IS_PATH, URL_IS_UNKNOWN, urlPath(), xmalloc(), XpoptParseArgvString(), xrealloc(), and xstrdup(). Referenced by IDTXglob(), processBinaryFile(), rpmGraph(), rpmInitMacros(), rpmInstall(), rpmQueryVerify(), and rpmReadPackageManifest(). |
|
Initialize macro context from set of macrofile(s).
Definition at line 1962 of file macro.c. References _free(), MacroContext, macrofiles, RMIL_CMDLINE, rpmCLIMacroContext, rpmGlob(), rpmLoadMacroFile(), rpmLoadMacros(), and xstrdup(). Referenced by rpmReadRC(). |
|
Load macro context from a macro file.
Definition at line 1929 of file macro.c. References Fclose(), FD_t, Ferror(), Fopen(), MacroContext, max_macro_depth, rdcl(), RMIL_MACROFILES, rpmDefineMacro(), and SKIPBLANK. Referenced by rpmInitMacros(). |
|
Load macros from specific context into global context.
Definition at line 1908 of file macro.c. References addMacro(), MacroEntry_s::body, MacroContext_s::firstFree, MacroContext, MacroEntry, MacroContext_s::macroTable, MacroEntry_s::name, and MacroEntry_s::opts. Referenced by rpmInitMacros(). |
|
|
|
|