w3m

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/w3m.git/
Log | Files | Refs | README

html.c (21134B)


      1 /* $Id$ */
      2 #include "html.h"
      3 
      4 /* Define HTML Tag Infomation Table */
      5 
      6 #define ATTR_CORE	ATTR_ID
      7 #define MAXA_CORE	1
      8 unsigned char ALST_A[] = {
      9     ATTR_NAME, ATTR_HREF, ATTR_REL, ATTR_CHARSET, ATTR_TARGET, ATTR_HSEQ,
     10     ATTR_REFERER,
     11     ATTR_FRAMENAME, ATTR_TITLE, ATTR_ACCESSKEY, ATTR_CORE
     12 };
     13 #define MAXA_A		MAXA_CORE + 10
     14 unsigned char ALST_P[] = { ATTR_ALIGN, ATTR_CORE };
     15 #define MAXA_P		MAXA_CORE + 1
     16 unsigned char ALST_UL[] = { ATTR_START, ATTR_TYPE, ATTR_CORE };
     17 #define MAXA_UL		MAXA_CORE + 2
     18 unsigned char ALST_LI[] = { ATTR_TYPE, ATTR_VALUE, ATTR_CORE };
     19 #define MAXA_LI		MAXA_CORE + 2
     20 unsigned char ALST_HR[] = { ATTR_WIDTH, ATTR_ALIGN, ATTR_CORE };
     21 #define MAXA_HR		MAXA_CORE + 2
     22 unsigned char ALST_LINK[] = { ATTR_HREF, ATTR_HSEQ, ATTR_REL, ATTR_REV,
     23     ATTR_TITLE, ATTR_TYPE, ATTR_CORE
     24 };
     25 #define MAXA_LINK	MAXA_CORE + sizeof ALST_LINK/sizeof ALST_LINK[0] - 1
     26 unsigned char ALST_DL[] = { ATTR_COMPACT, ATTR_CORE };
     27 #define MAXA_DL		MAXA_CORE + 1
     28 unsigned char ALST_PRE[] = { ATTR_FOR_TABLE, ATTR_CORE };
     29 #define MAXA_PRE	MAXA_CORE + 1
     30 unsigned char ALST_IMG[] =
     31     { ATTR_SRC, ATTR_ALT, ATTR_WIDTH, ATTR_HEIGHT, ATTR_ALIGN, ATTR_USEMAP,
     32     ATTR_ISMAP, ATTR_TITLE, ATTR_PRE_INT, ATTR_CORE
     33 };
     34 #define MAXA_IMG	MAXA_CORE + 9
     35 unsigned char ALST_TABLE[] =
     36     { ATTR_BORDER, ATTR_WIDTH, ATTR_HBORDER, ATTR_CELLSPACING,
     37     ATTR_CELLPADDING, ATTR_VSPACE, ATTR_CORE
     38 };
     39 #define MAXA_TABLE	MAXA_CORE + 6
     40 unsigned char ALST_META[] = { ATTR_HTTP_EQUIV, ATTR_CONTENT, ATTR_CORE };
     41 #define MAXA_META	MAXA_CORE + 2
     42 unsigned char ALST_FRAME[] = { ATTR_SRC, ATTR_NAME, ATTR_CORE };
     43 #define MAXA_FRAME	MAXA_CORE + 2
     44 unsigned char ALST_FRAMESET[] = { ATTR_COLS, ATTR_ROWS, ATTR_CORE };
     45 #define MAXA_FRAMESET	MAXA_CORE + 2
     46 unsigned char ALST_NOFRAMES[] = { ATTR_CORE };
     47 #define MAXA_NOFRAMES	MAXA_CORE
     48 unsigned char ALST_FORM[] =
     49     { ATTR_METHOD, ATTR_ACTION, ATTR_CHARSET, ATTR_ACCEPT_CHARSET,
     50     ATTR_ENCTYPE, ATTR_TARGET, ATTR_NAME, ATTR_CORE
     51 };
     52 #define MAXA_FORM       MAXA_CORE + 7
     53 unsigned char ALST_INPUT[] =
     54     { ATTR_TYPE, ATTR_VALUE, ATTR_NAME, ATTR_CHECKED, ATTR_ACCEPT, ATTR_SIZE,
     55     ATTR_MAXLENGTH, ATTR_ALT, ATTR_READONLY, ATTR_SRC, ATTR_WIDTH, ATTR_HEIGHT,
     56     ATTR_CORE
     57 };
     58 #define MAXA_INPUT      MAXA_CORE + 12
     59 unsigned char ALST_TEXTAREA[] =
     60     { ATTR_COLS, ATTR_ROWS, ATTR_NAME, ATTR_READONLY, ATTR_CORE };
     61 #define MAXA_TEXTAREA   MAXA_CORE + 4
     62 unsigned char ALST_SELECT[] = { ATTR_NAME, ATTR_MULTIPLE, ATTR_CORE };
     63 #define MAXA_SELECT	MAXA_CORE + 2
     64 unsigned char ALST_OPTION[] =
     65     { ATTR_VALUE, ATTR_LABEL, ATTR_SELECTED, ATTR_CORE };
     66 #define MAXA_OPTION	MAXA_CORE + 3
     67 unsigned char ALST_ISINDEX[] = { ATTR_ACTION, ATTR_PROMPT, ATTR_CORE };
     68 #define MAXA_ISINDEX	MAXA_CORE + 2
     69 unsigned char ALST_MAP[] = { ATTR_NAME, ATTR_CORE };
     70 #define MAXA_MAP	MAXA_CORE + 1
     71 unsigned char ALST_AREA[] =
     72     { ATTR_HREF, ATTR_TARGET, ATTR_ALT, ATTR_SHAPE, ATTR_COORDS, ATTR_CORE };
     73 #define MAXA_AREA	MAXA_CORE + 5
     74 unsigned char ALST_BASE[] = { ATTR_HREF, ATTR_TARGET, ATTR_CORE };
     75 #define MAXA_BASE	MAXA_CORE + 2
     76 unsigned char ALST_BODY[] = { ATTR_BACKGROUND, ATTR_CORE };
     77 #define MAXA_BODY	MAXA_CORE + 1
     78 unsigned char ALST_TR[] = { ATTR_ALIGN, ATTR_VALIGN, ATTR_CORE };
     79 #define MAXA_TR		MAXA_CORE + 2
     80 unsigned char ALST_TD[] =
     81     { ATTR_COLSPAN, ATTR_ROWSPAN, ATTR_ALIGN, ATTR_VALIGN, ATTR_WIDTH,
     82     ATTR_NOWRAP, ATTR_CORE
     83 };
     84 #define MAXA_TD		MAXA_CORE + 6
     85 unsigned char ALST_BGSOUND[] = { ATTR_SRC, ATTR_CORE };
     86 #define MAX_BGSOUND	MAXA_CORE + 1
     87 unsigned char ALST_APPLET[] = { ATTR_ARCHIVE, ATTR_CORE };
     88 #define MAX_APPLET	MAXA_CORE + 1
     89 unsigned char ALST_EMBED[] = { ATTR_SRC, ATTR_CORE };
     90 #define MAX_EMBED	MAXA_CORE + 1
     91 
     92 unsigned char ALST_TEXTAREA_INT[] = { ATTR_TEXTAREANUMBER };
     93 #define MAXA_TEXTAREA_INT 1
     94 unsigned char ALST_SELECT_INT[] = { ATTR_SELECTNUMBER };
     95 #define MAXA_SELECT_INT	1
     96 unsigned char ALST_TABLE_ALT[] = { ATTR_TID };
     97 #define MAXA_TABLE_ALT	1
     98 unsigned char ALST_SYMBOL[] = { ATTR_TYPE };
     99 #define MAXA_SYMBOL	1
    100 unsigned char ALST_TITLE_ALT[] = { ATTR_TITLE };
    101 #define MAXA_TITLE_ALT	1
    102 unsigned char ALST_FORM_INT[] =
    103     { ATTR_METHOD, ATTR_ACTION, ATTR_CHARSET, ATTR_ACCEPT_CHARSET,
    104     ATTR_ENCTYPE, ATTR_TARGET, ATTR_NAME, ATTR_FID
    105 };
    106 #define MAXA_FORM_INT  8
    107 unsigned char ALST_INPUT_ALT[] =
    108     { ATTR_HSEQ, ATTR_FID, ATTR_NO_EFFECT, ATTR_TYPE, ATTR_NAME, ATTR_VALUE,
    109     ATTR_CHECKED, ATTR_ACCEPT, ATTR_SIZE, ATTR_MAXLENGTH, ATTR_READONLY,
    110     ATTR_TEXTAREANUMBER,
    111     ATTR_SELECTNUMBER, ATTR_ROWS, ATTR_TOP_MARGIN, ATTR_BOTTOM_MARGIN
    112 };
    113 #define MAXA_INPUT_ALT  16
    114 unsigned char ALST_IMG_ALT[] =
    115     { ATTR_SRC, ATTR_WIDTH, ATTR_HEIGHT, ATTR_USEMAP, ATTR_ISMAP, ATTR_HSEQ,
    116     ATTR_XOFFSET, ATTR_YOFFSET, ATTR_TOP_MARGIN, ATTR_BOTTOM_MARGIN,
    117     ATTR_TITLE
    118 };
    119 #define MAXA_IMG_ALT  11
    120 unsigned char ALST_NOP[] = { ATTR_CORE };
    121 #define MAXA_NOP	MAXA_CORE
    122 
    123 TagInfo TagMAP[MAX_HTMLTAG] = {
    124     {NULL, NULL, 0, 0},		/*   0 HTML_UNKNOWN    */
    125     {"a", ALST_A, MAXA_A, 0},	/*   1 HTML_A          */
    126     {"/a", NULL, 0, TFLG_END},	/*   2 HTML_N_A        */
    127     {"h", ALST_P, MAXA_P, 0},	/*   3 HTML_H          */
    128     {"/h", NULL, 0, TFLG_END},	/*   4 HTML_N_H        */
    129     {"p", ALST_P, MAXA_P, 0},	/*   5 HTML_P          */
    130     {"br", ALST_NOP, MAXA_NOP, 0},		/*   6 HTML_BR         */
    131     {"b", ALST_NOP, MAXA_NOP, 0},	/*   7 HTML_B          */
    132     {"/b", NULL, 0, TFLG_END},	/*   8 HTML_N_B        */
    133     {"ul", ALST_UL, MAXA_UL, 0},	/*   9 HTML_UL         */
    134     {"/ul", NULL, 0, TFLG_END},	/*  10 HTML_N_UL       */
    135     {"li", ALST_LI, MAXA_LI, 0},	/*  11 HTML_LI         */
    136     {"ol", ALST_UL, MAXA_UL, 0},	/*  12 HTML_OL         */
    137     {"/ol", NULL, 0, TFLG_END},	/*  13 HTML_N_OL       */
    138     {"title", ALST_NOP, MAXA_NOP, 0},	/*  14 HTML_TITLE      */
    139     {"/title", NULL, 0, TFLG_END},	/*  15 HTML_N_TITLE    */
    140     {"hr", ALST_HR, MAXA_HR, 0},	/*  16 HTML_HR         */
    141     {"dl", ALST_DL, MAXA_DL, 0},	/*  17 HTML_DL         */
    142     {"/dl", NULL, 0, TFLG_END},	/*  18 HTML_N_DL       */
    143     {"dt", ALST_NOP, MAXA_NOP, 0},	/*  19 HTML_DT         */
    144     {"dd", ALST_NOP, MAXA_NOP, 0},	/*  20 HTML_DD         */
    145     {"pre", ALST_PRE, MAXA_PRE, 0},	/*  21 HTML_PRE        */
    146     {"/pre", NULL, 0, TFLG_END},	/*  22 HTML_N_PRE      */
    147     {"blockquote", ALST_NOP, MAXA_NOP, 0},	/*  23 HTML_BLQ        */
    148     {"/blockquote", NULL, 0, TFLG_END},	/*  24 HTML_N_BLQ      */
    149     {"img", ALST_IMG, MAXA_IMG, 0},	/*  25 HTML_IMG        */
    150     {"listing", ALST_NOP, MAXA_NOP, 0},	/*  26 HTML_LISTING    */
    151     {"/listing", NULL, 0, TFLG_END},	/*  27 HTML_N_LISTING  */
    152     {"xmp", ALST_NOP, MAXA_NOP, 0},	/*  28 HTML_XMP        */
    153     {"/xmp", NULL, 0, TFLG_END},	/*  29 HTML_N_XMP      */
    154     {"plaintext", ALST_NOP, MAXA_NOP, 0},	/*  30 HTML_PLAINTEXT  */
    155     {"table", ALST_TABLE, MAXA_TABLE, 0},	/*  31 HTML_TABLE      */
    156     {"/table", NULL, 0, TFLG_END},	/*  32 HTML_N_TABLE    */
    157     {"meta", ALST_META, MAXA_META, 0},	/*  33 HTML_META       */
    158     {"/p", NULL, 0, TFLG_END},	/*  34 HTML_N_P        */
    159     {"frame", ALST_FRAME, MAXA_FRAME, 0},	/*  35 HTML_FRAME      */
    160     {"frameset", ALST_FRAMESET, MAXA_FRAMESET, 0},	/*  36 HTML_FRAMESET   */
    161     {"/frameset", NULL, 0, TFLG_END},	/*  37 HTML_N_FRAMESET */
    162     {"center", ALST_NOP, MAXA_NOP, 0},	/*  38 HTML_CENTER     */
    163     {"/center", NULL, 0, TFLG_END},	/*  39 HTML_N_CENTER   */
    164     {"font", ALST_NOP, MAXA_NOP, 0},	/*  40 HTML_FONT       */
    165     {"/font", NULL, 0, TFLG_END},	/*  41 HTML_N_FONT     */
    166     {"form", ALST_FORM, MAXA_FORM, 0},	/*  42 HTML_FORM       */
    167     {"/form", NULL, 0, TFLG_END},	/*  43 HTML_N_FORM     */
    168     {"input", ALST_INPUT, MAXA_INPUT, 0},	/*  44 HTML_INPUT      */
    169     {"textarea", ALST_TEXTAREA, MAXA_TEXTAREA, 0},	/*  45 HTML_TEXTAREA   */
    170     {"/textarea", NULL, 0, TFLG_END},	/*  46 HTML_N_TEXTAREA */
    171     {"select", ALST_SELECT, MAXA_SELECT, 0},	/*  47 HTML_SELECT     */
    172     {"/select", NULL, 0, TFLG_END},	/*  48 HTML_N_SELECT   */
    173     {"option", ALST_OPTION, MAXA_OPTION, 0},	/*  49 HTML_OPTION     */
    174     {"nobr", ALST_NOP, MAXA_NOP, 0},	/*  50 HTML_NOBR       */
    175     {"/nobr", NULL, 0, TFLG_END},	/*  51 HTML_N_NOBR     */
    176     {"div", ALST_P, MAXA_P, 0},	/*  52 HTML_DIV        */
    177     {"/div", NULL, 0, TFLG_END},	/*  53 HTML_N_DIV      */
    178     {"isindex", ALST_ISINDEX, MAXA_ISINDEX, 0},	/*  54 HTML_ISINDEX    */
    179     {"map", ALST_MAP, MAXA_MAP, 0},	/*  55 HTML_MAP        */
    180     {"/map", NULL, 0, TFLG_END},	/*  56 HTML_N_MAP      */
    181     {"area", ALST_AREA, MAXA_AREA, 0},	/*  57 HTML_AREA       */
    182     {"script", ALST_NOP, MAXA_NOP, 0},	/*  58 HTML_SCRIPT     */
    183     {"/script", NULL, 0, TFLG_END},	/*  59 HTML_N_SCRIPT   */
    184     {"base", ALST_BASE, MAXA_BASE, 0},	/*  60 HTML_BASE       */
    185     {"del", ALST_NOP, MAXA_NOP, 0},	/*  61 HTML_DEL        */
    186     {"/del", NULL, 0, TFLG_END},	/*  62 HTML_N_DEL      */
    187     {"ins", ALST_NOP, MAXA_NOP, 0},	/*  63 HTML_INS        */
    188     {"/ins", NULL, 0, TFLG_END},	/*  64 HTML_N_INS      */
    189     {"u", ALST_NOP, MAXA_NOP, 0},		/*  65 HTML_U          */
    190     {"/u", NULL, 0, TFLG_END},	/*  66 HTML_N_U        */
    191     {"style", ALST_NOP, MAXA_NOP, 0},	/*  67 HTML_STYLE      */
    192     {"/style", NULL, 0, TFLG_END},	/*  68 HTML_N_STYLE    */
    193     {"wbr", ALST_NOP, MAXA_NOP, 0},	/*  69 HTML_WBR        */
    194     {"em", ALST_NOP, MAXA_NOP, 0},		/*  70 HTML_EM         */
    195     {"/em", NULL, 0, TFLG_END},	/*  71 HTML_N_EM       */
    196     {"body", ALST_BODY, MAXA_BODY, 0},	/*  72 HTML_BODY       */
    197     {"/body", NULL, 0, TFLG_END},	/*  73 HTML_N_BODY     */
    198     {"tr", ALST_TR, MAXA_TR, 0},	/*  74 HTML_TR         */
    199     {"/tr", NULL, 0, TFLG_END},	/*  75 HTML_N_TR       */
    200     {"td", ALST_TD, MAXA_TD, 0},	/*  76 HTML_TD         */
    201     {"/td", NULL, 0, TFLG_END},	/*  77 HTML_N_TD       */
    202     {"caption", ALST_NOP, MAXA_NOP, 0},	/*  78 HTML_CAPTION    */
    203     {"/caption", NULL, 0, TFLG_END},	/*  79 HTML_N_CAPTION  */
    204     {"th", ALST_TD, MAXA_TD, 0},	/*  80 HTML_TH         */
    205     {"/th", NULL, 0, TFLG_END},	/*  81 HTML_N_TH       */
    206     {"thead", ALST_NOP, MAXA_NOP, 0},	/*  82 HTML_THEAD      */
    207     {"/thead", NULL, 0, TFLG_END},	/*  83 HTML_N_THEAD    */
    208     {"tbody", ALST_NOP, MAXA_NOP, 0},	/*  84 HTML_TBODY      */
    209     {"/tbody", NULL, 0, TFLG_END},	/*  85 HTML_N_TBODY    */
    210     {"tfoot", ALST_NOP, MAXA_NOP, 0},	/*  86 HTML_TFOOT      */
    211     {"/tfoot", NULL, 0, TFLG_END},	/*  87 HTML_N_TFOOT    */
    212     {"colgroup", ALST_NOP, MAXA_NOP, 0},	/*  88 HTML_COLGROUP   */
    213     {"/colgroup", NULL, 0, TFLG_END},	/*  89 HTML_N_COLGROUP */
    214     {"col", ALST_NOP, MAXA_NOP, 0},	/*  90 HTML_COL        */
    215     {"bgsound", ALST_BGSOUND, MAX_BGSOUND, 0},	/*  91 HTML_BGSOUND    */
    216     {"applet", ALST_APPLET, MAX_APPLET, 0},	/*  92 HTML_APPLET     */
    217     {"embed", ALST_EMBED, MAX_EMBED, 0},	/*  93 HTML_EMBED      */
    218     {"/option", NULL, 0, TFLG_END},	/*  94 HTML_N_OPTION   */
    219     {"head", ALST_NOP, MAXA_NOP, 0},	/*  95 HTML_HEAD       */
    220     {"/head", NULL, 0, TFLG_END},	/*  96 HTML_N_HEAD     */
    221     {"doctype", ALST_NOP, MAXA_NOP, 0},	/*  97 HTML_DOCTYPE    */
    222     {"noframes", ALST_NOFRAMES, MAXA_NOFRAMES, 0},	/*  98 HTML_NOFRAMES   */
    223     {"/noframes", NULL, 0, TFLG_END},	/*  99 HTML_N_NOFRAMES */
    224 
    225     {"sup", ALST_NOP, MAXA_NOP, 0},	/* 100 HTML_SUP       */
    226     {"/sup", NULL, 0, 0},	/* 101 HTML_N_SUP       */
    227     /* FIXME: Should /sup and /sub have TFLG_END ? */
    228     {"sub", ALST_NOP, MAXA_NOP, 0},	/* 102 HTML_SUB       */
    229     {"/sub", NULL, 0, 0},	/* 103 HTML_N_SUB       */
    230     {"link", ALST_LINK, MAXA_LINK, 0},	/*  104 HTML_LINK      */
    231     {"s", ALST_NOP, MAXA_NOP, 0},		/*  105 HTML_S        */
    232     {"/s", NULL, 0, TFLG_END},	/*  106 HTML_N_S      */
    233     {"q", ALST_NOP, MAXA_NOP, 0},		/*  107 HTML_Q */
    234     {"/q", NULL, 0, TFLG_END},	/*  108 HTML_N_Q */
    235     {"i", ALST_NOP, MAXA_NOP, 0},	/*  109 HTML_I */
    236     {"/i", NULL, 0, TFLG_END},	/*  110 HTML_N_I */
    237     {"strong", ALST_NOP, MAXA_NOP, 0},	/* 111 HTML_STRONG */
    238     {"/strong", NULL, 0, TFLG_END},	/* 112 HTML_N_STRONG */
    239     {"span", ALST_NOP, MAXA_NOP, 0},	/* 113 HTML_SPAN       */
    240     {"/span", NULL, 0, TFLG_END},	/* 114 HTML_N_SPAN     */
    241     {"abbr", ALST_NOP, MAXA_NOP, 0},		/* 115 HTML_ABBR */
    242     {"/abbr", NULL, 0, TFLG_END},	/* 116 HTML_N_ABBR */
    243     {"acronym", ALST_NOP, MAXA_NOP, 0},		/* 117 HTML_ACRONYM */
    244     {"/acronym", NULL, 0, TFLG_END},	/* 118 HTML_N_ACRONYM */
    245     {"basefont", ALST_NOP, MAXA_NOP, 0},	        /* 119 HTML_BASEFONT */
    246     {"bdo", ALST_NOP, MAXA_NOP, 0}, 		/* 120 HTML_BDO */
    247     {"/bdo", NULL, 0, TFLG_END},	/* 121 HTML_N_BDO */
    248     {"big", ALST_NOP, MAXA_NOP, 0},		/* 122 HTML_BIG */
    249     {"/big", NULL, 0, TFLG_END},	/* 123 HTML_N_BIG */
    250     {"button", ALST_NOP, MAXA_NOP, 0},		/* 124 HTML_BUTTON */
    251     {"fieldset", ALST_NOP, MAXA_NOP, 0},	        /* 125 HTML_FIELDSET */
    252     {"/fieldset", NULL, 0, TFLG_END},	/* 126 HTML_N_FIELDSET */
    253     {"iframe", ALST_NOP, MAXA_NOP, 0},		/* 127 HTML_IFRAME */
    254     {"label", ALST_NOP, MAXA_NOP, 0}, 		/* 128 HTML_LABEL */
    255     {"/label", NULL, 0, TFLG_END},	/* 129 HTML_N_LABEL */
    256     {"legend", ALST_NOP, MAXA_NOP, 0},		/* 130 HTML_LEGEND */
    257     {"/legend", NULL, 0, TFLG_END},	/* 131 HTML_N_LEGEND */
    258     {"noscript", ALST_NOP, MAXA_NOP, 0},	        /* 132 HTML_NOSCRIPT */
    259     {"/noscript", NULL, 0, TFLG_END},	/* 133 HTML_N_NOSCRIPT */
    260     {"object", ALST_NOP, MAXA_NOP, 0},		/* 134 HTML_OBJECT */
    261     {"optgroup", ALST_NOP, MAXA_NOP, 0},	        /* 135 HTML_OPTGROUP */
    262     {"/optgroup", NULL, 0, TFLG_END},	/* 136 HTML_N_OPTGROUP */
    263     {"param", ALST_NOP, MAXA_NOP, 0},		/* 137 HTML_PARAM */
    264     {"small", ALST_NOP, MAXA_NOP, 0}, 		/* 138 HTML_SMALL */
    265     {"/small", NULL, 0, TFLG_END},	/* 139 HTML_N_SMALL */
    266 
    267     {NULL, NULL, 0, 0},		/* 140 Undefined */
    268     {NULL, NULL, 0, 0},		/* 141 Undefined */
    269     {NULL, NULL, 0, 0},		/* 142 Undefined */
    270     {NULL, NULL, 0, 0},		/* 143 Undefined */
    271     {NULL, NULL, 0, 0},		/* 144 Undefined */
    272     {NULL, NULL, 0, 0},		/* 145 Undefined */
    273     {NULL, NULL, 0, 0},		/* 146 Undefined */
    274     {NULL, NULL, 0, 0},		/* 147 Undefined */
    275     {NULL, NULL, 0, 0},		/* 148 Undefined */
    276     {NULL, NULL, 0, 0},		/* 149 Undefined */
    277     {NULL, NULL, 0, 0},		/* 150 Undefined */
    278     {NULL, NULL, 0, 0},		/* 151 Undefined */
    279     {NULL, NULL, 0, 0},		/* 152 Undefined */
    280     {NULL, NULL, 0, 0},		/* 153 Undefined */
    281     {NULL, NULL, 0, 0},		/* 154 Undefined */
    282     {NULL, NULL, 0, 0},		/* 155 Undefined */
    283     {NULL, NULL, 0, 0},		/* 156 Undefined */
    284     {NULL, NULL, 0, 0},		/* 157 Undefined */
    285     {NULL, NULL, 0, 0},		/* 158 Undefined */
    286     {NULL, NULL, 0, 0},		/* 159 Undefined */
    287 
    288     /* pseudo tag */
    289     {"select_int", ALST_SELECT_INT, MAXA_SELECT_INT, TFLG_INT},	/* 160 HTML_SELECT_INT   */
    290     {"/select_int", NULL, 0, TFLG_INT | TFLG_END},	/* 161 HTML_N_SELECT_INT */
    291     {"option_int", ALST_OPTION, MAXA_OPTION, TFLG_INT},	/* 162 HTML_OPTION_INT   */
    292     {"textarea_int", ALST_TEXTAREA_INT, MAXA_TEXTAREA_INT, TFLG_INT},	/* 163 HTML_TEXTAREA_INT   */
    293     {"/textarea_int", NULL, 0, TFLG_INT | TFLG_END},	/* 164 HTML_N_TEXTAREA_INT */
    294     {"table_alt", ALST_TABLE_ALT, MAXA_TABLE_ALT, TFLG_INT},	/* 165 HTML_TABLE_ALT   */
    295     {"symbol", ALST_SYMBOL, MAXA_SYMBOL, TFLG_INT},	/* 166 HTML_SYMBOL */
    296     {"/symbol", NULL, 0, TFLG_INT | TFLG_END},	/* 167 HTML_N_SYMBOL      */
    297     {"pre_int", NULL, 0, TFLG_INT},	/* 168 HTML_PRE_INT     */
    298     {"/pre_int", NULL, 0, TFLG_INT | TFLG_END},	/* 169 HTML_N_PRE_INT   */
    299     {"title_alt", ALST_TITLE_ALT, MAXA_TITLE_ALT, TFLG_INT},	/* 170 HTML_TITLE_ALT   */
    300     {"form_int", ALST_FORM_INT, MAXA_FORM_INT, TFLG_INT},	/* 171 HTML_FORM_INT    */
    301     {"/form_int", NULL, 0, TFLG_INT | TFLG_END},	/* 172 HTML_N_FORM_INT  */
    302     {"dl_compact", NULL, 0, TFLG_INT},	/* 173 HTML_DL_COMPACT  */
    303     {"input_alt", ALST_INPUT_ALT, MAXA_INPUT_ALT, TFLG_INT},	/* 174 HTML_INPUT_ALT   */
    304     {"/input_alt", NULL, 0, TFLG_INT | TFLG_END},	/* 175 HTML_N_INPUT_ALT */
    305     {"img_alt", ALST_IMG_ALT, MAXA_IMG_ALT, TFLG_INT},	/* 176 HTML_IMG_ALT     */
    306     {"/img_alt", NULL, 0, TFLG_INT | TFLG_END},	/* 177 HTML_N_IMG_ALT   */
    307     {" ", ALST_NOP, MAXA_NOP, TFLG_INT},	/* 178 HTML_NOP         */
    308     {"pre_plain", NULL, 0, TFLG_INT},	/* 179 HTML_PRE_PLAIN         */
    309     {"/pre_plain", NULL, 0, TFLG_INT | TFLG_END},	/* 180 HTML_N_PRE_PLAIN         */
    310     {"internal", NULL, 0, TFLG_INT},	/* 181 HTML_INTERNAL   */
    311     {"/internal", NULL, 0, TFLG_INT | TFLG_END},	/* 182 HTML_N_INTERNAL   */
    312     {"div_int", ALST_P, MAXA_P, TFLG_INT},	/*  183 HTML_DIV_INT    */
    313     {"/div_int", NULL, 0, TFLG_INT | TFLG_END},	/*  184 HTML_N_DIV_INT  */
    314 };
    315 
    316 TagAttrInfo AttrMAP[MAX_TAGATTR] = {
    317     {NULL, VTYPE_NONE, 0},	/*  0 ATTR_UNKNOWN        */
    318     {"accept", VTYPE_NONE, 0},	/*  1 ATTR_ACCEPT         */
    319     {"accept-charset", VTYPE_STR, 0},	/*  2 ATTR_ACCEPT_CHARSET */
    320     {"action", VTYPE_ACTION, 0},	/*  3 ATTR_ACTION         */
    321     {"align", VTYPE_ALIGN, 0},	/*  4 ATTR_ALIGN          */
    322     {"alt", VTYPE_STR, 0},	/*  5 ATTR_ALT            */
    323     {"archive", VTYPE_STR, 0},	/*  6 ATTR_ARCHIVE        */
    324     {"background", VTYPE_STR, 0},	/*  7 ATTR_BACKGROUND     */
    325     {"border", VTYPE_NUMBER, 0},	/*  8 ATTR_BORDER         */
    326     {"cellpadding", VTYPE_NUMBER, 0},	/*  9 ATTR_CELLPADDING    */
    327     {"cellspacing", VTYPE_NUMBER, 0},	/* 10 ATTR_CELLSPACING    */
    328     {"charset", VTYPE_STR, 0},	/* 11 ATTR_CHARSET        */
    329     {"checked", VTYPE_NONE, 0},	/* 12 ATTR_CHECKED        */
    330     {"cols", VTYPE_MLENGTH, 0},	/* 13 ATTR_COLS           */
    331     {"colspan", VTYPE_NUMBER, 0},	/* 14 ATTR_COLSPAN        */
    332     {"content", VTYPE_STR, 0},	/* 15 ATTR_CONTENT        */
    333     {"enctype", VTYPE_ENCTYPE, 0},	/* 16 ATTR_ENCTYPE        */
    334     {"height", VTYPE_LENGTH, 0},	/* 17 ATTR_HEIGHT         */
    335     {"href", VTYPE_STR, 0},	/* 18 ATTR_HREF           */
    336     {"http-equiv", VTYPE_STR, 0},	/* 19 ATTR_HTTP_EQUIV     */
    337     {"id", VTYPE_STR, 0},	/* 20 ATTR_ID             */
    338     {"link", VTYPE_STR, 0},	/* 21 ATTR_LINK           */
    339     {"maxlength", VTYPE_NUMBER, 0},	/* 22 ATTR_MAXLENGTH      */
    340     {"method", VTYPE_METHOD, 0},	/* 23 ATTR_METHOD         */
    341     {"multiple", VTYPE_NONE, 0},	/* 24 ATTR_MULTIPLE       */
    342     {"name", VTYPE_STR, 0},	/* 25 ATTR_NAME           */
    343     {"nowrap", VTYPE_NONE, 0},	/* 26 ATTR_NOWRAP         */
    344     {"prompt", VTYPE_STR, 0},	/* 27 ATTR_PROMPT         */
    345     {"rows", VTYPE_MLENGTH, 0},	/* 28 ATTR_ROWS           */
    346     {"rowspan", VTYPE_NUMBER, 0},	/* 29 ATTR_ROWSPAN        */
    347     {"size", VTYPE_NUMBER, 0},	/* 30 ATTR_SIZE           */
    348     {"src", VTYPE_STR, 0},	/* 31 ATTR_SRC            */
    349     {"target", VTYPE_STR, 0},	/* 32 ATTR_TARGET         */
    350     {"type", VTYPE_TYPE, 0},	/* 33 ATTR_TYPE           */
    351     {"usemap", VTYPE_STR, 0},	/* 34 ATTR_USEMAP         */
    352     {"valign", VTYPE_VALIGN, 0},	/* 35 ATTR_VALIGN         */
    353     {"value", VTYPE_STR, 0},	/* 36 ATTR_VALUE          */
    354     {"vspace", VTYPE_NUMBER, 0},	/* 37 ATTR_VSPACE         */
    355     {"width", VTYPE_LENGTH, 0},	/* 38 ATTR_WIDTH          */
    356     {"compact", VTYPE_NONE, 0},	/* 39 ATTR_COMPACT        */
    357     {"start", VTYPE_NUMBER, 0},	/* 40 ATTR_START          */
    358     {"selected", VTYPE_NONE, 0},	/* 41 ATTR_SELECTED       */
    359     {"label", VTYPE_STR, 0},	/* 42 ATTR_LABEL          */
    360     {"readonly", VTYPE_NONE, 0},	/* 43 ATTR_READONLY       */
    361     {"shape", VTYPE_STR, 0},	/* 44 ATTR_SHAPE          */
    362     {"coords", VTYPE_STR, 0},	/* 45 ATTR_COORDS         */
    363     {"ismap", VTYPE_NONE, 0},	/* 46 ATTR_ISMAP          */
    364     {"rel", VTYPE_STR, 0},	/* 47 ATTR_REL            */
    365     {"rev", VTYPE_STR, 0},	/* 48 ATTR_REV            */
    366     {"title", VTYPE_STR, 0},	/* 49 ATTR_TITLE          */
    367     {"accesskey", VTYPE_STR, 0},	/* 50 ATTR_ACCESSKEY          */
    368     {NULL, VTYPE_NONE, 0},	/* 51 Undefined           */
    369     {NULL, VTYPE_NONE, 0},	/* 52 Undefined           */
    370     {NULL, VTYPE_NONE, 0},	/* 53 Undefined           */
    371     {NULL, VTYPE_NONE, 0},	/* 54 Undefined           */
    372     {NULL, VTYPE_NONE, 0},	/* 55 Undefined           */
    373     {NULL, VTYPE_NONE, 0},	/* 56 Undefined           */
    374     {NULL, VTYPE_NONE, 0},	/* 57 Undefined           */
    375     {NULL, VTYPE_NONE, 0},	/* 58 Undefined           */
    376     {NULL, VTYPE_NONE, 0},	/* 59 Undefined           */
    377 
    378     /* Internal attribute */
    379     {"xoffset", VTYPE_NUMBER, AFLG_INT},	/* 60 ATTR_XOFFSET        */
    380     {"yoffset", VTYPE_NUMBER, AFLG_INT},	/* 61 ATTR_YOFFSET        */
    381     {"top_margin", VTYPE_NUMBER, AFLG_INT},	/* 62 ATTR_TOP_MARGIN,    */
    382     {"bottom_margin", VTYPE_NUMBER, AFLG_INT},	/* 63 ATTR_BOTTOM_MARGIN, */
    383     {"tid", VTYPE_NUMBER, AFLG_INT},	/* 64 ATTR_TID            */
    384     {"fid", VTYPE_NUMBER, AFLG_INT},	/* 65 ATTR_FID            */
    385     {"for_table", VTYPE_NONE, AFLG_INT},	/* 66 ATTR_FOR_TABLE      */
    386     {"framename", VTYPE_STR, AFLG_INT},	/* 67 ATTR_FRAMENAME      */
    387     {"hborder", VTYPE_NONE, 0},	/* 68 ATTR_HBORDER        */
    388     {"hseq", VTYPE_NUMBER, AFLG_INT},	/* 69 ATTR_HSEQ           */
    389     {"no_effect", VTYPE_NONE, AFLG_INT},	/* 70 ATTR_NO_EFFECT      */
    390     {"referer", VTYPE_STR, AFLG_INT},	/* 71 ATTR_REFERER        */
    391     {"selectnumber", VTYPE_NUMBER, AFLG_INT},	/* 72 ATTR_SELECTNUMBER   */
    392     {"textareanumber", VTYPE_NUMBER, AFLG_INT},	/* 73 ATTR_TEXTAREANUMBER */
    393     {"pre_int", VTYPE_NONE, AFLG_INT},	/* 74 ATTR_PRE_INT      */
    394 };