aboutsummaryrefslogtreecommitdiffstats
path: root/backend.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-02-03 06:12:41 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-02-03 06:12:41 +0000
commit63dffdd551989100dc3ad845b1f5a2126a59be6e (patch)
tree2208cf1f19c74ad407ccc98e61f04579e58e75c0 /backend.c
parent[w3m-dev 02972] (diff)
downloadw3m-63dffdd551989100dc3ad845b1f5a2126a59be6e.tar.gz
w3m-63dffdd551989100dc3ad845b1f5a2126a59be6e.zip
[w3m-dev 02964] Print data of forms when halfdump option is set
* backend.c (print_headers): print w3m-current-url and w3m-base-url * backend.c (print_formlist): deleted * backend.c (internal_get): remove "if (buf->formlist) {}" * file.c (print_internal_information): added * file.c (loadHTMLstream): if halfdump, print_internal_information if w3m_backend, print_internal_information * fm.h (DUMP_HALFEXTRA): added * main.c (-halfdump_extra): added From: TSUCHIYA Masatoshi <tsuchiya@pine.kuee.kyoto-u.ac.jp>
Diffstat (limited to '')
-rw-r--r--backend.c36
1 files changed, 4 insertions, 32 deletions
diff --git a/backend.c b/backend.c
index 3d63d1f..8ce0c07 100644
--- a/backend.c
+++ b/backend.c
@@ -1,4 +1,4 @@
-/* $Id: backend.c,v 1.7 2001/12/27 18:22:59 ukai Exp $ */
+/* $Id: backend.c,v 1.8 2002/02/03 06:12:41 ukai Exp $ */
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
@@ -97,6 +97,9 @@ print_headers(Buffer *buf, int len)
for (tp = buf->document_header->first; tp; tp = tp->next)
printf("%s\n", tp->ptr);
}
+ printf("w3m-current-url: %s\n", parsedURL2Str(&buf->currentURL)->ptr);
+ if (buf->baseURL)
+ printf("w3m-base-url: %s\n", parsedURL2Str(buf->baseURL)->ptr);
printf("w3m-content-type: %s\n", buf->type);
#ifdef JP_CHARSET
if (buf->document_code)
@@ -109,29 +112,6 @@ print_headers(Buffer *buf, int len)
static void
-print_formlist(int fid, FormList *fp)
-{
- Str s =
- Sprintf("w3m-form: (formlist (fid %d) (action \"%s\") (method \"%s\")",
- fid,
- fp->action->ptr,
- (fp->method == FORM_METHOD_POST) ? "post"
- : ((fp->method == FORM_METHOD_INTERNAL) ? "internal" : "get"));
- if (fp->target)
- Strcat(s, Sprintf(" (target \"%s\")", fp->target));
- if (fp->charset)
- Strcat(s,
- Sprintf(" (charset '%s)", get_mime_charset_name(fp->charset)));
- if (fp->enctype == FORM_ENCTYPE_MULTIPART)
- Strcat_charp(s, " (enctype \"multipart/form-data\")");
- if (fp->boundary)
- Strcat(s, Sprintf(" (boundary \"%s\")", fp->boundary));
- Strcat_charp(s, ")\n");
- Strfputs(s, stdout);
-}
-
-
-static void
internal_get(char *url, int flag, FormList *request)
{
Buffer *buf;
@@ -151,14 +131,6 @@ internal_get(char *url, int flag, FormList *request)
last = Strnew_m_charp("</pre><title>", html_quote(buf->buffername),
"</title>\n", NULL);
print_headers(buf, len + first->length + last->length);
- if (buf->formlist) {
- FormList *fp;
- int fid = 0;
- for (fp = buf->formlist; fp; fp = fp->next)
- fid++;
- for (fp = buf->formlist; fp; fp = fp->next)
- print_formlist(--fid, fp);
- }
printf("\n");
printf("%s", first->ptr);
for (p = backend_halfdump_buf->first; p; p = p->next)