rpmmacro.h
Go to the documentation of this file.
#ifndef _H_MACRO_
#define _H_MACRO_
#include <stdio.h>
#include <stddef.h>
#include <rpm/rpmutil.h>
#include <rpm/rpmfileutil.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct rpmMacroEntry_s * rpmMacroEntry;
typedef struct rpmMacroContext_s * rpmMacroContext;
extern rpmMacroContext rpmGlobalMacroContext;
extern rpmMacroContext rpmCLIMacroContext;
extern const char * macrofiles;
#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
/* Deprecated compatibility wrappers */
#define addMacro(_mc, _n, _o, _b, _l) rpmPushMacro(_mc, _n, _o, _b, _l)
#define delMacro(_mc, _n) rpmPopMacro(_mc, _n)
void rpmDumpMacroTable (rpmMacroContext mc,
FILE * fp);
int rpmExpandMacros (rpmMacroContext mc, const char * sbuf,
char ** obuf, int flags);
int rpmPushMacro (rpmMacroContext mc, const char * n,
const char * o,
const char * b, int level);
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);
#ifdef __cplusplus
}
#endif
#endif /* _H_ MACRO_ */
rpmLoadMacros
void rpmLoadMacros(rpmMacroContext mc, int level)
Load macros from specific context into global context.
rpmMacroContext
struct rpmMacroContext_s * rpmMacroContext
Definition: rpmmacro.h:22
RPM_GNUC_NULL_TERMINATED
#define RPM_GNUC_NULL_TERMINATED
Definition: rpmutil.h:49
rpmPushMacro
int rpmPushMacro(rpmMacroContext mc, const char *n, const char *o, const char *b, int level)
Push macro to context.
rpmDefineMacro
int rpmDefineMacro(rpmMacroContext mc, const char *macro, int level)
Define macro in context.
rpmInitMacros
void rpmInitMacros(rpmMacroContext mc, const char *macrofiles)
Initialize macro context from set of macrofile(s).
rpmExpand
char * rpmExpand(const char *arg,...) RPM_GNUC_NULL_TERMINATED
Return (malloc'ed) concatenated macro expansion(s).
rpmGlobalMacroContext
rpmMacroContext rpmGlobalMacroContext
rpmExpandNumeric
int rpmExpandNumeric(const char *arg)
Return macro expansion as a numeric value.
rpmCLIMacroContext
rpmMacroContext rpmCLIMacroContext
rpmPopMacro
int rpmPopMacro(rpmMacroContext mc, const char *n)
Pop macro from context.
rpmDumpMacroTable
void rpmDumpMacroTable(rpmMacroContext mc, FILE *fp)
Print macros to file stream.
rpmLoadMacroFile
int rpmLoadMacroFile(rpmMacroContext mc, const char *fn)
Load macro context from a macro file.
macrofiles
const char * macrofiles
List of macro files to read when configuring rpm.
rpmFreeMacros
void rpmFreeMacros(rpmMacroContext mc)
Destroy macro context.
rpmExpandMacros
int rpmExpandMacros(rpmMacroContext mc, const char *sbuf, char **obuf, int flags)
Expand macro into buffer.
rpmConfigDir
const char * rpmConfigDir(void)
Return rpm configuration base directory.
rpmMacroEntry
struct rpmMacroEntry_s * rpmMacroEntry
Definition: rpmmacro.h:20