diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2010-10-27 15:52:36 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2010-10-27 16:52:00 +0200 |
commit | 9156953cc95cd4d814ea0ad0e9407efc9a6a0a7d (patch) | |
tree | 9bb740c24230eb0d4c5d79fa6ad684ca1f328eb3 /src/ld-lua.c | |
parent | aa33db342b4fc194cdb4966381ac1e5f44b73465 (diff) | |
download | logdiag-9156953cc95cd4d814ea0ad0e9407efc9a6a0a7d.tar.gz logdiag-9156953cc95cd4d814ea0ad0e9407efc9a6a0a7d.tar.xz logdiag-9156953cc95cd4d814ea0ad0e9407efc9a6a0a7d.zip |
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.
Diffstat (limited to 'src/ld-lua.c')
-rw-r--r-- | src/ld-lua.c | 16 |
1 files changed, 6 insertions, 10 deletions
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); |