aboutsummaryrefslogtreecommitdiffhomepage
path: root/uzbl.c
diff options
context:
space:
mode:
authorGravatar Barrucadu <mike@barrucadu.co.uk>2009-05-02 23:19:43 +0100
committerGravatar Barrucadu <mike@barrucadu.co.uk>2009-05-02 23:19:43 +0100
commit6f98b4d221ef308193b710ec0e763c430e53aeca (patch)
treea3e9e443508154ab868ef8cd213bc01139380c28 /uzbl.c
parentb9bf66f1051eea96a78d65a8c18079690f19a4d4 (diff)
parentc3a8768621d322da0472e4837ee4cafb9110f01a (diff)
Merge branch 'anydot/master' into experimental
Diffstat (limited to 'uzbl.c')
-rw-r--r--uzbl.c49
1 files changed, 18 insertions, 31 deletions
diff --git a/uzbl.c b/uzbl.c
index da81fb3..f6234cd 100644
--- a/uzbl.c
+++ b/uzbl.c
@@ -122,28 +122,13 @@ static gint max_conns;
static gint max_conns_host;
/* --- UTILITY FUNCTIONS --- */
-void
-eprint(const char *errstr, ...) {
- va_list ap;
- vfprintf(stderr, errstr, ap);
- va_end(ap);
- exit(EXIT_FAILURE);
-}
-
-char *
-estrdup(const char *str) {
- void *res = strdup(str);
- if(!res)
- eprint("fatal: could not allocate %u bytes\n", strlen(str));
- return res;
-}
char *
itos(int val) {
char tmp[20];
snprintf(tmp, sizeof(tmp), "%i", val);
- return estrdup(tmp);
+ return g_strdup(tmp);
}
/* --- CALLBACKS --- */
@@ -295,6 +280,7 @@ log_history_cb () {
#define VIEWFUNC(name) static void view_##name(WebKitWebView *page, const char *param){(void)param; webkit_web_view_##name(page);}
VIEWFUNC(reload)
+VIEWFUNC(reload_bypass_cache)
VIEWFUNC(stop_loading)
VIEWFUNC(zoom_in)
VIEWFUNC(zoom_out)
@@ -307,20 +293,20 @@ VIEWFUNC(go_forward)
static struct {char *name; Command command;} cmdlist[] =
{
- { "back", view_go_back },
- { "forward", view_go_forward },
- { "scroll_vert", scroll_vert },
- { "scroll_horz", scroll_horz },
- { "reload", view_reload, }, //Buggy
- { "refresh", view_reload, }, /* for convenience, will change */
- { "stop", view_stop_loading, },
- { "zoom_in", view_zoom_in, }, //Can crash (when max zoom reached?).
- { "zoom_out", view_zoom_out, },
- { "uri", load_uri },
- { "toggle_status", toggle_status_cb },
- { "spawn", spawn },
- { "exit", close_uzbl },
- { "insert_mode", set_insert_mode }
+ { "back", view_go_back },
+ { "forward", view_go_forward },
+ { "scroll_vert", scroll_vert },
+ { "scroll_horz", scroll_horz },
+ { "reload", view_reload, },
+ { "reload_ign_cache", view_reload_bypass_cache},
+ { "stop", view_stop_loading, },
+ { "zoom_in", view_zoom_in, }, //Can crash (when max zoom reached?).
+ { "zoom_out", view_zoom_out, },
+ { "uri", load_uri },
+ { "toggle_status", toggle_status_cb },
+ { "spawn", spawn },
+ { "exit", close_uzbl },
+ { "insert_mode", set_insert_mode }
};
static void
@@ -487,6 +473,7 @@ build_stream_name(int type) {
default:
break;
}
+ g_free(xwin_str);
}
static void
@@ -557,7 +544,7 @@ control_socket(GIOChannel *chan) {
buffer[strlen (buffer)] = '\0';
}
close (clientsock);
- ctl_line = estrdup(buffer);
+ ctl_line = g_strdup(buffer);
parse_line (ctl_line);
/*