summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Rameau <quinq@fifth.space>2024-03-17 07:59:30 +0100
committerRafael Marçalo <raroma09@gmail.com>2024-06-10 21:13:25 +0100
commitdd27aea9f41bedebd8a593816a3755011dbb3642 (patch)
tree12a5dd7b41312a89825bfd121564c91493e7ac68
parent069aa2461b77a05c182eec6613d7d01beb04cf80 (diff)
webext: Remove unused functions
Communication from web extension to surf isn't used, this code can always be brought back if needed.
-rw-r--r--surf.c26
-rw-r--r--webext-surf.c17
2 files changed, 0 insertions, 43 deletions
diff --git a/surf.c b/surf.c
index c5e89b6..b5fd3a1 100644
--- a/surf.c
+++ b/surf.c
@@ -189,7 +189,6 @@ static gboolean buttonreleased(GtkWidget *w, GdkEvent *e, Client *c);
static GdkFilterReturn processx(GdkXEvent *xevent, GdkEvent *event,
gpointer d);
static gboolean winevent(GtkWidget *w, GdkEvent *e, Client *c);
-static gboolean readsock(GIOChannel *s, GIOCondition ioc, gpointer unused);
static void showview(WebKitWebView *v, Client *c);
static GtkWidget *createwindow(Client *c);
static gboolean loadfailedtls(WebKitWebView *v, gchar *uri,
@@ -378,7 +377,6 @@ setup(void)
g_io_channel_set_flags(gchanin, g_io_channel_get_flags(gchanin)
| G_IO_FLAG_NONBLOCK, NULL);
g_io_channel_set_close_on_unref(gchanin, TRUE);
- g_io_add_watch(gchanin, G_IO_IN, readsock, NULL);
}
@@ -1257,30 +1255,6 @@ newview(Client *c, WebKitWebView *rv)
return v;
}
-static gboolean
-readsock(GIOChannel *s, GIOCondition ioc, gpointer unused)
-{
- static char msg[MSGBUFSZ];
- GError *gerr = NULL;
- gsize msgsz;
-
- if (g_io_channel_read_chars(s, msg, sizeof(msg), &msgsz, &gerr) !=
- G_IO_STATUS_NORMAL) {
- if (gerr) {
- fprintf(stderr, "surf: error reading socket: %s\n",
- gerr->message);
- g_error_free(gerr);
- }
- return TRUE;
- }
- if (msgsz < 2) {
- fprintf(stderr, "surf: message too short: %d\n", msgsz);
- return TRUE;
- }
-
- return TRUE;
-}
-
void
initwebextensions(WebKitWebContext *wc, Client *c)
{
diff --git a/webext-surf.c b/webext-surf.c
index d2753b5..f09714e 100644
--- a/webext-surf.c
+++ b/webext-surf.c
@@ -19,23 +19,6 @@
static WebKitWebExtension *webext;
static int sock;
-static void
-msgsurf(guint64 pageid, const char *s)
-{
- static char msg[MSGBUFSZ];
- size_t sln = strlen(s);
- int ret;
-
- if ((ret = snprintf(msg, sizeof(msg), "%c%s", pageid, s))
- >= sizeof(msg)) {
- fprintf(stderr, "webext: msg: message too long: %d\n", ret);
- return;
- }
-
- if (send(sock, msg, ret, 0) < 0)
- fprintf(stderr, "webext: error sending: %s\n", msg+1);
-}
-
static gboolean
readsock(GIOChannel *s, GIOCondition c, gpointer unused)
{