Loading...
Searching...
No Matches
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_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
/* Deprecated compatibility wrappers */
#define addMacro(_mc, _n, _o, _b, _l) rpmPushMacro(_mc, _n, _o, _b, _l)
#define delMacro(_mc, _n) rpmPopMacro(_mc, _n)
/* rpm expression parser flags */
#define RPMEXPR_EXPAND (1 << 0)
/* rpm macro expansion flags */
#define RPMEXPAND_EXPAND_ARGS (1 << 0)
typedef enum rpmMacroFlags_e {
RPMMACRO_DEFAULT = 0,
RPMMACRO_LITERAL = (1 << 0),
} rpmMacroFlags;
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 rpmPopMacro (rpmMacroContext mc, const char * n);
int rpmDefineMacro (rpmMacroContext mc, const char * macro,
int level);
/*
* Test whether a macro is defined
* @param mc macro context (NULL uses global context).
* @param n macro name
* @return 1 if defined, 0 if not
*/
int rpmMacroIsDefined(rpmMacroContext mc, const char *n);
/*
* Test whether a macro is parametric (ie takes arguments)
* @param mc macro context (NULL uses global context).
* @param n macro name
* @return 1 if parametric, 0 if not
*/
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);
#ifdef __cplusplus
}
#endif
#endif /* _H_ MACRO_ */
rpmPushMacroFlags
int rpmPushMacroFlags(rpmMacroContext mc, const char *n, const char *o, const char *b, int level, rpmMacroFlags flags)
rpmFreeMacros
void rpmFreeMacros(rpmMacroContext mc)
rpmExprStrFlags
char * rpmExprStrFlags(const char *expr, int flags)
rpmConfigDir
const char * rpmConfigDir(void)
rpmLoadMacroFile
int rpmLoadMacroFile(rpmMacroContext mc, const char *fn)
rpmLoadMacros
void rpmLoadMacros(rpmMacroContext mc, int level)
rpmExpandNumeric
int rpmExpandNumeric(const char *arg)
rpmExprBoolFlags
int rpmExprBoolFlags(const char *expr, int flags)
rpmPopMacro
int rpmPopMacro(rpmMacroContext mc, const char *n)
rpmExprStr
char * rpmExprStr(const char *expr)
rpmInitMacros
void rpmInitMacros(rpmMacroContext mc, const char *macrofiles)
rpmExpandMacros
int rpmExpandMacros(rpmMacroContext mc, const char *sbuf, char **obuf, int flags)
rpmDefineMacro
int rpmDefineMacro(rpmMacroContext mc, const char *macro, int level)
rpmPushMacro
int rpmPushMacro(rpmMacroContext mc, const char *n, const char *o, const char *b, int level)
rpmExpand
char * rpmExpand(const char *arg,...) RPM_GNUC_NULL_TERMINATED
rpmExpandThisMacro
int rpmExpandThisMacro(rpmMacroContext mc, const char *n, ARGV_const_t args, char **obuf, int flags)
rpmDumpMacroTable
void rpmDumpMacroTable(rpmMacroContext mc, FILE *fp)
rpmExprBool
int rpmExprBool(const char *expr)
macrofiles
const char * macrofiles
rpmfileutil.h
rpmMacroFlags_e
rpmMacroFlags_e
Definition: rpmmacro.h:59
RPMMACRO_LITERAL
@ RPMMACRO_LITERAL
Definition: rpmmacro.h:61
rpmutil.h