diff options
author | koral <koral@mailoo.org> | 2011-02-10 15:20:19 +0100 |
---|---|---|
committer | koral <koral@mailoo.org> | 2011-02-10 15:20:19 +0100 |
commit | 59af2a8499160a369aceed1bd5cb32109fb5e77c (patch) | |
tree | 8ca62aa594b1ee548566236bf73998dc0f1b720d /src/uzbl-core.c | |
parent | ece7f8a0bc6f4b45e931ce2634f79fe6c84a18c9 (diff) |
Moves additionnal utility functions to util.c.
Diffstat (limited to 'src/uzbl-core.c')
-rw-r--r-- | src/uzbl-core.c | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/src/uzbl-core.c b/src/uzbl-core.c index 8cc20bb..4ee0129 100644 --- a/src/uzbl-core.c +++ b/src/uzbl-core.c @@ -165,24 +165,6 @@ create_var_to_name_hash() { /* --- UTILITY FUNCTIONS --- */ -enum exp_type {EXP_ERR, EXP_SIMPLE_VAR, EXP_BRACED_VAR, EXP_EXPR, EXP_JS, EXP_ESCAPE}; -enum exp_type -get_exp_type(const gchar *s) { - /* variables */ - if(*(s+1) == '(') - return EXP_EXPR; - else if(*(s+1) == '{') - return EXP_BRACED_VAR; - else if(*(s+1) == '<') - return EXP_JS; - else if(*(s+1) == '[') - return EXP_ESCAPE; - else - return EXP_SIMPLE_VAR; - - /*@notreached@*/ -return EXP_ERR; -} /* * recurse == 1: don't expand '@(command)@' @@ -353,56 +335,6 @@ expand(const char* s, guint recurse) { } -/* search a PATH style string for an existing file+path combination */ -gchar* -find_existing_file(gchar* path_list) { - int i=0; - int cnt; - gchar **split; - gchar *tmp = NULL; - gchar *executable; - - if(!path_list) - return NULL; - - split = g_strsplit(path_list, ":", 0); - while(split[i]) - i++; - - if(i<=1) { - tmp = g_strdup(split[0]); - g_strfreev(split); - return tmp; - } - else - cnt = i-1; - - i=0; - tmp = g_strdup(split[cnt]); - g_strstrip(tmp); - if(tmp[0] == '/') - executable = g_strdup_printf("%s", tmp+1); - else - executable = g_strdup(tmp); - g_free(tmp); - - while(i<cnt) { - tmp = g_strconcat(g_strstrip(split[i]), "/", executable, NULL); - if(g_file_test(tmp, G_FILE_TEST_EXISTS)) { - g_strfreev(split); - return tmp; - } - else - g_free(tmp); - i++; - } - - g_free(executable); - g_strfreev(split); - return NULL; -} - - void clean_up(void) { if (uzbl.info.pid_str) { |