View | Details | Raw Unified | Return to bug 126660
Collapse All | Expand All

(-)include/tolua++.h (-10 / +9 lines)
Lines 53-59 Link Here
53
#define TOLUA_NOPEER	LUA_REGISTRYINDEX /* for lua 5.1 */
53
#define TOLUA_NOPEER	LUA_REGISTRYINDEX /* for lua 5.1 */
54
54
55
TOLUA_API const char* tolua_typename (lua_State* L, int lo);
55
TOLUA_API const char* tolua_typename (lua_State* L, int lo);
56
TOLUA_API void tolua_error (lua_State* L, char* msg, tolua_Error* err);
56
TOLUA_API void tolua_error (lua_State* L, const char* msg, tolua_Error* err);
57
TOLUA_API int tolua_isnoobj (lua_State* L, int lo, tolua_Error* err);
57
TOLUA_API int tolua_isnoobj (lua_State* L, int lo, tolua_Error* err);
58
TOLUA_API int tolua_isvalue (lua_State* L, int lo, int def, tolua_Error* err);
58
TOLUA_API int tolua_isvalue (lua_State* L, int lo, int def, tolua_Error* err);
59
TOLUA_API int tolua_isboolean (lua_State* L, int lo, int def, tolua_Error* err);
59
TOLUA_API int tolua_isboolean (lua_State* L, int lo, int def, tolua_Error* err);
Lines 84-99 Link Here
84
TOLUA_API int tolua_register_gc (lua_State* L, int lo);
84
TOLUA_API int tolua_register_gc (lua_State* L, int lo);
85
TOLUA_API int tolua_default_collect (lua_State* tolua_S);
85
TOLUA_API int tolua_default_collect (lua_State* tolua_S);
86
86
87
TOLUA_API void tolua_usertype (lua_State* L, char* type);
87
TOLUA_API void tolua_usertype (lua_State* L, const char* type);
88
TOLUA_API void tolua_beginmodule (lua_State* L, char* name);
88
TOLUA_API void tolua_beginmodule (lua_State* L, const char* name);
89
TOLUA_API void tolua_endmodule (lua_State* L);
89
TOLUA_API void tolua_endmodule (lua_State* L);
90
TOLUA_API void tolua_module (lua_State* L, char* name, int hasvar);
90
TOLUA_API void tolua_module (lua_State* L, const char* name, int hasvar);
91
TOLUA_API void tolua_class (lua_State* L, char* name, char* base);
91
TOLUA_API void tolua_cclass (lua_State* L, const char* lname, const char* name, const char* base, lua_CFunction col);
92
TOLUA_API void tolua_cclass (lua_State* L, char* lname, char* name, char* base, lua_CFunction col);
92
TOLUA_API void tolua_function (lua_State* L, const char* name, lua_CFunction func);
93
TOLUA_API void tolua_function (lua_State* L, char* name, lua_CFunction func);
93
TOLUA_API void tolua_constant (lua_State* L, const char* name, double value);
94
TOLUA_API void tolua_constant (lua_State* L, char* name, double value);
94
TOLUA_API void tolua_variable (lua_State* L, const char* name, lua_CFunction get, lua_CFunction set);
95
TOLUA_API void tolua_variable (lua_State* L, char* name, lua_CFunction get, lua_CFunction set);
95
TOLUA_API void tolua_array (lua_State* L, const char* name, lua_CFunction get, lua_CFunction set);
96
TOLUA_API void tolua_array (lua_State* L,char* name, lua_CFunction get, lua_CFunction set);
97
96
98
/* TOLUA_API void tolua_set_call_event(lua_State* L, lua_CFunction func, char* type); */
97
/* TOLUA_API void tolua_set_call_event(lua_State* L, lua_CFunction func, char* type); */
99
/* TOLUA_API void tolua_addbase(lua_State* L, char* name, char* base); */
98
/* TOLUA_API void tolua_addbase(lua_State* L, char* name, char* base); */
(-)src/lib/tolua_is.c (-1 / +1 lines)
Lines 85-91 Link Here
85
	return lua_tostring(L,-1);
85
	return lua_tostring(L,-1);
