summaryrefslogtreecommitdiff
path: root/debug/netsurfd.c
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2003-06-21 13:18:00 +0000
committerJames Bursa <james@netsurf-browser.org>2003-06-21 13:18:00 +0000
commit94073c9bf642727d41a50c278d03a2b2f4af60ee (patch)
tree18395e80cb5f3984844f88819354d9ed5064794c /debug/netsurfd.c
parent0c0ff3c59631d0968c888279195ea40d4a7fd824 (diff)
downloadnetsurf-94073c9bf642727d41a50c278d03a2b2f4af60ee.tar.gz
netsurf-94073c9bf642727d41a50c278d03a2b2f4af60ee.tar.bz2
[project @ 2003-06-21 13:18:00 by bursa]
Add debug command line build. svn path=/import/netsurf/; revision=181
Diffstat (limited to 'debug/netsurfd.c')
-rw-r--r--debug/netsurfd.c63
1 files changed, 63 insertions, 0 deletions
diff --git a/debug/netsurfd.c b/debug/netsurfd.c
new file mode 100644
index 000000000..81a494ff0
--- /dev/null
+++ b/debug/netsurfd.c
@@ -0,0 +1,63 @@
+#include <string.h>
+#include "netsurf/content/fetch.h"
+#include "netsurf/content/cache.h"
+#include "netsurf/content/content.h"
+#include "netsurf/content/fetchcache.h"
+#include "netsurf/utils/log.h"
+
+int done;
+
+void callback(content_msg msg, struct content *c, void *p1,
+ void *p2, const char *error)
+{
+ LOG(("content %s, message %i", c->url, msg));
+ if (msg == CONTENT_MSG_DONE || msg == CONTENT_MSG_ERROR)
+ done = 1;
+ else if (msg == CONTENT_MSG_STATUS)
+ printf("=== STATUS: %s", c->status_message);
+}
+
+int main(int argc, char *argv[])
+{
+ char url[1000];
+ struct content *c;
+
+ fetch_init();
+ cache_init();
+
+ while (1) {
+ puts("=== URL:");
+ gets(url);
+ c = fetchcache(url, 0, callback, 0, 0, 100, 1000);
+ done = c->status == CONTENT_STATUS_DONE;
+ while (!done)
+ fetch_poll();
+ puts("=== SUCCESS, dumping cache");
+ cache_dump();
+ }
+
+ cache_quit();
+ fetch_quit();
+
+ return 0;
+}
+
+void gui_multitask(void)
+{
+ LOG(("-"));
+}
+
+int stricmp(char *s0, char *s1)
+{
+ return strcasecmp(s0, s1);
+}
+
+void gui_remove_gadget(void *p)
+{
+}
+
+void plugin_decode(void *a, void *b, void *c, void *d)
+{
+}
+
+