D:/Projects/dark-oberon.svn/game/sources/luamodule/luacommands.cpp File Reference

Detailed Description

Matthew T. Welker, Vadim Macagon, Peter Knut
1.0 - Initial.

#include "kernel/logserver.h"
#include "kernel/kernelserver.h"
#include "kernel/fileserver.h"
#include "kernel/ref.h"
#include "luamodule/luascriptloader.h"
#include "luamodule/luacmdproto.h"


int _luaDispatch (lua_State *L, Object *obj, CmdProto *cmd_proto, bool print)
 Static function that will handle Lua to Cmd translations and dispatch to the provided Object *pointer.
int luacmd_Error (lua_State *L)
int luacmd_StackDump (lua_State *L)
int luacmd_Panic (lua_State *L)
int luacmd_New (lua_State *L)
int luacmd_NewThunk (lua_State *L)
int luacmd_Delete (lua_State *L)
int luacmd_UnpinThunk (lua_State *L)
int luacmd_PinThunk (lua_State *L)
int luacmd_Sel (lua_State *L)
int luacmd_Psel (lua_State *L)
int luacmd_Exit (lua_State *L)
int luacmd_LogTree (lua_State *L)
int luacmd_LogInfo (lua_State *L)
int luacmd_LogWarning (lua_State *L)
int luacmd_LogError (lua_State *L)
int luacmd_LogCritical (lua_State *L)
int luacmd_LogDebug (lua_State *L)
int luacmd_Dir (lua_State *L)
int luacmd_CmdDispatch (lua_State *L)
int luacmd_Call (lua_State *L)
int luacmd_ConCall (lua_State *L)
int luacmd_Lookup (lua_State *L)
int luacmd_Mangle (lua_State *L)
int luacmd_Exists (lua_State *L)
int luacmd_BeginCmds (lua_State *L)
int luacmd_AddCmd (lua_State *L)
int luacmd_EndCmds (lua_State *L)
int luacmd_DeleteNRef (lua_State *L)
int luacmd_IsZombieThunk (lua_State *L)
int luacmd_PushCwd (lua_State *L)
int luacmd_PopCwd (lua_State *L)

Function Documentation

int _luaDispatch ( lua_State *  L,
Object obj,
CmdProto cmd_proto,
bool  print 

Static function that will handle Lua to Cmd translations and dispatch to the provided Object *pointer.

int luacmd_AddCmd ( lua_State *  L  ) 

int luacmd_BeginCmds ( lua_State *  L  ) 

int luacmd_Call ( lua_State *  L  ) 

Executes a func on the current working directory.

int luacmd_CmdDispatch ( lua_State *  L  ) 

int luacmd_ConCall ( lua_State *  L  ) 

Executes a func on the current working directory and prints the result to the console.

int luacmd_Delete ( lua_State *  L  ) 

If a string is passed in it is assumed to be a NOH path, the corresponding Root instance will be deleted and if there's a thunk associated with that instance it will be removed from the _nebthunks table. If a thunk is passed in pretty much the same thing happens.

int luacmd_DeleteNRef ( lua_State *  L  ) 

Deletes an Ref previously created during thunking. This method will be automatically called when a thunk gets garbage collected.

int luacmd_Dir ( lua_State *  L  ) 

int luacmd_EndCmds ( lua_State *  L  ) 

int luacmd_Error ( lua_State *  L  ) 

int luacmd_Exists ( lua_State *  L  ) 

int luacmd_Exit ( lua_State *  L  ) 

int luacmd_IsZombieThunk ( lua_State *  L  ) 

Checks if a thunk is a zombie (has an Ref that points to a non-existent Root).

int luacmd_LogCritical ( lua_State *  L  ) 

int luacmd_LogDebug ( lua_State *  L  ) 

int luacmd_LogError ( lua_State *  L  ) 

int luacmd_LogInfo ( lua_State *  L  ) 

int luacmd_LogTree ( lua_State *  L  ) 

int luacmd_LogWarning ( lua_State *  L  ) 

int luacmd_Lookup ( lua_State *  L  ) 

Returns the thunk that corresponds to specified NOH path. If the thunk hasn't been created yet it will be created, otherwise the existing thunk is returned.

int luacmd_Mangle ( lua_State *  L  ) 

int luacmd_New ( lua_State *  L  ) 

int luacmd_NewThunk ( lua_State *  L  ) 

Just like luacmd_New() except that it also creates and returns a thunk for the new object (the thunk is also stored in the _nebthunks table).

int luacmd_Panic ( lua_State *  L  ) 

int luacmd_PinThunk ( lua_State *  L  ) 

Pins a thunk, which means that a reference to it is stored in _nebthunks. The thunk will then be reused whenever possible instead of thunking an object all over again. If you want to define script side commands for an object you'll have to pin the corresponding thunk.

If you have multiple thunks that correspond to the same object and you pin them all then only the last pin will actually "work".

int luacmd_PopCwd ( lua_State *  L  ) 

Just exposes KernelServer::PopCwd()

int luacmd_Psel ( lua_State *  L  ) 

Returns the cwd of the NOH as a thunk.

int luacmd_PushCwd ( lua_State *  L  ) 

Just exposes KernelServer::PushCwd().

int luacmd_Sel ( lua_State *  L  ) 

int luacmd_StackDump ( lua_State *  L  ) 

int luacmd_UnpinThunk ( lua_State *  L  ) 

Removes the thunk passed in from the _nebthunks table, but does not delete the corresponding Root instance.

If a string is passed in it is assumed to be a NOH path, otherwise it a thunk is expected.

Generated on Sat Oct 20 14:47:30 2007 for Dark Oberon by  doxygen 1.5.3