Feature #1661 ยป 0034-tolua-Remove-trailing-spaces.patch
dependencies/tolua-5.2/include/tolua.h | ||
---|---|---|
** $Id: tolua.h,v 1.12 2011/01/13 13:43:45 fabraham Exp $
|
||
*/
|
||
/* This code is free software; you can redistribute it and/or modify it.
|
||
** The software provided hereunder is on an "as is" basis, and
|
||
/* This code is free software; you can redistribute it and/or modify it.
|
||
** The software provided hereunder is on an "as is" basis, and
|
||
** the author has no obligation to provide maintenance, support, updates,
|
||
** enhancements, or modifications.
|
||
** enhancements, or modifications.
|
||
*/
|
||
... | ... | |
TOLUA_API int tolua_isstring (lua_State* L, int lo, int def, tolua_Error* err);
|
||
TOLUA_API int tolua_istable (lua_State* L, int lo, int def, tolua_Error* err);
|
||
TOLUA_API int tolua_isusertable (lua_State* L, int lo, const char* type, int def, tolua_Error* err);
|
||
TOLUA_API int tolua_isfunction (lua_State* L, int lo, int def, tolua_Error* err);
|
||
TOLUA_API int tolua_isfunction (lua_State* L, int lo, int def, tolua_Error* err);
|
||
TOLUA_API int tolua_isuserdata (lua_State* L, int lo, int def, tolua_Error* err);
|
||
TOLUA_API int tolua_isusertype (lua_State* L, int lo, const char* type, int def, tolua_Error* err);
|
||
TOLUA_API int tolua_isvaluearray
|
||
TOLUA_API int tolua_isvaluearray
|
||
(lua_State* L, int lo, int dim, int def, tolua_Error* err);
|
||
TOLUA_API int tolua_isbooleanarray
|
||
TOLUA_API int tolua_isbooleanarray
|
||
(lua_State* L, int lo, int dim, int def, tolua_Error* err);
|
||
TOLUA_API int tolua_isnumberarray
|
||
TOLUA_API int tolua_isnumberarray
|
||
(lua_State* L, int lo, int dim, int def, tolua_Error* err);
|
||
TOLUA_API int tolua_isstringarray
|
||
TOLUA_API int tolua_isstringarray
|
||
(lua_State* L, int lo, int dim, int def, tolua_Error* err);
|
||
TOLUA_API int tolua_istablearray
|
||
TOLUA_API int tolua_istablearray
|
||
(lua_State* L, int lo, int dim, int def, tolua_Error* err);
|
||
TOLUA_API int tolua_isuserdataarray
|
||
TOLUA_API int tolua_isuserdataarray
|
||
(lua_State* L, int lo, int dim, int def, tolua_Error* err);
|
||
TOLUA_API int tolua_isusertypearray
|
||
TOLUA_API int tolua_isusertypearray
|
||
(lua_State* L, int lo, const char* type, int dim, int def, tolua_Error* err);
|
||
TOLUA_API void tolua_open (lua_State* L);
|
dependencies/tolua-5.2/src/bin/tolua.c | ||
---|---|---|
** $Id: tolua.c,v 1.4 2009/11/24 16:45:12 fabraham Exp $
|
||
*/
|
||
/* This code is free software; you can redistribute it and/or modify it.
|
||
** The software provided hereunder is on an "as is" basis, and
|
||
/* This code is free software; you can redistribute it and/or modify it.
|
||
** The software provided hereunder is on an "as is" basis, and
|
||
** the author has no obligation to provide maintenance, support, updates,
|
||
** enhancements, or modifications.
|
||
** enhancements, or modifications.
|
||
*/
|
||
#include "tolua.h"
|
||
... | ... | |
" -P : parse and print structure information (for debug).\n"
|
||
" -h : print this message.\n"
|
||
"Should the input file be omitted, stdin is assumed;\n"
|
||
"in that case, the package name must be explicitly set.\n\n"
|
||
"in that case, the package name must be explicitly set.\n\n"
|
||
);
|
||
}
|
||
dependencies/tolua-5.2/src/lib/tolua_event.c | ||
---|---|---|
** $Id: tolua_event.c,v 1.7 2011/01/13 13:43:46 fabraham Exp $
|
||
*/
|
||
/* This code is free software; you can redistribute it and/or modify it.
|
||
** The software provided hereunder is on an "as is" basis, and
|
||
/* This code is free software; you can redistribute it and/or modify it.
|
||
** The software provided hereunder is on an "as is" basis, and
|
||
** the author has no obligation to provide maintenance, support, updates,
|
||
** enhancements, or modifications.
|
||
** enhancements, or modifications.
|
||
*/
|
||
#include <stdio.h>
|
||
... | ... | |
}
|
||
/* Class index function
|
||
* If the object is a userdata (ie, an object), it searches the field in
|
||
* If the object is a userdata (ie, an object), it searches the field in
|
||
* the alternative table stored in the corresponding "peer" table.
|
||
*/
|
||
static int class_index_event (lua_State* L)
|
||
... | ... | |
if (lua_isnumber(L,2)) /* check if key is a numeric value */
|
||
{
|
||
/* try operator[] */
|
||
lua_pushstring(L,".geti");
|
||
lua_pushstring(L,".geti");
|
||
lua_rawget(L,-2); /* stack: obj key mt func */
|
||
if (lua_isfunction(L,-1))
|
||
{
|
||
... | ... | |
else
|
||
lua_pop(L,1);
|
||
/* try C/C++ variable */
|
||
lua_pushstring(L,".get");
|
||
lua_pushstring(L,".get");
|
||
lua_rawget(L,-2); /* stack: obj key mt tget */
|
||
if (lua_istable(L,-1))
|
||
{
|
||
... | ... | |
if (lua_iscfunction(L,-1))
|
||
{
|
||
lua_pushvalue(L,1);
|
||
lua_pushvalue(L,2);
|
||
lua_pushvalue(L,2);
|
||
lua_call(L,2,1);
|
||
return 1;
|
||
}
|
||
... | ... | |
lua_pushvalue(L,1); /* stack: obj key v obj */
|
||
while (lua_getmetatable(L,-1)) { /* stack: obj key v obj mt */
|
||
lua_remove(L,-2); /* stack: obj key v mt */
|
||
lua_pushstring(L,".seti");
|
||
lua_pushstring(L,".seti");
|
||
lua_rawget(L,-2); /* stack: obj key v mt func */
|
||
if (lua_isfunction(L,-1))
|
||
{
|
||
... | ... | |
if (lua_iscfunction(L,-1))
|
||
{
|
||
lua_pushvalue(L,1);
|
||
lua_pushvalue(L,3);
|
||
lua_pushvalue(L,3);
|
||
lua_call(L,2,0);
|
||
return 0;
|
||
}
|
||
... | ... | |
if (lua_isfunction(L,-1))
|
||
{
|
||
lua_pushvalue(L,1);
|
||
lua_pushvalue(L,2);
|
||
lua_pushvalue(L,2);
|
||
lua_call(L,2,1);
|
||
return 1;
|
||
}
|
||
... | ... | |
lua_pushstring(L,"__newindex");
|
||
lua_pushcfunction(L,class_newindex_event);
|
||
lua_rawset(L,-3);
|
||
|
||
lua_pushstring(L,"__add");
|
||
lua_pushcfunction(L,class_add_event);
|
||
lua_rawset(L,-3);
|
dependencies/tolua-5.2/src/lib/tolua_event.h | ||
---|---|---|
** $Id: tolua_event.h,v 1.3 2009/11/24 16:45:15 fabraham Exp $
|
||
*/
|
||
/* This code is free software; you can redistribute it and/or modify it.
|
||
** The software provided hereunder is on an "as is" basis, and
|
||
/* This code is free software; you can redistribute it and/or modify it.
|
||
** The software provided hereunder is on an "as is" basis, and
|
||
** the author has no obligation to provide maintenance, support, updates,
|
||
** enhancements, or modifications.
|
||
** enhancements, or modifications.
|
||
*/
|
||
#ifndef TOLUA_EVENT_H
|
dependencies/tolua-5.2/src/lib/tolua_map.c | ||
---|---|---|
int tolua_bnd_takeownership(lua_State *L);
|
||
static char toluaname[128] = "tolua.";
|
||
static const char* TOLUANAME (const char* n)
|
||
static const char* TOLUANAME (const char* n)
|
||
{
|
||
sprintf(&toluaname[6],"%.120s",n);
|
||
return toluaname;
|
||
... | ... | |
void* u;
|
||
lua_pushstring(L,".collector");
|
||
lua_rawget(L,-2);
|
||
func = lua_iscfunction(L,-1) ? lua_tocfunction(L,-1) : NULL;
|
||
func = lua_iscfunction(L,-1) ? lua_tocfunction(L,-1) : NULL;
|
||
lua_pop(L,2);
|
||
u = *((void**)lua_touserdata(L,1));
|
||
tolua_clone(L,u,func);
|
||
... | ... | |
if (!lua_isboolean(L,-1))
|
||
{
|
||
lua_pushstring(L,"tolua_opened"); lua_pushboolean(L,1); lua_rawset(L,LUA_REGISTRYINDEX);
|
||
lua_pushstring(L,"tolua_ubox");
|
||
lua_newtable(L);
|
||
lua_pushstring(L,"tolua_ubox");
|
||
lua_newtable(L);
|
||
lua_pushvalue(L, -1); /* metatable: for weak table */
|
||
lua_pushstring(L, "__mode");
|
||
lua_pushstring(L, "v");
|
||
lua_rawset(L, -3);
|
||
lua_setmetatable(L, -2);
|
||
lua_rawset(L,LUA_REGISTRYINDEX);
|
||
lua_pushstring(L,"tolua_peer");
|
||
lua_newtable(L);
|
||
lua_pushstring(L,"tolua_peer");
|
||
lua_newtable(L);
|
||
lua_pushvalue(L, -1); /* metatable: for weak table */
|
||
lua_pushstring(L, "__mode");
|
||
lua_pushstring(L, "k");
|
dependencies/tolua-5.2/src/lib/tolua_to.c | ||
---|---|---|
** $Id: tolua_to.c,v 1.5 2009/11/24 16:45:15 fabraham Exp $
|
||
*/
|
||
/* This code is free software; you can redistribute it and/or modify it.
|
||
** The software provided hereunder is on an "as is" basis, and
|
||
/* This code is free software; you can redistribute it and/or modify it.
|
||
** The software provided hereunder is on an "as is" basis, and
|
||
** the author has no obligation to provide maintenance, support, updates,
|
||
** enhancements, or modifications.
|
||
** enhancements, or modifications.
|
||
*/
|
||
#include "tolua.h"
|
||
... | ... | |
return v;
|
||
}
|
||
TOLUA_API const char* tolua_tofieldstring
|
||
TOLUA_API const char* tolua_tofieldstring
|
||
(lua_State* L, int lo, int index, const char* def)
|
||
{
|
||
const char* v;
|