forked from Qihoo360/Atlas
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlua-scope.h
More file actions
65 lines (47 loc) · 1.62 KB
/
lua-scope.h
File metadata and controls
65 lines (47 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* $%BEGINLICENSE%$
Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; version 2 of the
License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
$%ENDLICENSE%$ */
#ifndef _LUA_SCOPE_H_
#define _LUA_SCOPE_H_
#include <glib.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef HAVE_LUA_H
#include <lua.h>
#endif
#include "chassis-exports.h"
typedef struct {
#ifdef HAVE_LUA_H
lua_State *L;
int L_ref;
#endif
GMutex *mutex; /*remove lock*/
int L_top;
} lua_scope;
CHASSIS_API lua_scope *lua_scope_init(void) G_GNUC_DEPRECATED;
CHASSIS_API lua_scope *lua_scope_new(void);
CHASSIS_API void lua_scope_free(lua_scope *sc);
CHASSIS_API void lua_scope_get(lua_scope *sc, const char* pos);
CHASSIS_API void lua_scope_release(lua_scope *sc, const char* pos);
#define LOCK_LUA(sc) \
lua_scope_get(sc, G_STRLOC);
#define UNLOCK_LUA(sc) \
lua_scope_release(sc, G_STRLOC);
#ifdef HAVE_LUA_H
CHASSIS_API lua_State *lua_scope_load_script(lua_scope *sc, const gchar *name);
CHASSIS_API void proxy_lua_dumpstack_verbose(lua_State *L);
#endif
#endif