~ubuntu-branches/ubuntu/utopic/w3m/utopic

« back to all changes in this revision

Viewing changes to .pc/240_win64gc.patch/fm.h

  • Committer: Package Import Robot
  • Author(s): Tatsuya Kinoshita
  • Date: 2013-12-17 19:57:42 UTC
  • mfrom: (3.1.24 sid)
  • Revision ID: package-import@ubuntu.com-20131217195742-2mdqsjidjuwj3xz5
Tags: 0.5.3-13
* New patch 240_win64gc.patch for GC on Cygwin64
* New patch 250_schemebug.patch to fix scheme bug (closes: #650747)
* New patch 260_openssl.patch from openSUSE for OpenSSL issues
* New patch 270_refresh-url.patch to accept single quoted URL
* New patch 280_search-next.patch to fix crash after SEARCH_NEXT
* New patch 290_closedir.patch to fix a directory descriptor leak
* Update 230_cygwin-lang.patch to really fix
* Update 090_parallel-make.patch to fix scripts and w3mimg (closes: #726188)
* Update 040_link_gcc45.patch to 040_link-gtk2.patch
* Update 050_autotools-config.patch with autotools-dev 20130810.1
* Drop 050_autotools-config.patch (comment out)
* Update 900_ChangeLog.patch
* Update 015_debian-version.patch to 0.5.3+debian-13
* Use LFS_CFLAGS to support large file (closes: #493956)
* Use autotools-dev dh addon again (closes: #732086)
* Update gitlog2changelog to fix paren handling
* debian/rules: builddir fixes
* Use dpkg-maintscript-helper to remove obsolete conffile
* Update Standards-Version to 3.9.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: fm.h,v 1.149 2010/08/20 09:47:09 htrb Exp $ */
 
2
/* 
 
3
 * w3m: WWW wo Miru utility
 
4
 * 
 
5
 * by A.ITO  Feb. 1995
 
6
 * 
 
7
 * You can use,copy,modify and distribute this program without any permission.
 
8
 */
 
9
 
 
10
#ifndef FM_H
 
11
#define FM_H
 
12
 
 
13
 
 
14
#ifndef _GNU_SOURCE
 
15
#define _GNU_SOURCE             /* strcasestr() */
 
16
#endif
 
17
 
 
18
#include <stdio.h>
 
19
#include <stdlib.h>
 
20
#include <string.h>
 
21
#include <unistd.h>
 
22
#include <sys/types.h>
 
23
#include <sys/stat.h>
 
24
#include <unistd.h>
 
25
#include "config.h"
 
26
#include "history.h"
 
27
 
 
28
#ifdef USE_MENU
 
29
#define MENU_SELECT
 
30
#define MENU_MAP
 
31
#endif                          /* USE_MENU */
 
32
 
 
33
#ifndef USE_COLOR
 
34
#undef USE_ANSI_COLOR
 
35
#undef USE_BG_COLOR
 
36
#endif
 
37
 
 
38
#include "ctrlcode.h"
 
39
#include "html.h"
 
40
#include <gc.h>
 
41
#include "Str.h"
 
42
#ifdef USE_M17N
 
43
#include "wc.h"
 
44
#include "wtf.h"
 
45
#else
 
46
typedef int wc_ces;     /* XXX: not used */
 
47
#endif
 
48
 
 
49
#ifdef HAVE_LOCALE_H
 
50
#include <locale.h>
 
51
#endif
 
52
#if !HAVE_SETLOCALE
 
53
#define setlocale(category, locale)     /* empty */
 
54
#endif
 
55
 
 
56
#ifdef ENABLE_NLS
 
57
#include <libintl.h>
 
58
#define _(String) gettext (String)
 
59
#define N_(String) (String)
 
60
#else
 
61
# undef bindtextdomain
 
62
# define bindtextdomain(Domain, Directory)      /* empty */
 
63
# undef textdomain
 
64
# define textdomain(Domain)     /* empty */
 
65
# define _(Text) Text
 
66
# define N_(Text) Text
 
67
# define gettext(Text) Text
 
68
#endif
 
69
 
 
70
#include "form.h"
 
71
#include "frame.h"
 
72
#include "parsetag.h"
 
73
#include "parsetagx.h"
 
74
#include "func.h"
 
75
#include "menu.h"
 
76
#include "textlist.h"
 
77
#include "funcname1.h"
 
78
#include "terms.h"
 
79
 
 
80
#ifndef HAVE_BCOPY
 
81
void bcopy(const void *, void *, int);
 
82
void bzero(void *, int);
 
83
#endif                          /* HAVE_BCOPY */
 
84
#ifdef __EMX__
 
85
#include <strings.h>            /* for bzero() and bcopy() */
 
86
#endif
 
87
 
 
88
#ifdef MAINPROGRAM
 
89
#define global
 
90
#define init(x) =(x)
 
91
#else                           /* not MAINPROGRAM */
 
92
#define global extern
 
93
#define init(x)
 
94
#endif                          /* not MAINPROGRAM */
 
95
 
 
96
#define DEFUN(funcname, macroname, docstring) void funcname(void)
 
97
 
 
98
/* 
 
99
 * Constants.
 
100
 */
 
101
#define LINELEN 256             /* Initial line length */
 
102
#define PAGER_MAX_LINE  10000   /* Maximum line kept as pager */
 
103
 
 
104
#define MAXIMUM_COLS 1024
 
105
#define DEFAULT_COLS 80
 
106
 
 
107
#ifdef USE_IMAGE
 
108
#define MAX_IMAGE 1000
 
109
#define MAX_IMAGE_SIZE 2048
 
110
 
 
111
#define DEFAULT_PIXEL_PER_CHAR  7.0     /* arbitrary */
 
112
#define DEFAULT_PIXEL_PER_LINE  14.0    /* arbitrary */
 
113
#else
 
114
#define DEFAULT_PIXEL_PER_CHAR  8.0     /* arbitrary */
 
115
#endif
 
116
#define MINIMUM_PIXEL_PER_CHAR  4.0
 
117
#define MAXIMUM_PIXEL_PER_CHAR  32.0
 
118
 
 
119
#ifdef FALSE
 
120
#undef FALSE
 
121
#endif
 
122
 
 
123
#ifdef TRUE
 
124
#undef TRUE
 
125
#endif
 
126
 
 
127
#define FALSE 0
 
128
#define TRUE   1
 
129
 
 
130
#define SHELLBUFFERNAME "*Shellout*"
 
131
#define PIPEBUFFERNAME  "*stream*"
 
132
#define CPIPEBUFFERNAME "*stream(closed)*"
 
133
#ifdef USE_DICT
 
134
#define DICTBUFFERNAME "*dictionary*"
 
135
#endif                          /* USE_DICT */
 
136
 
 
137
/* 
 
138
 * Line Property
 
139
 */
 
140
 
 
141
#define P_CHARTYPE      0x3f00
 
142
#ifdef USE_M17N
 
143
#define PC_ASCII        (WTF_TYPE_ASCII << 8)
 
144
#define PC_CTRL         (WTF_TYPE_CTRL << 8)
 
145
#define PC_WCHAR1       (WTF_TYPE_WCHAR1 << 8)
 
146
#define PC_WCHAR2       (WTF_TYPE_WCHAR2 << 8)
 
147
#define PC_KANJI        (WTF_TYPE_WIDE << 8)
 
148
#define PC_KANJI1       (PC_WCHAR1 | PC_KANJI)
 
149
#define PC_KANJI2       (PC_WCHAR2 | PC_KANJI)
 
150
#define PC_UNKNOWN      (WTF_TYPE_UNKNOWN << 8)
 
151
#define PC_UNDEF        (WTF_TYPE_UNDEF << 8)
 
152
#else
 
153
#define PC_ASCII        0x0000
 
154
#define PC_CTRL         0x0100
 
155
#endif
 
156
#define PC_SYMBOL       0x8000
 
157
 
 
158
/* Effect ( standout/underline ) */
 
159
#define P_EFFECT        0x40ff
 
160
#define PE_NORMAL       0x00
 
161
#define PE_MARK         0x01
 
162
#define PE_UNDER        0x02
 
163
#define PE_STAND        0x04
 
164
#define PE_BOLD         0x08
 
165
#define PE_ANCHOR       0x10
 
166
#define PE_EMPH         0x08
 
167
#define PE_IMAGE        0x20
 
168
#define PE_FORM         0x40
 
169
#define PE_ACTIVE       0x80
 
170
#define PE_VISITED      0x4000
 
171
 
 
172
/* Extra effect */
 
173
#define PE_EX_ITALIC    0x01
 
174
#define PE_EX_INSERT    0x02
 
175
#define PE_EX_STRIKE    0x04
 
176
 
 
177
#define PE_EX_ITALIC_E  PE_UNDER
 
178
#define PE_EX_INSERT_E  PE_UNDER
 
179
#define PE_EX_STRIKE_E  PE_STAND
 
180
 
 
181
#define CharType(c)     ((c)&P_CHARTYPE)
 
182
#define CharEffect(c)   ((c)&(P_EFFECT|PC_SYMBOL))
 
183
#define SetCharType(v,c)        ((v)=(((v)&~P_CHARTYPE)|(c)))
 
184
 
 
185
 
 
186
#define COLPOS(l,c)     calcPosition(l->lineBuf,l->propBuf,l->len,c,0,CP_AUTO)
 
187
 
 
188
/* Flags for displayBuffer() */
 
189
#define B_NORMAL        0
 
190
#define B_FORCE_REDRAW  1
 
191
#define B_REDRAW        2
 
192
#define B_SCROLL        3
 
193
#define B_REDRAW_IMAGE  4
 
194
 
 
195
/* Buffer Property */
 
196
#define BP_NORMAL       0x0
 
197
#define BP_PIPE         0x1
 
198
#define BP_FRAME        0x2
 
199
#define BP_INTERNAL     0x8
 
200
#define BP_NO_URL       0x10
 
201
#define BP_REDIRECTED   0x20
 
202
#define BP_CLOSE        0x40
 
203
 
 
204
/* Link Buffer */
 
205
#define LB_NOLINK       -1
 
206
#define LB_FRAME        0       /* rFrame() */
 
207
#define LB_N_FRAME      1
 
208
#define LB_INFO         2       /* pginfo() */
 
209
#define LB_N_INFO       3
 
210
#define LB_SOURCE       4       /* vwSrc() */
 
211
#define LB_N_SOURCE     LB_SOURCE
 
212
#define MAX_LB          5
 
213
 
 
214
/* Search Result */
 
215
#define SR_FOUND       0x1
 
216
#define SR_NOTFOUND    0x2
 
217
#define SR_WRAPPED     0x4
 
218
 
 
219
#ifdef MAINPROGRAM
 
220
int REV_LB[MAX_LB] = {
 
221
    LB_N_FRAME, LB_FRAME, LB_N_INFO, LB_INFO, LB_N_SOURCE,
 
222
};
 
223
#else                           /* not MAINPROGRAM */
 
224
extern int REV_LB[];
 
225
#endif                          /* not MAINPROGRAM */
 
226
 
 
227
/* mark URL, Message-ID */
 
228
#define CHK_URL                1
 
229
#define CHK_NMID       2
 
230
 
 
231
/* Flags for calcPosition() */
 
232
#define CP_AUTO         0
 
233
#define CP_FORCE        1
 
234
 
 
235
/* Completion status. */
 
236
#define CPL_OK          0
 
237
#define CPL_AMBIG       1
 
238
#define CPL_FAIL        2
 
239
#define CPL_MENU        3
 
240
 
 
241
#define CPL_NEVER       0x0
 
242
#define CPL_OFF         0x1
 
243
#define CPL_ON          0x2
 
244
#define CPL_ALWAYS      0x4
 
245
#define CPL_URL         0x8
 
246
 
 
247
/* Flags for inputLine() */
 
248
#define IN_STRING       0x10
 
249
#define IN_FILENAME     0x20
 
250
#define IN_PASSWORD     0x40
 
251
#define IN_COMMAND      0x80
 
252
#define IN_URL          0x100
 
253
#define IN_CHAR         0x200
 
254
 
 
255
#define IMG_FLAG_SKIP   1
 
256
#define IMG_FLAG_AUTO   2
 
257
 
 
258
#define IMG_FLAG_START  0
 
259
#define IMG_FLAG_STOP   1
 
260
#define IMG_FLAG_NEXT   2
 
261
 
 
262
#define IMG_FLAG_UNLOADED       0
 
263
#define IMG_FLAG_LOADED         1
 
264
#define IMG_FLAG_ERROR          2
 
265
#define IMG_FLAG_DONT_REMOVE    4
 
266
 
 
267
#define IS_EMPTY_PARSED_URL(pu) ((pu)->scheme == SCM_UNKNOWN && !(pu)->file)
 
268
#define SCONF_RESERVED          0
 
269
#define SCONF_SUBSTITUTE_URL    1
 
270
#define SCONF_URL_CHARSET       2
 
271
#define SCONF_NO_REFERER_FROM   3
 
272
#define SCONF_NO_REFERER_TO     4
 
273
#define SCONF_N_FIELD           5
 
274
#define query_SCONF_SUBSTITUTE_URL(pu) ((const char *)querySiteconf(pu, SCONF_SUBSTITUTE_URL))
 
275
#define query_SCONF_URL_CHARSET(pu) ((const wc_ces *)querySiteconf(pu, SCONF_URL_CHARSET))
 
276
#define query_SCONF_NO_REFERER_FROM(pu) ((const int *)querySiteconf(pu, SCONF_NO_REFERER_FROM))
 
277
#define query_SCONF_NO_REFERER_TO(pu) ((const int *)querySiteconf(pu, SCONF_NO_REFERER_TO))
 
278
 
 
279
/* 
 
280
 * Macros.
 
281
 */
 
282
 
 
283
#define inputLineHist(p,d,f,h)  inputLineHistSearch(p,d,f,h,NULL)
 
284
#define inputLine(p,d,f)        inputLineHist(p,d,f,NULL)
 
285
#define inputStr(p,d)           inputLine(p,d,IN_STRING)
 
286
#define inputStrHist(p,d,h)     inputLineHist(p,d,IN_STRING,h)
 
287
#define inputFilename(p,d)      inputLine(p,d,IN_FILENAME)
 
288
#define inputFilenameHist(p,d,h)        inputLineHist(p,d,IN_FILENAME,h)
 
289
#define inputChar(p)            inputLine(p,"",IN_CHAR)
 
290
 
 
291
#define free(x)  GC_free(x)     /* let GC do it. */
 
292
 
 
293
#ifdef __EMX__
 
294
#define HAVE_STRCASECMP
 
295
#define strcasecmp      stricmp
 
296
#define strncasecmp     strnicmp
 
297
#endif                          /* __EMX__ */
 
298
 
 
299
 
 
300
#define SKIP_BLANKS(p) {while(*(p)&&IS_SPACE(*(p)))(p)++;}
 
301
#define SKIP_NON_BLANKS(p) {while(*(p)&&!IS_SPACE(*(p)))(p)++;}
 
302
#define IS_ENDL(c) ((c)=='\0'||(c)=='\r'||(c)=='\n')
 
303
#define IS_ENDT(c) (IS_ENDL(c)||(c)==';')
 
304
 
 
305
#define bpcmp(a,b) \
 
306
  (((a).line - (b).line) ? ((a).line - (b).line) : ((a).pos - (b).pos))
 
307
 
 
308
#define RELATIVE_WIDTH(w)   (((w)>=0)?(int)((w)/pixel_per_char):(w))
 
309
#define REAL_WIDTH(w,limit) (((w)>=0)?(int)((w)/pixel_per_char):-(w)*(limit)/100)
 
310
 
 
311
#define EOL(l) (&(l)->ptr[(l)->length])
 
312
#define IS_EOL(p,l) ((p)==&(l)->ptr[(l)->length])
 
313
 
 
314
/* 
 
315
 * Types.
 
316
 */
 
317
 
 
318
typedef unsigned short Lineprop;
 
319
#ifdef USE_ANSI_COLOR
 
320
typedef unsigned char Linecolor;
 
321
#endif
 
322
 
 
323
typedef struct _MapArea {
 
324
    char *url;
 
325
    char *target;
 
326
    char *alt;
 
327
#ifdef USE_IMAGE
 
328
    char shape;
 
329
    short *coords;
 
330
    int ncoords;
 
331
    short center_x;
 
332
    short center_y;
 
333
#endif
 
334
} MapArea;
 
335
 
 
336
typedef struct _MapList {
 
337
    Str name;
 
338
    GeneralList *area;
 
339
    struct _MapList *next;
 
340
} MapList;
 
341
 
 
342
typedef struct _Line {
 
343
    char *lineBuf;
 
344
    Lineprop *propBuf;
 
345
#ifdef USE_ANSI_COLOR
 
346
    Linecolor *colorBuf;
 
347
#endif
 
348
    struct _Line *next;
 
349
    struct _Line *prev;
 
350
    int len;
 
351
    int width;
 
352
    long linenumber;            /* on buffer */
 
353
    long real_linenumber;       /* on file */
 
354
    unsigned short usrflags;
 
355
    int size;
 
356
    int bpos;
 
357
    int bwidth;
 
358
} Line;
 
359
 
 
360
typedef struct {
 
361
    int line;
 
362
    int pos;
 
363
    int invalid;
 
364
} BufferPoint;
 
365
 
 
366
#ifdef USE_IMAGE
 
367
typedef struct _imageCache {
 
368
    char *url;
 
369
    ParsedURL *current;
 
370
    char *file;
 
371
    char *touch;
 
372
    pid_t pid;
 
373
    char loaded;
 
374
    int index;
 
375
    short width;
 
376
    short height;
 
377
} ImageCache;
 
378
 
 
379
typedef struct _image {
 
380
    char *url;
 
381
    char *ext;
 
382
    short width;
 
383
    short height;
 
384
    short xoffset;
 
385
    short yoffset;
 
386
    short y;
 
387
    short rows;
 
388
    char *map;
 
389
    char ismap;
 
390
    int touch;
 
391
    ImageCache *cache;
 
392
} Image;
 
393
#endif
 
394
 
 
395
typedef struct _anchor {
 
396
    char *url;
 
397
    char *target;
 
398
    char *referer;
 
399
    char *title;
 
400
    unsigned char accesskey;
 
401
    BufferPoint start;
 
402
    BufferPoint end;
 
403
    int hseq;
 
404
    char slave;
 
405
    short y;
 
406
    short rows;
 
407
#ifdef USE_IMAGE
 
408
    Image *image;
 
409
#endif
 
410
} Anchor;
 
411
 
 
412
#define NO_REFERER ((char*)-1)
 
413
 
 
414
typedef struct _anchorList {
 
415
    Anchor *anchors;
 
416
    int nanchor;
 
417
    int anchormax;
 
418
    int acache;
 
419
} AnchorList;
 
420
 
 
421
typedef struct {
 
422
    BufferPoint *marks;
 
423
    int nmark;
 
424
    int markmax;
 
425
    int prevhseq;
 
426
} HmarkerList;
 
427
 
 
428
#define LINK_TYPE_NONE 0
 
429
#define LINK_TYPE_REL  1
 
430
#define LINK_TYPE_REV  2
 
431
typedef struct _LinkList {
 
432
    char *url;
 
433
    char *title;                /* Next, Contents, ... */
 
434
    char *ctype;                /* Content-Type */
 
435
    char type;                  /* Rel, Rev */
 
436
    struct _LinkList *next;
 
437
} LinkList;
 
438
 
 
439
typedef struct _Buffer {
 
440
    char *filename;
 
441
    char *buffername;
 
442
    Line *firstLine;
 
443
    Line *topLine;
 
444
    Line *currentLine;
 
445
    Line *lastLine;
 
446
    struct _Buffer *nextBuffer;
 
447
    struct _Buffer *linkBuffer[MAX_LB];
 
448
    short width;
 
449
    short height;
 
450
    char *type;
 
451
    char *real_type;
 
452
    int allLine;
 
453
    short bufferprop;
 
454
    int currentColumn;
 
455
    short cursorX;
 
456
    short cursorY;
 
457
    int pos;
 
458
    int visualpos;
 
459
    short rootX;
 
460
    short rootY;
 
461
    short COLS;
 
462
    short LINES;
 
463
    InputStream pagerSource;
 
464
    AnchorList *href;
 
465
    AnchorList *name;
 
466
    AnchorList *img;
 
467
    AnchorList *formitem;
 
468
    LinkList *linklist;
 
469
    FormList *formlist;
 
470
    MapList *maplist;
 
471
    HmarkerList *hmarklist;
 
472
    HmarkerList *imarklist;
 
473
    ParsedURL currentURL;
 
474
    ParsedURL *baseURL;
 
475
    char *baseTarget;
 
476
    int real_scheme;
 
477
    char *sourcefile;
 
478
    struct frameset *frameset;
 
479
    struct frameset_queue *frameQ;
 
480
    int *clone;
 
481
    size_t trbyte;
 
482
    char check_url;
 
483
#ifdef USE_M17N
 
484
    wc_ces document_charset;
 
485
    wc_uint8 auto_detect;
 
486
#endif
 
487
    TextList *document_header;
 
488
    FormItemList *form_submit;
 
489
    char *savecache;
 
490
    char *edit;
 
491
    struct mailcap *mailcap;
 
492
    char *mailcap_source;
 
493
    char *header_source;
 
494
    char search_header;
 
495
#ifdef USE_SSL
 
496
    char *ssl_certificate;
 
497
#endif
 
498
    char image_flag;
 
499
    char image_loaded;
 
500
    char need_reshape;
 
501
    Anchor *submit;
 
502
    struct _BufferPos *undo;
 
503
#ifdef USE_ALARM
 
504
    struct _AlarmEvent *event;
 
505
#endif
 
506
} Buffer;
 
507
 
 
508
typedef struct _BufferPos {
 
509
    long top_linenumber;
 
510
    long cur_linenumber;
 
511
    int currentColumn;
 
512
    int pos;
 
513
    int bpos;
 
514
    struct _BufferPos *next;
 
515
    struct _BufferPos *prev;
 
516
} BufferPos;
 
517
 
 
518
typedef struct _TabBuffer {
 
519
    struct _TabBuffer *nextTab;
 
520
    struct _TabBuffer *prevTab;
 
521
    Buffer *currentBuffer;
 
522
    Buffer *firstBuffer;
 
523
    short x1;
 
524
    short x2;
 
525
    short y;
 
526
} TabBuffer;
 
527
 
 
528
typedef struct _DownloadList {
 
529
    pid_t pid;
 
530
    char *url;
 
531
    char *save;
 
532
    char *lock;
 
533
    clen_t size;
 
534
    time_t time;
 
535
    int running;
 
536
    int err;
 
537
    struct _DownloadList *next;
 
538
    struct _DownloadList *prev;
 
539
} DownloadList;
 
540
#define DOWNLOAD_LIST_TITLE "Download List Panel"
 
541
 
 
542
#define COPY_BUFROOT(dstbuf, srcbuf) {\
 
543
 (dstbuf)->rootX = (srcbuf)->rootX; \
 
544
 (dstbuf)->rootY = (srcbuf)->rootY; \
 
545
 (dstbuf)->COLS = (srcbuf)->COLS; \
 
546
 (dstbuf)->LINES = (srcbuf)->LINES; \
 
547
}
 
548
 
 
549
#define COPY_BUFPOSITION(dstbuf, srcbuf) {\
 
550
 (dstbuf)->topLine = (srcbuf)->topLine; \
 
551
 (dstbuf)->currentLine = (srcbuf)->currentLine; \
 
552
 (dstbuf)->pos = (srcbuf)->pos; \
 
553
 (dstbuf)->cursorX = (srcbuf)->cursorX; \
 
554
 (dstbuf)->cursorY = (srcbuf)->cursorY; \
 
555
 (dstbuf)->visualpos = (srcbuf)->visualpos; \
 
556
 (dstbuf)->currentColumn = (srcbuf)->currentColumn; \
 
557
}
 
558
#define SAVE_BUFPOSITION(sbufp) COPY_BUFPOSITION(sbufp, Currentbuf)
 
559
#define RESTORE_BUFPOSITION(sbufp) COPY_BUFPOSITION(Currentbuf, sbufp)
 
560
#define TOP_LINENUMBER(buf) ((buf)->topLine ? (buf)->topLine->linenumber : 1)
 
561
#define CUR_LINENUMBER(buf) ((buf)->currentLine ? (buf)->currentLine->linenumber : 1)
 
562
 
 
563
#define NO_BUFFER ((Buffer*)1)
 
564
 
 
565
#define RB_STACK_SIZE 10
 
566
 
 
567
#define TAG_STACK_SIZE 10
 
568
 
 
569
#define FONT_STACK_SIZE 5
 
570
 
 
571
#define FONTSTAT_SIZE 7
 
572
 
 
573
#define _INIT_BUFFER_WIDTH (COLS - (showLineNum ? 6 : 1))
 
574
#define INIT_BUFFER_WIDTH ((_INIT_BUFFER_WIDTH > 0) ? _INIT_BUFFER_WIDTH : 0)
 
575
#define FOLD_BUFFER_WIDTH (FoldLine ? (INIT_BUFFER_WIDTH + 1) : -1)
 
576
 
 
577
struct input_alt_attr {
 
578
  int hseq;
 
579
  int fid;
 
580
  int in;
 
581
  Str type, name, value;
 
582
};
 
583
 
 
584
typedef struct {
 
585
    int pos;
 
586
    int len;
 
587
    int tlen;
 
588
    long flag;
 
589
    Anchor anchor;
 
590
    Str img_alt;
 
591
    struct input_alt_attr input_alt;
 
592
    char fontstat[FONTSTAT_SIZE];
 
593
    short nobr_level;
 
594
    Lineprop prev_ctype;
 
595
    char init_flag;
 
596
    short top_margin;
 
597
    short bottom_margin;
 
598
} Breakpoint;
 
599
 
 
600
struct readbuffer {
 
601
    Str line;
 
602
    Lineprop cprop;
 
603
    short pos;
 
604
    Str prevchar;
 
605
    long flag;
 
606
    long flag_stack[RB_STACK_SIZE];
 
607
    int flag_sp;
 
608
    int status;
 
609
    unsigned char end_tag;
 
610
    short table_level;
 
611
    short nobr_level;
 
612
    Anchor anchor;
 
613
    Str img_alt;
 
614
    struct input_alt_attr input_alt;
 
615
    char fontstat[FONTSTAT_SIZE];
 
616
    char fontstat_stack[FONT_STACK_SIZE][FONTSTAT_SIZE];
 
617
    int fontstat_sp;
 
618
    Lineprop prev_ctype;
 
619
    Breakpoint bp;
 
620
    struct cmdtable *tag_stack[TAG_STACK_SIZE];
 
621
    int tag_sp;
 
622
    short top_margin;
 
623
    short bottom_margin;
 
624
};
 
625
 
 
626
#define in_bold fontstat[0]
 
627
#define in_under fontstat[1]
 
628
#define in_italic fontstat[2]
 
629
#define in_strike fontstat[3]
 
630
#define in_ins fontstat[4]
 
631
#define in_stand fontstat[5]
 
632
 
 
633
#define RB_PRE          0x01
 
634
#define RB_SCRIPT       0x02
 
635
#define RB_STYLE        0x04
 
636
#define RB_PLAIN        0x08
 
637
#define RB_LEFT         0x10
 
638
#define RB_CENTER       0x20
 
639
#define RB_RIGHT        0x40
 
640
#define RB_ALIGN        (RB_LEFT| RB_CENTER | RB_RIGHT)
 
641
#define RB_NOBR         0x80
 
642
#define RB_P            0x100
 
643
#define RB_PRE_INT      0x200
 
644
#define RB_IN_DT        0x400
 
645
#define RB_INTXTA       0x800
 
646
#define RB_INSELECT     0x1000
 
647
#define RB_IGNORE_P     0x2000
 
648
#define RB_TITLE        0x4000
 
649
#define RB_NFLUSHED     0x8000
 
650
#define RB_NOFRAMES     0x10000
 
651
#define RB_INTABLE      0x20000
 
652
#define RB_PREMODE      (RB_PRE | RB_PRE_INT | RB_SCRIPT | RB_STYLE | RB_PLAIN | RB_INTXTA)
 
653
#define RB_SPECIAL      (RB_PRE | RB_PRE_INT | RB_SCRIPT | RB_STYLE | RB_PLAIN | RB_NOBR)
 
654
#define RB_PLAIN_PRE    0x40000
 
655
 
 
656
#ifdef FORMAT_NICE
 
657
#define RB_FILL         0x80000
 
658
#endif                          /* FORMAT_NICE */
 
659
#define RB_DEL          0x100000
 
660
#define RB_S            0x200000
 
661
 
 
662
#define RB_GET_ALIGN(obuf) ((obuf)->flag&RB_ALIGN)
 
663
#define RB_SET_ALIGN(obuf,align) {(obuf)->flag &= ~RB_ALIGN; (obuf)->flag |= (align); }
 
664
#define RB_SAVE_FLAG(obuf) {\
 
665
  if ((obuf)->flag_sp < RB_STACK_SIZE) \
 
666
    (obuf)->flag_stack[(obuf)->flag_sp++] = RB_GET_ALIGN(obuf); \
 
667
}
 
668
#define RB_RESTORE_FLAG(obuf) {\
 
669
  if ((obuf)->flag_sp > 0) \
 
670
   RB_SET_ALIGN(obuf,(obuf)->flag_stack[--(obuf)->flag_sp]); \
 
671
}
 
