rpm 4.19.92
The RPM Package Manager
|
Macro API. More...
Functions | |
void | rpmDumpMacroTable (rpmMacroContext mc, FILE *fp) |
int | rpmExpandMacros (rpmMacroContext mc, const char *sbuf, char **obuf, int flags) |
int | rpmExpandThisMacro (rpmMacroContext mc, const char *n, ARGV_const_t args, char **obuf, int flags) |
int | rpmPushMacro (rpmMacroContext mc, const char *n, const char *o, const char *b, int level) |
int | rpmPushMacroFlags (rpmMacroContext mc, const char *n, const char *o, const char *b, int level, rpmMacroFlags flags) |
int | rpmPushMacroAux (rpmMacroContext mc, const char *n, const char *o, macroFunc f, void *priv, int nargs, int level, rpmMacroFlags flags) |
void * | rpmMacroEntryPriv (rpmMacroEntry me) |
void | rpmMacroBufAppend (rpmMacroBuf mb, char c) |
void | rpmMacroBufAppendStr (rpmMacroBuf mb, const char *str) |
void | rpmMacroBufErr (rpmMacroBuf mb, int error, const char *fmt,...) |
int | rpmPopMacro (rpmMacroContext mc, const char *n) |
int | rpmDefineMacro (rpmMacroContext mc, const char *macro, int level) |
void | rpmLoadMacros (rpmMacroContext mc, int level) |
int | rpmLoadMacroFile (rpmMacroContext mc, const char *fn) |
void | rpmInitMacros (rpmMacroContext mc, const char *macrofiles) |
void | rpmFreeMacros (rpmMacroContext mc) |
char * | rpmExpand (const char *arg,...) RPM_GNUC_NULL_TERMINATED |
int | rpmExpandNumeric (const char *arg) |
const char * | rpmConfigDir (void) |
int | rpmExprBoolFlags (const char *expr, int flags) |
char * | rpmExprStrFlags (const char *expr, int flags) |
int | rpmExprBool (const char *expr) |
char * | rpmExprStr (const char *expr) |
Macro API.
const char * rpmConfigDir | ( | void | ) |
Return rpm configuration base directory. If RPM_CONFIGDIR environment variable is set, it's value will be used. Otherwise the configuration directory is the one set at build time, typically /usr/lib/rpm. The value of rpmConfigDir() is determined on first call to this function and is guaranteed to remain the same on subsequent calls.
int rpmDefineMacro | ( | rpmMacroContext | 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) |
void rpmDumpMacroTable | ( | rpmMacroContext | mc, |
FILE * | fp | ||
) |
Print macros to file stream.
mc | macro context (NULL uses global context). |
fp | file stream (NULL uses stderr). |
char * rpmExpand | ( | const char * | arg, |
... | |||
) |
Return (malloc'ed) concatenated macro expansion(s).
arg | macro(s) to expand (NULL terminates list) |
int rpmExpandMacros | ( | rpmMacroContext | mc, |
const char * | sbuf, | ||
char ** | obuf, | ||
int | flags | ||
) |
Expand macro into buffer.
mc | macro context (NULL uses global context). |
sbuf | input macro to expand |
obuf | macro expansion (malloc'ed) |
flags | flags (currently unused) |
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 |
int rpmExpandThisMacro | ( | rpmMacroContext | mc, |
const char * | n, | ||
ARGV_const_t | args, | ||
char ** | obuf, | ||
int | flags | ||
) |
Expand a specific macro into buffer.
mc | macro context (NULL uses global context). |
n | macro name |
args | arguments for parametric macros |
obuf | macro expansion (malloc'ed) |
flags | flags (currently unused) |
int rpmExprBool | ( | const char * | expr | ) |
Evaluate boolean expression.
expr | expression to parse |
int rpmExprBoolFlags | ( | const char * | expr, |
int | flags | ||
) |
Evaluate boolean expression.
expr | expression to parse |
flags | parser flags |
char * rpmExprStr | ( | const char * | expr | ) |
Evaluate string expression.
expr | expression to parse |
char * rpmExprStrFlags | ( | const char * | expr, |
int | flags | ||
) |
Evaluate string expression.
expr | expression to parse |
flags | parser flags |
void rpmFreeMacros | ( | rpmMacroContext | mc | ) |
Destroy macro context.
mc | macro context (NULL uses global context). |
void rpmInitMacros | ( | rpmMacroContext | 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) |
int rpmLoadMacroFile | ( | rpmMacroContext | mc, |
const char * | fn | ||
) |
Load macro context from a macro file.
mc | (unused) |
fn | macro file name |
void rpmLoadMacros | ( | rpmMacroContext | 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) |
void rpmMacroBufAppend | ( | rpmMacroBuf | mb, |
char | c | ||
) |
Append a character to macro buffer (in aux macro)
mb | macro buffer |
c | character to append |
void rpmMacroBufAppendStr | ( | rpmMacroBuf | mb, |
const char * | str | ||
) |
Append a string to macro buffer (in aux macro)
mb | macro buffer |
str | string to append |
void rpmMacroBufErr | ( | rpmMacroBuf | mb, |
int | error, | ||
const char * | fmt, | ||
... | |||
) |
Raise an error or warning in macro buffer (in aux macro)
mb | macro buffer |
error | 1 if error, 0 if warning |
fmt | j |
void * rpmMacroEntryPriv | ( | rpmMacroEntry | me | ) |
Return macro entry user data (in aux macro)
me | macro entry |
int rpmPopMacro | ( | rpmMacroContext | mc, |
const char * | n | ||
) |
Pop macro from context.
mc | macro context (NULL uses global context). |
n | macro name |
int rpmPushMacro | ( | rpmMacroContext | mc, |
const char * | n, | ||
const char * | o, | ||
const char * | b, | ||
int | level | ||
) |
Push macro to context.
mc | macro context (NULL uses global context). |
n | macro name |
o | macro parameters |
b | macro body |
level | macro recursion level (0 is entry API) |
int rpmPushMacroAux | ( | rpmMacroContext | mc, |
const char * | n, | ||
const char * | o, | ||
macroFunc | f, | ||
void * | priv, | ||
int | nargs, | ||
int | level, | ||
rpmMacroFlags | flags | ||
) |
Push an auxiliary macro to context.
mc | macro context (NULL uses global context). |
n | macro name |
o | macro parameters (or NULL) |
f | macro function |
priv | private user data (or NULL) |
nargs | number of arguments (0-N for enforced check, -1 for optional) |
level | macro recursion level (0 is entry API) |
flags | macro flags |
int rpmPushMacroFlags | ( | rpmMacroContext | mc, |
const char * | n, | ||
const char * | o, | ||
const char * | b, | ||
int | level, | ||
rpmMacroFlags | flags | ||
) |
Push macro to context.
mc | macro context (NULL uses global context). |
n | macro name |
o | macro parameters |
b | macro body |
level | macro recursion level (0 is entry API) |
flags | macro flags |