1 /* $Id: fm.h,v 1.138 2007/05/30 04:47:24 inu Exp $ */
3 * w3m: WWW wo Miru utility
7 * You can use,copy,modify and distribute this program without any permission.
15 #define _GNU_SOURCE /* strcasestr() */
22 #include <sys/types.h>
46 typedef int wc_ces; /* XXX: not used */
53 #define setlocale(category, locale) /* empty */
58 #define _(String) gettext (String)
59 #define N_(String) (String)
61 # undef bindtextdomain
62 # define bindtextdomain(Domain, Directory) /* empty */
64 # define textdomain(Domain) /* empty */
66 # define N_(Text) Text
67 # define gettext(Text) Text
73 #include "parsetagx.h"
77 #include "funcname1.h"
81 void bcopy(const void *, void *, int);
82 void bzero(void *, int);
83 #endif /* HAVE_BCOPY */
85 #include <strings.h> /* for bzero() and bcopy() */
91 #else /* not MAINPROGRAM */
94 #endif /* not MAINPROGRAM */
96 #define DEFUN(funcname, macroname, docstring) void funcname(void)
101 #define LINELEN 256 /* Initial line length */
102 #define PAGER_MAX_LINE 10000 /* Maximum line kept as pager */
105 #define MAX_IMAGE 1000
106 #define MAX_IMAGE_SIZE 2048
108 #define DEFAULT_PIXEL_PER_CHAR 7.0 /* arbitrary */
109 #define DEFAULT_PIXEL_PER_LINE 14.0 /* arbitrary */
111 #define DEFAULT_PIXEL_PER_CHAR 8.0 /* arbitrary */
113 #define MINIMUM_PIXEL_PER_CHAR 4.0
114 #define MAXIMUM_PIXEL_PER_CHAR 32.0
127 #define SHELLBUFFERNAME "*Shellout*"
128 #define PIPEBUFFERNAME "*stream*"
129 #define CPIPEBUFFERNAME "*stream(closed)*"
131 #define DICTBUFFERNAME "*dictionary*"
132 #endif /* USE_DICT */
138 #define P_CHARTYPE 0x3f00
140 #define PC_ASCII (WTF_TYPE_ASCII << 8)
141 #define PC_CTRL (WTF_TYPE_CTRL << 8)
142 #define PC_WCHAR1 (WTF_TYPE_WCHAR1 << 8)
143 #define PC_WCHAR2 (WTF_TYPE_WCHAR2 << 8)
144 #define PC_KANJI (WTF_TYPE_WIDE << 8)
145 #define PC_KANJI1 (PC_WCHAR1 | PC_KANJI)
146 #define PC_KANJI2 (PC_WCHAR2 | PC_KANJI)
147 #define PC_UNKNOWN (WTF_TYPE_UNKNOWN << 8)
148 #define PC_UNDEF (WTF_TYPE_UNDEF << 8)
150 #define PC_ASCII 0x0000
151 #define PC_CTRL 0x0100
153 #define PC_SYMBOL 0x8000
155 /* Effect ( standout/underline ) */
156 #define P_EFFECT 0x40ff
157 #define PE_NORMAL 0x00
159 #define PE_UNDER 0x02
160 #define PE_STAND 0x04
162 #define PE_ANCHOR 0x10
164 #define PE_IMAGE 0x20
166 #define PE_ACTIVE 0x80
167 #define PE_VISITED 0x4000
170 #define PE_EX_ITALIC 0x01
171 #define PE_EX_INSERT 0x02
172 #define PE_EX_STRIKE 0x04
174 #define PE_EX_ITALIC_E PE_UNDER
175 #define PE_EX_INSERT_E PE_UNDER
176 #define PE_EX_STRIKE_E PE_STAND
178 #define CharType(c) ((c)&P_CHARTYPE)
179 #define CharEffect(c) ((c)&(P_EFFECT|PC_SYMBOL))
180 #define SetCharType(v,c) ((v)=(((v)&~P_CHARTYPE)|(c)))
183 #define COLPOS(l,c) calcPosition(l->lineBuf,l->propBuf,l->len,c,0,CP_AUTO)
185 /* Flags for displayBuffer() */
187 #define B_FORCE_REDRAW 1
190 #define B_REDRAW_IMAGE 4
192 /* Buffer Property */
193 #define BP_NORMAL 0x0
196 #define BP_INTERNAL 0x8
197 #define BP_NO_URL 0x10
198 #define BP_REDIRECTED 0x20
199 #define BP_CLOSE 0x40
203 #define LB_FRAME 0 /* rFrame() */
205 #define LB_INFO 2 /* pginfo() */
207 #define LB_SOURCE 4 /* vwSrc() */
208 #define LB_N_SOURCE LB_SOURCE
213 #define SR_NOTFOUND 0x2
214 #define SR_WRAPPED 0x4
217 int REV_LB[MAX_LB] = {
218 LB_N_FRAME, LB_FRAME, LB_N_INFO, LB_INFO, LB_N_SOURCE,
220 #else /* not MAINPROGRAM */
222 #endif /* not MAINPROGRAM */
224 /* mark URL, Message-ID */
228 /* Flags for calcPosition() */
232 /* Completion status. */
238 #define CPL_NEVER 0x0
241 #define CPL_ALWAYS 0x4
244 /* Flags for inputLine() */
245 #define IN_STRING 0x10
246 #define IN_FILENAME 0x20
247 #define IN_PASSWORD 0x40
248 #define IN_COMMAND 0x80
250 #define IN_CHAR 0x200
252 #define IMG_FLAG_SKIP 1
253 #define IMG_FLAG_AUTO 2
255 #define IMG_FLAG_START 0
256 #define IMG_FLAG_STOP 1
257 #define IMG_FLAG_NEXT 2
259 #define IMG_FLAG_UNLOADED 0
260 #define IMG_FLAG_LOADED 1
261 #define IMG_FLAG_ERROR 2
262 #define IMG_FLAG_DONT_REMOVE 4
268 #define inputLineHist(p,d,f,h) inputLineHistSearch(p,d,f,h,NULL)
269 #define inputLine(p,d,f) inputLineHist(p,d,f,NULL)
270 #define inputStr(p,d) inputLine(p,d,IN_STRING)
271 #define inputStrHist(p,d,h) inputLineHist(p,d,IN_STRING,h)
272 #define inputFilename(p,d) inputLine(p,d,IN_FILENAME)
273 #define inputFilenameHist(p,d,h) inputLineHist(p,d,IN_FILENAME,h)
274 #define inputChar(p) inputLine(p,"",IN_CHAR)
276 #define free(x) GC_free(x) /* let GC do it. */
279 #define HAVE_STRCASECMP
280 #define strcasecmp stricmp
281 #define strncasecmp strnicmp
285 #define SKIP_BLANKS(p) {while(*(p)&&IS_SPACE(*(p)))(p)++;}
286 #define SKIP_NON_BLANKS(p) {while(*(p)&&!IS_SPACE(*(p)))(p)++;}
287 #define IS_ENDL(c) ((c)=='\0'||(c)=='\r'||(c)=='\n')
288 #define IS_ENDT(c) (IS_ENDL(c)||(c)==';')
291 (((a).line - (b).line) ? ((a).line - (b).line) : ((a).pos - (b).pos))
293 #define RELATIVE_WIDTH(w) (((w)>=0)?(int)((w)/pixel_per_char):(w))
294 #define REAL_WIDTH(w,limit) (((w)>=0)?(int)((w)/pixel_per_char):-(w)*(limit)/100)
296 #define EOL(l) (&(l)->ptr[(l)->length])
297 #define IS_EOL(p,l) ((p)==&(l)->ptr[(l)->length])
303 typedef unsigned short Lineprop;
304 #ifdef USE_ANSI_COLOR
305 typedef unsigned char Linecolor;
308 typedef struct _MapArea {
321 typedef struct _MapList {
324 struct _MapList *next;
327 typedef struct _Line {
330 #ifdef USE_ANSI_COLOR
337 long linenumber; /* on buffer */
338 long real_linenumber; /* on file */
339 unsigned short usrflags;
352 typedef struct _imageCache {
364 typedef struct _image {
380 typedef struct _anchor {
385 unsigned char accesskey;
397 #define NO_REFERER ((char*)-1)
399 typedef struct _anchorList {
413 #define LINK_TYPE_NONE 0
414 #define LINK_TYPE_REL 1
415 #define LINK_TYPE_REV 2
416 typedef struct _LinkList {
418 char *title; /* Next, Contents, ... */
419 char *ctype; /* Content-Type */
420 char type; /* Rel, Rev */
421 struct _LinkList *next;
424 typedef struct _Buffer {
431 struct _Buffer *nextBuffer;
432 struct _Buffer *linkBuffer[MAX_LB];
448 InputStream pagerSource;
452 AnchorList *formitem;
456 HmarkerList *hmarklist;
457 HmarkerList *imarklist;
458 ParsedURL currentURL;
463 struct frameset *frameset;
464 struct frameset_queue *frameQ;
469 wc_ces document_charset;
470 wc_uint8 auto_detect;
472 TextList *document_header;
473 FormItemList *form_submit;
476 struct mailcap *mailcap;
477 char *mailcap_source;
481 char *ssl_certificate;
487 struct _BufferPos *undo;
489 struct _AlarmEvent *event;
493 typedef struct _BufferPos {
499 struct _BufferPos *next;
500 struct _BufferPos *prev;
503 typedef struct _TabBuffer {
504 struct _TabBuffer *nextTab;
505 struct _TabBuffer *prevTab;
506 Buffer *currentBuffer;
513 typedef struct _DownloadList {
521 struct _DownloadList *next;
522 struct _DownloadList *prev;
524 #define DOWNLOAD_LIST_TITLE "Download List Panel"
526 #define COPY_BUFROOT(dstbuf, srcbuf) {\
527 (dstbuf)->rootX = (srcbuf)->rootX; \
528 (dstbuf)->rootY = (srcbuf)->rootY; \
529 (dstbuf)->COLS = (srcbuf)->COLS; \
530 (dstbuf)->LINES = (srcbuf)->LINES; \
533 #define COPY_BUFPOSITION(dstbuf, srcbuf) {\
534 (dstbuf)->topLine = (srcbuf)->topLine; \
535 (dstbuf)->currentLine = (srcbuf)->currentLine; \
536 (dstbuf)->pos = (srcbuf)->pos; \
537 (dstbuf)->cursorX = (srcbuf)->cursorX; \
538 (dstbuf)->cursorY = (srcbuf)->cursorY; \
539 (dstbuf)->visualpos = (srcbuf)->visualpos; \
540 (dstbuf)->currentColumn = (srcbuf)->currentColumn; \
542 #define SAVE_BUFPOSITION(sbufp) COPY_BUFPOSITION(sbufp, Currentbuf)
543 #define RESTORE_BUFPOSITION(sbufp) COPY_BUFPOSITION(Currentbuf, sbufp)
544 #define TOP_LINENUMBER(buf) ((buf)->topLine ? (buf)->topLine->linenumber : 1)
545 #define CUR_LINENUMBER(buf) ((buf)->currentLine ? (buf)->currentLine->linenumber : 1)
547 #define NO_BUFFER ((Buffer*)1)
549 #define RB_STACK_SIZE 10
551 #define TAG_STACK_SIZE 10
553 #define FONT_STACK_SIZE 5
555 #define FONTSTAT_SIZE 7
557 #define _INIT_BUFFER_WIDTH (COLS - (showLineNum ? 6 : 1))
558 #define INIT_BUFFER_WIDTH ((_INIT_BUFFER_WIDTH > 0) ? _INIT_BUFFER_WIDTH : 0)
559 #define FOLD_BUFFER_WIDTH (FoldLine ? (INIT_BUFFER_WIDTH + 1) : -1)
568 char fontstat[FONTSTAT_SIZE];
582 long flag_stack[RB_STACK_SIZE];
585 unsigned char end_tag;
590 char fontstat[FONTSTAT_SIZE];
591 char fontstat_stack[FONT_STACK_SIZE][FONTSTAT_SIZE];
595 struct cmdtable *tag_stack[TAG_STACK_SIZE];
601 #define in_bold fontstat[0]
602 #define in_under fontstat[1]
603 #define in_italic fontstat[2]
604 #define in_strike fontstat[3]
605 #define in_ins fontstat[4]
606 #define in_stand fontstat[5]
609 #define RB_SCRIPT 0x02
610 #define RB_STYLE 0x04
611 #define RB_PLAIN 0x08
613 #define RB_CENTER 0x20
614 #define RB_RIGHT 0x40
615 #define RB_ALIGN (RB_LEFT| RB_CENTER | RB_RIGHT)
618 #define RB_PRE_INT 0x200
619 #define RB_IN_DT 0x400
620 #define RB_INTXTA 0x800
621 #define RB_INSELECT 0x1000
622 #define RB_IGNORE_P 0x2000
623 #define RB_TITLE 0x4000
624 #define RB_NFLUSHED 0x8000
625 #define RB_NOFRAMES 0x10000
626 #define RB_INTABLE 0x20000
627 #define RB_PREMODE (RB_PRE | RB_PRE_INT | RB_SCRIPT | RB_STYLE | RB_PLAIN | RB_INTXTA)
628 #define RB_SPECIAL (RB_PRE | RB_PRE_INT | RB_SCRIPT | RB_STYLE | RB_PLAIN | RB_NOBR)
629 #define RB_PLAIN_PRE 0x40000
632 #define RB_FILL 0x80000
633 #endif /* FORMAT_NICE */
634 #define RB_DEL 0x100000
635 #define RB_S 0x200000
637 #define RB_GET_ALIGN(obuf) ((obuf)->flag&RB_ALIGN)
638 #define RB_SET_ALIGN(obuf,align) {(obuf)->flag &= ~RB_ALIGN; (obuf)->flag |= (align); }
639 #define RB_SAVE_FLAG(obuf) {\
640 if ((obuf)->flag_sp < RB_STACK_SIZE) \
641 (obuf)->flag_stack[(obuf)->flag_sp++] = RB_GET_ALIGN(obuf); \
643 #define RB_RESTORE_FLAG(obuf) {\
644 if ((obuf)->flag_sp > 0) \
645 RB_SET_ALIGN(obuf,(obuf)->flag_stack[--(obuf)->flag_sp]); \
649 #define R_ST_NORMAL 0 /* normal */
650 #define R_ST_TAG0 1 /* within tag, just after < */
651 #define R_ST_TAG 2 /* within tag */
652 #define R_ST_QUOTE 3 /* within single quote */
653 #define R_ST_DQUOTE 4 /* within double quote */
654 #define R_ST_EQL 5 /* = */
655 #define R_ST_AMP 6 /* within ampersand quote */
656 #define R_ST_EOL 7 /* end of file */
657 #define R_ST_CMNT1 8 /* <! */
658 #define R_ST_CMNT2 9 /* <!- */
659 #define R_ST_CMNT 10 /* within comment */
660 #define R_ST_NCMNT1 11 /* comment - */
661 #define R_ST_NCMNT2 12 /* comment -- */
662 #define R_ST_NCMNT3 13 /* comment -- space */
663 #define R_ST_IRRTAG 14 /* within irregular tag */
664 #define R_ST_VALUE 15 /* within tag attribule value */
666 #define ST_IS_REAL_TAG(s) ((s)==R_ST_TAG||(s)==R_ST_TAG0||(s)==R_ST_EQL||(s)==R_ST_VALUE)
668 /* is this '<' really means the beginning of a tag? */
669 #define REALLY_THE_BEGINNING_OF_A_TAG(p) \
670 (IS_ALPHA(p[1]) || p[1] == '/' || p[1] == '!' || p[1] == '?' || p[1] == '\0' || p[1] == '_')
672 /* flags for loadGeneralFile */
675 #define RG_FRAME_SRC 4
677 struct html_feed_environ {
678 struct readbuffer *obuf;
684 struct environment *envs;
695 struct portlist *next;
707 struct portlist *portl;
716 #define COO_DISCARD 16
717 #define COO_OVERRIDE 32 /* user chose to override security checks */
719 #define COO_OVERRIDE_OK 32 /* flag to specify that an error is overridable */
720 /* version 0 refers to the original cookie_spec.html */
721 /* version 1 refers to RFC 2109 */
722 /* version 1' refers to the Internet draft to obsolete RFC 2109 */
723 #define COO_EINTERNAL (1) /* unknown error; probably forgot to convert "return 1" in cookie.c */
724 #define COO_ETAIL (2 | COO_OVERRIDE_OK) /* tail match failed (version 0) */
725 #define COO_ESPECIAL (3) /* special domain check failed (version 0) */
726 #define COO_EPATH (4) /* Path attribute mismatch (version 1 case 1) */
727 #define COO_ENODOT (5 | COO_OVERRIDE_OK) /* no embedded dots in Domain (version 1 case 2.1) */
728 #define COO_ENOTV1DOM (6 | COO_OVERRIDE_OK) /* Domain does not start with a dot (version 1 case 2.2) */
729 #define COO_EDOM (7 | COO_OVERRIDE_OK) /* domain-match failed (version 1 case 3) */
730 #define COO_EBADHOST (8 | COO_OVERRIDE_OK) /* dot in matched host name in FQDN (version 1 case 4) */
731 #define COO_EPORT (9) /* Port match failed (version 1' case 5) */
732 #define COO_EMAX COO_EPORT
733 #endif /* USE_COOKIE */
735 /* modes for align() */
737 #define ALIGN_CENTER 0
739 #define ALIGN_RIGHT 2
740 #define ALIGN_MIDDLE 4
742 #define ALIGN_BOTTOM 6
744 #define VALIGN_MIDDLE 0
746 #define VALIGN_BOTTOM 2
748 typedef struct http_request {
755 #define HR_COMMAND_GET 0
756 #define HR_COMMAND_POST 1
757 #define HR_COMMAND_CONNECT 2
758 #define HR_COMMAND_HEAD 3
760 #define HR_FLAG_LOCAL 1
761 #define HR_FLAG_PROXY 2
763 #define HTST_UNKNOWN 255
764 #define HTST_MISSING 254
765 #define HTST_NORMAL 0
766 #define HTST_CONNECT 1
772 #define TMPF_COOKIE 4
773 #define MAX_TMPF_TYPE 5
775 #define set_no_proxy(domains) (NO_proxy_domains=make_domain_list(domains))
781 extern int LINES, COLS;
782 #if defined(__CYGWIN__)
784 #else /* not defined(__CYGWIN__) */
785 #define LASTLINE (LINES-1)
786 #endif /* not defined(__CYGWIN__) */
788 global int Tabstop init(8);
789 global int IndentIncr init(4);
790 global int ShowEffect init(TRUE);
791 global int PagerMax init(PAGER_MAX_LINE);
793 global char SearchHeader init(FALSE);
794 global char *DefaultType init(NULL);
795 global char RenderFrame init(FALSE);
796 global char TargetSelf init(FALSE);
797 global char PermitSaveToPipe init(FALSE);
798 global char DecodeCTE init(FALSE);
799 global char AutoUncompress init(FALSE);
800 global char PreserveTimestamp init(TRUE);
801 global char ArgvIsURL init(FALSE);
802 global char MetaRefresh init(FALSE);
804 global char fmInitialized init(FALSE);
805 global char QuietMessage init(FALSE);
806 global char TrapSignal init(TRUE);
807 #define TRAP_ON if (TrapSignal) { \
808 prevtrap = mySignal(SIGINT, KeyAbort); \
812 #define TRAP_OFF if (TrapSignal) { \
816 mySignal(SIGINT, prevtrap); \
819 extern unsigned char GlobalKeymap[];
820 extern unsigned char EscKeymap[];
821 extern unsigned char EscBKeymap[];
822 extern unsigned char EscDKeymap[];
824 extern unsigned char PcKeymap[];
826 extern FuncList w3mFuncList[];
828 global char *HTTP_proxy init(NULL);
830 global char *HTTPS_proxy init(NULL);
833 global char *GOPHER_proxy init(NULL);
834 #endif /* USE_GOPHER */
835 global char *FTP_proxy init(NULL);
836 global ParsedURL HTTP_proxy_parsed;
838 global ParsedURL HTTPS_proxy_parsed;
841 global ParsedURL GOPHER_proxy_parsed;
842 #endif /* USE_GOPHER */
843 global ParsedURL FTP_proxy_parsed;
844 global char *NO_proxy init(NULL);
845 global int NOproxy_netaddr init(TRUE);
847 #define DNS_ORDER_UNSPEC 0
848 #define DNS_ORDER_INET_INET6 1
849 #define DNS_ORDER_INET6_INET 2
850 #define DNS_ORDER_INET_ONLY 4
851 #define DNS_ORDER_INET6_ONLY 6
852 global int DNS_order init(DNS_ORDER_UNSPEC);
853 extern int ai_family_order_table[7][3]; /* XXX */
855 global TextList *NO_proxy_domains;
856 global char NoCache init(FALSE);
857 global char use_proxy init(TRUE);
858 #define Do_not_use_proxy (!use_proxy)
859 global int Do_not_use_ti_te init(FALSE);
861 global char *NNTP_server init(NULL);
862 global char *NNTP_mode init(NULL);
863 global int MaxNewsMessage init(50);
866 global char *document_root init(NULL);
867 global char *personal_document_root init(NULL);
868 global char *cgi_bin init(NULL);
869 global char *index_file init(NULL);
871 global char *CurrentDir;
872 global int CurrentPid;
874 * global Buffer *Currentbuf;
875 * global Buffer *Firstbuf;
877 global TabBuffer *CurrentTab;
878 global TabBuffer *FirstTab;
879 global TabBuffer *LastTab;
880 global int open_tab_blank init(FALSE);
881 global int open_tab_dl_list init(FALSE);
882 global int close_tab_back init(FALSE);
884 global int TabCols init(10);
885 #define NO_TABBUFFER ((TabBuffer *)1)
886 #define Currentbuf (CurrentTab->currentBuffer)
887 #define Firstbuf (CurrentTab->firstBuffer)
888 global DownloadList *FirstDL init(NULL);
889 global DownloadList *LastDL init(NULL);
890 global int CurrentKey;
891 global char *CurrentKeyData;
892 global char *CurrentCmdData;
893 global char *w3m_reqlog;
894 extern char *w3m_version;
896 #define DUMP_BUFFER 0x01
897 #define DUMP_HEAD 0x02
898 #define DUMP_SOURCE 0x04
899 #define DUMP_EXTRA 0x08
900 #define DUMP_HALFDUMP 0x10
901 #define DUMP_FRAME 0x20
902 global int w3m_debug;
903 global int w3m_dump init(0);
904 #define w3m_halfdump (w3m_dump & DUMP_HALFDUMP)
905 global int w3m_halfload init(FALSE);
906 global Str header_string init(NULL);
907 global int override_content_type init(FALSE);
910 global int useColor init(TRUE);
911 global int basic_color init(8); /* don't change */
912 global int anchor_color init(4); /* blue */
913 global int image_color init(2); /* green */
914 global int form_color init(1); /* red */
916 global int bg_color init(8); /* don't change */
917 global int mark_color init(6); /* cyan */
918 #endif /* USE_BG_COLOR */
919 global int useActiveColor init(FALSE);
920 global int active_color init(6); /* cyan */
921 global int useVisitedColor init(FALSE);
922 global int visited_color init(5); /* magenta */
923 #endif /* USE_COLOR */
924 global int confirm_on_quit init(TRUE);
926 global int use_mark init(FALSE);
928 global int emacs_like_lineedit init(FALSE);
929 global int vi_prec_num init(FALSE);
930 global int label_topline init(FALSE);
931 global int nextpage_topline init(FALSE);
932 global char *displayTitleTerm init(NULL);
933 global int displayLink init(FALSE);
934 global int displayLineInfo init(FALSE);
935 global int DecodeURL init(FALSE);
936 global int retryAsHttp init(TRUE);
937 global int showLineNum init(FALSE);
938 global int show_srch_str init(TRUE);
940 global char *Imgdisplay init(IMGDISPLAY);
941 global int activeImage init(FALSE);
942 global int displayImage init(TRUE);
943 global int autoImage init(TRUE);
944 global int useExtImageViewer init(TRUE);
945 global int maxLoadImage init(4);
946 global int image_map_list init(TRUE);
948 global int displayImage init(FALSE); /* XXX: emacs-w3m use display_image=off */
950 global char *Editor init(DEF_EDITOR);
952 global char *Mailer init(NULL);
954 global char *Mailer init(DEF_MAILER);
956 global char *ExtBrowser init(DEF_EXT_BROWSER);
957 global char *ExtBrowser2 init(NULL);
958 global char *ExtBrowser3 init(NULL);
959 global int BackgroundExtViewer init(TRUE);
960 global int disable_secret_security_check init(FALSE);
961 global char *passwd_file init(PASSWD_FILE);
962 global char *pre_form_file init(PRE_FORM_FILE);
963 global char *ftppasswd init(NULL);
964 global int ftppass_hostnamegen init(TRUE);
965 global int do_download init(FALSE);
967 global char *image_source init(NULL);
969 global char *UserAgent init(NULL);
970 global int NoSendReferer init(FALSE);
971 global char *AcceptLang init(NULL);
972 global char *AcceptEncoding init(NULL);
973 global char *AcceptMedia init(NULL);
974 global int WrapDefault init(FALSE);
975 global int IgnoreCase init(TRUE);
976 global int WrapSearch init(FALSE);
977 global int squeezeBlankLine init(FALSE);
978 global char *BookmarkFile init(NULL);
979 global char *pauth init(NULL);
980 global Str proxy_auth_cookie init(NULL);
981 global int UseExternalDirBuffer init(TRUE);
982 global char *DirBufferCommand init("file:///$LIB/dirlist" CGI_EXTENSION);
984 global int UseDictCommand init(FALSE);
985 global char *DictCommand init("file:///$LIB/w3mdict" CGI_EXTENSION);
986 #endif /* USE_DICT */
987 global int ignore_null_img_alt init(TRUE);
988 #define DISPLAY_INS_DEL_SIMPLE 0
989 #define DISPLAY_INS_DEL_NORMAL 1
990 #define DISPLAY_INS_DEL_FONTIFY 2
991 global int displayInsDel init(DISPLAY_INS_DEL_NORMAL);
992 global int FoldTextarea init(FALSE);
993 global int FoldLine init(FALSE);
994 #define DEFAULT_URL_EMPTY 0
995 #define DEFAULT_URL_CURRENT 1
996 #define DEFAULT_URL_LINK 2
997 global int DefaultURLString init(DEFAULT_URL_EMPTY);
998 global int MarkAllPages init(FALSE);
1001 global int use_migemo init(FALSE);
1002 global int migemo_active init(0);
1003 global char *migemo_command init(DEF_MIGEMO_COMMAND);
1004 #endif /* USE_MIGEMO */
1006 global struct auth_cookie *Auth_cookie init(NULL);
1008 global struct cookie *First_cookie init(NULL);
1009 #endif /* USE_COOKIE */
1011 global char *mailcap_files init(USER_MAILCAP ", " SYS_MAILCAP);
1012 global char *mimetypes_files init(USER_MIMETYPES ", " SYS_MIMETYPES);
1013 #ifdef USE_EXTERNAL_URI_LOADER
1014 global char *urimethodmap_files init(USER_URIMETHODMAP ", " SYS_URIMETHODMAP);
1017 global TextList *fileToDelete;
1019 extern Hist *LoadHist;
1020 extern Hist *SaveHist;
1021 extern Hist *URLHist;
1022 extern Hist *ShellHist;
1023 extern Hist *TextHist;
1025 global int UseHistory init(TRUE);
1026 global int URLHistSize init(100);
1027 global int SaveURLHist init(TRUE);
1028 #endif /* USE_HISTORY */
1029 global int multicolList init(FALSE);
1032 global wc_ces InnerCharset init(WC_CES_WTF); /* Don't change */
1033 global wc_ces DisplayCharset init(DISPLAY_CHARSET);
1034 global wc_ces DocumentCharset init(DOCUMENT_CHARSET);
1035 global wc_ces SystemCharset init(SYSTEM_CHARSET);
1036 global wc_ces BookmarkCharset init(SYSTEM_CHARSET);
1037 global char ExtHalfdump init(FALSE);
1038 global char FollowLocale init(TRUE);
1039 global char UseContentCharset init(TRUE);
1040 global char SearchConv init(TRUE);
1041 #define Str_conv_from_system(x) wc_Str_conv((x), SystemCharset, InnerCharset)
1042 #define Str_conv_to_system(x) wc_Str_conv_strict((x), InnerCharset, SystemCharset)
1043 #define Str_conv_to_halfdump(x) (ExtHalfdump ? wc_Str_conv((x), InnerCharset, DisplayCharset) : (x))
1044 #define conv_from_system(x) wc_conv((x), SystemCharset, InnerCharset)->ptr
1045 #define conv_to_system(x) wc_conv_strict((x), InnerCharset, SystemCharset)->ptr
1046 #define url_quote_conv(x,c) url_quote(wc_conv_strict((x), InnerCharset, (c))->ptr)
1048 #define Str_conv_from_system(x) (x)
1049 #define Str_conv_to_system(x) (x)
1050 #define Str_conv_to_halfdump(x) (x)
1051 #define conv_from_system(x) (x)
1052 #define conv_to_system(x) (x)
1053 #define url_quote_conv(x,c) url_quote(x)
1054 #define wc_Str_conv(x,charset0,charset1) (x)
1055 #define wc_Str_conv_strict(x,charset0,charset1) (x)
1057 global char UseAltEntity init(TRUE);
1058 global char UseGraphicChar init(FALSE);
1059 extern char *graph_symbol[];
1060 extern char *graph2_symbol[];
1061 extern int symbol_width;
1062 extern int symbol_width0;
1063 #define N_GRAPH_SYMBOL 32
1064 #define SYMBOL_BASE 0x20
1065 global int no_rc_dir init(FALSE);
1066 global char *rc_dir init(NULL);
1067 global char *tmp_dir;
1068 global char *config_file init(NULL);
1071 global int use_mouse init(TRUE);
1072 extern int mouseActive;
1073 global int reverse_mouse init(FALSE);
1074 global int relative_wheel_scroll init(FALSE);
1075 global int fixed_wheel_scroll_count init(5);
1076 global int relative_wheel_scroll_ratio init(30);
1077 typedef struct _MouseActionMap {
1081 typedef struct _MouseAction {
1089 MouseActionMap default_map[3];
1090 MouseActionMap anchor_map[3];
1091 MouseActionMap active_map[3];
1092 MouseActionMap tab_map[3];
1093 MouseActionMap *menu_map[3];
1094 MouseActionMap *lastline_map[3];
1096 global MouseAction mouse_action;
1097 #define LIMIT_MOUSE_MENU 100
1098 #endif /* USE_MOUSE */
1101 global int default_use_cookie init(TRUE);
1102 global int use_cookie init(FALSE);
1103 global int show_cookie init(TRUE);
1104 global int accept_cookie init(FALSE);
1105 #define ACCEPT_BAD_COOKIE_DISCARD 0
1106 #define ACCEPT_BAD_COOKIE_ACCEPT 1
1107 #define ACCEPT_BAD_COOKIE_ASK 2
1108 global int accept_bad_cookie init(ACCEPT_BAD_COOKIE_DISCARD);
1109 global char *cookie_reject_domains init(NULL);
1110 global char *cookie_accept_domains init(NULL);
1111 global TextList *Cookie_reject_domains;
1112 global TextList *Cookie_accept_domains;
1113 #endif /* USE_COOKIE */
1116 global int view_unseenobject init(FALSE);
1118 global int view_unseenobject init(TRUE);
1121 #if defined(USE_SSL) && defined(USE_SSL_VERIFY)
1122 global int ssl_verify_server init(FALSE);
1123 global char *ssl_cert_file init(NULL);
1124 global char *ssl_key_file init(NULL);
1125 global char *ssl_ca_path init(NULL);
1126 global char *ssl_ca_file init(NULL);
1127 global int ssl_path_modified init(FALSE);
1128 #endif /* defined(USE_SSL) &&
1129 * defined(USE_SSL_VERIFY) */
1131 global char *ssl_forbid_method init(NULL);
1134 global int is_redisplay init(FALSE);
1135 global int clear_buffer init(TRUE);
1136 global double pixel_per_char init(DEFAULT_PIXEL_PER_CHAR);
1137 global int set_pixel_per_char init(FALSE);
1139 global double pixel_per_line init(DEFAULT_PIXEL_PER_LINE);
1140 global int set_pixel_per_line init(FALSE);
1141 global double image_scale init(100);
1143 global int use_lessopen init(FALSE);
1145 global char *keymap_file init(KEYMAP_FILE);
1148 #define get_mctype(c) ((Lineprop)wtf_type((wc_uchar *)(c)) << 8)
1149 #define get_mclen(c) wtf_len1((wc_uchar *)(c))
1150 #define get_mcwidth(c) wtf_width((wc_uchar *)(c))
1151 #define get_strwidth(c) wtf_strwidth((wc_uchar *)(c))
1152 #define get_Str_strwidth(c) wtf_strwidth((wc_uchar *)((c)->ptr))
1154 #define get_mctype(c) (IS_CNTRL(*(c)) ? PC_CTRL : PC_ASCII)
1155 #define get_mclen(c) 1
1156 #define get_mcwidth(c) 1
1157 #define get_strwidth(c) strlen(c)
1158 #define get_Str_strwidth(c) ((c)->length)
1161 global int FollowRedirection init(10);
1163 global int w3m_backend init(FALSE);
1164 global TextLineList *backend_halfdump_buf;
1165 global TextList *backend_batch_commands init(NULL);
1167 extern void deleteFiles(void);
1168 void w3m_exit(int i);
1172 #define AL_EXPLICIT 1
1173 #define AL_IMPLICIT 2
1174 #define AL_IMPLICIT_ONCE 3
1176 typedef struct _AlarmEvent {
1191 #endif /* not FM_H */