From f95825ef1b9f1b5765d5fe88ac0bad786478d00e Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Thu, 19 Jan 2017 16:02:00 +0200 Subject: [PATCH] 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... --- rpmio/macro.c | 6 ++++-- rpmio/rpmmacro.h | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/rpmio/macro.c b/rpmio/macro.c index 07b39c19f..8dd99737c 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -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 diff --git a/rpmio/rpmmacro.h b/rpmio/rpmmacro.h index b0900eb35..7c2a4f071 100644 --- a/rpmio/rpmmacro.h +++ b/rpmio/rpmmacro.h @@ -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.