aboutsummaryrefslogtreecommitdiffhomepage
path: root/uzbl-core.c
diff options
context:
space:
mode:
authorGravatar Rob <rob.manea@gmail.com>2009-11-03 16:20:13 +0100
committerGravatar Rob <rob.manea@gmail.com>2009-11-03 16:20:13 +0100
commit849aacc54869eb047c710467802ef8aaa5fbc522 (patch)
tree6d759db8dbf524d6fe09846a09748bb0cbe045c7 /uzbl-core.c
parent77e2abd3d243d2edf57a4bfa63ffcd525a3fc478 (diff)
added include command
Diffstat (limited to 'uzbl-core.c')
-rw-r--r--uzbl-core.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/uzbl-core.c b/uzbl-core.c
index 7b44c52..1383cc9 100644
--- a/uzbl-core.c
+++ b/uzbl-core.c
@@ -636,7 +636,8 @@ struct {const char *key; CommandInfo value;} cmdlist[] =
{ "menu_link_remove", {menu_remove_link, TRUE} },
{ "menu_image_remove", {menu_remove_image, TRUE} },
{ "menu_editable_remove", {menu_remove_edit, TRUE} },
- { "hardcopy", {hardcopy, TRUE} }
+ { "hardcopy", {hardcopy, TRUE} },
+ { "include", {include, TRUE} }
};
void
@@ -876,6 +877,33 @@ hardcopy(WebKitWebView *page, GArray *argv, GString *result) {
}
void
+include(WebKitWebView *page, GArray *argv, GString *result) {
+ (void) page;
+ (void) result;
+ gchar *pe = NULL, *path = NULL;
+ gchar *line;
+ int i;
+
+ if(!argv_idx(argv, 0))
+ return;
+
+ pe = parseenv(argv_idx(argv, 0));
+ if((path = find_existing_file(pe))) {
+ g_free(pe);
+
+ GArray* lines = read_file_by_line(path);
+ g_free(path);
+
+ while ((line = g_array_index(lines, gchar*, i))) {
+ parse_cmd_line (line, NULL);
+ i++;
+ g_free (line);
+ }
+ g_array_free (lines, TRUE);
+ }
+}
+
+void
act_dump_config() {
dump_config();
}