gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/object-index.c
diff options
context:
space:
mode:
authorfrancesco-ST <francesco.abbate@st.com>2010年12月28日 16:52:42 +0100
committerfrancesco-ST <francesco.abbate@st.com>2010年12月28日 16:52:42 +0100
commitab7fc91161b8cb493b418bfdd2871e45c4537a26 (patch)
treeea400f746489d587d153f0b6b6677c6a17bf916f /object-index.c
parent978986bb98f1ae622be3f430f4e729fbb598afb8 (diff)
downloadgsl-shell-ab7fc91161b8cb493b418bfdd2871e45c4537a26.tar.gz
changed window closing unref main lock strategy
A global lock is used now to guard the main loop. The plot windows directly unrefs the window by just waiting the main lock. Simplified also the window index code since plot are not indexed since many versions now. The windows are not explicitely closed when the main loop terminates.
Diffstat (limited to 'object-index.c')
-rw-r--r--object-index.c 24
1 files changed, 12 insertions, 12 deletions
diff --git a/object-index.c b/object-index.c
index fab7830e..4074511c 100644
--- a/object-index.c
+++ b/object-index.c
@@ -4,24 +4,24 @@
#include "object-index.h"
-static const char *table_name[] = {"GSL.reg.wins"};
+static const char *table_name = "GSL.reg.wins";
void
object_index_prepare (lua_State *L)
{
lua_newtable (L);
- lua_setfield (L, LUA_REGISTRYINDEX, table_name[OBJECT_WINDOW]);
+ lua_setfield (L, LUA_REGISTRYINDEX, table_name);
}
int
-object_index_add(lua_State *L, int obj_class, int index)
+object_index_add(lua_State *L, int index)
{
int n;
if (index < 0)
index = lua_gettop (L) - (index+1);
- lua_getfield (L, LUA_REGISTRYINDEX, table_name[obj_class]);
+ lua_getfield (L, LUA_REGISTRYINDEX, table_name);
n = lua_objlen (L, -1);
@@ -33,26 +33,26 @@ object_index_add(lua_State *L, int obj_class, int index)
}
void
-object_index_get (lua_State *L, int obj_class, int id)
+object_index_get (lua_State *L, int id)
{
- lua_getfield (L, LUA_REGISTRYINDEX, table_name[obj_class]);
+ lua_getfield (L, LUA_REGISTRYINDEX, table_name);
lua_rawgeti (L, -1, id);
lua_remove (L, -2);
}
void
-object_index_remove (lua_State *L, int obj_class, int id)
+object_index_remove (lua_State *L, int id)
{
- lua_getfield (L, LUA_REGISTRYINDEX, table_name[obj_class]);
+ lua_getfield (L, LUA_REGISTRYINDEX, table_name);
lua_pushnil (L);
lua_rawseti (L, -2, id);
lua_pop (L, 1);
}
void
-object_index_apply_all (lua_State *L, int obj_class, lua_CFunction f)
+object_index_apply_all (lua_State *L, lua_CFunction f)
{
- lua_getfield (L, LUA_REGISTRYINDEX, table_name[obj_class]);
+ lua_getfield (L, LUA_REGISTRYINDEX, table_name);
lua_pushnil (L); /* first key */
while (lua_next(L, -2) != 0)
@@ -66,11 +66,11 @@ object_index_apply_all (lua_State *L, int obj_class, lua_CFunction f)
}
int
-object_index_count (lua_State *L, int obj_class)
+object_index_count (lua_State *L)
{
int count = 0;
- lua_getfield (L, LUA_REGISTRYINDEX, table_name[obj_class]);
+ lua_getfield (L, LUA_REGISTRYINDEX, table_name);
lua_pushnil (L); /* first key */
while (lua_next(L, -2) != 0)
generated by cgit v1.2.3 (git 2.25.1) at 2025年09月29日 19:48:51 +0000

AltStyle によって変換されたページ (->オリジナル) /