rpm
5.4.14
|
#include "system.h"
#include <stdarg.h>
#include <rpmio_internal.h>
#include <rpmlog.h>
#include <mire.h>
#include <rpmaug.h>
#include <rpmficl.h>
#include <rpmgit.h>
#include <rpmjs.h>
#include <rpmperl.h>
#include <rpmpython.h>
#include <rpmruby.h>
#include <rpmsm.h>
#include <rpmsquirrel.h>
#include <rpmsql.h>
#include <rpmtcl.h>
#include <rpmuuid.h>
#include <rpmmacro.h>
#include "debug.h"
Go to the source code of this file.
Data Structures | |
struct | MacroBuf_s |
Macro expansion state. More... | |
Macros | |
#define | isblank(_c) ((char)(_c) == ' ' || (char)(_c) == '\t') |
#define | iseol(_c) ((char)(_c) == '\n' || (char)(_c) == '\r') |
#define | STREQ(_t, _f, _fn) ((_fn) == (sizeof(_t)-1) && !strncmp((_t), (_f), (_fn))) |
#define | _RPMAUG_INTERNAL /* XXX for _rpmaugFoo globals */ |
#define | _MACRO_INTERNAL |
#define | SAVECHAR(_mb, _c) { *(_mb)->t = (char) (_c), (_mb)->t++, (_mb)->nb--; } |
#define | _MAX_MACRO_DEPTH 16 |
#define | _PRINT_MACRO_TRACE 0 |
#define | _PRINT_EXPAND_TRACE 0 |
#define | _MAX_LOAD_DEPTH 2 |
#define | MACRO_CHUNK_SIZE 16 |
#define | SKIPBLANK(_s, _c) |
#define | SKIPNONBLANK(_s, _c) |
#define | COPYNAME(_ne, _s, _c) |
#define | COPYOPTS(_oe, _s, _c) |
#define | POPT_ERROR_NOARG -10 |
#define | POPT_ERROR_BADQUOTE -15 |
#define | POPT_ERROR_MALLOC -21 |
#define | POPT_ARGV_ARRAY_GROW_DELTA 5 |
#define | _suffix(_s, _x) (slen >= sizeof(_x) && !strcmp((_s)+slen-(sizeof(_x)-1), (_x))) |
Typedefs | |
typedef struct MacroBuf_s * | MacroBuf |
Functions | |
static int | expandMacro (MacroBuf mb) |
return | strcmp (ame->name, bme->name) |
qsort (mc->macroTable, mc->firstFree, sizeof(mc->macroTable[0]), compareMacroName) | |
for (i=0;i< mc->firstFree;i++) | |
static char * | dupMacroEntry (MacroEntry me) |
void | rpmDumpMacroTable (MacroContext mc, FILE *fp) |
Print macros to file stream. More... | |
int | rpmGetMacroEntries (MacroContext mc, void *_mire, int used, const char ***avp) |
Return macro entries as string array. More... | |
static MacroEntry * | if (mc==NULL) |
Find entry in macro table. More... | |
if (fgets(q,(int) size, f)==NULL) | |
if (nb==0||(*q!= '\\'&&!bc &&!pc)||*(q+1)== '\0') | |
while (size > 0) | |
return (nread > 0?buf:NULL) | |
while ((c=*p++)!= '\0') | |
return (const char *) | |
Pre-print macro expression to be expanded. More... | |
if (!(te > t)) | |
if (mb->depth > 0) | |
fprintf (stderr,"%3d<%*s", mb->depth,(2 *mb->depth+1),"") | |
fprintf (stderr,"%.*s%s",(int)(te-t), t, ellipsis) | |
fprintf (stderr,"\n") | |
memset (sbuf, 0,(flen+1)) | |
strncpy (sbuf, f, flen) | |
memset (tbuf, 0,(ulen+1)) | |
strncpy (u, tbuf,(ulen-mb->nb+1)) | |
strncpy (buf, cmd, clen) | |
if ((shf=popen(buf,"r"))==NULL) | |
void | pclose (shf) |
while (((char)(mb->t[-1])== '\n'||(char)(mb->t[-1])== '\r')) | |
while (((c)=(int)*(s))&&((char)(c)== ' '||(char)(c)== '\t')) | |
while (((c)=(int)*(s))&&(xisalnum(c)||(c)==(int) '_')) { while ((( c ) = (int) *( s )) && ((char)( c ) == ' ' || (char)( c ) == '\t')) ( s )++ | |
delMacro (mc, n) | |
delMacroAll (mc, n) | |
static void | pushMacro (MacroEntry *mep, const char *n, const char *o, const char *b, int level) |
Push new macro definition onto macro entry stack. More... | |
if (me) | |
sortMacroTable (mc) | |
static const char * | grabArgs (MacroBuf mb, const MacroEntry me, const char *se, const char *lastc) |
Parse arguments (to next new line) for parameterized macro. More... | |
strncpy (buf, msg, msglen) | |
void | expandU (mb, buf, bufn) |
rpmlog (RPMLOG_ERR,"%s\n", buf) | |
else | fprintf (stderr,"%s", buf) |
static void | doFoo (MacroBuf mb, int negate, const char *f, size_t fn, const char *g, size_t gn) |
Execute macro primitives. More... | |
static int | expandFIFO (MacroBuf mb, MacroEntry me, const char *g, size_t gn) |
static int | XpoptDupArgv (int argc, char **argv, int *argcPtr, char ***argvPtr) |
static int | XpoptParseArgvString (const char *s, int *argcPtr, char ***argvPtr) |
if (++mb->depth > max_macro_depth) | |
while (rc==0 &&mb->nb > 0 &&(c=(int)*s)!=(int)'\0') | |
printExpansion (mb, t, mb->t) | |
int | rpmSecuritySaneFile (const char *filename) |
Check whether configuration file is moderately secure to load. More... | |
int | rpmGlob (const char *patterns, int *argcPtr, const char ***argvPtr) |
Return URL path(s) from a (URL prefixed) pattern glob. More... | |
int | expandMacros (void *spec, MacroContext mc, char *sbuf, size_t slen) |
Expand macro into buffer. More... | |
void | addMacro (MacroContext mc, const char *n, const char *o, const char *b, int level) |
Add macro to context. More... | |
void | delMacro (MacroContext mc, const char *n) |
Delete macro from context. More... | |
void | delMacroAll (MacroContext mc, const char *n) |
int | rpmDefineMacro (MacroContext mc, const char *macro, int level) |
Define macro in context. More... | |
int | rpmUndefineMacro (MacroContext mc, const char *macro) |
Undefine macro in context. More... | |
void | rpmLoadMacros (MacroContext mc, int level) |
Load macros from specific context into global context. More... | |
int | rpmLoadMacroFile (MacroContext mc, const char *fn, int nesting) |
Load macro context from a macro file. More... | |
void | rpmInitMacros (MacroContext mc, const char *macrofiles) |
Initialize macro context from set of macrofile(s). More... | |
void | rpmFreeMacros (MacroContext mc) |
Destroy macro context. More... | |
int | isCompressed (const char *file, rpmCompressedMagic *compressed) |
Return type of compression used in file. More... | |
char * | rpmExpand (const char *arg,...) |
Return (malloc'ed) concatenated macro expansion(s). More... | |
char * | rpmMCExpand (MacroContext mc, const char *arg,...) |
Return (malloc'ed) concatenated macro expansion(s) in a context. More... | |
int | rpmExpandNumeric (const char *arg) |
Return macro expansion as a numeric value. More... | |
char * | rpmCleanPath (char *path) |
Canonicalize file path. More... | |
char * | rpmGetPath (const char *path,...) |
Return (malloc'ed) expanded, canonicalized, file path. More... | |
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. More... | |
Variables | |
const char * | rpmMacrofiles = MACROFILES |
List of macro files to read when configuring rpm. More... | |
static struct MacroContext_s | rpmGlobalMacroContext_s |
MacroContext | rpmGlobalMacroContext = &rpmGlobalMacroContext_s |
static struct MacroContext_s | rpmCLIMacroContext_s |
MacroContext | rpmCLIMacroContext = &rpmCLIMacroContext_s |
int | max_macro_depth = 16 |
int | print_macro_trace = 0 |
int | print_expand_trace = 0 |
int | _max_load_depth = 2 |
static size_t | _macro_BUFSIZ = 16 * 1024 |
static | int |
Compare macro entries by name (qsort/bsearch). More... | |
MacroEntry | bme = *((MacroEntry *)bp) |
return | |
static | void |
Enlarge macro table. More... | |
key | name = (char *)name |
ret | |
static char *size_t | nb = 0 |
fgets(3) analogue that reads \ continuations. More... | |
size_t | nread = 0 |
FILE * | f = fdGetFILE(fd) |
int | pc = 0 |
int | bc = 0 |
char * | p = buf |
do | |
q = '\n' | |
size = nb | |
static const char *char | c |
Return text between pl and matching pr characters. More... | |
int | choplen |
te | |
ellipsis = "" | |
const char * | s = mb->s |
int | rc = expandMacro(mb) |
sbuf = (char *) alloca(flen + 1) | |
char * | t = mb->t |
char * | tbuf = (char *) alloca(ulen + 1) |
char * | buf = (char *) alloca(bufn) |
Parse (and execute) macro undefinition. More... | |
FILE * | shf |
static const char *size_t | bufn = _macro_BUFSIZ |
Parse (and execute) new macro definition. More... | |
char * | n = buf |
char * | ne = n |
char * | oe = ne + 1 |
char * | b |
char * | be |
int | oc = (int) ')' |
if(*)(c) s | ('){s++;o=oe;{while(((oc)=(int)*(s))&&(oc)!=(int) ')')*(oe)++=*(s)++;*(oe)= '\0';};s++;}b=be=oe+1;while(((c)=(int)*(s))&&((char (') |
return | se |
int | ndeleted = 0 |
int | i |
MacroEntry | me |
const char * | fe |
const char * | g |
const char * | ge |
size_t | fn |
size_t | gn |
int | negate |
int | stackarray |
const char * | lastc |
int | chkexist |
mb | depth |
static int | _debug = 0 |
Class: Rpmts | |
key = (MacroEntry) memset(alloca(sizeof(*key)), 0, sizeof(*key)) | |
Class: Rpmds | |
char * | o = NULL |
#define _MAX_MACRO_DEPTH 16 |
Definition at line 152 of file macro.c.
Referenced by rpmLoadMacroFile().
#define _suffix | ( | _s, | |
_x | |||
) | (slen >= sizeof(_x) && !strcmp((_s)+slen-(sizeof(_x)-1), (_x))) |
Referenced by rpmInitMacros().
#define COPYNAME | ( | _ne, | |
_s, | |||
_c | |||
) |
#define COPYOPTS | ( | _oe, | |
_s, | |||
_c | |||
) |
Definition at line 594 of file macro.c.
Referenced by ('){s++;o=oe;{while(((oc)=(int)*(s))&&(oc)!=(int) ')')*(oe)++=*(s)++;*(oe)= '\0';};s++;}b=be=oe+1;while(((c)=(int)*(s))&&((char.
#define isblank | ( | _c | ) | ((char)(_c) == ' ' || (char)(_c) == '\t') |
Definition at line 9 of file macro.c.
Referenced by doFoo(), grabArgs(), and while().
#define iseol | ( | _c | ) | ((char)(_c) == '\n' || (char)(_c) == '\r') |
#define POPT_ARGV_ARRAY_GROW_DELTA 5 |
Definition at line 1525 of file macro.c.
Referenced by XpoptParseArgvString().
#define POPT_ERROR_BADQUOTE -15 |
error in paramter quoting
Definition at line 1522 of file macro.c.
Referenced by XpoptParseArgvString().
#define POPT_ERROR_MALLOC -21 |
memory allocation failed
Definition at line 1523 of file macro.c.
Referenced by XpoptDupArgv(), and XpoptParseArgvString().
#define POPT_ERROR_NOARG -10 |
#define SKIPBLANK | ( | _s, | |
_c | |||
) |
Definition at line 575 of file macro.c.
Referenced by rpmLoadMacroFile().
#define SKIPNONBLANK | ( | _s, | |
_c | |||
) |
#define STREQ | ( | _t, | |
_f, | |||
_fn | |||
) | ((_fn) == (sizeof(_t)-1) && !strncmp((_t), (_f), (_fn))) |
typedef struct MacroBuf_s * MacroBuf |
void addMacro | ( | MacroContext | mc, |
const char * | n, | ||
const char * | o, | ||
const char * | b, | ||
int | level | ||
) |
Add macro to context.
mc | macro context (NULL uses global context). |
n | macro name |
o | macro paramaters |
b | macro body |
level | macro recursion level (0 is entry API) |
Definition at line 2722 of file macro.c.
References _, findEntry(), n, NULL, pushMacro(), rpmGlobalMacroContext, rpmlog(), RPMLOG_ERR, sortMacroTable(), and strcmp().
Referenced by addMacroDefault(), addSource(), doSetupMacro(), grabArgs(), handlePreambleTag(), headerMacrosLoad(), makeGPGSignature(), parsePreamble(), parseSpec(), rpmcliInstall(), rpmLoadMacros(), rpmPlatform(), rpmRebuildTargetVars(), rpmtsOpenSDB(), setDefaults(), setPathDefault(), and while().
delMacro | ( | mc | , |
n | |||
) |
Referenced by delMacroAll(), handlePreambleTag(), headerMacrosUnload(), makeGPGSignature(), parseSpec(), rpmcliInstall(), rpmRebuildTargetVars(), and rpmtsOpenSDB().
void delMacro | ( | MacroContext | mc, |
const char * | n | ||
) |
Delete macro from context.
mc | macro context (NULL uses global context). |
n | macro name |
Definition at line 2761 of file macro.c.
References findEntry(), NULL, rpmGlobalMacroContext, and sortMacroTable().
delMacroAll | ( | mc | , |
n | |||
) |
void delMacroAll | ( | MacroContext | mc, |
const char * | n | ||
) |
Definition at line 2776 of file macro.c.
References delMacro(), findEntry(), NULL, and rpmGlobalMacroContext.
|
static |
Execute macro primitives.
mb | macro expansion state |
negate | should logic be inverted? |
f | beginning of field f |
fn | length of field f |
g | beginning of field g |
gn | length of field g |
Definition at line 1271 of file macro.c.
References _macro_BUFSIZ, alloca(), be, buf, c, COMPRESSED_OTHER, expandU(), getenv(), gn, i, int, isblank, isCompressed(), j, k, mode, n, negate, NULL, PATH_MAX, realpath(), rpmlog(), RPMLOG_ERR, RPMLOG_INFO, RPMLOG_MASK, rpmlogSetMask(), rpmuuidMake(), sprintf(), stpcpy(), stpncpy(), STREQ, strncpy(), urlPath(), uuid_ns, uuid_version, void, xisdigit(), and xisspace().
Referenced by while().
|
static |
|
static |
Referenced by expandMacros(), and while().
int expandMacros | ( | void * | spec, |
MacroContext | mc, | ||
char * | sbuf, | ||
size_t | slen | ||
) |
Expand macro into buffer.
spec | cookie (unused) |
mc | macro context (NULL uses global context). |
sbuf | input macro to expand, output expansion |
slen | size of buffer |
Definition at line 2687 of file macro.c.
References _, alloca(), MacroBuf_s::depth, MacroBuf_s::expand_trace, expandMacro(), MacroBuf_s::macro_trace, MacroBuf_s::mc, MacroBuf_s::nb, NULL, print_expand_trace, print_macro_trace, rc, rpmGlobalMacroContext, rpmlog(), RPMLOG_ERR, MacroBuf_s::s, sbuf, spec, MacroBuf_s::spec, strncpy(), MacroBuf_s::t, and tbuf.
Referenced by addFileToTagAux(), copyNextLineFromOFI(), processPackageFiles(), rpmExpand(), rpmGetPath(), and rpmMCExpand().
Referenced by doFoo(), and grabArgs().
fprintf | ( | stderr | , |
"%3d<%*s", mb-> | depth, | ||
(2 *mb->depth+1) | , | ||
"" | |||
) |
fprintf | ( | stderr | , |
"\n" | |||
) |
|
static |
Parse arguments (to next new line) for parameterized macro.
mb | macro expansion state |
me | macro entry slot |
se | arguments to parse |
lastc | stop parsing at lastc |
Definition at line 1069 of file macro.c.
References _, _free(), _macro_BUFSIZ, addMacro(), alloca(), argv, b, be, buf, c, MacroBuf_s::depth, exit, expandU(), int, isblank, MacroBuf_s::mc, NULL, optCon, poptContext, rpmlog(), RPMLOG_ERR, se, sprintf(), stpcpy(), and xcalloc().
Referenced by while().
static MacroEntry* if | ( | mc | = = NULL | ) |
if | ( | ! | te > t | ) |
Definition at line 545 of file macro.c.
References _, MacroBuf_s::depth, and fprintf().
if | ( | mb-> | depth, |
0 | |||
) |
Definition at line 554 of file macro.c.
References choplen, and MacroBuf_s::depth.
if | ( | ++mb-> | depth, |
max_macro_depth | |||
) |
Definition at line 1707 of file macro.c.
References _, MacroBuf_s::depth, MacroBuf_s::expand_trace, max_macro_depth, rpmlog(), and RPMLOG_ERR.
int isCompressed | ( | const char * | file, |
rpmCompressedMagic * | compressed | ||
) |
Return type of compression used in file.
file | name of file |
compressed | address of compression type |
Definition at line 3045 of file macro.c.
References _, COMPRESSED_7ZIP, COMPRESSED_BZIP2, COMPRESSED_LRZIP, COMPRESSED_LZIP, COMPRESSED_LZMA, COMPRESSED_LZOP, COMPRESSED_NOT, COMPRESSED_OTHER, COMPRESSED_XZ, COMPRESSED_ZIP, Fclose(), fd, Ferror(), Fopen(), Fread(), Fstrerror(), nb, NULL, rc, rpmlog(), RPMLOG_ERR, and void.
memset | ( | sbuf | , |
0 | , | ||
(flen+1) | |||
) |
memset | ( | tbuf | , |
0 | , | ||
(ulen+1) | |||
) |
Referenced by rpmdsLdconfig(), and rpmdsPipe().
printExpansion | ( | mb | , |
t | , | ||
mb-> | t | ||
) |
|
static |
Push new macro definition onto macro entry stack.
mep | address of macro entry slot |
n | macro name |
o | macro parameters (NULL if none) |
b | macro body (NULL becomes "") |
level | macro recursion level |
Definition at line 960 of file macro.c.
References me, n, NULL, xmalloc, and xstrdup().
Referenced by addMacro().
qsort | ( | mc-> | macroTable, |
mc-> | firstFree, | ||
sizeof(mc->macroTable[0]) | , | ||
compareMacroName | |||
) |
return | ( | nread | , |
0?buf:NULL | |||
) |
return | ( | const char * | ) |
char* rpmCleanPath | ( | char * | path | ) |
Canonicalize file path.
path | path to canonicalize (in-place) |
Definition at line 3279 of file macro.c.
References NULL, path, s, se, t, and te.
Referenced by db3open(), doLookup(), relocateFileList(), rpmGetPath(), rpmioAccess(), and rpmQueryVerify().
int rpmDefineMacro | ( | MacroContext | mc, |
const char * | macro, | ||
int | level | ||
) |
Define macro in context.
mc | macro context (NULL uses global context). |
macro | macro name, options, body |
level | macro recursion level (0 is entry API) |
Definition at line 2789 of file macro.c.
References alloca(), MacroBuf_s::mc, memset(), rpmGlobalMacroContext, and void.
Referenced by ftsCacheUpdate(), main(), rpmcliAllArgCallback(), rpmioAllArgCallback(), rpmLoadMacroFile(), and rpmmc_add().
void rpmDumpMacroTable | ( | MacroContext | mc, |
FILE * | fp | ||
) |
Print macros to file stream.
mc | macro context (NULL uses global context). |
fp | file stream (NULL uses stderr). |
Definition at line 285 of file macro.c.
References _, fprintf(), i, me, NULL, and rpmGlobalMacroContext.
Referenced by rpmShowRC(), and while().
char* rpmExpand | ( | const char * | arg, |
... | |||
) |
Return (malloc'ed) concatenated macro expansion(s).
arg | macro(s) to expand (NULL terminates list) |
Definition at line 3178 of file macro.c.
References _macro_BUFSIZ, bufn, expandMacros(), NULL, s, stpcpy(), t, te, void, xmalloc, xrealloc, and xstrdup().
Referenced by _GetPass(), addChangelog(), archScore(), checkForValidArchitectures(), checkUnpackagedFiles(), cpio_doio(), dbiTagsInit(), debevrfmtTag(), debmd5sumsTag(), defaultMachine(), doPatch(), doPrimary(), doSetupMacro(), fillOutMainPackage(), Fopen(), for(), formatValue(), getMachineInfo(), headerMacrosLoad(), headerMacrosUnload(), headerSprintf(), i18nTag(), if(), initGlobs(), initSourceHeader(), lookupPackage(), main(), makeGPGSignature(), Open(), open_dso(), packageBinaries(), packageSources(), parseBuildInstallClean(), parseForRegexLang(), parseForSimple(), parsePreamble(), parseSpec(), prepFetch(), processBinaryFiles(), processSourceFiles(), rdToken(), readLine(), Realpath(), rpmCheckPassPhrase(), rpmcliEvalSlurp(), rpmcliImportPubkeys(), rpmcliInstallElementPath(), rpmcliQuery(), rpmdbExportL10N_SQL(), rpmdbNew(), rpmdcParseZeroInstall(), rpmdsCpuinfo(), rpmdsEVRorder(), rpmdsLdconfig(), rpmdsPipe(), rpmdsSysinfo(), rpmEVRmire(), rpmEVRorder(), rpmExpandNumeric(), rpmfcClassify(), rpmfcExec(), rpmfcExpandAppend(), rpmfcExpandRegexps(), rpmfcGenerateDependsHelper(), rpmfcSCRIPT(), rpmgiNext(), rpmgiOpen(), rpmInstallSourcePackage(), rpmioAllArgCallback(), rpmmiAddPattern(), rpmnsArch(), rpmnsParse(), rpmnsProbeSignature(), rpmperlNew(), rpmPlatform(), rpmpsmStage(), rpmpythonNew(), rpmrbLoadClasses(), rpmrbLoadFile(), rpmReadConfigFiles(), rpmReadRC(), rpmrepoDoRepoMetadata(), rpmrepoInitPopt(), rpmrepoMDExpand(), rpmRollback(), rpmShowProgress(), rpmShowRC(), rpmsqlNew(), rpmsqlRun(), rpmtsAddInstallElement(), rpmtsAddObsoletes(), rpmtsAddUpgrades(), rpmtsEraseDebuginfo(), rpmtsFindPubkey(), rpmtsOpenSDB(), rpmtsRollback(), rpmtsSkipFiles(), rpmtsSolve(), rpmvtNew(), runImmedTriggers(), runInstScript(), runScript(), runTriggers(), statFormat(), strsubFormat(), tagLoadATags(), tagValidate(), unsatisfiedDepend(), urlFind(), urlGetFile(), and writeRPM().
int rpmExpandNumeric | ( | const char * | arg | ) |
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.
arg | macro to expand |
Definition at line 3252 of file macro.c.
References _free(), NULL, rc, rpmExpand(), and val.
Referenced by _rpmtsRun(), addChangelog(), checkPackageDeps(), checkPackages(), checkUnpackagedFiles(), doIcon(), doPatchMacro(), genCpioListAndHeader(), getDigestAlgo(), main(), newSpec(), parseScript(), parseSpec(), processBinaryFiles(), processPackageFiles(), relocateFileList(), rpmcliInstall(), rpmcliQuery(), rpmcliVerify(), rpmdbNew(), rpmdbOpen(), rpmdsELF(), rpmErase(), rpmfcGenerateDepends(), rpmfcSCRIPT(), rpmRollback(), rpmts_new(), rpmtsAddInstallElement(), rpmtsCreate(), rpmtsOpenSDB(), rpmtsPrepare(), rpmtsRollback(), rpmtsSkipFiles(), unsatisfiedDepend(), and urlGetFile().
void rpmFreeMacros | ( | MacroContext | mc | ) |
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.
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.
urlroot | root URL (often path to chroot, or NULL) |
urlmdir | directory URL (often a directory, or NULL) |
urlfile | file URL (often a file, or NULL) |
Definition at line 3417 of file macro.c.
References _free(), alloca(), file, fprintf(), NULL, result, rpmGetPath(), strncpy(), t, URL_IS_DASH, and urlPath().
Referenced by addSource(), createDir(), db3close(), db3open(), db_init(), doIcon(), doPatch(), doScript(), doSetupMacro(), doUntar(), for(), handlePreambleTag(), prepFetch(), processBinaryFile(), processMetadataFile(), processPackageFiles(), rpmdsNew(), rpmfcGenerateDepends(), rpmfiNew(), rpmpsmStage(), rpmrepoInitPopt(), rpmTempFile(), sql_close(), sql_initDB(), and sql_open().
int rpmGetMacroEntries | ( | MacroContext | mc, |
void * | _mire, | ||
int | used, | ||
const char *** | avp | ||
) |
Return macro entries as string array.
mc | macro context (NULL uses global context) |
_mire | pattern to match (NULL disables) |
used | macro usage (<0 all, =0 unused, >=1 used count) |
*avp | macro definitions |
Definition at line 319 of file macro.c.
References ac, av, dupMacroEntry(), i, me, mireRegexec(), NULL, rpmGlobalMacroContext, xcalloc(), and xrealloc.
Referenced by packageSources(), rpmmc_list(), and rpmtsFini().
char* rpmGetPath | ( | const char * | path, |
... | |||
) |
Return (malloc'ed) expanded, canonicalized, file path.
path | macro(s) to expand (NULL terminates list) |
Definition at line 3371 of file macro.c.
References _macro_BUFSIZ, alloca(), buf, DRD_xstrdup, expandMacros(), nb, NULL, rpmCleanPath(), s, stpcpy(), t, te, void, and xstrdup().
Referenced by addFileToTagAux(), buildSpec(), Chroot(), db3open(), db_init(), defaultMachine(), doPatch(), doUntar(), for(), fpLookupSubdir(), getSourceDir(), initSourceHeader(), packageBinaries(), packageSources(), parseFiles(), parseForSimple(), parseSpec(), processPackageFiles(), Realpath(), repoWriteMetadataDocs(), rpmcliInstallElementPath(), rpmdbExportHR_MIB(), rpmdbExportL10N_SQL(), rpmdbURIPath(), rpmdsSysinfo(), rpmfiNew(), rpmGenPath(), rpmGetFilesystemUsage(), rpmpsmStage(), rpmQueryVerify(), rpmrbLoadClasses(), rpmrepoCloseMDFile(), rpmrepoDoFinalMove(), rpmrepoDoPkgMetadata(), rpmrepoDoRepoMetadata(), rpmrepoGetPath(), rpmrepoInitPopt(), rpmrepoMkdir(), rpmrepoOpenMDFile(), rpmrepoTestSetupDirs(), rpmsqlNew(), rpmsxNew(), rpmtsFindPubkey(), rpmtsOpenDB(), rpmtsOpenSDB(), rpmtsPRCO(), rpmtsRebuildDB(), rpmvfNew(), str2uuid(), and unsatisfiedDepend().
Return URL path(s) from a (URL prefixed) pattern glob.
patterns | glob pattern |
*argcPtr | no. of paths |
*argvPtr | array of paths (malloc'd contiguous blob) |
Definition at line 2547 of file macro.c.
References _free(), ac, argv, av, exit, fprintf(), glob_t::gl_pathc, glob_t::gl_pathv, Glob(), Glob_error(), Glob_pattern_p(), GLOB_TILDE, Globfree(), i, j, nb, NULL, path, rc, setlocale, strncpy(), t, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, urlPath(), void, xmalloc, XpoptParseArgvString(), xrealloc, and xstrdup().
Referenced by for(), IDTXglob(), processBinaryFile(), rpmcliInstallElementPath(), rpmgiGlobArgv(), rpmInitMacros(), rpmioInit(), rpmLoadMacroFile(), and rpmReadPackageManifest().
void rpmInitMacros | ( | MacroContext | mc, |
const char * | macrofiles | ||
) |
Initialize macro context from set of macrofile(s).
mc | macro context |
macrofiles | colon separated list of macro files (NULL does nothing) |
Definition at line 2930 of file macro.c.
References _free(), _max_load_depth, _suffix, ac, av, i, m, me, NULL, RMIL_CMDLINE, rpmCLIMacroContext, rpmGlob(), rpmGlobalMacroContext, rpmLoadMacroFile(), rpmLoadMacros(), rpmlog(), RPMLOG_WARNING, rpmSecuritySaneFile(), void, xmalloc, and xstrdup().
Referenced by rpmmc_init_macros(), and rpmReadRC().
int rpmLoadMacroFile | ( | MacroContext | mc, |
const char * | fn, | ||
int | nesting | ||
) |
Load macro context from a macro file.
mc | (unused) |
fn | macro file name |
nesting | max load recursion depth, 0 disables. |
Definition at line 2851 of file macro.c.
References _, _free(), _macro_BUFSIZ, _MAX_MACRO_DEPTH, alloca(), argv, buf, c, exit, Fclose(), fd, Ferror(), Fopen(), i, max_macro_depth, NULL, rc, RMIL_MACROFILES, rpmDefineMacro(), rpmGlob(), rpmLoadMacroFile(), rpmlog(), RPMLOG_WARNING, rpmMCExpand(), s, SKIPBLANK, void, and xx.
Referenced by rpmInitMacros(), rpmLoadMacroFile(), rpmmc_load_macro_file(), and while().
void rpmLoadMacros | ( | MacroContext | mc, |
int | level | ||
) |
Load macros from specific context into global context.
mc | macro context (NULL does nothing). |
level | macro recursion level (0 is entry API) |
Definition at line 2811 of file macro.c.
References addMacro(), i, me, NULL, and rpmGlobalMacroContext.
Referenced by rpmInitMacros().
rpmlog | ( | RPMLOG_ERR | , |
"%s\n" | , | ||
buf | |||
) |
Referenced by _rpmtsCheck(), _rpmtsRun(), _specQuery(), addChangelog(), addFile(), addFileToTagAux(), addMacro(), addSource(), build(), buildHost(), buildSpec(), cacheStashLatest(), checkForDuplicates(), checkForRequired(), checkForValidArchitectures(), checkOwners(), checkPackages(), checkUnpackagedFiles(), copyFile(), copyNextLineFromOFI(), cpio_copy(), cpio_doio(), createDir(), db3close(), db3open(), db_fini(), db_init(), dbiFindMatches(), dbiMireKeys(), dbiOpen(), dnlInitIterator(), doAddSubtract(), doFoo(), doIcon(), doLogical(), doMultiplyDivide(), doPatch(), doPatchMacro(), doPrimary(), doRelational(), doSetupMacro(), doUntar(), expandMacros(), Fadvise(), Fallocate(), fiIntersect(), findErases(), findPreambleTag(), flushBuffer(), for(), fsmMapAttrs(), fsmMkdirs(), fsmStage(), genCpioListAndHeader(), getFilesystemList(), getGidS(), getGname(), getGnameS(), getOutputFrom(), getUidS(), getUname(), getUnameS(), grabArgs(), handlePreambleTag(), headerCheck(), IDTXglob(), if(), initGlobs(), installArgCallback(), iosmMapAttrs(), iosmMkdirs(), iosmStage(), isCompressed(), main(), makeGPGSignature(), makeHDRSignature(), manageFile(), miFreeHeader(), mireRegcomp(), mireRegexec(), mireStudy(), packageBinaries(), parseBuildInstallClean(), parseDescription(), parseExpressionBoolean(), parseExpressionString(), parseFiles(), parseForAttr(), parseForConfig(), parseForDev(), parseForLang(), parseForSimple(), parseForVerify(), parseNoSource(), parsePreamble(), parsePrep(), parseRCPOT(), parseScript(), parseSpec(), pkgUnpackagedSubdirs(), prepFetch(), prepFetchVerbose(), printDeps(), printSize(), processBinaryFile(), processBinaryFiles(), processMetadataFile(), processPackageFiles(), processScriptFiles(), processSourceFiles(), psmWait(), queryHeader(), rdToken(), readFile(), readLine(), readLineFromOFI(), relocateFileList(), removeSillyDeps(), rpmalAllFileSatisfiesDepend(), rpmCheckPassPhrase(), rpmcliImportPubkeys(), rpmcliInstall(), rpmcliInstallProblems(), rpmcliInstallSuggests(), rpmcliSign(), rpmdbCheckSignals(), rpmdbCount(), rpmdbExportHR_MIB(), rpmdbNew(), rpmdbRemove(), rpmdsCompare(), rpmdsNotify(), rpmdsProblem(), rpmErase(), rpmEVRcompare(), rpmfcApply(), rpmfcClassify(), rpmfcExpandRegexps(), rpmfcGenerateDependsHelper(), rpmfcHelper(), rpmfcMatchRegexps(), rpmfiDecideFate(), rpmGetFilesystemUsage(), rpmgiInitFilter(), rpmgiLoadReadHeader(), rpmgiNext(), rpmgiOpen(), rpmgiWalkPathFilter(), rpmInitMacros(), rpmInstallSource(), rpmInstallSourcePackage(), rpmioAllArgCallback(), rpmioFreePool(), rpmioInit(), rpmioMkpath(), rpmioNewPool(), rpmLoadMacroFile(), rpmmgBuffer(), rpmmgFile(), rpmmgNew(), rpmmiNext(), rpmMkdirPath(), rpmpsmStage(), rpmQueryVerify(), rpmReadHeaders(), rpmReadPackageFile(), rpmReadPackageManifest(), rpmReSign(), rpmRollback(), rpmShowProgress(), rpmSingleHeaderFromFD(), rpmspecQuery(), rpmTempFile(), rpmts_Die(), rpmtsAddInstallElement(), rpmtsAddObsoletes(), rpmtsAddUpgrades(), rpmtsCheckInstalledFiles(), rpmtsEraseDebuginfo(), rpmtsFindPubkey(), rpmtsInitDSI(), rpmtsOpenDB(), rpmtsOpenSDB(), rpmtsPrepare(), rpmtsProcess(), rpmtsRebuildDB(), rpmtsRollback(), rpmtsSanityCheck(), rpmtsSkipFiles(), rpmtsSolve(), rpmuuidMake(), rpmVerifySignatures(), rpmvfVerify(), rpmWriteHeaders(), runScript(), showQueryPackage(), showVerifyPackage(), sql_busy_handler(), sql_cdel(), sql_cget(), sql_close(), sql_cput(), sql_open(), tagValidate(), timeCheck(), urlConnect(), urlGetFile(), urlSplit(), verifyDependencies(), while(), writeRPM(), wrSignature(), and Xcvtdberr().
char* rpmMCExpand | ( | MacroContext | mc, |
const char * | arg, | ||
... | |||
) |
Return (malloc'ed) concatenated macro expansion(s) in a context.
mc | macro context |
arg | macro(s) to expand (NULL terminates list) |
Definition at line 3215 of file macro.c.
References _macro_BUFSIZ, bufn, expandMacros(), NULL, s, stpcpy(), t, te, void, xmalloc, xrealloc, and xstrdup().
Referenced by rpmLoadMacroFile(), and rpmmc_expand().
int rpmSecuritySaneFile | ( | const char * | filename | ) |
Check whether configuration file is moderately secure to load.
filename | filename to check |
Definition at line 2524 of file macro.c.
Referenced by for(), rpmInitMacros(), and rpmioInit().
int rpmUndefineMacro | ( | MacroContext | mc, |
const char * | macro | ||
) |
Undefine macro in context.
mc | macro context (NULL uses global context). |
macro | macro name |
Definition at line 2803 of file macro.c.
References rpmGlobalMacroContext, and void.
Referenced by rpmcliAllArgCallback(), rpmioAllArgCallback(), and rpmmc_del().
sortMacroTable | ( | mc | ) |
Referenced by addMacro(), and delMacro().
Referenced by addFile(), addMacro(), addReqProv(), argvCmp(), cacheWalkPathFilter(), checkPackageDeps(), checkResponse(), chkSuffix(), Chroot(), cmpArgvStr(), cmpItem(), compareFileListRecs(), cpioStrCmp(), dateToTimet(), dncmp(), doPatchMacro(), doRelational(), extractRegular(), FDGSkip(), Fdopen(), fiIntersect(), findErases(), findTag(), Fopen(), for(), fsmMkdirs(), fsmSetup(), fsmStage(), genCpioListAndHeader(), getFilesystemList(), getGidS(), getGnameS(), getHostAddress(), getUidS(), getUnameS(), gnameToGid(), handleOverlappedFiles(), handlePreambleTag(), hashEqualityString(), headerSprintf(), httpReq(), IDTXglob(), indexcmp(), iosmMkdirs(), iosmSetup(), iosmStage(), iosmStrCmp(), langCmp(), lookupInCanonTable(), lookupInDefaultTable(), lookupPackage(), main(), nwlookupTag(), packagedDir(), parseDescription(), parseForConfig(), parseForSimple(), parseForVerify(), parseScript(), parseSimplePart(), parseSpec(), pkgUnpackagedSubdirs(), PRCOSkip(), prepFetch(), providePackageNVR(), relocateFileList(), Rename(), rpmalAllFileSatisfiesDepend(), rpmcliEvalSlurp(), rpmdcName2Algo(), rpmdcParseCoreutils(), rpmdcParseZeroInstall(), rpmdcPrintFile(), rpmdsCompare(), rpmdsCpuinfo(), rpmdsCpuinfoCtagFlags(), rpmdsELF(), rpmdsFind(), rpmdsNAcmp(), rpmdsNotify(), rpmdsSearch(), rpmdsUname(), rpmfcGenerateDepends(), rpmfcGenerateScriptletDeps(), rpmfcSCRIPT(), rpmfiCompare(), rpmfiDecideFate(), rpmfiNew(), rpmGetFilesystemUsage(), rpmgiWalkPathFilter(), rpmHeadersIdentical(), rpmhookTableFindBucket(), rpmioAccess(), rpmioInit(), rpmkuPassPhrase(), rpmmiAddPattern(), rpmnsArch(), rpmpkgCheck(), rpmpkgRead(), rpmpkgSizeof(), rpmpkgWrite(), rpmpsmStage(), rpmpythonRunFile(), rpmpythonSlurp(), rpmrepoDoRepoMetadata(), rpmrepoTestSetupDirs(), rpmSetMachine(), rpmsqlRun(), rpmsxMatch(), rpmts_setattro(), rpmtsAddInstallElement(), rpmtsAddObsoletes(), rpmtsAddUpgrades(), rpmtsEraseDebuginfo(), rpmtsPrepare(), rpmtsSanityCheck(), rpmtsSkipFiles(), rpmvfVerify(), rpmxarPull(), rpmxarPush(), runImmedTriggers(), runScript(), runTriggers(), runTriggersLoop(), sameProblem(), singleSprintf(), sql_step(), stashSt(), str2uuid(), sugcmp(), tagCmpName(), ufdOpen(), unameToUid(), unsatisfiedDepend(), urlGetFile(), urlStrcmp(), while(), wnlookupTag(), writeRPM(), and xarMode().
Referenced by _tagName(), arHeaderWrite(), buildHost(), checkResponse(), defaultMachine(), doFoo(), doPatchMacro(), expandMacros(), for(), ftpOpendir(), if(), mireRegexec(), parseForAttr(), parseForConfig(), parseForDev(), parseForLang(), parseForVerify(), parsePreamble(), parseRCPOT(), parseScript(), printFileInfo(), processPackageFiles(), rpmGenPath(), rpmGlob(), rpmrepoInitPopt(), rpmspecQuery(), strntoul(), tarHeaderWrite(), while(), writeRPM(), and wrLead().
while | ( | size | , |
0 | |||
) |
Definition at line 721 of file macro.c.
References MacroBuf_s::nb, and MacroBuf_s::t.
Definition at line 1716 of file macro.c.
References _, _free(), _max_load_depth, addMacro(), alloca(), assert(), av, MacroBuf_s::depth, doFoo(), MacroBuf_s::expand_trace, expandFIFO(), expandMacro(), f, fe, findEntry(), g, gn, grabArgs(), int, isblank, iseol, lastc, len, MacroBuf_s::macro_trace, MacroBuf_s::mc, MacroBuf_s::nb, negate, NULL, print_expand_trace, print_macro_trace, result, RMIL_GLOBAL, rpmDumpMacroTable(), rpmjsFree(), rpmjsNew(), rpmjsRun(), rpmLoadMacroFile(), rpmlog(), RPMLOG_ERR, rpmluaGetGlobalState(), rpmluaGetPrintBuffer(), rpmluaRunScript(), rpmperlFree(), rpmperlNew(), rpmperlRun(), rpmpythonFree(), rpmpythonNew(), rpmpythonRun(), RPMRC_OK, rpmrubyFree(), rpmrubyNew(), rpmrubyRun(), rpmsqlFree(), rpmsqlNew(), rpmsqlRun(), rpmsquirrelFree(), rpmsquirrelNew(), rpmsquirrelRun(), rpmtclFree(), rpmtclNew(), rpmtclRun(), MacroBuf_s::s, s, SAVECHAR, se, strcmp(), STREQ, strncpy(), MacroBuf_s::t, xisalnum(), xisdigit(), xmalloc, xstrdup(), and xx.
< missing argument
< missing argument
< memory allocation failed
Definition at line 1527 of file macro.c.
References i, NULL, POPT_ERROR_MALLOC, POPT_ERROR_NOARG, and xmalloc.
Referenced by XpoptParseArgvString().
< memory allocation failed
< error in paramter quoting
< error in paramter quoting
Definition at line 1567 of file macro.c.
References alloca(), argv, buf, exit, memset(), NULL, POPT_ARGV_ARRAY_GROW_DELTA, POPT_ERROR_BADQUOTE, POPT_ERROR_MALLOC, rc, xmalloc, and XpoptDupArgv().
Referenced by rpmGlob().
|
static |
Definition at line 173 of file macro.c.
Referenced by doFoo(), grabArgs(), rpmExpand(), rpmGetPath(), rpmLoadMacroFile(), and rpmMCExpand().
int _max_load_depth = 2 |
Definition at line 166 of file macro.c.
Referenced by rpmInitMacros(), and while().
char* b |
Definition at line 746 of file macro.c.
Referenced by argvFgets(), compareFileListRecs(), dbiMireKeys(), extractRegular(), findEntry(), fsmStage(), genCpioListAndHeader(), grabArgs(), hdrNumCmp(), headerCheck(), htAddEntry(), htFini(), htGetEntry(), htGetKeys(), htHasEntry(), if(), indexcmp(), intFormat(), labelCompare(), matchTok(), pointRpmEVR(), PRCOSkip(), queryArgCallback(), rdLead(), rpm_mergesort(), rpmdsCompare(), rpmEVRcmp(), rpmfiNew(), rpmiobSlurp(), rpmioParse(), rpmmgFile(), rpmReadHeader(), rpmVerifySignatures(), rpmxarPull(), rpmxarSwapBuf(), statFormat(), tagCmpName(), tagCmpValue(), tagSwab(), uint32Cmp(), uint64Cmp(), unsatisfiedDepend(), writeRPM(), and xarRead().
int bc = 0 |
Definition at line 412 of file macro.c.
Referenced by copyNextLineFromOFI(), and rpmbcInit().
char * be |
Definition at line 746 of file macro.c.
Referenced by argvFgets(), dbiMireKeys(), doFoo(), fdbg(), grabArgs(), matchTok(), rpmbcExportPubkey(), rpmbcExportSignature(), rpmdcParseZeroInstall(), rpmEVRcmp(), rpmfiNew(), rpmhookTableFindBucket(), rpmioParse(), and rpmnsProbeSignature().
MacroEntry bme = *((MacroEntry *)bp) |
Parse (and execute) macro undefinition.
mc | macro context |
se | macro name to undefine |
Definition at line 703 of file macro.c.
Referenced by addFileToTagAux(), addSource(), argvFgets(), checkResponse(), copyFile(), cpio_copy(), dodigest(), doFoo(), doLookup(), doPatch(), doPatchMacro(), doSetupMacro(), doUntar(), fdbg(), fflagsFormat(), fmtDBafflags(), fmtDBaflags(), fmtDBCflags(), fmtDBCoflags(), fmtDBeflags(), fmtDBoflags(), fmtKDR(), for(), ftpLstat(), ftpMkdir(), ftpStat(), genCpioListAndHeader(), getOutputFrom(), grabArgs(), hdrUnload(), headerCheck(), hintFormat(), initGlobs(), main(), parseExpressionString(), parseForRegexLang(), parseForSimple(), prepFetchVerbose(), processPackageFiles(), rdLead(), rdSignature(), readFile(), realDateFormat(), rpmdcParseCoreutils(), rpmdsELF(), rpmdsPipe(), rpmdsSysinfoFile(), rpmfcFileDep(), rpmfcGenerateDepends(), rpmfcHelper(), rpmfcMergePR(), rpmfcSCRIPT(), rpmGetFilesystemUsage(), rpmGetPath(), rpmLoadMacroFile(), rpmProblemString(), rpmReadHeader(), rpmReadPackageFile(), rpmrepoOpenMDFile(), rpmrepoRfileDigest(), rpmVerifySignatures(), rpmvfVerify(), stashSt(), statstr(), strntoul(), tblName(), ufdCopy(), unsatisfiedDepend(), writeRPM(), and XpoptParseArgvString().
const char* size_t bufn = _macro_BUFSIZ |
Parse (and execute) new macro definition.
mb | macro expansion state |
se | macro definition to parse |
level | macro recursion level |
expandbody | should body be expanded? |
Definition at line 742 of file macro.c.
Referenced by rpmExpand(), and rpmMCExpand().
int c |
Return text between pl and matching pr characters.
p | start of text |
pl | left char, i.e. '[', '(', '{', etc. |
pr | right char, i.e. ']', ')', '}', etc. |
Definition at line 470 of file macro.c.
Referenced by __crc32(), __crc64(), _tagCanonicalize(), argvSplit(), cvtfmode(), doFoo(), dpkgEVRctype(), FDGsqlTag(), FDGxmlTag(), FDGyamlTag(), ftpOpendir(), Glob_pattern_p(), grabArgs(), intFormat(), isPart(), jsonFormat(), jsonstrcpy(), jsonstrlen(), mireDup(), parseBits(), parseFormat(), PRCOsqlTag(), PRCOxmlTag(), PRCOyamlTag(), rpmdcParseCoreutils(), rpmioParse(), rpmLoadMacroFile(), rpmRebuildTargetVars(), shescapeFormat(), sqlstrcpy(), sqlstrlen(), stemEnd(), strunvis(), strvis(), sum32Digest(), sum64Digest(), unvis(), xmlstrcpy(), xmlstrlen(), yamlFormat(), yamlstrcpy(), and yamlstrlen().
mb depth |
Definition at line 2516 of file macro.c.
Referenced by next_brace_sub().
do |
Definition at line 411 of file macro.c.
Referenced by addFileToTagAux(), parseNoSource(), PRCOxmlTag(), processPackageFiles(), readLineFromOFI(), rpmdcParseZeroInstall(), rpmdsCpuinfo(), rpmdsLdconfig(), rpmdsPipe(), rpmdsSysinfoFile(), rpmpsTrim(), rpmReadPackageManifest(), urlSplit(), and while().
const char * fe |
Definition at line 1696 of file macro.c.
Referenced by for(), parseNoSource(), PRCOxmlTag(), rpmdcParseZeroInstall(), rpmdsCpuinfo(), rpmdsLdconfig(), rpmdsPipe(), rpmdsSysinfoFile(), urlSplit(), and while().
size_t fn |
Definition at line 1698 of file macro.c.
Referenced by addFile(), addFileToTagAux(), checkUnpackagedFiles(), compressFilelist(), doIcon(), doPatch(), doRmSource(), doUntar(), extractRegular(), for(), fsmStage(), getExtension(), getSourceDir(), handleOverlappedFiles(), IDTXglob(), main(), makeHDRSignature(), manageFile(), Open(), packageBinaries(), packageSources(), pkgUnpackagedSubdirs(), populateInstallHeader(), processMetadataFile(), queryArgCallback(), rdLead(), relocateFileList(), rpmalAllFileSatisfiesDepend(), rpmcliImportPubkey(), rpmcliImportPubkeys(), rpmcliInstall(), rpmcliInstallElementPath(), rpmcliSign(), rpmcliWalkFirst(), rpmdbExportHR_MIB(), rpmdbExportL10N_SQL(), rpmdbURIPath(), rpmdsELF(), rpmdsSysinfo(), rpmfcApply(), rpmfcELF(), rpmfcHelper(), rpmfcSCRIPT(), rpmfiDecideFate(), rpmfiFNBF(), rpmfiOpendir(), rpmfiStat(), rpmgiLoadReadHeader(), rpmgiOpen(), rpmioAccess(), rpmioInit(), rpmQueryVerify(), rpmrbLoadClasses(), rpmrepoDoRepoMetadata(), rpmrepoOpenMDFile(), rpmrepoRfileDigest(), rpmrepoTestSetupDirs(), rpmReSign(), rpmShowRC(), rpmtsFindPubkey(), rpmtsOpenSDB(), rpmtsPRCO(), rpmtsRebuildDB(), runScript(), showQueryPackage(), statFormat(), and unsatisfiedDepend().
const char* g |
Definition at line 1697 of file macro.c.
Referenced by rpmdsCpuinfo(), rpmdsLdconfig(), rpmdsPipe(), rpmdsSysinfoFile(), while(), and xarGid().
const char * ge |
Definition at line 1697 of file macro.c.
Referenced by rpmdsCpuinfo(), rpmdsLdconfig(), rpmdsPipe(), and rpmdsSysinfoFile().
|
static |
Compare macro entries by name (qsort/bsearch).
Parse args and string for PHP like %{foo <args> : <string> } syntax.
Expand output of shell command into target buffer.
Save source/target and expand macro in u.
Save source and expand field into target.
ap | 1st macro entry |
bp | 2nd macro entry |
mb | macro expansion state |
f | field |
flen | no. bytes in field |
mb | macro expansion state |
u | input macro, output expansion |
ulen | no. bytes in u buffer |
mb | macro expansion state |
cmd | shell command |
clen | no. bytes in shell command |
s | "{ ... }" construct to parse |
nb | no. of bytes |
*avp | invocation args |
mb | macro expansion state |
char * key = (MacroEntry) memset(alloca(sizeof(*key)), 0, sizeof(*key)) |
Definition at line 383 of file macro.c.
Referenced by _RequestPass(), addTE(), alKey2Num(), alNum2Key(), hashFunctionString(), htAddEntry(), if(), nwlookupTag(), rebuildCompatTables(), rpmalAdd(), rpmdsProblem(), rpmkuFindPubkey(), rpmkuPassPhrase(), rpmps_Append(), rpmps_push(), rpmpsAppend(), unsatisfiedDepend(), and wnlookupTag().
int max_macro_depth = 16 |
Definition at line 154 of file macro.c.
Referenced by if(), and rpmLoadMacroFile().
MacroEntry me |
Definition at line 1694 of file macro.c.
Referenced by pushMacro(), rpmDumpMacroTable(), rpmFreeMacros(), rpmGetMacroEntries(), rpmInitMacros(), and rpmLoadMacros().
char * n = buf |
Definition at line 744 of file macro.c.
Referenced by __adler32(), __crc32_combine(), __crc64_combine(), __fnmatch_mempcpy(), addMacro(), checkDuplicateFiles(), checkUnpackagedFiles(), checkUnpackagedSubdirs(), defaultMachine(), doFoo(), fiIntersect(), ftpNLST(), getMachineInfo(), gf2_matrix_square32(), gf2_matrix_square64(), htFini(), htGetKeys(), lookupPackage(), pkgUnpackagedSubdirs(), prefix_array(), pushMacro(), removePackage(), rpmcliImportPubkey(), rpmdbe_event_notify(), rpmfiFNBF(), rpmfts_new(), rpmhookTableAddItem(), rpmhookTableCallArgs(), rpmhookTableDelItem(), rpmhookTableRehash(), rpmtsFindBaseNamesInDB(), tagLoadIndex(), tblName(), and ufdCopy().
mb nb = 0 |
fgets(3) analogue that reads \ continuations.
Last newline always trimmed.
buf | input buffer |
size | inbut buffer size (bytes) |
fd | file handle |
Definition at line 409 of file macro.c.
Referenced by __crc32_combine(), __crc64_combine(), _tagCanonicalize(), _tagGenerate(), addFile(), argvJoin(), arHeaderRead(), arHeaderWrite(), arRead(), arSetup(), arWrite(), bncdataFormat(), cdataFormat(), copyEntry(), cpio_copy(), cpioHeaderRead(), cpioHeaderWrite(), cpioRead(), cpioTrailerWrite(), cpioWrite(), db3open(), dbiMireKeys(), debevrfmtTag(), debmd5sumsTag(), doIcon(), doLookup(), dupMacroEntry(), ensureOlder(), fdFgets(), FDGsqlTag(), FDGxmlTag(), FDGyamlTag(), fmtDBT(), for(), formatValue(), fsmFsPath(), handleOneTrigger(), hdrUnload(), headerCheck(), headerLoad(), hGetNVRA(), i18nTag(), intFormat(), iosmFsPath(), isCompressed(), jsonFormat(), mireDup(), missingokTag(), needswhatTag(), Open(), pgpGrab(), pgpMpiHex(), pgpsigFormat(), PRCOsqlTag(), PRCOxmlTag(), PRCOyamlTag(), providePackageNVR(), queryArgCallback(), rdLead(), rdSignature(), rpmbcSetRSA(), rpmcliAllArgCallback(), rpmcliImportPubkey(), rpmdcPrintCoreutils(), rpmdcPrintFile(), rpmdcPrintZeroInstall(), rpmdsDup(), rpmdsDupArgv(), rpmdsNewDNEVR(), rpmdsNVRMatchesDep(), rpmdsThis(), rpmEVRparse(), rpmfi_FDigest_get(), rpmfiBuildFClasses(), rpmfiBuildFDeps(), rpmfiNew(), rpmGetPath(), rpmgiEscapeSpaces(), rpmGlob(), rpmheRealloc(), rpmmgFile(), rpmProblemString(), rpmpsmStage(), rpmReadHeader(), rpmReadPackageFile(), rpmrepoInitPopt(), rpmrepoOpenMDFile(), rpmrepoProgress(), rpmrepoReadHeader(), rpmrepoRfileDigest(), rpmrfileXMLWrite(), rpmsqlRun(), rpmteColorDS(), rpmWriteHeader(), shescapeFormat(), spewescapeFormat(), sql_step(), statFormat(), strsubFormat(), tagSwab(), tarHeaderRead(), tarHeaderReadName(), tarHeaderWrite(), tarRead(), tarWrite(), unsatisfiedDepend(), urlStrdup(), verifyDependencies(), vrpmlog(), whatneedsTag(), writeFile(), writeRPM(), xarRead(), xmlFormat(), and yamlFormat().
char * ne = n |
Definition at line 744 of file macro.c.
Referenced by checkResponse(), ftpNLST(), headerLoad(), headerRemoveEntry(), Link(), and Rename().
int negate |
Definition at line 1702 of file macro.c.
Referenced by doFoo(), rpmioAccess(), and while().
static PyObject *rpmdsObject * o = NULL |
Definition at line 745 of file macro.c.
Referenced by addRpmTags(), dbiTagsInit(), freeTriggerFiles(), ftpNLST(), hdr_subscript(), hdrKeyList(), init_rpm(), rpmdbe_event_notify(), rpmfts_new(), rpmpythonRun(), rpmRebuildTargetVars(), and signalsCaught().
Definition at line 748 of file macro.c.
Referenced by rpmtsAddEraseElement(), rpmtsAddInstallElement(), rpmtsEmpty(), and rpmtsiNextElement().
oe = ne + 1 |
Definition at line 745 of file macro.c.
Referenced by ('){s++;o=oe;{while(((oc)=(int)*(s))&&(oc)!=(int) ')')*(oe)++=*(s)++;*(oe)= '\0';};s++;}b=be=oe+1;while(((c)=(int)*(s))&&((char, dbiTagsInit(), ftpNLST(), Link(), and Rename().
p = buf |
Definition at line 413 of file macro.c.
Referenced by __glob_pattern_p(), _rpmtsCheck(), addSource(), checkForRequired(), copyNextLineFromOFI(), dateToTimet(), dbiMireKeys(), fdSeek(), findPreambleTag(), findSource(), for(), fpLookupSubdir(), freePackages(), freeTriggerFiles(), fssizesTag(), fts_alloc(), fts_build(), Fts_children(), Fts_close(), fts_lfree(), Fts_open(), fts_padjust(), fts_palloc(), Fts_read(), fts_sort(), getSource(), glob(), Glob_pattern_p(), handleOverlappedFiles(), isPart(), lookupPackage(), main(), mapFind(), parseCVOG(), parseForAttr(), parseForConfig(), parseForDev(), parseForLang(), parseForVerify(), parseNoSource(), parseScript(), pgpGrabPkts(), pgpImplMpiItem(), pgpPrtKey(), pgpPrtPubkeyParams(), pgpPrtSeckeyParams(), pgpPrtSig(), pgpPrtSubType(), pkgUnpackagedSubdirs(), processScriptFiles(), providePackageNVR(), rdToken(), readLine(), regionSwab(), relocateFileList(), removePackage(), rpm_mergesort(), rpmCheckPassPhrase(), rpmfiNew(), rpmgiNext(), rpmInstallSourcePackage(), rpmmiNext(), rpmnsArch(), rpmPlatform(), rpmpsAppend(), rpmpsFini(), rpmpsPrint(), rpmpsProblem(), rpmrepoDoFinalMove(), rpmrepoGetFileList(), rpmteNew(), rpmtsAddFingerprints(), rpmtsAddInstallElement(), rpmtsCheckInstalledFiles(), rpmtsClean(), rpmtsEmpty(), rpmtsFindBaseNamesInDB(), rpmtsPrepare(), rpmtsProcess(), rpmtsRepackage(), rpmtsRunScript(), rpmtsSanityCheck(), rpmtsSetup(), showQueryPackage(), szHeader(), and while().
int pc = 0 |
Definition at line 412 of file macro.c.
Referenced by copyNextLineFromOFI().
int print_expand_trace = 0 |
Definition at line 162 of file macro.c.
Referenced by expandMacros(), and while().
int print_macro_trace = 0 |
Definition at line 158 of file macro.c.
Referenced by expandMacros(), and while().
Definition at line 451 of file macro.c.
Referenced by dateToTimet(), findErases(), freeTriggerFiles(), if(), parseForAttr(), parseForConfig(), parseForDev(), parseForLang(), parseForVerify(), PRCOsqlTag(), rpm_mergesort(), rpmhdr_sprintf(), rpmtsAddObsoletes(), rpmtsAddUpgrades(), rpmtsEraseDebuginfo(), and rpmtsMarkLinkedFailed().
return rc = expandMacro(mb) |
return ret |
Definition at line 387 of file macro.c.
Referenced by checkfd(), dbiFindMatches(), dbiMireKeys(), fts_safe_changedir(), main(), makeHDRSignature(), rpmAddSignature(), rpmalAllFileSatisfiesDepend(), rpmalAllSatisfiesDepend(), rpmalSatisfiesDepend(), rpmHeaderToFD(), rpmHeaderToFile(), rpmhookTableFindBucket(), rpmrbLoadFile(), rpmsqAction(), rpmsqEnable(), rpmsqInsert(), rpmsqRemove(), rpmsqThread(), rpmsqWaitUnregister(), strntoul(), and tagCmpValue().
MacroContext rpmCLIMacroContext = &rpmCLIMacroContext_s |
Definition at line 127 of file macro.c.
Referenced by _rpmmc_free(), rpmcliAllArgCallback(), rpmInitMacros(), rpmioAllArgCallback(), rpmioFini(), and rpmmc_get_cli_mc().
MacroContext rpmGlobalMacroContext = &rpmGlobalMacroContext_s |
Definition at line 122 of file macro.c.
Referenced by _rpmmc_free(), addMacro(), delMacro(), delMacroAll(), expandMacros(), newSpec(), rpmDefineMacro(), rpmDumpMacroTable(), rpmFreeMacros(), rpmGetMacroEntries(), rpmInitMacros(), rpmLoadMacros(), rpmmc_get_global_mc(), and rpmUndefineMacro().
sbuf[flen] = (char *) alloca(flen + 1) |
Definition at line 616 of file macro.c.
Referenced by expandMacros().
const char * se |
Definition at line 897 of file macro.c.
Referenced by _str2PCREpat(), _tagCanonicalize(), addChangelog(), checkResponse(), dataLength(), findLastChar(), fpLookupSubdir(), ftpNLST(), ftpOpendir(), grabArgs(), headerUnload(), parseBits(), parseDescription(), parseSimplePart(), pgpPubkeyFingerprint(), rpmCleanPath(), rpmdcParseCoreutils(), rpmds_ParseEVR(), rpmfcApply(), rpmfcClassify(), rpmfcGenerateScriptletDeps(), rpmfcSCRIPT(), rpmgiEscapeSpaces(), rpmnsClassify(), rpmnsProbe(), rpmReadPackageManifest(), strsubFormat(), urlSplit(), and while().
tbuf[ulen] = (char *) alloca(ulen + 1) |
Definition at line 668 of file macro.c.
Referenced by expandMacros(), and rpmdsNewDNEVR().
te |
Definition at line 552 of file macro.c.
Referenced by _str2PCREpat(), _tagCanonicalize(), addChangelog(), argvJoin(), arHeaderRead(), arHeaderWrite(), debevrfmtTag(), debmd5sumsTag(), depflagsFormat(), deptypeFormat(), dupMacroEntry(), flushBuffer(), fmtBits(), fmtDBT(), fmtKDR(), formatValue(), fpLookupSubdir(), fsmMkdirs(), fsmRmdirs(), ftpCommand(), headerSprintf(), headerUnload(), installArgCallback(), iosmMkdirs(), iosmRmdirs(), jsonFormat(), jsonstrcpy(), localeTag(), needswhatTag(), parseFormat(), pgpArmorUnwrap(), PRCOsqlTag(), relocateFileList(), rpmCleanPath(), rpmcliConfigured(), rpmdcPrintCoreutils(), rpmdcPrintZeroInstall(), rpmEVRparse(), rpmExpand(), rpmfiNew(), rpmGetPath(), rpmgiEscapeSpaces(), rpmioAccess(), rpmMCExpand(), rpmnsProbeSignature(), rpmpsmNew(), rpmspecQuery(), rpmte_Wrap(), rpmteFini(), rpmteGetPool(), rpmtsElement(), rpmtsiFi(), rpmtsiNext(), rpmtsiNextElement(), rpmtsRollback(), rpmvfVerify(), showQueryPackage(), singleSprintf(), sqlstrcpy(), strdup_iconv_check(), strsubFormat(), tag2uuidv5(), uuidFormat(), verifyDependencies(), whatneedsTag(), xmlFormat(), xmlstrcpy(), yamlFormat(), and yamlstrcpy().
|
static |
Enlarge macro table.
Perform macro message output.
Free parsed arguments for parameterized macro.
Pop macro definition from macro entry stack.
Post-print expanded macro expression.
Sort entries in macro table.
mc | macro context |
mb | macro expansion state |
t | current expansion string result |
te | end of string |
mep | address of macro entry slot |
mb | macro expansion state |
mb | macro expansion state |
waserror | use rpmError()? |
msg | message to ouput |
msglen | no. of bytes in message |
Definition at line 215 of file macro.c.
Referenced by doFoo(), isCompressed(), rpmDefineMacro(), rpmExpand(), rpmGetPath(), rpmGlob(), rpmInitMacros(), rpmLoadMacroFile(), rpmMCExpand(), and rpmUndefineMacro().