[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Gavin D. Smith |
Date: |
Sun, 20 Mar 2022 04:55:17 -0400 (EDT) |
branch: master
commit 9bfb8e3de0c77d26d56560a5234d4aa23b3a1ed9
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Wed Oct 16 13:07:52 2019 +0100
code in working state
---
js/wkinfo/extension.c | 14 +++++++++-----
js/wkinfo/main.c | 3 ++-
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/js/wkinfo/extension.c b/js/wkinfo/extension.c
index 791b020c4e..3e68b3789b 100644
--- a/js/wkinfo/extension.c
+++ b/js/wkinfo/extension.c
@@ -37,6 +37,7 @@ send_datagram (GString *s)
{
ssize_t result;
+ g_print ("send datagram %s", s->str);
if (s->len > PACKET_SIZE)
{
g_print ("datagram too big");
@@ -56,8 +57,8 @@ send_datagram (GString *s)
static char *current_manual;
static char *current_manual_dir;
-/* Called from request_callback. */
-void
+/* Called from request_callback. Return 0 on failure. */
+int
load_manual (char *manual)
{
free (current_manual_dir);
@@ -67,7 +68,7 @@ load_manual (char *manual)
if (!current_manual_dir)
{
free (manual);
- return;
+ return 0;
}
current_manual = manual;
@@ -84,6 +85,8 @@ load_manual (char *manual)
send_datagram (s1);
g_string_free (s1, TRUE);
+
+ return 1;
}
gboolean
@@ -139,7 +142,8 @@ request_callback (WebKitWebPage *web_page,
if (!current_manual || strcmp(manual, current_manual) != 0)
{
- load_manual (manual);
+ if (!load_manual (manual))
+ ;// return TRUE; /* Cancel load request */
}
}
@@ -194,6 +198,7 @@ find_indices (WebKitDOMHTMLCollection *links, gulong
num_links)
|| strstr (href, "-index.html")
|| strstr (href, "/Index.html")))
{
+ g_print ("AAAAAAA AAAAAAA index node at |%s|\n", href);
g_string_append (s, href);
g_string_append (s, "\n");
}
@@ -363,7 +368,6 @@ document_loaded_callback (WebKitWebPage *web_page,
const char *p = current_uri;
const char *q;
- g_print ("current uri is |%s|\n", current_uri);
/* Set p to after the last '/'. */
while ((q = strchr (p, '/')))
{
diff --git a/js/wkinfo/main.c b/js/wkinfo/main.c
index fdbd5d5e5f..47a85ea468 100644
--- a/js/wkinfo/main.c
+++ b/js/wkinfo/main.c
@@ -265,6 +265,7 @@ socket_cb (GSocket *socket,
g_print ("NEW MANUAL %s\n", p + 1);
clear_completions ();
+#if 0
char *q = strchr (p + 1, '\n');
if (!q)
break;
@@ -278,7 +279,7 @@ socket_cb (GSocket *socket,
g_string_append (s, "/index.html?top-node");
webkit_web_view_load_uri (hiddenWebView, s->str);
g_string_free (s, TRUE);
-
+#endif
}
else if (!strcmp (buffer, "index-nodes"))
{
- [no subject], (continued)
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject],
Gavin D. Smith <=
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20