removed "ag_" prefix on ag:: functions

git-svn-id: svn://anubis/anaglym/trunk@11 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
Josh Holtrop 2009-09-14 23:01:43 +00:00
parent ed80f25cee
commit 917991df34
2 changed files with 14 additions and 14 deletions

22
ag.cc
View File

@ -12,15 +12,15 @@ namespace ag
void register_functions(lua_State * L)
{
static const luaL_Reg functions[] = {
{ "print", ag_print },
{ "println", ag_println },
{ "loadModel", ag_loadModel },
{ "print", print },
{ "println", println },
{ "loadModel", loadModel },
{ NULL, NULL }
};
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);
switch (type)
@ -42,10 +42,10 @@ namespace ag
if (!first)
cout << ", ";
cout << '[';
ag_print_val(L, lua_gettop(L) - 1);
print_val(L, lua_gettop(L) - 1);
cout << ']';
cout << " => ";
ag_print_val(L, lua_gettop(L));
print_val(L, lua_gettop(L));
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);
for ( int n = 1; n <= argc; n++ )
{
ag_print_val(L, n);
print_val(L, n);
}
return 0;
}
int ag_println(lua_State * L)
int println(lua_State * L)
{
int ret = ag_print(L);
int ret = print(L);
cout << endl;
return ret;
}
int ag_loadModel(lua_State * L)
int loadModel(lua_State * L)
{
int argc = lua_gettop(L);

6
ag.h
View File

@ -7,9 +7,9 @@
namespace ag
{
void register_functions(lua_State * L);
int ag_print(lua_State * L);
int ag_println(lua_State * L);
int ag_loadModel(lua_State * L);
int print(lua_State * L);
int println(lua_State * L);
int loadModel(lua_State * L);
}
#endif