diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-09-12 10:48:22 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-09-12 10:48:22 -0300 |
commit | 4ef14ba28094b9db88cedd9876d9bad79cc03374 (patch) | |
tree | f6c0ab0a39c468042a43c743d09e5051a6c8a5ae | |
parent | b8d57092ebbaefb088bf63fca7fa91f77545beda (diff) | |
download | lua-4ef14ba28094b9db88cedd9876d9bad79cc03374.tar.gz lua-4ef14ba28094b9db88cedd9876d9bad79cc03374.tar.bz2 lua-4ef14ba28094b9db88cedd9876d9bad79cc03374.zip |
new function `luaL_addstring'
-rw-r--r-- | lauxlib.c | 7 | ||||
-rw-r--r-- | lauxlib.h | 3 |
2 files changed, 8 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lauxlib.c,v 1.34 2000/09/11 17:38:42 roberto Exp roberto $ | 2 | ** $Id: lauxlib.c,v 1.35 2000/09/11 20:29:27 roberto Exp roberto $ |
3 | ** Auxiliary functions for building Lua libraries | 3 | ** Auxiliary functions for building Lua libraries |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -178,6 +178,11 @@ void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l) { | |||
178 | } | 178 | } |
179 | 179 | ||
180 | 180 | ||
181 | void luaL_addstring (luaL_Buffer *B, const char *s) { | ||
182 | luaL_addlstring(B, s, strlen(s)); | ||
183 | } | ||
184 | |||
185 | |||
181 | void luaL_pushresult (luaL_Buffer *B) { | 186 | void luaL_pushresult (luaL_Buffer *B) { |
182 | emptybuffer(B); | 187 | emptybuffer(B); |
183 | if (B->level == 0) | 188 | if (B->level == 0) |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lauxlib.h,v 1.23 2000/09/11 17:38:42 roberto Exp roberto $ | 2 | ** $Id: lauxlib.h,v 1.24 2000/09/11 20:29:27 roberto Exp roberto $ |
3 | ** Auxiliary functions for building Lua libraries | 3 | ** Auxiliary functions for building Lua libraries |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -80,6 +80,7 @@ typedef struct luaL_Buffer { | |||
80 | void luaL_buffinit (lua_State *L, luaL_Buffer *B); | 80 | void luaL_buffinit (lua_State *L, luaL_Buffer *B); |
81 | char *luaL_prepbuffer (luaL_Buffer *B); | 81 | char *luaL_prepbuffer (luaL_Buffer *B); |
82 | void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l); | 82 | void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l); |
83 | void luaL_addstring (luaL_Buffer *B, const char *s); | ||
83 | void luaL_addvalue (luaL_Buffer *B); | 84 | void luaL_addvalue (luaL_Buffer *B); |
84 | void luaL_pushresult (luaL_Buffer *B); | 85 | void luaL_pushresult (luaL_Buffer *B); |
85 | 86 | ||