Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/facebook/luaffifb.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/ffi.h
diff options
context:
space:
mode:
authorJames R. McKaskill <james@foobar.co.nz>2012-04-23 08:25:57 +0400
committerJames R. McKaskill <james@foobar.co.nz>2012-04-23 08:25:57 +0400
commit4d4379dfcc11a0d8eda14010d006c5df44939bcd (patch)
treec76fafa2ed61769cf826fe4125d8cf2cdecd832d /ffi.h
parentba38f94673ab4dc874255ae8d8852ead4b3fe4d8 (diff)
Process escapes in __asm strings
Diffstat (limited to 'ffi.h')
-rw-r--r--ffi.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/ffi.h b/ffi.h
index 7b4fef6..7027d41 100644
--- a/ffi.h
+++ b/ffi.h
@@ -116,6 +116,17 @@ static void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup) {
#define lua_setuservalue lua_setfenv
#define lua_getuservalue lua_getfenv
#define lua_rawlen lua_objlen
+static char* luaL_buffinitsize(lua_State* L, luaL_Buffer* B, size_t sz) {
+ if (sz > LUAL_BUFFERSIZE) {
+ luaL_error(L, "string too long");
+ }
+ luaL_buffinit(L, B);
+ return luaL_prepbuffer(B);
+}
+static void luaL_pushresultsize(luaL_Buffer* B, size_t sz) {
+ luaL_addsize(B, sz);
+ luaL_pushresult(B);
+}
#endif
/* architectures */