672
 
 
673
/* status flags */
 
674
#define R_ST_NORMAL 0           /* normal */
 
675
#define R_ST_TAG0   1           /* within tag, just after < */
 
676
#define R_ST_TAG    2           /* within tag */
 
677
#define R_ST_QUOTE  3           /* within single quote */
 
678
#define R_ST_DQUOTE 4           /* within double quote */
 
679
#define R_ST_EQL    5           /* = */
 
680
#define R_ST_AMP    6           /* within ampersand quote */
 
681
#define R_ST_EOL    7           /* end of file */
 
682
#define R_ST_CMNT1  8           /* <!  */
 
683
#define R_ST_CMNT2  9           /* <!- */
 
684
#define R_ST_CMNT   10          /* within comment */
 
685
#define R_ST_NCMNT1 11          /* comment - */
 
686
#define R_ST_NCMNT2 12          /* comment -- */
 
687
#define R_ST_NCMNT3 13          /* comment -- space */
 
688
#define R_ST_IRRTAG 14          /* within irregular tag */
 
689
#define R_ST_VALUE  15          /* within tag attribule value */
 
690
 
 
691
#define ST_IS_REAL_TAG(s)   ((s)==R_ST_TAG||(s)==R_ST_TAG0||(s)==R_ST_EQL||(s)==R_ST_VALUE)
 
