summaryrefslogtreecommitdiff
path: root/src/session.c
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2010-11-13 01:30:09 +0100
committerportix <portix@gmx.net>2010-11-13 01:30:09 +0100
commit141e1cb65a98112626216729a6ddb9a6c8dc506f (patch)
treef50d4093dfe1dbcb641a0252c325b24cb1b1b002 /src/session.c
parent69604231f4319deb0e3625008ac56d143e407f85 (diff)
downloaddwb-141e1cb65a98112626216729a6ddb9a6c8dc506f.zip
replace gint, gdouble, gchar with int, double, char
Diffstat (limited to 'src/session.c')
-rw-r--r--src/session.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/src/session.c b/src/session.c
index 6a91acb7..0f4ad59c 100644
--- a/src/session.c
+++ b/src/session.c
@@ -6,11 +6,11 @@
#include "util.h"
#include "view.h"
-/* dwb_session_get_groups() return gchar ** (alloc){{{*/
-static gchar **
+/* dwb_session_get_groups() return char ** (alloc){{{*/
+static char **
dwb_session_get_groups() {
- gchar **groups = NULL;
- gchar *content = dwb_util_get_file_content(dwb.files.session);
+ char **groups = NULL;
+ char *content = dwb_util_get_file_content(dwb.files.session);
if (content) {
groups = g_regex_split_simple("^g:", content, G_REGEX_MULTILINE, G_REGEX_MATCH_NOTEMPTY);
g_free(content);
@@ -18,15 +18,15 @@ dwb_session_get_groups() {
return groups;
}/*}}}*/
-/* dwb_session_get_group(const gchar *) return gchar* (alloc){{{*/
-static gchar *
-dwb_session_get_group(const gchar *name) {
- gchar *content = NULL;
+/* dwb_session_get_group(const char *) return char* (alloc){{{*/
+static char *
+dwb_session_get_group(const char *name) {
+ char *content = NULL;
- gchar **groups = dwb_session_get_groups();
+ char **groups = dwb_session_get_groups();
if (groups) {
- gint i=1;
- gchar *group = g_strconcat(name, "\n", NULL);
+ int i=1;
+ char *group = g_strconcat(name, "\n", NULL);
while (groups[i]) {
if (g_str_has_prefix(groups[i], group)) {
content = g_strdup(groups[i]);
@@ -39,9 +39,9 @@ dwb_session_get_group(const gchar *name) {
return content;
}/*}}}*/
-/* dwb_session_load_webview(WebKitWebView *, gchar *, gint *){{{*/
+/* dwb_session_load_webview(WebKitWebView *, char *, int *){{{*/
static void
-dwb_session_load_webview(WebKitWebView *web, gchar *uri, gint last) {
+dwb_session_load_webview(WebKitWebView *web, char *uri, int last) {
if (last > 0) {
for (int j=0; j<last; j++) {
webkit_web_view_go_back(web);
@@ -55,12 +55,12 @@ dwb_session_load_webview(WebKitWebView *web, gchar *uri, gint last) {
/* dwb_session_list {{{*/
void
dwb_session_list() {
- gchar *path = dwb_util_build_path();
+ char *path = dwb_util_build_path();
dwb.files.session = g_build_filename(path, "session", NULL);
- gchar **content = dwb_session_get_groups();
- gint i=1;
+ char **content = dwb_session_get_groups();
+ int i=1;
while (content[i]) {
- gchar **group = g_strsplit(content[i], "\n", -1);
+ char **group = g_strsplit(content[i], "\n", -1);
fprintf(stdout, "%d: %s\n", i++, group[0]);
g_strfreev(group);
}
@@ -69,24 +69,24 @@ dwb_session_list() {
exit(EXIT_SUCCESS);
}/*}}}*/
-/* dwb_session_restore(const gchar *name) {{{*/
+/* dwb_session_restore(const char *name) {{{*/
gboolean
-dwb_session_restore(const gchar *name) {
- gchar *group = dwb_session_get_group(name);
+dwb_session_restore(const char *name) {
+ char *group = dwb_session_get_group(name);
if (!group) {
return false;
}
- gchar **lines = g_strsplit(group, "\n", -1);
+ char **lines = g_strsplit(group, "\n", -1);
WebKitWebView *web, *lastweb = NULL;
WebKitWebBackForwardList *bf_list;
- gint last = 1;
- gchar *uri = NULL;
+ int last = 1;
+ char *uri = NULL;
- gint length = g_strv_length(lines) - 1;
- for (gint i=1; i<=length; i++) {
- gchar **line = g_strsplit(lines[i], " ", 4);
+ int length = g_strv_length(lines) - 1;
+ for (int i=1; i<=length; i++) {
+ char **line = g_strsplit(lines[i], " ", 4);
if (line[0] && line[1] && line[2]) {
- gint current = strtol(line[0], NULL, 10);
+ int current = strtol(line[0], NULL, 10);
if (current <= last) {
dwb_add_view(NULL);
web = CURRENT_WEBVIEW();
@@ -123,32 +123,32 @@ dwb_session_restore(const gchar *name) {
return true;
}/*}}}*/
-/* dwb_session_save(const gchar *) {{{*/
+/* dwb_session_save(const char *) {{{*/
gboolean
-dwb_session_save(const gchar *name) {
+dwb_session_save(const char *name) {
if (!name) {
name = "default";
}
GString *buffer = g_string_new(NULL);
g_string_append_printf(buffer, "g:%s\n", name);
- gint view=0;
+ int view=0;
for (GList *l = g_list_last(dwb.state.views); l; l=l->prev, view++) {
WebKitWebView *web = WEBVIEW(l);
WebKitWebBackForwardList *bf_list = webkit_web_view_get_back_forward_list(web);
- for (gint i= -webkit_web_back_forward_list_get_back_length(bf_list); i<=webkit_web_back_forward_list_get_forward_length(bf_list); i++) {
+ for (int i= -webkit_web_back_forward_list_get_back_length(bf_list); i<=webkit_web_back_forward_list_get_forward_length(bf_list); i++) {
WebKitWebHistoryItem *item = webkit_web_back_forward_list_get_nth_item(bf_list, i);
if (item) {
- const gchar *uri = webkit_web_history_item_get_uri(item);
- const gchar *title = webkit_web_history_item_get_title(item);
+ const char *uri = webkit_web_history_item_get_uri(item);
+ const char *title = webkit_web_history_item_get_title(item);
g_string_append_printf(buffer, "%d %s %s\n", i, uri, title);
}
}
}
- gchar **groups = dwb_session_get_groups();
+ char **groups = dwb_session_get_groups();
if (groups) {
- gint i=1;
- gchar *group = g_strconcat(name, "\n", NULL);
+ int i=1;
+ char *group = g_strconcat(name, "\n", NULL);
while(groups[i]) {
if (!g_str_has_prefix(groups[i], group)) {
g_string_append_printf(buffer, "g:%s", groups[i]);