aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar David Keijser <keijser@gmail.com>2011-05-30 19:07:05 +0200
committerGravatar David Keijser <keijser@gmail.com>2011-05-30 19:07:05 +0200
commitda8e6d70e09c9c92c55b110ada1d3bcc63889a72 (patch)
tree6f9ca86ab1668a5a026296069e4a28cc0d631758 /src
parent952ceba2183d781245236834dbabf4365b549b95 (diff)
move variable hashtable to a more sane place
Diffstat (limited to 'src')
-rw-r--r--src/uzbl-core.c2
-rw-r--r--src/uzbl-core.h6
-rw-r--r--src/variables.c12
3 files changed, 9 insertions, 11 deletions
diff --git a/src/uzbl-core.c b/src/uzbl-core.c
index b235e9e..91a9cd0 100644
--- a/src/uzbl-core.c
+++ b/src/uzbl-core.c
@@ -147,7 +147,7 @@ expand(const char* s, guint recurse) {
if(etype == EXP_SIMPLE_VAR ||
etype == EXP_BRACED_VAR) {
- if( (c = g_hash_table_lookup(uzbl.comm.proto_var, ret)) ) {
+ 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);
}
diff --git a/src/uzbl-core.h b/src/uzbl-core.h
index c4fb94e..892c779 100644
--- a/src/uzbl-core.h
+++ b/src/uzbl-core.h
@@ -91,7 +91,6 @@ enum { FIFO, SOCKET};
typedef struct {
gchar *fifo_path;
gchar *socket_path;
- GHashTable *proto_var; /* stores (key)"variable name" -> (value)"pointer to var */
GPtrArray *connect_chan;
GPtrArray *client_chan;
@@ -195,9 +194,8 @@ typedef struct {
/* command list: (key)name -> (value)Command */
GHashTable* commands;
-
- /* event lookup: (key)event_id -> (value)event_name */
- GHashTable *event_lookup;
+ /* variables: (key)name -> (value)uzbl_cmdprop */
+ GHashTable *proto_var;
} Behaviour;
diff --git a/src/variables.c b/src/variables.c
index d1552f9..e22d079 100644
--- a/src/variables.c
+++ b/src/variables.c
@@ -99,9 +99,9 @@ const struct var_name_to_ptr_t {
void
variables_hash() {
const struct var_name_to_ptr_t *n2v_p = var_name_to_ptr;
- uzbl.comm.proto_var = g_hash_table_new(g_str_hash, g_str_equal);
+ uzbl.behave.proto_var = g_hash_table_new(g_str_hash, g_str_equal);
while(n2v_p->name) {
- g_hash_table_insert(uzbl.comm.proto_var,
+ g_hash_table_insert(uzbl.behave.proto_var,
(gpointer) n2v_p->name,
(gpointer) &n2v_p->cp);
n2v_p++;
@@ -146,7 +146,7 @@ set_var_value(const gchar *name, gchar *val) {
g_assert(val != NULL);
- if( (c = g_hash_table_lookup(uzbl.comm.proto_var, name)) ) {
+ if( (c = g_hash_table_lookup(uzbl.behave.proto_var, name)) ) {
if(!c->writeable) return FALSE;
switch(c->type) {
@@ -186,7 +186,7 @@ set_var_value(const gchar *name, gchar *val) {
buf = g_strdup(val);
c->ptr.s = g_malloc(sizeof(char *));
*c->ptr.s = buf;
- g_hash_table_insert(uzbl.comm.proto_var,
+ g_hash_table_insert(uzbl.behave.proto_var,
g_strdup(name), (gpointer) c);
send_event (VARIABLE_SET, NULL,
@@ -217,7 +217,7 @@ dump_var_hash(gpointer k, gpointer v, gpointer ud) {
void
dump_config() {
- g_hash_table_foreach(uzbl.comm.proto_var, dump_var_hash, NULL);
+ g_hash_table_foreach(uzbl.behave.proto_var, dump_var_hash, NULL);
}
void
@@ -231,7 +231,7 @@ dump_var_hash_as_event(gpointer k, gpointer v, gpointer ud) {
void
dump_config_as_events() {
- g_hash_table_foreach(uzbl.comm.proto_var, dump_var_hash_as_event, NULL);
+ g_hash_table_foreach(uzbl.behave.proto_var, dump_var_hash_as_event, NULL);
}
/* is the given string made up entirely of decimal digits? */