692
 
 
693
/* is this '<' really means the beginning of a tag? */
 
694
#define REALLY_THE_BEGINNING_OF_A_TAG(p) \
 
695
          (IS_ALPHA(p[1]) || p[1] == '/' || p[1] == '!' || p[1] == '?' || p[1] == '\0' || p[1] == '_')
 
696
 
 
697
/* flags for loadGeneralFile */
 
698
#define RG_NOCACHE   1
 
699
#define RG_FRAME     2
 
700
#define RG_FRAME_SRC 4
 
701
 
 
702
struct html_feed_environ {
 
703
    struct readbuffer *obuf;
 
704
    TextLineList *buf;
 
705
    FILE *f;
 
706
    Str tagbuf;
 
707
    int limit;
 
708
    int maxlimit;
 
709
    struct environment *envs;
 
710
    int nenv;
 
711
    int envc;
 
712
    int envc_real;
 
713
    char *title;
 
714
    int blank_lines;
 
715
};
 
716
 
 
717
#ifdef USE_COOKIE
 
718
struct portlist {
 
719
    unsigned short port;
 
720
    struct portlist *next;
 
721
};
 
722
 
 
723
struct cookie {
 
724
    ParsedURL url;
 
725
    Str name;
 
726
    Str value;
 
727
    time_t expires;
 
728
    Str path;
 
729
    Str domain;
 
730
    Str comment;
 
731
    Str commentURL;
 
732
    struct portlist *portl;
 
733
    char version;
 
734
    char flag;
 
735
    struct cookie *next;
 
736
};
 
