⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 htmltags.c

📁 将konqueror浏览器移植到ARM9 2410中
💻 C
字号:
/* ANSI-C code produced by gperf version 2.7.2 *//* Command-line: gperf -a -L ANSI-C -D -E -C -l -o -t -k '*' -NfindTag -Hhash_tag -Wwordlist_tag htmltags.gperf  *//* This file is automatically generated from htmltags.in by maketags, do not edit *//* Copyright 1999 Lars Knoll */#include "htmltags.h"struct tags {    const char *name;    int id;};/* maximum key range = 277, duplicates = 1 */#ifdef __GNUC____inline#else#ifdef __cplusplusinline#endif#endifstatic unsigned inthash_tag (register const char *str, register unsigned int len){  static const unsigned short asso_values[] =    {      278, 278, 278, 278, 278, 278, 278, 278, 278, 278,      278, 278, 278, 278, 278, 278, 278, 278, 278, 278,      278, 278, 278, 278, 278, 278, 278, 278, 278, 278,      278, 278, 278, 278, 278, 278, 278, 278, 278, 278,      278, 278, 278, 278, 278,   0, 278, 278, 278,  40,       45,  60,  65,  20,  30, 278, 278, 278, 278, 278,      278, 278, 278, 278, 278, 278, 278, 278, 278, 278,      278, 278, 278, 278, 278, 278, 278, 278, 278, 278,      278, 278, 278, 278, 278, 278, 278, 278, 278, 278,      278, 278, 278, 278, 278, 278, 278,   0, 117,  35,       20,   0,  90,  75,  30,  10,   0,   5,  45,  80,       10,   0,  25,   5,   5,  40,   0,  60,  15, 278,       30,  35, 278, 278, 278, 278, 278, 278, 278, 278,      278, 278, 278, 278, 278, 278, 278, 278, 278, 278,      278, 278, 278, 278, 278, 278, 278, 278, 278, 278,      278, 278, 278, 278, 278, 278, 278, 278, 278, 278,      278, 278, 278, 278, 278, 278, 278, 278, 278, 278,      278, 278, 278, 278, 278, 278, 278, 278, 278, 278,      278, 278, 278, 278, 278, 278, 278, 278, 278, 278,      278, 278, 278, 278, 278, 278, 278, 278, 278, 278,      278, 278, 278, 278, 278, 278, 278, 278, 278, 278,      278, 278, 278, 278, 278, 278, 278, 278, 278, 278,      278, 278, 278, 278, 278, 278, 278, 278, 278, 278,      278, 278, 278, 278, 278, 278, 278, 278, 278, 278,      278, 278, 278, 278, 278, 278, 278, 278, 278, 278,      278, 278, 278, 278, 278, 278    };  register int hval = len;  switch (hval)    {      default:      case 10:        hval += asso_values[(unsigned char)str[9]];      case 9:        hval += asso_values[(unsigned char)str[8]];      case 8:        hval += asso_values[(unsigned char)str[7]];      case 7:        hval += asso_values[(unsigned char)str[6]];      case 6:        hval += asso_values[(unsigned char)str[5]];      case 5:        hval += asso_values[(unsigned char)str[4]];      case 4:        hval += asso_values[(unsigned char)str[3]];      case 3:        hval += asso_values[(unsigned char)str[2]];      case 2:        hval += asso_values[(unsigned char)str[1]];      case 1:        hval += asso_values[(unsigned char)str[0]];        break;    }  return hval;}#ifdef __GNUC____inline#endifconst struct tags *findTag (register const char *str, register unsigned int len){  enum    {      TOTAL_KEYWORDS = 102,      MIN_WORD_LENGTH = 1,      MAX_WORD_LENGTH = 10,      MIN_HASH_VALUE = 1,      MAX_HASH_VALUE = 277    };  static const unsigned char lengthtable[] =    {       1,  2,  1,  2,  4,  1,  2,  2,  3,  1,  2,  3,  2,  3,       1,  2,  8,  2,  3,  4,  6,  2,  4,  5,  6,  2,  4,  5,       1,  2,  3,  6,  2,  3,  2,  4,  2,  4,  2,  3,  4,  6,       7,  5,  2,  5,  2,  6,  7,  4,  2,  3,  5,  5,  1,  6,       3,  2,  5,  6,  7,  3,  9,  6,  7,  8,  6,  3,  3,  3,       4,  4,  6,  6,  4,  4,  5,  3,  5,  7,  4,  5,  4,  5,       6,  6,  7,  8,  3,  5,  8,  5,  3,  5,  8, 10,  8,  7,       4,  8,  8, 10    };  static const struct tags wordlist_tag[] =    {      {"a", ID_A},      {"tt", ID_TT},      {"q", ID_Q},      {"tr", ID_TR},      {"area", ID_AREA},      {"i", ID_I},      {"dt", ID_DT},      {"td", ID_TD},      {"var", ID_VAR},      {"p", ID_P},      {"th", ID_TH},      {"pre", ID_PRE},      {"hr", ID_HR},      {"dir", ID_DIR},      {"s", ID_S},      {"dd", ID_DD},      {"textarea", ID_TEXTAREA},      {"ol", ID_OL},      {"div", ID_DIV},      {"cite", ID_CITE},      {"option", ID_OPTION},      {"h5", ID_H5},      {"head", ID_HEAD},      {"thead", ID_THEAD},      {"center", ID_CENTER},      {"li", ID_LI},      {"code", ID_CODE},      {"title", ID_TITLE},      {"u", ID_U},      {"h6", ID_H6},      {"ins", ID_INS},      {"strike", ID_STRIKE},      {"dl", ID_DL},      {"del", ID_DEL},      {"h1", ID_H1},      {"link", ID_LINK},      {"h2", ID_H2},      {"span", ID_SPAN},      {"em", ID_EM},      {"col", ID_COL},      {"meta", ID_META},      {"anchor", ID_A},      {"caption", ID_CAPTION},      {"layer", ID_LAYER},      {"h3", ID_H3},      {"tfoot", ID_TFOOT},      {"h4", ID_H4},      {"applet", ID_APPLET},      {"nolayer", ID_NOLAYER},      {"font", ID_FONT},      {"ul", ID_UL},      {"map", ID_MAP},      {"input", ID_INPUT},      {"param", ID_PARAM},      {"b", ID_B},      {"script", ID_SCRIPT},      {"dfn", ID_DFN},      {"br", ID_BR},      {"style", ID_STYLE},      {"select", ID_SELECT},      {"isindex", ID_ISINDEX},      {"sup", ID_SUP},      {"plaintext", ID_PLAINTEXT},      {"keygen", ID_KEYGEN},      {"address", ID_ADDRESS},      {"noscript", ID_NOSCRIPT},      {"strong", ID_STRONG},      {"xmp", ID_PRE},      {"bdo", ID_BDO},      {"kbd", ID_KBD},      {"samp", ID_SAMP},      {"menu", ID_MENU},      {"legend", ID_LEGEND},      {"object", ID_OBJECT},      {"html", ID_HTML},      {"base", ID_BASE},      {"table", ID_TABLE},      {"img", ID_IMG},      {"image", ID_IMG},      {"acronym", ID_ACRONYM},      {"body", ID_BODY},      {"tbody", ID_TBODY},      {"form", ID_FORM},      {"frame", ID_FRAME},      {"iframe", ID_IFRAME},      {"button", ID_BUTTON},      {"listing", ID_LISTING},      {"optgroup", ID_OPTGROUP},      {"big", ID_BIG},      {"label", ID_LABEL},      {"fieldset", ID_FIELDSET},      {"small", ID_SMALL},      {"sub", ID_SUB},      {"embed", ID_EMBED},      {"frameset", ID_FRAMESET},      {"-konqblock", ID__KONQBLOCK},      {"noframes", ID_NOFRAMES},      {"noembed", ID_NOEMBED},      {"abbr", ID_ABBR},      {"colgroup", ID_COLGROUP},      {"basefont", ID_BASEFONT},      {"blockquote", ID_BLOCKQUOTE}    };  static const signed char lookup[] =    {        -1,    0,    1,   -1,   -1,   -1,    2,    3,        -1,    4,   -1,    5,   -1,   -1,   -1,   -1,        -1,   -1,   -1,   -1,   -1,   -1, -127,    8,       -96,   -2,    9,   -1,   -1,   -1,   -1,   -1,        10,   11,   -1,   -1,   -1,   12,   13,   -1,        -1,   14,   15,   16,   -1,   -1,   -1,   17,        18,   19,   -1,   20,   21,   -1,   22,   23,        24,   25,   -1,   26,   27,   28,   29,   30,        -1,   -1,   31,   32,   33,   -1,   -1,   -1,        34,   -1,   35,   -1,   -1,   36,   -1,   37,        -1,   -1,   38,   39,   40,   -1,   41,   42,        -1,   -1,   43,   -1,   44,   -1,   -1,   45,        -1,   46,   -1,   -1,   -1,   47,   48,   -1,        49,   -1,   -1,   50,   51,   -1,   52,   -1,        -1,   -1,   -1,   53,   -1,   -1,   54,   -1,        -1,   55,   -1,   56,   57,   58,   59,   60,        61,   62,   -1,   63,   64,   65,   -1,   -1,        66,   -1,   67,   -1,   68,   -1,   -1,   -1,        -1,   69,   -1,   -1,   -1,   70,   -1,   -1,        -1,   -1,   71,   -1,   72,   -1,   73,   74,        -1,   75,   -1,   -1,   -1,   -1,   -1,   76,        77,   -1,   78,   -1,   79,   -1,   -1,   -1,        80,   81,   -1,   82,   83,   -1,   -1,   -1,        -1,   -1,   -1,   -1,   -1,   -1,   -1,   84,        -1,   85,   -1,   -1,   -1,   86,   87,   -1,        -1,   -1,   -1,   -1,   -1,   88,   -1,   -1,        -1,   -1,   -1,   -1,   89,   90,   -1,   91,        -1,   -1,   -1,   -1,   92,   -1,   93,   94,        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,        95,   96,   97,   -1,   -1,   -1,   -1,   -1,        -1,   -1,   -1,   98,   -1,   -1,   -1,   -1,        -1,   -1,   -1,   -1,   -1,   99,   -1,   -1,        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,        -1,  100,   -1,   -1,   -1,   -1,   -1,   -1,        -1,   -1,   -1,   -1,   -1,  101    };  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)    {      register int key = hash_tag (str, len);      if (key <= MAX_HASH_VALUE && key >= 0)        {          register int index = lookup[key];          if (index >= 0)            {              if (len == lengthtable[index])                {                  register const char *s = wordlist_tag[index].name;                  if (*str == *s && !memcmp (str + 1, s + 1, len - 1))                    return &wordlist_tag[index];                }            }          else if (index < -TOTAL_KEYWORDS)            {              register int offset = - 1 - TOTAL_KEYWORDS - index;              register const unsigned char *lengthptr = &lengthtable[TOTAL_KEYWORDS + lookup[offset]];              register const struct tags *wordptr = &wordlist_tag[TOTAL_KEYWORDS + lookup[offset]];              register const struct tags *wordendptr = wordptr + -lookup[offset + 1];              while (wordptr < wordendptr)                {                  if (len == *lengthptr)                    {                      register const char *s = wordptr->name;                      if (*str == *s && !memcmp (str + 1, s + 1, len - 1))                        return wordptr;                    }                  lengthptr++;                  wordptr++;                }            }        }    }  return 0;}static const char * tagList[] = {"",    "A",    "ABBR",    "ACRONYM",    "ADDRESS",    "APPLET",    "AREA",    "B",    "BASE",    "BASEFONT",    "BDO",    "BIG",    "BLOCKQUOTE",    "BODY",    "BR",    "BUTTON",    "CAPTION",    "CENTER",    "CITE",    "CODE",    "COL",    "COLGROUP",    "DD",    "DEL",    "DFN",    "DIR",    "DIV",    "DL",    "DT",    "EM",    "EMBED",    "FIELDSET",    "FONT",    "FORM",    "FRAME",    "FRAMESET",    "H1",    "H2",    "H3",    "H4",    "H5",    "H6",    "HEAD",    "HR",    "HTML",    "I",    "IFRAME",    "IMG",    "INPUT",    "INS",    "ISINDEX",    "KBD",    "KEYGEN",    "-KONQBLOCK",    "LABEL",    "LAYER",    "LEGEND",    "LI",    "LINK",    "LISTING",    "MAP",    "MENU",    "META",    "NOEMBED",    "NOFRAMES",    "NOSCRIPT",    "NOLAYER",    "OBJECT",    "OL",    "OPTGROUP",    "OPTION",    "P",    "PARAM",    "PLAINTEXT",    "PRE",    "Q",    "S",    "SAMP",    "SCRIPT",    "SELECT",    "SMALL",    "SPAN",    "STRIKE",    "STRONG",    "STYLE",    "SUB",    "SUP",    "TABLE",    "TBODY",    "TD",    "TEXTAREA",    "TFOOT",    "TH",    "THEAD",    "TITLE",    "TR",    "TT",    "U",    "UL",    "VAR","TEXT","COMMENT",    "/A",    "/ABBR",    "/ACRONYM",    "/ADDRESS",    "/APPLET",    "/AREA",    "/B",    "/BASE",    "/BASEFONT",    "/BDO",    "/BIG",    "/BLOCKQUOTE",    "/BODY",    "/BR",    "/BUTTON",    "/CAPTION",    "/CENTER",    "/CITE",    "/CODE",    "/COL",    "/COLGROUP",    "/DD",    "/DEL",    "/DFN",    "/DIR",    "/DIV",    "/DL",    "/DT",    "/EM",    "/EMBED",    "/FIELDSET",    "/FONT",    "/FORM",    "/FRAME",    "/FRAMESET",    "/H1",    "/H2",    "/H3",    "/H4",    "/H5",    "/H6",    "/HEAD",    "/HR",    "/HTML",    "/I",    "/IFRAME",    "/IMG",    "/INPUT",    "/INS",    "/ISINDEX",    "/KBD",    "/KEYGEN",    "/-KONQBLOCK",    "/LABEL",    "/LAYER",    "/LEGEND",    "/LI",    "/LINK",    "/LISTING",    "/MAP",    "/MENU",    "/META",    "/NOEMBED",    "/NOFRAMES",    "/NOSCRIPT",    "/NOLAYER",    "/OBJECT",    "/OL",    "/OPTGROUP",    "/OPTION",    "/P",    "/PARAM",    "/PLAINTEXT",    "/PRE",    "/Q",    "/S",    "/SAMP",    "/SCRIPT",    "/SELECT",    "/SMALL",    "/SPAN",    "/STRIKE",    "/STRONG",    "/STYLE",    "/SUB",    "/SUP",    "/TABLE",    "/TBODY",    "/TD",    "/TEXTAREA",    "/TFOOT",    "/TH",    "/THEAD",    "/TITLE",    "/TR",    "/TT",    "/U",    "/UL",    "/VAR",    0};DOMString getTagName(unsigned short id){    if(id > ID_CLOSE_TAG*2) id = ID_CLOSE_TAG+1;    return DOMString(tagList[id]);};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -