diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2011-05-24 20:28:16 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2011-05-24 20:41:38 +0300 |
commit | ecfece7ec0d0eb0485745568d10dabc428e92824 (patch) | |
tree | 52de2136d00d67ed935916b05d92907ac07d3d54 /rpmio/rpmlua.h | |
parent | 48b5879931ef2ef3039b22123d6aaad17657618e (diff) | |
download | librpm-tizen-ecfece7ec0d0eb0485745568d10dabc428e92824.tar.gz librpm-tizen-ecfece7ec0d0eb0485745568d10dabc428e92824.tar.bz2 librpm-tizen-ecfece7ec0d0eb0485745568d10dabc428e92824.zip |
Add support for nested Lua macro expansion (RhBug:490740)
- Lift the printbuffer accounting out of rpmlua into a struct of
its own (Funny thing, this looks a whole lot like the macro
expansion buffer and Good Ole StringBuf Brothers ... Boys ... Mam.
Unify them one of these days maybe)
- Replace the simplistic on/off printbuffer with a stack of buffers,
fixup the lone caller to use the new internal push/pop API.
Diffstat (limited to 'rpmio/rpmlua.h')
-rw-r--r-- | rpmio/rpmlua.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/rpmio/rpmlua.h b/rpmio/rpmlua.h index c8a310ebc..7298ed57d 100644 --- a/rpmio/rpmlua.h +++ b/rpmio/rpmlua.h @@ -12,13 +12,12 @@ typedef enum rpmluavType_e { #include <stdarg.h> #include <lua.h> +typedef struct rpmluapb_s * rpmluapb; + struct rpmlua_s { lua_State *L; size_t pushsize; - int storeprint; - size_t printbufsize; - size_t printbufused; - char *printbuf; + rpmluapb printbuf; }; struct rpmluav_s { @@ -60,8 +59,8 @@ void rpmluaInteractive(rpmlua lua); void *rpmluaGetData(rpmlua lua, const char *key); void rpmluaSetData(rpmlua lua, const char *key, const void *data); -const char *rpmluaGetPrintBuffer(rpmlua lua); -void rpmluaSetPrintBuffer(rpmlua lua, int flag); +char *rpmluaPopPrintBuffer(rpmlua lua); +void rpmluaPushPrintBuffer(rpmlua lua); void rpmluaGetVar(rpmlua lua, rpmluav var); void rpmluaSetVar(rpmlua lua, rpmluav var); |