737
#define COO_USE         1
 
738
#define COO_SECURE      2
 
739
#define COO_DOMAIN      4
 
740
#define COO_PATH        8
 
741
#define COO_DISCARD     16
 
742
#define COO_OVERRIDE    32      /* user chose to override security checks */
 
743
 
 
744
#define COO_OVERRIDE_OK 32      /* flag to specify that an error is overridable */
 
745
                                                /* version 0 refers to the original cookie_spec.html */
 
746
                                                /* version 1 refers to RFC 2109 */
 
747
                                                /* version 1' refers to the Internet draft to obsolete RFC 2109 */
 
748
#define COO_EINTERNAL   (1)     /* unknown error; probably forgot to convert "return 1" in cookie.c */
 
749
#define COO_ETAIL       (2 | COO_OVERRIDE_OK)   /* tail match failed (version 0) */
 
750
#define COO_ESPECIAL    (3)     /* special domain check failed (version 0) */
 
751
#define COO_EPATH       (4)     /* Path attribute mismatch (version 1 case 1) */
 
752
#define COO_ENODOT      (5 | COO_OVERRIDE_OK)   /* no embedded dots in Domain (version 1 case 2.1) */
 
753
#define COO_ENOTV1DOM   (6 | COO_OVERRIDE_OK)   /* Domain does not start with a dot (version 1 case 2.2) */
 
