Ardour  9.0-pre0-582-g084a23a80d
luastate.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-2017 Robin Gareus <robin@gareus.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef LUA_STATE_H
20 #define LUA_STATE_H
21 
22 #include <string>
23 #include <sigc++/sigc++.h>
24 
25 #include "lua/liblua_visibility.h"
26 #include "lua/lua.h"
27 
29 public:
30  LuaState (bool sandbox, bool rt_safe);
33 
34  int do_command (std::string);
35  int do_file (std::string);
36  void collect_garbage () const;
37  void collect_garbage_step (int debt = 0);
38  void tweak_rt_gc ();
39 
40  sigc::signal<void,std::string> Print;
41 
42  lua_State* getState () { return L; }
43 
44 protected:
46 
47 private:
48  void init ();
49  void sandbox (bool rt_safe);
50  static int _print (lua_State *L);
51  void print (std::string text);
52 
53 };
54 
55 #endif
lua_State * L
Definition: luastate.h:45
void collect_garbage() const
sigc::signal< void, std::string > Print
Definition: luastate.h:40
LuaState(bool sandbox, bool rt_safe)
void tweak_rt_gc()
int do_command(std::string)
void print(std::string text)
lua_State * getState()
Definition: luastate.h:42
void collect_garbage_step(int debt=0)
static int _print(lua_State *L)
void init()
int do_file(std::string)
void sandbox(bool rt_safe)
LuaState(lua_State *ls)
#define LIBLUA_API