Hi,
Each file opened in lua, has an associated luaL_Stream structure?
If so, is it possible to think about moving the buffer (luaL_Buffer) to this structure?
Would it be possible, in this way, to use this buffer, instead of the local buffer?
diff --git a/lauxlib.h b/lauxlib.h
index 59fef6af..60a6e8e3 100644
--- a/lauxlib.h
+++ b/lauxlib.h
@@ -218,6 +218,7 @@ LUALIB_API char *(luaL_buffinitsize) (lua_State *L, luaL_Buffer *B, size_t sz);
typedef struct luaL_Stream {
+ luaL_Buffer b; /* stream internal buffer */
FILE *f; /* stream (NULL for incompletely created streams) */
lua_CFunction closef; /* to close stream (NULL for closed streams) */
} luaL_Stream;
regards,
Ranier Vilela