754
#define COO_EDOM        (7 | COO_OVERRIDE_OK)   /* domain-match failed (version 1 case 3) */
 
755
#define COO_EBADHOST    (8 | COO_OVERRIDE_OK)   /* dot in matched host name in FQDN (version 1 case 4) */
 
756
#define COO_EPORT       (9)     /* Port match failed (version 1' case 5) */
 
757
#define COO_EMAX        COO_EPORT
 
758
#endif                          /* USE_COOKIE */
 
759
 
 
760
/* modes for align() */
 
761
 
 
762
#define ALIGN_CENTER 0
 
763
#define ALIGN_LEFT   1
 
764
#define ALIGN_RIGHT  2
 
765
#define ALIGN_MIDDLE 4
 
766
#define ALIGN_TOP    5
 
767
#define ALIGN_BOTTOM 6
 
768
 
 
769
#define VALIGN_MIDDLE 0
 
770
#define VALIGN_TOP    1
 
771
#define VALIGN_BOTTOM 2
 
772
 
 
773
typedef struct http_request {
 
774
    char command;
 
775
    char flag;
 
776
    char *referer;
 
777
    FormList *request;
 
778
} HRequest;
 
779
 
 
780
#define HR_COMMAND_GET          0
 
781
#define HR_COMMAND_POST         1
 
782
#define HR_COMMAND_CONNECT      2
 
783
#define HR_COMMAND_HEAD         3
 
784
 
 
785
#define HR_FLAG_LOCAL           1
 
786
#define HR_FLAG_PROXY           2
 
787
 
 
788
#define HTST_UNKNOWN            255
 
789
#define HTST_MISSING            254
 
790
#define HTST_NORMAL             0
 
791
#define HTST_CONNECT            1
 
792
 
 
793
#define TMPF_DFL        0
 
794
#define TMPF_SRC        1
 
795
#define TMPF_FRAME      2
 
796
#define TMPF_CACHE      3
 
797
#define TMPF_COOKIE     4
 
798
#define MAX_TMPF_TYPE   5
 
799
 
 
800
#define set_no_proxy(domains) (NO_proxy_domains=make_domain_list(domains))
 
