|
@@ -238,8 +238,7 @@ static int l_graph_connections (lua_State *L)
|
|
|
const LSUP_LinkType type = luaL_checkinteger (L, 3);
|
|
|
LOG_DEBUG ("Adding term for connections: @%p", *t);
|
|
|
|
|
|
- LSUP_LinkMap **lm_p =
|
|
|
- (LSUP_LinkMap **)lua_newuserdata (L, sizeof *lm_p);
|
|
|
+ LSUP_LinkMap **lm_p = lua_newuserdata (L, sizeof *lm_p);
|
|
|
*lm_p = LSUP_graph_connections (gr, t, type);
|
|
|
luaL_getmetatable (L, "LSUP.LinkMap");
|
|
|
lua_setmetatable (L, -2);
|
|
@@ -251,6 +250,17 @@ static int l_graph_connections (lua_State *L)
|
|
|
static int l_graph_term_set (lua_State *L)
|
|
|
{
|
|
|
const LSUP_Graph *gr = check_graph (L);
|
|
|
+ const LSUP_Term *t1 = *(LSUP_Term **)luaL_checkudata (L, 2, "LSUP.Term");
|
|
|
+ const LSUP_TriplePos t1_pos = luaL_checkinteger (L, 3);
|
|
|
+ const LSUP_Term *t2 = *(LSUP_Term **)luaL_checkudata (L, 3, "LSUP.Term");
|
|
|
+ const LSUP_TriplePos t2_pos = luaL_checkinteger (L, 4);
|
|
|
+
|
|
|
+ LSUP_TermSet **ts_p = lua_newuserdata (L, sizeof *ts_p);
|
|
|
+ luaL_getmetatable (L, "LSUP.TermSet");
|
|
|
+ lua_setmetatable (L, -2);
|
|
|
+
|
|
|
+ *ts_p = LSUP_graph_term_set (gr, t1, t1_pos, t2, t2_pos);
|
|
|
+ LUA_NLCHECK (*ts_p, "Error creating term set.");
|
|
|
|
|
|
return 1;
|
|
|
}
|
|
@@ -259,6 +269,14 @@ static int l_graph_term_set (lua_State *L)
|
|
|
static int l_graph_unique_terms (lua_State *L)
|
|
|
{
|
|
|
const LSUP_Graph *gr = check_graph (L);
|
|
|
+ const LSUP_TriplePos pos = luaL_checkinteger (L, 2);
|
|
|
+
|
|
|
+ LSUP_TermSet **ts_p = lua_newuserdata (L, sizeof *ts_p);
|
|
|
+ luaL_getmetatable (L, "LSUP.TermSet");
|
|
|
+ lua_setmetatable (L, -2);
|
|
|
+
|
|
|
+ *ts_p = LSUP_graph_unique_terms (gr, pos);
|
|
|
+ LUA_NLCHECK (*ts_p, "Error creating term set.");
|
|
|
|
|
|
return 1;
|
|
|
}
|