aboutsummaryrefslogtreecommitdiffstats
path: root/indep.h
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2003-02-05 16:43:56 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2003-02-05 16:43:56 +0000
commite312638d0c8d64fe85db128d0eb8c3885a8bfe88 (patch)
tree8ffc104ec0f6eef6aae2eea58ff34d882547d065 /indep.h
parent[w3m-dev 03729] buf fix of reAnchorNewsheader() (diff)
downloadw3m-e312638d0c8d64fe85db128d0eb8c3885a8bfe88.tar.gz
w3m-e312638d0c8d64fe85db128d0eb8c3885a8bfe88.zip
[w3m-dev 03730] display decoded URL
* anchor.c (link_list_panel): support DecodeURL * display.c (make_lastline_link): support DecodeURL * etc.c (url_unquote_conv): added * fm.h (DecodeURL): added * history.c (historyBuffer): support DecodeURL * indep.c (QUOTE_MAP): added (HTML_QUOTE_MAP): added (html_quote_char): deleted (url_quote): use is_url_quote (file_quote): use is_file_quote (is_url_safe): deleted (Str_form_quote): use is_url_unsafe (Str_url_unquote): add safe args (is_shell_safe): delete (shell_quote): use is_shell_unsafe * indep.h (QUOTE_MAP): added (HTML_QUOTE_MAP): added (HTML_QUOTE_MASK): added (SHELL_UNSAFE_MASK): added (URL_QUOTE_MASK): added (FILE_QUOTE_MASK): added (URL_UNSAFE_MASK): added (GET_QUOTE_TYPE): added (is_html_quote): added (is_shell_unsafe): added (is_url_quote): added (is_file_quote): added (is_url_unsafe): added (html_quote_char): added (html_quote_char): deleted (Str_url_unquote): added safe (form_unquote): Str_url_unquote changes * linein.c (_prev): support DecodeURL (_next): ditto * main.c (goURL0): support DecodeURL (_peekURL): ditto (curURL): ditto * map.c (follow_map_panel): support DecodeURL (append_map_info): ditto (append_link_info): ditto (append_frame_info): ditto (page_info_panel): ditto * menu.c (initSelectMenu): delete SCM_LOCAL_CGI support DecodeURL (initSelTabMenu): delete SCM_LOCAL_CGI support DecodeURL (link_menu): support DecodeURL * parsetagx.c (parse_tag): is_html_quote * proto.h (url_unquote_conv): added * rc.c (CMT_DECODE_URL): added (params1): add decode_url * url.c (openURL): Str_url_unquote non safe From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to 'indep.h')
-rw-r--r--indep.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/indep.h b/indep.h
index afbed8f..10b838a 100644
--- a/indep.h
+++ b/indep.h
@@ -1,4 +1,4 @@
-/* $Id: indep.h,v 1.12 2003/01/15 16:11:43 ukai Exp $ */
+/* $Id: indep.h,v 1.13 2003/02/05 16:43:57 ukai Exp $ */
#ifndef INDEP_H
#define INDEP_H
#include "gc.h"
@@ -17,6 +17,21 @@
#define HTML_MODE 2
#define HEADER_MODE 3
+extern unsigned char QUOTE_MAP[];
+extern char *HTML_QUOTE_MAP[];
+#define HTML_QUOTE_MASK 0x07 /* &, <, >, " */
+#define SHELL_UNSAFE_MASK 0x08 /* [^A-Za-z0-9_./:\200-\377] */
+#define URL_QUOTE_MASK 0x10 /* [\0- \177-\377] */
+#define FILE_QUOTE_MASK 0x30 /* [\0- #%&+:?\177-\377] */
+#define URL_UNSAFE_MASK 0x70 /* [^A-Za-z0-9_$\-.] */
+#define GET_QUOTE_TYPE(c) QUOTE_MAP[(int)(unsigned char)(c)]
+#define is_html_quote(c) (GET_QUOTE_TYPE(c) & HTML_QUOTE_MASK)
+#define is_shell_unsafe(c) (GET_QUOTE_TYPE(c) & SHELL_UNSAFE_MASK)
+#define is_url_quote(c) (GET_QUOTE_TYPE(c) & URL_QUOTE_MASK)
+#define is_file_quote(c) (GET_QUOTE_TYPE(c) & FILE_QUOTE_MASK)
+#define is_url_unsafe(c) (GET_QUOTE_TYPE(c) & URL_UNSAFE_MASK)
+#define html_quote_char(c) HTML_QUOTE_MAP[(int)is_html_quote(c)]
+
extern clen_t strtoclen(const char *s);
extern char *conv_entity(int ch);
extern int getescapechar(char **s);
@@ -40,15 +55,14 @@ extern int strcasemstr(char *str, char *srch[], char **ret_ptr);
extern char *remove_space(char *str);
extern int non_null(char *s);
extern void cleanup_line(Str s, int mode);
-extern char *html_quote_char(char c);
extern char *html_quote(char *str);
extern char *html_unquote(char *str);
extern char *file_quote(char *str);
extern char *file_unquote(char *str);
extern char *url_quote(char *str);
-extern Str Str_url_unquote(Str x, int is_form);
+extern Str Str_url_unquote(Str x, int is_form, int safe);
extern Str Str_form_quote(Str x);
-#define Str_form_unquote(x) Str_url_unquote((x), TRUE)
+#define Str_form_unquote(x) Str_url_unquote((x), TRUE, FALSE)
extern char *shell_quote(char *str);
extern char *w3m_auxbin_dir();