801
 
 
802
/* 
 
803
 * Globals.
 
804
 */
 
805
 
 
806
extern int LINES, COLS;
 
807
#if defined(__CYGWIN__)
 
808
extern int LASTLINE;
 
809
#else                           /* not defined(__CYGWIN__) */
 
810
#define LASTLINE (LINES-1)
 
811
#endif                          /* not defined(__CYGWIN__) */
 
812
 
 
813
global int Tabstop init(8);
 
814
global int IndentIncr init(4);
 
815
global int ShowEffect init(TRUE);
 
816
global int PagerMax init(PAGER_MAX_LINE);
 
817
 
 
818
global char SearchHeader init(FALSE);
 
819
global char *DefaultType init(NULL);
 
820
global char RenderFrame init(FALSE);
 
821
global char TargetSelf init(FALSE);
 
822
global char PermitSaveToPipe init(FALSE);
 
823
global char DecodeCTE init(FALSE);
 
824
global char AutoUncompress init(FALSE);
 
825
global char PreserveTimestamp init(TRUE);
 
826
global char ArgvIsURL init(FALSE);
 
827
global char MetaRefresh init(FALSE);
 
828
 
 
829
global char fmInitialized init(FALSE);
 
830
global char QuietMessage init(FALSE);
 
831
global char TrapSignal init(TRUE);
 
832
#define TRAP_ON if (TrapSignal) { \
 
833
    prevtrap = mySignal(SIGINT, KeyAbort); \
 
834
    if (fmInitialized) \
 
835
        term_cbreak(); \
 
836
}
 
837
#define TRAP_OFF if (TrapSignal) { \
 
838
    if (fmInitialized) \
 
839
        term_raw(); \
 
840
    if (prevtrap) \
 
841
        mySignal(SIGINT, prevtrap); \
 
842
}
 
843
 
 
844
extern unsigned char GlobalKeymap[];
 
845
extern unsigned char EscKeymap[];
 
846
extern unsigned char EscBKeymap[];
 
847
extern unsigned char EscDKeymap[];
 
848
#ifdef __EMX__
 
849
extern unsigned char PcKeymap[];
 
850
#endif
 
851
extern FuncList w3mFuncList[];
 
852
 
 
853
global char *HTTP_proxy init(NULL);
 
854
#ifdef USE_SSL
 
855
global char *HTTPS_proxy init(NULL);
 
856
#endif                          /* USE_SSL */
 
857
#ifdef USE_GOPHER
 
858
global char *GOPHER_proxy init(NULL);
 
859
#endif                          /* USE_GOPHER */
 
860
global char *FTP_proxy init(NULL);
 
861
global ParsedURL HTTP_proxy_parsed;
 
862
#ifdef USE_SSL
 
863
global ParsedURL HTTPS_proxy_parsed;
 
864
#endif                          /* USE_SSL */
 
865
#ifdef USE_GOPHER
 
866
global ParsedURL GOPHER_proxy_parsed;
 
867
#endif                          /* USE_GOPHER */
 
868
global ParsedURL FTP_proxy_parsed;
 
869
global char *NO_proxy init(NULL);
 
870
global int NOproxy_netaddr init(TRUE);
 
871
#ifdef INET6
 
872
#define DNS_ORDER_UNSPEC     0
 
873
#define DNS_ORDER_INET_INET6 1
 
874
#define DNS_ORDER_INET6_INET 2
 
875
#define DNS_ORDER_INET_ONLY  4
 
876
#define DNS_ORDER_INET6_ONLY 6
 
877
global int DNS_order init(DNS_ORDER_UNSPEC);
 
878
extern int ai_family_order_table[7][3]; /* XXX */
 
879
#endif                          /* INET6 */
 
880
global TextList *NO_proxy_domains;
 
881
global char NoCache init(FALSE);
 
882
global char use_proxy init(TRUE);
 
883
#define Do_not_use_proxy (!use_proxy)
 
884
global int Do_not_use_ti_te init(FALSE);
 
885
#ifdef USE_NNTP
 
886
global char *NNTP_server init(NULL);
 
887
global char *NNTP_mode init(NULL);
 
888
global int MaxNewsMessage init(50);
 
889
#endif
 
890
 
 
891
global char *document_root init(NULL);
 
892
global char *personal_document_root init(NULL);
 
893
global char *cgi_bin init(NULL);
 
894
global char *index_file init(NULL);
 
895
 
 
896
global char *CurrentDir;
 
897
global int CurrentPid;
 
898
/*
 
899
 * global Buffer *Currentbuf;
 
900
 * global Buffer *Firstbuf;
 
901
 */
 
902
global TabBuffer *CurrentTab;
 
903
global TabBuffer *FirstTab;
 
904
global TabBuffer *LastTab;
 
905
global int open_tab_blank init(FALSE);
 
906
global int open_tab_dl_list init(FALSE);
 
907
global int close_tab_back init(FALSE);
 
908
global int nTab;
 
909
global int TabCols init(10);
 
910
#define NO_TABBUFFER ((TabBuffer *)1)
 
911
#define Currentbuf (CurrentTab->currentBuffer)
 
912
#define Firstbuf (CurrentTab->firstBuffer)
 
913
global DownloadList *FirstDL init(NULL);
 
914
global DownloadList *LastDL init(NULL);
 
915
global int CurrentKey;
 
916
global char *CurrentKeyData;
 
917
global char *CurrentCmdData;
 
918
global char *w3m_reqlog;
 
919
extern char *w3m_version;
 
920
 
 
921
#define DUMP_BUFFER   0x01
 
922
#define DUMP_HEAD     0x02
 
923
#define DUMP_SOURCE   0x04
 
924
#define DUMP_EXTRA    0x08
 
925
#define DUMP_HALFDUMP 0x10
 
926
#define DUMP_FRAME    0x20
 
927
global int w3m_debug;
 
928
global int w3m_dump init(0);
 
929
#define w3m_halfdump (w3m_dump & DUMP_HALFDUMP)
 
930
global int w3m_halfload init(FALSE);
 
931
global Str header_string init(NULL);
 
932
global int override_content_type init(FALSE);
 
933
 
 
934
#ifdef USE_COLOR
 
935
global int useColor init(TRUE);
 
936
global int basic_color init(8); /* don't change */
 
937
global int anchor_color init(4);        /* blue  */
 
938
global int image_color init(2); /* green */
 
939
global int form_color init(1);  /* red   */
 
940
#ifdef USE_BG_COLOR
 
941
global int bg_color init(8);    /* don't change */
 
942
global int mark_color init(6);  /* cyan */
 
943
#endif                          /* USE_BG_COLOR */
 
944
global int useActiveColor init(FALSE);
 
945
global int active_color init(6);        /* cyan */
 
946
global int useVisitedColor init(FALSE);
 
947
global int visited_color init(5);       /* magenta  */
 
948
#endif                          /* USE_COLOR */
 
949
global int confirm_on_quit init(TRUE);
 
950
#ifdef USE_MARK
 
951
global int use_mark init(FALSE);
 
952
#endif
 
953
global int emacs_like_lineedit init(FALSE);
 
954
global int vi_prec_num init(FALSE);
 
955
global int label_topline init(FALSE);
 
956
global int nextpage_topline init(FALSE);
 
957
global char *displayTitleTerm init(NULL);
 