86
}
86
}
87
87
88
TOLUA_API void tolua_error (lua_State* L, char* msg, tolua_Error* err)
88
TOLUA_API void tolua_error (lua_State* L, const char* msg, tolua_Error* err)
89
{
89
{
90
	if (msg[0] == '#')
90
	if (msg[0] == '#')
91
	{
91
	{
(-)src/lib/tolua_map.c (-9 / +9 lines)
Lines 389-395 Link Here
389
	* It creates the correspoding metatable in the registry, for both 'type' and 'const type'.
389
	* It creates the correspoding metatable in the registry, for both 'type' and 'const type'.
390
	* It maps 'const type' as being also a 'type'
390
	* It maps 'const type' as being also a 'type'
391
*/
391
*/
392
TOLUA_API void tolua_usertype (lua_State* L, char* type)
392
TOLUA_API void tolua_usertype (lua_State* L, const char* type)
393
{
393
{
394
 char ctype[128] = "const ";
394
 char ctype[128] = "const ";
395
 strncat(ctype,type,120);
395
 strncat(ctype,type,120);
Lines 403-409 Link Here
403
/* Begin module
403
/* Begin module
404
	* It pushes the module (or class) table on the stack
404
	* It pushes the module (or class) table on the stack
405
*/
405
*/
406
TOLUA_API void tolua_beginmodule (lua_State* L, char* name)
406
TOLUA_API void tolua_beginmodule (lua_State* L, const char* name)
407
{
407
{
408
	if (name)
408
	if (name)
409
	{
409
	{
Lines 426-432 Link Here
426
	* It creates a new module
426
	* It creates a new module
427
*/
427
*/
428
#if 1
428
#if 1
429
TOLUA_API void tolua_module (lua_State* L, char* name, int hasvar)
429
TOLUA_API void tolua_module (lua_State* L, const char* name, int hasvar)
430
{
430
{
431
	if (name)
431
	if (name)
432
	{
432
	{
Lines 462-468 Link Here
462
	lua_pop(L,1);               /* pop module */
462
	lua_pop(L,1);               /* pop module */
463
}
463
}
464
#else
464
#else
465
TOLUA_API void tolua_module (lua_State* L, char* name, int hasvar)
465
TOLUA_API void tolua_module (lua_State* L, const char* name, int hasvar)
466
{
466
{
467
	if (name)
467
	if (name)
468
	{
468
	{
Lines 518-524 Link Here
518
/* Map C class
518
/* Map C class
519
	* It maps a C class, setting the appropriate inheritance and super classes.
519
	* It maps a C class, setting the appropriate inheritance and super classes.
520
*/
520
*/
521
TOLUA_API void tolua_cclass (lua_State* L, char* lname, char* name, char* base, lua_CFunction col)
521
TOLUA_API void tolua_cclass (lua_State* L, const char* lname, const char* name, const char* base, lua_CFunction col)
522
{
522
{
523
	char cname[128] = "const ";
523
	char cname[128] = "const ";
524
	char cbase[128] = "const ";
524
	char cbase[128] = "const ";
Lines 577-583 Link Here
577
/* Map function
577
/* Map function
578
	* It assigns a function into the current module (or class)
578
	* It assigns a function into the current module (or class)
579
*/
579
*/
580
TOLUA_API void tolua_function (lua_State* L, char* name, lua_CFunction func)
580
TOLUA_API void tolua_function (lua_State* L, const char* name, lua_CFunction func)
581
{
581
{
582
 lua_pushstring(L,name);
582
 lua_pushstring(L,name);
583
 lua_pushcfunction(L,func);
583
 lua_pushcfunction(L,func);
Lines 600-606 Link Here
600
/* Map constant number
600
/* Map constant number
601
	* It assigns a constant number into the current module (or class)
601
	* It assigns a constant number into the current module (or class)
602
*/
602
*/
603
TOLUA_API void tolua_constant (lua_State* L, char* name, double value)
603
TOLUA_API void tolua_constant (lua_State* L, const char* name, double value)
604
{
604
{
605
	lua_pushstring(L,name);
605
	lua_pushstring(L,name);
606
	tolua_pushnumber(L,value);
606
	tolua_pushnumber(L,value);
Lines 611-617 Link Here
611
/* Map variable
611
/* Map variable
612
	* It assigns a variable into the current module (or class)
612
	* It assigns a variable into the current module (or class)
613
*/
613
*/
614
TOLUA_API void tolua_variable (lua_State* L, char* name, lua_CFunction get, lua_CFunction set)
614
TOLUA_API void tolua_variable (lua_State* L, const char* name, lua_CFunction get, lua_CFunction set)
615
{
615
{
616
	/* get func */
616
	/* get func */
617
	lua_pushstring(L,".get");
617
	lua_pushstring(L,".get");
Lines 663-669 Link Here
663
/* Map an array
663
/* Map an array
664
	* It assigns an array into the current module (or class)
664
	* It assigns an array into the current module (or class)
665
*/
665
*/
666
TOLUA_API void tolua_array (lua_State* L, char* name, lua_CFunction get, lua_CFunction set)
666
TOLUA_API void tolua_array (lua_State* L, const char* name, lua_CFunction get, lua_CFunction set)
667
{
667
{
668
	lua_pushstring(L,".get");
668
	lua_pushstring(L,".get");
669
	lua_rawget(L,-2);
669
	lua_rawget(L,-2);

Return to bug 126660