Add return code to rpmPushMacro() and rpmPopMacro()

These haven't been in any public release yet so there's time to
fiddle with stuff like this. Both always succeed currently so no
change in that respect but it's better to have room for expansion...
This commit is contained in:
Panu Matilainen 2017-01-19 16:02:00 +02:00
parent 6988799d0f
commit f95825ef1b
2 changed files with 8 additions and 4 deletions

View File

@ -1513,19 +1513,21 @@ rpmDumpMacroTable(rpmMacroContext mc, FILE * fp)
rpmmctxRelease(mc);
}
void rpmPushMacro(rpmMacroContext mc,
int rpmPushMacro(rpmMacroContext mc,
const char * n, const char * o, const char * b, int level)
{
mc = rpmmctxAcquire(mc);
pushMacro(mc, n, o, b, level, ME_NONE);
rpmmctxRelease(mc);
return 0;
}
void rpmPopMacro(rpmMacroContext mc, const char * n)
int rpmPopMacro(rpmMacroContext mc, const char * n)
{
mc = rpmmctxAcquire(mc);
popMacro(mc, n);
rpmmctxRelease(mc);
return 0;
}
int

View File

@ -75,8 +75,9 @@ int rpmExpandMacros (rpmMacroContext mc, const char * sbuf,
* @param o macro paramaters
* @param b macro body
* @param level macro recursion level (0 is entry API)
* @return 0 on success
*/
void rpmPushMacro (rpmMacroContext mc, const char * n,
int rpmPushMacro (rpmMacroContext mc, const char * n,
const char * o,
const char * b, int level);
@ -84,8 +85,9 @@ void rpmPushMacro (rpmMacroContext mc, const char * n,
* Pop macro from context.
* @param mc macro context (NULL uses global context).
* @param n macro name
* @return 0 on success
*/
void rpmPopMacro (rpmMacroContext mc, const char * n);
int rpmPopMacro (rpmMacroContext mc, const char * n);
/** \ingroup rpmmacro
* Define macro in context.