The two remaining function are moved into main.c.
#include "hints.h"
#include "shortcut.h"
#include "history.h"
-#include "session.h"
+#include "cookiejar.h"
#include "hsts.h"
#include "mode.h"
#include "normal.h"
static void read_config(void);
static void setup_signals();
static void init_files(void);
+static void session_init(void);
+static void session_cleanup(void);
static gboolean hide_message();
static void set_status(const StatusType status);
static void input_print(gboolean force, const MessageType type, gboolean hide, const char *message);
g_free(path);
}
+static void session_init(void)
+{
+ /* init soup session */
+ vb.session = webkit_get_default_session();
+ g_object_set(vb.session, "max-conns", SETTING_MAX_CONNS , NULL);
+ g_object_set(vb.session, "max-conns-per-host", SETTING_MAX_CONNS_PER_HOST, NULL);
+ g_object_set(vb.session, "accept-language-auto", true, NULL);
+
+#ifdef FEATURE_COOKIE
+ SoupCookieJar *cookie = cookiejar_new(vb.files[FILES_COOKIE], false);
+ soup_session_add_feature(vb.session, SOUP_SESSION_FEATURE(cookie));
+ g_object_unref(cookie);
+#endif
+#ifdef FEATURE_HSTS
+ HSTSProvider *hsts = hsts_provider_new();
+ soup_session_add_feature(vb.session, SOUP_SESSION_FEATURE(hsts));
+ g_object_unref(hsts);
+#endif
+}
+
+static void session_cleanup(void)
+{
+#ifdef FEATURE_HSTS
+ /* remove feature from session to make sure the feature is finalized */
+ soup_session_remove_feature_by_type(vb.session, HSTS_TYPE_PROVIDER);
+#endif
+}
+
static gboolean button_relase_cb(WebKitWebView *webview, GdkEventButton *event)
{
gboolean propagate = false;
+++ /dev/null
-/**
- * vimb - a webkit based vim like browser.
- *
- * Copyright (C) 2012-2014 Daniel Carl
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see http://www.gnu.org/licenses/.
- */
-
-#include "config.h"
-#include "main.h"
-#include "session.h"
-#ifdef FEATURE_COOKIE
-#include "cookiejar.h"
-#endif
-#ifdef FEATURE_HSTS
-#include "hsts.h"
-#endif
-
-extern VbCore vb;
-
-
-void session_init(void)
-{
- /* init soup session */
- vb.session = webkit_get_default_session();
- g_object_set(vb.session, "max-conns", SETTING_MAX_CONNS , NULL);
- g_object_set(vb.session, "max-conns-per-host", SETTING_MAX_CONNS_PER_HOST, NULL);
- g_object_set(vb.session, "accept-language-auto", true, NULL);
-
-#ifdef FEATURE_COOKIE
- SoupCookieJar *cookie = cookiejar_new(vb.files[FILES_COOKIE], false);
- soup_session_add_feature(vb.session, SOUP_SESSION_FEATURE(cookie));
- g_object_unref(cookie);
-#endif
-#ifdef FEATURE_HSTS
- HSTSProvider *hsts = hsts_provider_new();
- soup_session_add_feature(vb.session, SOUP_SESSION_FEATURE(hsts));
- g_object_unref(hsts);
-#endif
-}
-
-void session_cleanup(void)
-{
-#ifdef FEATURE_HSTS
- /* remove feature from session to make sure the feature is finalized */
- soup_session_remove_feature_by_type(vb.session, HSTS_TYPE_PROVIDER);
-#endif
-}
+++ /dev/null
-/**
- * vimb - a webkit based vim like browser.
- *
- * Copyright (C) 2012-2014 Daniel Carl
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see http://www.gnu.org/licenses/.
- */
-
-#ifndef _SESSION_H
-#define _SESSION_H
-
-void session_init(void);
-void session_cleanup(void);
-
-#endif /* end of include guard: _SESSION_H */