From 9156953cc95cd4d814ea0ad0e9407efc9a6a0a7d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C5=99emysl=20Janouch?=
Date: Wed, 27 Oct 2010 15:52:36 +0200
Subject: Add more properties to LdSymbol.
Also move the actual storage of symbol properties to implementations
of the abstract LdSymbol class. All the properties are read only.
---
src/ld-lua.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
(limited to 'src/ld-lua.c')
diff --git a/src/ld-lua.c b/src/ld-lua.c
index 1e1dd30..3a6a5af 100644
--- a/src/ld-lua.c
+++ b/src/ld-lua.c
@@ -363,14 +363,6 @@ ld_lua_logdiag_register (lua_State *L)
lua_pop (L, 1);
g_return_val_if_fail (ud != NULL, 0);
- /* TODO: Create a symbol using the given parameters:
- * 1. name
- * 2. names (table) -> use g_get_language_names ()
- * 3. area (table)
- * 4. terminals (table)
- * 5. render function
- */
-
/* Check and retrieve arguments. */
name = lua_tostring (L, 1);
if (!name)
@@ -378,12 +370,16 @@ ld_lua_logdiag_register (lua_State *L)
if (!lua_isfunction (L, 5))
luaL_error (L, "register: bad or missing argument #%d", 5);
- /* Create a symbol object. */
+ /* TODO: Create a symbol using the given parameters:
+ * 2. names (table) -> use g_get_language_names ()
+ * 3. area (table)
+ * 4. terminals (table)
+ */
symbol = g_object_new (LD_TYPE_LUA_SYMBOL, NULL);
symbol->priv->lua = ud->self;
g_object_ref (ud->self);
- ld_symbol_set_name (LD_SYMBOL (symbol), name);
+ symbol->priv->name = g_strdup (name);
/* Create an entry in the symbol table. */
lua_getfield (L, LUA_REGISTRYINDEX, LD_LUA_SYMBOLS_INDEX);
--
cgit v1.2.3