958
global int displayLink init(FALSE);
 
959
global int displayLinkNumber init(FALSE);
 
960
global int displayLineInfo init(FALSE);
 
961
global int DecodeURL init(FALSE);
 
962
global int retryAsHttp init(TRUE);
 
963
global int showLineNum init(FALSE);
 
964
global int show_srch_str init(TRUE);
 
965
#ifdef USE_IMAGE
 
966
global char *Imgdisplay init(IMGDISPLAY);
 
967
global int activeImage init(FALSE);
 
968
global int displayImage init(TRUE);
 
969
global int autoImage init(TRUE);
 
970
global int useExtImageViewer init(TRUE);
 
971
global int maxLoadImage init(4);
 
972
global int image_map_list init(TRUE);
 
973
#else
 
974
global int displayImage init(FALSE);    /* XXX: emacs-w3m use display_image=off */
 
975
#endif
 
976
global int pseudoInlines init(TRUE);
 
977
global char *Editor init(DEF_EDITOR);
 
978
#ifdef USE_W3MMAILER
 
979
global char *Mailer init(NULL);
 
980
#else
 
981
global char *Mailer init(DEF_MAILER);
 
982
#endif
 
983
#ifdef USE_W3MMAILER
 
984
#define MAILTO_OPTIONS_USE_W3MMAILER 0
 
985
#endif
 
986
#define MAILTO_OPTIONS_IGNORE 1
 
987
#define MAILTO_OPTIONS_USE_MAILTO_URL 2
 
988
global int MailtoOptions init(MAILTO_OPTIONS_IGNORE);
 
989
global char *ExtBrowser init(DEF_EXT_BROWSER);
 
990
global char *ExtBrowser2 init(NULL);
 
991
global char *ExtBrowser3 init(NULL);
 
992
global int BackgroundExtViewer init(TRUE);
 
993
global int disable_secret_security_check init(FALSE);
 
994
global char *passwd_file init(PASSWD_FILE);
 
995
global char *pre_form_file init(PRE_FORM_FILE);
 
996
global char *siteconf_file init(SITECONF_FILE);
 
997
global char *ftppasswd init(NULL);
 
998
global int ftppass_hostnamegen init(TRUE);
 
999
global int do_download init(FALSE);
 
1000
#ifdef USE_IMAGE
 
1001
global char *image_source init(NULL);
 
1002
#endif
 
1003
global char *UserAgent init(NULL);
 
1004
global int NoSendReferer init(FALSE);
 
1005
global char *AcceptLang init(NULL);
 
1006
global char *AcceptEncoding init(NULL);
 
1007
global char *AcceptMedia init(NULL);
 
1008
global int WrapDefault init(FALSE);
 
1009
global int IgnoreCase init(TRUE);
 
1010
global int WrapSearch init(FALSE);
 
1011
global int squeezeBlankLine init(FALSE);
 
1012
global char *BookmarkFile init(NULL);
 
1013
global int UseExternalDirBuffer init(TRUE);
 
1014
global char *DirBufferCommand init("file:///$LIB/dirlist" CGI_EXTENSION);
 
1015
#ifdef USE_DICT
 
1016
global int UseDictCommand init(FALSE);
 
1017
global char *DictCommand init("file:///$LIB/w3mdict" CGI_EXTENSION);
 
1018
#endif                          /* USE_DICT */
 
1019
global int ignore_null_img_alt init(TRUE);
 
1020
#define DISPLAY_INS_DEL_SIMPLE  0
 
1021
#define DISPLAY_INS_DEL_NORMAL  1
 
1022
#define DISPLAY_INS_DEL_FONTIFY 2
 
1023
global int displayInsDel init(DISPLAY_INS_DEL_NORMAL);
 
1024
global int FoldTextarea init(FALSE);
 
1025
global int FoldLine init(FALSE);
 
1026
#define DEFAULT_URL_EMPTY       0
 
1027
#define DEFAULT_URL_CURRENT     1
 
1028
#define DEFAULT_URL_LINK        2
 
1029
global int DefaultURLString init(DEFAULT_URL_EMPTY);
 
1030
global int MarkAllPages init(FALSE);
 
1031
 
 
1032
#ifdef USE_MIGEMO
 
1033
global int use_migemo init(FALSE);
 
1034
global int migemo_active init(0);
 
1035
global char *migemo_command init(DEF_MIGEMO_COMMAND);
 
1036
#endif                          /* USE_MIGEMO */
 
1037
 
 
1038
global struct auth_cookie *Auth_cookie init(NULL);
 
1039
#ifdef USE_COOKIE
 
1040
global struct cookie *First_cookie init(NULL);
 
1041
#endif                          /* USE_COOKIE */
 
1042
 
 
1043
global char *mailcap_files init(USER_MAILCAP ", " SYS_MAILCAP);
 
1044
global char *mimetypes_files init(USER_MIMETYPES ", " SYS_MIMETYPES);
 
1045
#ifdef USE_EXTERNAL_URI_LOADER
 
1046
global char *urimethodmap_files init(USER_URIMETHODMAP ", " SYS_URIMETHODMAP);
 
1047
#endif
 
1048
 
 
1049
global TextList *fileToDelete;
 
1050
 
 
1051
extern Hist *LoadHist;
 
1052
extern Hist *SaveHist;
 
1053
extern Hist *URLHist;
 
1054
extern Hist *ShellHist;
 
1055
extern Hist *TextHist;
 
1056
#ifdef USE_HISTORY
 
1057
global int UseHistory init(TRUE);
 
1058
global int URLHistSize init(100);
 
1059
global int SaveURLHist init(TRUE);
 
1060
#endif                          /* USE_HISTORY */
 
1061
global int multicolList init(FALSE);
 
1062
 
 
1063
#ifdef USE_M17N
 
1064
global wc_ces InnerCharset init(WC_CES_WTF);    /* Don't change */
 
1065
global wc_ces DisplayCharset init(DISPLAY_CHARSET);
 
1066
global wc_ces DocumentCharset init(DOCUMENT_CHARSET);
 
1067
global wc_ces SystemCharset init(SYSTEM_CHARSET);
 
1068
global wc_ces BookmarkCharset init(SYSTEM_CHARSET);
 
1069
global char ExtHalfdump init(FALSE);
 
1070
global char FollowLocale init(TRUE);
 
1071
global char UseContentCharset init(TRUE);
 
1072
global char SearchConv init(TRUE);
 
1073
global char SimplePreserveSpace init(FALSE);
 
1074
#define Str_conv_from_system(x) wc_Str_conv((x), SystemCharset, InnerCharset)
 
1075
#define Str_conv_to_system(x) wc_Str_conv_strict((x), InnerCharset, SystemCharset)
 
1076
#define Str_conv_to_halfdump(x) (ExtHalfdump ? wc_Str_conv((x), InnerCharset, DisplayCharset) : (x))
 
1077
#define conv_from_system(x) wc_conv((x), SystemCharset, InnerCharset)->ptr
 
1078
#define conv_to_system(x) wc_conv_strict((x), InnerCharset, SystemCharset)->ptr
 
1079
#define url_quote_conv(x,c) url_quote(wc_conv_strict((x), InnerCharset, (c))->ptr)
 
1080
#else
 
1081
#define Str_conv_from_system(x) (x)
 
