#include <stdio.h>
#include <stddef.h>
#include <rpm/rpmutil.h>
#include <rpm/rpmfileutil.h>
Go to the source code of this file.
|
void | rpmDumpMacroTable (rpmMacroContext mc, FILE *fp) |
| Print macros to file stream. More...
|
|
int | expandMacros (void *spec, rpmMacroContext mc, char *sbuf, size_t slen) |
| Expand macro into buffer. More...
|
|
int | rpmExpandMacros (rpmMacroContext mc, const char *sbuf, char **obuf, int flags) |
| Expand macro into buffer. More...
|
|
void | addMacro (rpmMacroContext mc, const char *n, const char *o, const char *b, int level) |
| Add macro to context. More...
|
|
void | delMacro (rpmMacroContext mc, const char *n) |
| Delete macro from context. More...
|
|
int | rpmDefineMacro (rpmMacroContext mc, const char *macro, int level) |
| Define macro in context. More...
|
|
void | rpmLoadMacros (rpmMacroContext mc, int level) |
| Load macros from specific context into global context. More...
|
|
int | rpmLoadMacroFile (rpmMacroContext mc, const char *fn) |
| Load macro context from a macro file. More...
|
|
void | rpmInitMacros (rpmMacroContext mc, const char *macrofiles) |
| Initialize macro context from set of macrofile(s). More...
|
|
void | rpmFreeMacros (rpmMacroContext mc) |
| Destroy macro context. More...
|
|
char * | rpmExpand (const char *arg,...) RPM_GNUC_NULL_TERMINATED |
| Return (malloc'ed) concatenated macro expansion(s). More...
|
|
int | rpmExpandNumeric (const char *arg) |
| Return macro expansion as a numeric value. More...
|
|
const char * | rpmConfigDir (void) |
| Return rpm configuration base directory. More...
|
|
§ RMIL_CMDLINE
§ RMIL_DEFAULT
Markers for sources of macros added throughout rpm.
Definition at line 36 of file rpmmacro.h.
§ RMIL_GLOBAL
§ RMIL_MACROFILES
#define RMIL_MACROFILES -13 |
§ RMIL_OLDSPEC
§ RMIL_RPMRC
§ RMIL_SPEC
§ RMIL_TARBALL
§ rpmMacroContext
§ rpmMacroEntry
§ addMacro()
void addMacro |
( |
rpmMacroContext |
mc, |
|
|
const char * |
n, |
|
|
const char * |
o, |
|
|
const char * |
b, |
|
|
int |
level |
|
) |
| |
§ delMacro()
Delete macro from context.
- Parameters
-
mc | macro context (NULL uses global context). |
n | macro name |
§ expandMacros()
int expandMacros |
( |
void * |
spec, |
|
|
rpmMacroContext |
mc, |
|
|
char * |
sbuf, |
|
|
size_t |
slen |
|
) |
| |
Expand macro into buffer.
- Deprecated:
- Use rpmExpand().
- Todo:
- Eliminate from API.
- Parameters
-
spec | cookie (unused) |
mc | macro context (NULL uses global context). |
- Return values
-
sbuf | input macro to expand, output expansion |
- Parameters
-
- Returns
- 0 on success
§ rpmConfigDir()
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.
- Returns
- rpm configuration directory name
§ rpmDefineMacro()
Define macro in context.
- Parameters
-
mc | macro context (NULL uses global context). |
macro | macro name, options, body |
level | macro recursion level (0 is entry API) |
- Returns
- 0 on success (always)
Referenced by build(), and buildArgCallback().
§ rpmDumpMacroTable()
Print macros to file stream.
- Parameters
-
mc | macro context (NULL uses global context). |
fp | file stream (NULL uses stderr). |
§ rpmExpand()
char* rpmExpand |
( |
const char * |
arg, |
|
|
|
... |
|
) |
| |
Return (malloc'ed) concatenated macro expansion(s).
- Parameters
-
arg | macro(s) to expand (NULL terminates list) |
- Returns
- macro expansion (malloc'ed)
Referenced by doSign(), and getTarSpec().
§ rpmExpandMacros()
int rpmExpandMacros |
( |
rpmMacroContext |
mc, |
|
|
const char * |
sbuf, |
|
|
char ** |
obuf, |
|
|
int |
flags |
|
) |
| |
Expand macro into buffer.
- Parameters
-
mc | macro context (NULL uses global context). |
sbuf | input macro to expand |
obuf | macro expansion (malloc'ed) |
flags | flags (currently unused) |
- Returns
- negative on failure
§ rpmExpandNumeric()
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.
- Parameters
-
- Returns
- numeric value
Referenced by build(), and main().
§ rpmFreeMacros()
Destroy macro context.
- Parameters
-
mc | macro context (NULL uses global context). |
Referenced by build(), and main().
§ rpmInitMacros()
Initialize macro context from set of macrofile(s).
- Parameters
-
mc | macro context |
macrofiles | colon separated list of macro files (NULL does nothing) |
§ rpmLoadMacroFile()
Load macro context from a macro file.
- Parameters
-
mc | (unused) |
fn | macro file name |
§ rpmLoadMacros()
Load macros from specific context into global context.
- Parameters
-
mc | macro context (NULL does nothing). |
level | macro recursion level (0 is entry API) |
§ macrofiles
List of macro files to read when configuring rpm.
This is a colon separated list of files. URI's are permitted as well, identified by the token '://', so file paths must not begin with '//'.
§ rpmCLIMacroContext
§ rpmGlobalMacroContext