23 #ifndef __LUA_CONTEXT_H_ 24 #define __LUA_CONTEXT_H_ 26 #include <lua/exceptions.h> 27 #include <core/utils/lock_list.h> 28 #include <core/utils/refptr.h> 29 #include <utils/system/fam.h> 30 #include <utils/system/fam_thread.h> 44 class LuaContextWatcher;
54 void setup_fam(
bool auto_restart,
bool conc_thread);
57 void set_start_script(
const char *start_script);
58 void set_finalization_calls(std::string finalize,
59 std::string finalize_prepare,
60 std::string finalize_cancel);
64 void add_package_dir(
const char *path,
bool prefix =
false);
65 void add_cpackage_dir(
const char *path,
bool prefix =
false);
66 void add_package(
const char *package);
68 lua_State * get_lua_state();
74 void do_file(
const char *filename);
75 void do_string(
const char *format, ...);
77 void load_string(
const char *s);
78 void pcall(
int nargs = 0,
int nresults = 0,
int errfunc = 0);
80 void set_usertype(
const char *name,
void *data,
const char *type_name,
81 const char *name_space = 0);
82 void set_string(
const char *name,
const char *value);
83 void set_number(
const char *name, lua_Number value);
84 void set_boolean(
const char *name,
bool value);
85 void set_integer(
const char *name, lua_Integer value);
86 void set_cfunction(
const char *name, lua_CFunction f);
87 void remove_global(
const char *name);
88 void set_global(
const char *name);
90 void push_boolean(
bool value);
91 void push_fstring(
const char *format, ...);
92 void push_integer(lua_Integer value);
93 void push_light_user_data(
void *p);
94 void push_lstring(
const char *s,
size_t len);
96 void push_number(lua_Number value);
97 void push_string(
const char *value);
99 void push_value(
int idx);
100 void push_vfstring(
const char *format, va_list arg);
101 void push_usertype(
void *data,
const char *type_name,
102 const char *name_space = 0);
103 void push_cfunction(lua_CFunction f);
105 std::string type_name(
int idx);
108 void remove(
int idx);
111 void create_table(
int narr = 0,
int nrec = 0);
112 void set_table(
int t_index = -3);
113 void set_field(
const char *key,
int t_index = -2);
115 void get_table(
int idx);
116 void get_field(
int idx,
const char *k);
117 void get_global(
const char *name);
119 bool table_next(
int idx);
121 void raw_set(
int idx);
122 void raw_seti(
int idx,
int n);
123 void raw_get(
int idx);
124 void raw_geti(
int idx,
int n);
126 lua_Number to_number(
int idx);
127 lua_Integer to_integer(
int idx);
128 bool to_boolean(
int idx);
129 const char * to_string(
int idx);
130 void * to_userdata(
int idx);
131 void * to_pointer(
int idx);
132 void * to_usertype(
int idx);
134 bool is_boolean(
int idx);
135 bool is_cfunction(
int idx);
136 bool is_function(
int idx);
137 bool is_light_user_data(
int idx);
138 bool is_nil(
int idx);
139 bool is_number(
int idx);
140 bool is_string(
int idx);
141 bool is_table(
int idx);
142 bool is_thread(
int idx);
144 size_t objlen(
int idx);
145 void setfenv(
int idx = -2);
151 virtual void fam_event(
const char *filename,
unsigned int mask);
152 void process_fam_events();
156 lua_State * init_state();
157 void do_string(lua_State *L,
const char *format, ...);
158 void do_file(lua_State *L,
const char *s);
159 void assert_unique_name(
const char *name, std::string type);
165 bool __enable_tracebacks;
168 char *__start_script;
170 std::list<std::string> __package_dirs;
171 std::list<std::string> __cpackage_dirs;
172 std::list<std::string> __packages;
173 std::list<std::string>::iterator __slit;
175 std::map<std::string, std::pair<void *, std::string> > __usertypes;
176 std::map<std::string, std::pair<void *, std::string> >::iterator __utit;
177 std::map<std::string, std::string> __strings;
178 std::map<std::string, std::string>::iterator __strings_it;
179 std::map<std::string, bool> __booleans;
180 std::map<std::string, bool>::iterator __booleans_it;
181 std::map<std::string, lua_Number> __numbers;
182 std::map<std::string, lua_Number>::iterator __numbers_it;
183 std::map<std::string, lua_Integer> __integers;
184 std::map<std::string, lua_Integer>::iterator __integers_it;
185 std::map<std::string, lua_CFunction> __cfuncs;
186 std::map<std::string, lua_CFunction>::iterator __cfuncs_it;
188 std::string __finalize_call;
189 std::string __finalize_prepare_call;
190 std::string __finalize_cancel_call;
Fawkes library namespace.
File Alteration Monitor Listener.
RefPtr<> is a reference-counting shared smartpointer.
FileAlterationMonitor thread wrapper.
Mutex mutual exclusion lock.