1082
#define Str_conv_to_system(x) (x)
 
1083
#define Str_conv_to_halfdump(x) (x)
 
1084
#define conv_from_system(x) (x)
 
1085
#define conv_to_system(x) (x)
 
1086
#define url_quote_conv(x,c) url_quote(x)
 
1087
#define wc_Str_conv(x,charset0,charset1) (x)
 
1088
#define wc_Str_conv_strict(x,charset0,charset1) (x)
 
1089
#endif
 
1090
global char UseAltEntity init(TRUE);
 
1091
#define GRAPHIC_CHAR_ASCII 2
 
1092
#define GRAPHIC_CHAR_DEC 1
 
1093
#define GRAPHIC_CHAR_CHARSET 0
 
1094
global char UseGraphicChar init(GRAPHIC_CHAR_CHARSET);
 
1095
extern char *graph_symbol[];
 
1096
extern char *graph2_symbol[];
 
1097
extern int symbol_width;
 
1098
extern int symbol_width0;
 
1099
#define N_GRAPH_SYMBOL 32
 
1100
#define SYMBOL_BASE 0x20
 
1101
global int no_rc_dir init(FALSE);
 
1102
global char *rc_dir init(NULL);
 
1103
global char *tmp_dir;
 
1104
global char *config_file init(NULL);
 
1105
 
 
1106
#ifdef USE_MOUSE
 
1107
global int use_mouse init(TRUE);
 
1108
extern int mouseActive;
 
1109
global int reverse_mouse init(FALSE);
 
1110
global int relative_wheel_scroll init(FALSE);
 
1111
global int fixed_wheel_scroll_count init(5);
 
1112
global int relative_wheel_scroll_ratio init(30);
 
1113
typedef struct _MouseActionMap {
 
1114
    void (*func) ();
 
1115
    char *data;
 
1116
} MouseActionMap;
 
1117
typedef struct _MouseAction {
 
1118
    char *menu_str;
 
1119
    char *lastline_str;
 
1120
    int menu_width;
 
1121
    int lastline_width;
 
1122
    int in_action;
 
1123
    int cursorX;
 
1124
    int cursorY;
 
1125
    MouseActionMap default_map[3];
 
1126
    MouseActionMap anchor_map[3];
 
1127
    MouseActionMap active_map[3];
 
1128
    MouseActionMap tab_map[3];
 
1129
    MouseActionMap *menu_map[3];
 
1130
    MouseActionMap *lastline_map[3];
 
1131
} MouseAction;
 
1132
global MouseAction mouse_action;
 
1133
#define LIMIT_MOUSE_MENU 100
 
1134
#endif                          /* USE_MOUSE */
 
1135
 
 
1136
#ifdef USE_COOKIE
 
1137
global int default_use_cookie init(TRUE);
 
1138
global int use_cookie init(FALSE);
 
1139
global int show_cookie init(TRUE);
 
1140
global int accept_cookie init(FALSE);
 
1141
#define ACCEPT_BAD_COOKIE_DISCARD       0
 
1142
#define ACCEPT_BAD_COOKIE_ACCEPT        1
 
1143
#define ACCEPT_BAD_COOKIE_ASK           2
 
1144
global int accept_bad_cookie init(ACCEPT_BAD_COOKIE_DISCARD);
 
1145
global char *cookie_reject_domains init(NULL);
 
1146
global char *cookie_accept_domains init(NULL);
 
1147
global char *cookie_avoid_wrong_number_of_dots init(NULL);
 
1148
global TextList *Cookie_reject_domains;
 
1149
global TextList *Cookie_accept_domains;
 
1150
global TextList *Cookie_avoid_wrong_number_of_dots_domains;
 
1151
#endif                          /* USE_COOKIE */
 
1152
 
 
1153
#ifdef USE_IMAGE
 
1154
global int view_unseenobject init(FALSE);
 
1155
#else
 
1156
global int view_unseenobject init(TRUE);
 
1157
#endif
 
1158
 
 
1159
#if defined(USE_SSL) && defined(USE_SSL_VERIFY)
 
1160
global int ssl_verify_server init(FALSE);
 
1161
global char *ssl_cert_file init(NULL);
 
1162
global char *ssl_key_file init(NULL);
 
1163
global char *ssl_ca_path init(NULL);
 
1164
global char *ssl_ca_file init(NULL);
 
1165
global int ssl_path_modified init(FALSE);
 
1166
#endif                          /* defined(USE_SSL) &&
 
1167
                                 * defined(USE_SSL_VERIFY) */
 
1168
#ifdef USE_SSL
 
1169
global char *ssl_forbid_method init(NULL);
 
1170
#endif
 
1171
 
 
1172
global int is_redisplay init(FALSE);
 
1173
global int clear_buffer init(TRUE);
 
1174
global double pixel_per_char init(DEFAULT_PIXEL_PER_CHAR);
 
1175
global int set_pixel_per_char init(FALSE);
 
1176
#ifdef USE_IMAGE
 
1177
global double pixel_per_line init(DEFAULT_PIXEL_PER_LINE);
 
1178
global int set_pixel_per_line init(FALSE);
 
1179
global double image_scale init(100);
 
1180
#endif
 
1181
global int use_lessopen init(FALSE);
 
1182
 
 
1183
global char *keymap_file init(KEYMAP_FILE);
 
1184
 
 
1185
#ifdef USE_M17N
 
1186
#define get_mctype(c) ((Lineprop)wtf_type((wc_uchar *)(c)) << 8)
 
1187
#define get_mclen(c) wtf_len1((wc_uchar *)(c))
 
1188
#define get_mcwidth(c) wtf_width((wc_uchar *)(c))
 
1189
#define get_strwidth(c) wtf_strwidth((wc_uchar *)(c))
 
1190
#define get_Str_strwidth(c) wtf_strwidth((wc_uchar *)((c)->ptr))
 
1191
#else
 
1192
#define get_mctype(c) (IS_CNTRL(*(c)) ? PC_CTRL : PC_ASCII)
 
1193
#define get_mclen(c) 1
 
1194
#define get_mcwidth(c) 1
 
1195
#define get_strwidth(c) strlen(c)
 
1196
#define get_Str_strwidth(c) ((c)->length)
 
1197
#endif
 
1198
 
 
1199
global int FollowRedirection init(10);
 
1200
 
 
1201
global int w3m_backend init(FALSE);
 
1202
global TextLineList *backend_halfdump_buf;
 
1203
global TextList *backend_batch_commands init(NULL);
 
1204
int backend(void);
 
1205
extern void deleteFiles(void);
 
1206
void w3m_exit(int i);
 
1207
 
 
1208
#ifdef USE_ALARM
 
1209
#define AL_UNSET         0
 
1210
#define AL_EXPLICIT      1
 
1211
#define AL_IMPLICIT      2
 
1212
#define AL_IMPLICIT_ONCE 3
 
1213
 
 
1214
typedef struct _AlarmEvent {
 
1215
    int sec;
 
1216
    short status;
 
1217
    int cmd;
 
1218
    void *data;
 
1219
} AlarmEvent;
 
1220
#endif
 
1221
 
 
1222
/* 
 
1223
 * Externals
 
1224
 */
 
1225
 
 
1226
#include "table.h"
 
1227
#include "proto.h"
 
1228
 
 
1229
#endif                          /* not FM_H */