2011-07-16 13:08:58 -06:00
|
|
|
#ifndef LUAMAIN_H
|
|
|
|
#define LUAMAIN_H
|
2011-07-16 10:29:46 -06:00
|
|
|
#include <string>
|
|
|
|
using std::string;
|
|
|
|
|
2011-07-16 11:43:57 -06:00
|
|
|
|
|
|
|
|
2012-03-26 09:48:24 -06:00
|
|
|
|
2011-07-16 10:29:46 -06:00
|
|
|
#include "lua.h"
|
|
|
|
#include "lauxlib.h"
|
|
|
|
#include "lualib.h"
|
2012-03-26 09:48:24 -06:00
|
|
|
|
2011-07-16 10:29:46 -06:00
|
|
|
|
2011-08-03 07:07:57 -06:00
|
|
|
#include "lune.h"
|
2011-07-16 10:29:46 -06:00
|
|
|
#include "luaxx.hpp"
|
|
|
|
|
|
|
|
namespace lua
|
|
|
|
{
|
2015-02-14 20:53:06 -07:00
|
|
|
//global lua state singleton
|
2011-07-16 10:29:46 -06:00
|
|
|
class glua
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static state &Get();
|
|
|
|
private:
|
|
|
|
glua();
|
|
|
|
static glua *ptr;
|
|
|
|
state mystate;
|
|
|
|
};
|
2015-02-14 20:53:06 -07:00
|
|
|
//registers basic lua commands
|
2011-07-16 10:29:46 -06:00
|
|
|
void RegBasics(lua::state &L);
|
2015-02-14 20:53:06 -07:00
|
|
|
//dumps lua function trace, useless unless called from lua.
|
2011-07-16 10:29:46 -06:00
|
|
|
string DebugDump(lua::state &L);
|
2015-02-14 20:53:06 -07:00
|
|
|
//register functions, first registers into global scope, second into current table
|
|
|
|
void RegFunctions(lua::state &L,luaL_Reg const *arr);
|
|
|
|
void RegFunctionsLocal(lua::state &L,luaL_Reg const *arr);
|
2011-07-16 10:29:46 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-07-16 13:08:58 -06:00
|
|
|
#endif // LUAMAIN_H
|