rpm 4.20.0 The RPM Package Manager

Loading...
Searching...
No Matches
Macros | Typedefs | Enumerations | Functions | Variables
rpmmacro.h File Reference
I/O » RPM IO API.
`#include <stdio.h>`
`#include <stddef.h>`
`#include <rpm/rpmutil.h>`
`#include <rpm/rpmfileutil.h>`
Include dependency graph for rpmmacro.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Macros
#define | RMIL_BUILTIN -20
#define | RMIL_DEFAULT -15
#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
#define | addMacro(_mc, _n, _o, _b, _l) rpmPushMacro(_mc, _n, _o, _b, _l)
#define | delMacro(_mc, _n) rpmPopMacro(_mc, _n)
#define | RPMEXPR_EXPAND (1 << 0)
#define | RPMEXPAND_EXPAND_ARGS (1 << 0)
#define | RPMEXPAND_KEEP_QUOTED (1 << 1)
#define | RPMEXPAND_HAVE_QUOTED (1 << 2)

## Typedefs
typedef struct rpmMacroEntry_s * | rpmMacroEntry
typedef struct rpmMacroContext_s * | rpmMacroContext
typedef struct rpmMacroBuf_s * | rpmMacroBuf
typedef void(* | macroFunc) (rpmMacroBuf mb, rpmMacroEntry me, ARGV_t argv, size_t *parsed)
typedef rpmFlags | rpmMacroFlags

## Enumerations
enum | rpmMacroFlags_e { RPMMACRO_DEFAULT = 0 , RPMMACRO_LITERAL = (1 << 0) }

## 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)
int | rpmMacroIsDefined (rpmMacroContext mc, const char *n)
int | rpmMacroIsParametric (rpmMacroContext mc, const char *n)
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)

## Variables
rpmMacroContext | rpmGlobalMacroContext
rpmMacroContext | rpmCLIMacroContext
const char * | macrofiles

## Detailed Description

Macro API

## Macro Definition Documentation

## ◆ RMIL_BUILTIN

#define RMIL_BUILTIN -20

Markers for sources of macros added throughout rpm.

## ◆ RPMEXPAND_EXPAND_ARGS

#define RPMEXPAND_EXPAND_ARGS (1 << 0)

expand arguments of parametric macros

## ◆ RPMEXPAND_HAVE_QUOTED

#define RPMEXPAND_HAVE_QUOTED (1 << 2)

expanded macros contain quote characters

## ◆ RPMEXPAND_KEEP_QUOTED

#define RPMEXPAND_KEEP_QUOTED (1 << 1)

do not remove quotes from expanded macros

## ◆ RPMEXPR_EXPAND

#define RPMEXPR_EXPAND (1 << 0)

expand primary terms

## Enumeration Type Documentation

## ◆ rpmMacroFlags_e

enum rpmMacroFlags_e

Enumerator
RPMMACRO_LITERAL | do not expand body of macro

## Function Documentation

## ◆ rpmMacroIsDefined()

int rpmMacroIsDefined | ( | rpmMacroContext | mc,
|  | const char * | n )

Test whether a macro is defined

Parameters

  mc | macro context (NULL uses global context).
  n | macro name

Returns
  1 if defined, 0 if not

## ◆ rpmMacroIsParametric()

int rpmMacroIsParametric | ( | rpmMacroContext | mc,
|  | const char * | n )

Test whether a macro is parametric (ie takes arguments)

Parameters

  mc | macro context (NULL uses global context).
  n | macro name

Returns
  1 if parametric, 0 if not