removed "ag_" prefix on ag:: functions
git-svn-id: svn://anubis/anaglym/trunk@11 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
parent
ed80f25cee
commit
917991df34
22
ag.cc
22
ag.cc
@ -12,15 +12,15 @@ namespace ag
|
|||||||
void register_functions(lua_State * L)
|
void register_functions(lua_State * L)
|
||||||
{
|
{
|
||||||
static const luaL_Reg functions[] = {
|
static const luaL_Reg functions[] = {
|
||||||
{ "print", ag_print },
|
{ "print", print },
|
||||||
{ "println", ag_println },
|
{ "println", println },
|
||||||
{ "loadModel", ag_loadModel },
|
{ "loadModel", loadModel },
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
luaL_register(L, "ag", functions);
|
luaL_register(L, "ag", functions);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ag_print_val(lua_State * L, int index)
|
static int print_val(lua_State * L, int index)
|
||||||
{
|
{
|
||||||
int type = lua_type(L, index);
|
int type = lua_type(L, index);
|
||||||
switch (type)
|
switch (type)
|
||||||
@ -42,10 +42,10 @@ namespace ag
|
|||||||
if (!first)
|
if (!first)
|
||||||
cout << ", ";
|
cout << ", ";
|
||||||
cout << '[';
|
cout << '[';
|
||||||
ag_print_val(L, lua_gettop(L) - 1);
|
print_val(L, lua_gettop(L) - 1);
|
||||||
cout << ']';
|
cout << ']';
|
||||||
cout << " => ";
|
cout << " => ";
|
||||||
ag_print_val(L, lua_gettop(L));
|
print_val(L, lua_gettop(L));
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,25 +66,25 @@ namespace ag
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int ag_print(lua_State * L)
|
int print(lua_State * L)
|
||||||
{
|
{
|
||||||
int argc = lua_gettop(L);
|
int argc = lua_gettop(L);
|
||||||
|
|
||||||
for ( int n = 1; n <= argc; n++ )
|
for ( int n = 1; n <= argc; n++ )
|
||||||
{
|
{
|
||||||
ag_print_val(L, n);
|
print_val(L, n);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ag_println(lua_State * L)
|
int println(lua_State * L)
|
||||||
{
|
{
|
||||||
int ret = ag_print(L);
|
int ret = print(L);
|
||||||
cout << endl;
|
cout << endl;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ag_loadModel(lua_State * L)
|
int loadModel(lua_State * L)
|
||||||
{
|
{
|
||||||
int argc = lua_gettop(L);
|
int argc = lua_gettop(L);
|
||||||
|
|
||||||
|
6
ag.h
6
ag.h
@ -7,9 +7,9 @@
|
|||||||
namespace ag
|
namespace ag
|
||||||
{
|
{
|
||||||
void register_functions(lua_State * L);
|
void register_functions(lua_State * L);
|
||||||
int ag_print(lua_State * L);
|
int print(lua_State * L);
|
||||||
int ag_println(lua_State * L);
|
int println(lua_State * L);
|
||||||
int ag_loadModel(lua_State * L);
|
int loadModel(lua_State * L);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user