diff options
author | David Keijser <keijser@gmail.com> | 2011-05-30 19:15:01 +0200 |
---|---|---|
committer | David Keijser <keijser@gmail.com> | 2011-05-30 19:15:01 +0200 |
commit | 1110023039fa7d13e2ddab29d6a7db50ab61f2ae (patch) | |
tree | 2d9b6800c40e8cb7f4ad02253e03ee3fb1f318f7 /src/uzbl-core.c | |
parent | da8e6d70e09c9c92c55b110ada1d3bcc63889a72 (diff) |
hide some implementation details of variables
Diffstat (limited to 'src/uzbl-core.c')
-rw-r--r-- | src/uzbl-core.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/uzbl-core.c b/src/uzbl-core.c index 91a9cd0..6f82d2e 100644 --- a/src/uzbl-core.c +++ b/src/uzbl-core.c @@ -38,6 +38,7 @@ #include "menu.h" #include "io.h" #include "variables.h" +#include "type.h" UzblCore uzbl; @@ -90,7 +91,6 @@ get_exp_type(const gchar *s) { */ gchar* expand(const char* s, guint recurse) { - uzbl_cmdprop* c; enum exp_type etype; char* end_simple_var = "\t^°!\"§$%&/()=?'`'+~*'#-:,;@<>| \\{}[]¹²³¼½"; char* ret = NULL; @@ -147,17 +147,8 @@ expand(const char* s, guint recurse) { if(etype == EXP_SIMPLE_VAR || etype == EXP_BRACED_VAR) { - if( (c = g_hash_table_lookup(uzbl.behave.proto_var, ret)) ) { - if(c->type == TYPE_STR && *c->ptr.s != NULL) { - g_string_append(buf, (gchar *)*c->ptr.s); - } - else if(c->type == TYPE_INT) { - g_string_append_printf(buf, "%d", *c->ptr.i); - } - else if(c->type == TYPE_FLOAT) { - g_string_append_printf(buf, "%f", *c->ptr.f); - } - } + + expand_variable(buf, ret); if(etype == EXP_SIMPLE_VAR) s = vend; |