зеркало из https://github.com/mozilla/pjs.git
resurecting until UNIX build autogenerate problem is fixed
This commit is contained in:
Родитель
b2dd64ba03
Коммит
e603ee7e26
|
@ -0,0 +1,97 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
|
||||
/* Do not edit - generated by gentags.pl */
|
||||
#include "nsCRT.h"
|
||||
#include "nsHTMLTags.h"
|
||||
|
||||
static char* tagTable[] = {
|
||||
"a", "abbr", "acronym", "address", "applet", "area", "b", "base",
|
||||
"basefont", "bdo", "bgsound", "big", "blink", "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", "ilayer", "img", "input", "ins", "isindex",
|
||||
"kbd", "keygen", "label", "layer", "legend", "li", "link", "listing",
|
||||
"map", "menu", "meta", "multicol", "nobr", "noembed", "noframes",
|
||||
"nolayer", "noscript", "object", "ol", "optgroup", "option", "p", "param",
|
||||
"plaintext", "pre", "q", "s", "samp", "script", "select", "server",
|
||||
"small", "sound", "spacer", "span", "strike", "strong", "style", "sub",
|
||||
"sup", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "title",
|
||||
"tr", "tt", "u", "ul", "var", "wbr", "xmp"
|
||||
};
|
||||
|
||||
nsHTMLTag NS_TagToEnum(const char* aTagName) {
|
||||
int low = 0;
|
||||
int high = NS_HTML_TAG_MAX - 1;
|
||||
while (low <= high) {
|
||||
int middle = (low + high) >> 1;
|
||||
int result = nsCRT::strcasecmp(aTagName, tagTable[middle]);
|
||||
if (result == 0)
|
||||
return (nsHTMLTag) (middle + 1);
|
||||
if (result < 0)
|
||||
high = middle - 1;
|
||||
else
|
||||
low = middle + 1;
|
||||
}
|
||||
return eHTMLTag_userdefined;
|
||||
}
|
||||
|
||||
const char* NS_EnumToTag(nsHTMLTag aTagID) {
|
||||
if ((int(aTagID) <= 0) || (int(aTagID) > NS_HTML_TAG_MAX)) {
|
||||
return 0;
|
||||
}
|
||||
return tagTable[int(aTagID) - 1];
|
||||
}
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
#include <stdio.h>
|
||||
|
||||
class nsTestTagTable {
|
||||
public:
|
||||
nsTestTagTable() {
|
||||
const char *tag;
|
||||
nsHTMLTag id;
|
||||
|
||||
// Make sure we can find everything we are supposed to
|
||||
for (int i = 0; i < NS_HTML_TAG_MAX; i++) {
|
||||
tag = tagTable[i];
|
||||
id = NS_TagToEnum(tag);
|
||||
NS_ASSERTION(id != eHTMLTag_userdefined, "can't find tag id");
|
||||
const char* check = NS_EnumToTag(id);
|
||||
NS_ASSERTION(check == tag, "can't map id back to tag");
|
||||
}
|
||||
|
||||
// Make sure we don't find things that aren't there
|
||||
id = NS_TagToEnum("@");
|
||||
NS_ASSERTION(id == eHTMLTag_userdefined, "found @");
|
||||
id = NS_TagToEnum("zzzzz");
|
||||
NS_ASSERTION(id == eHTMLTag_userdefined, "found zzzzz");
|
||||
|
||||
tag = NS_EnumToTag((nsHTMLTag) 0);
|
||||
NS_ASSERTION(0 == tag, "found enum 0");
|
||||
tag = NS_EnumToTag((nsHTMLTag) -1);
|
||||
NS_ASSERTION(0 == tag, "found enum -1");
|
||||
tag = NS_EnumToTag((nsHTMLTag) (NS_HTML_TAG_MAX + 1));
|
||||
NS_ASSERTION(0 == tag, "found past max enum");
|
||||
}
|
||||
};
|
||||
nsTestTagTable validateTagTable;
|
||||
#endif
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
|
||||
/* Do not edit - generated by gentags.pl */
|
||||
#ifndef nsHTMLTags_h___
|
||||
#define nsHTMLTags_h___
|
||||
#include "nshtmlpars.h"
|
||||
enum nsHTMLTag {
|
||||
/* this enum must be first and must be zero */
|
||||
eHTMLTag_unknown=0,
|
||||
|
||||
/* begin tag enums */
|
||||
eHTMLTag_a=1, eHTMLTag_abbr=2, eHTMLTag_acronym=3, eHTMLTag_address=4,
|
||||
eHTMLTag_applet=5, eHTMLTag_area=6, eHTMLTag_b=7, eHTMLTag_base=8,
|
||||
eHTMLTag_basefont=9, eHTMLTag_bdo=10, eHTMLTag_bgsound=11, eHTMLTag_big=12,
|
||||
eHTMLTag_blink=13, eHTMLTag_blockquote=14, eHTMLTag_body=15,
|
||||
eHTMLTag_br=16, eHTMLTag_button=17, eHTMLTag_caption=18,
|
||||
eHTMLTag_center=19, eHTMLTag_cite=20, eHTMLTag_code=21, eHTMLTag_col=22,
|
||||
eHTMLTag_colgroup=23, eHTMLTag_dd=24, eHTMLTag_del=25, eHTMLTag_dfn=26,
|
||||
eHTMLTag_dir=27, eHTMLTag_div=28, eHTMLTag_dl=29, eHTMLTag_dt=30,
|
||||
eHTMLTag_em=31, eHTMLTag_embed=32, eHTMLTag_fieldset=33, eHTMLTag_font=34,
|
||||
eHTMLTag_form=35, eHTMLTag_frame=36, eHTMLTag_frameset=37, eHTMLTag_h1=38,
|
||||
eHTMLTag_h2=39, eHTMLTag_h3=40, eHTMLTag_h4=41, eHTMLTag_h5=42,
|
||||
eHTMLTag_h6=43, eHTMLTag_head=44, eHTMLTag_hr=45, eHTMLTag_html=46,
|
||||
eHTMLTag_i=47, eHTMLTag_iframe=48, eHTMLTag_ilayer=49, eHTMLTag_img=50,
|
||||
eHTMLTag_input=51, eHTMLTag_ins=52, eHTMLTag_isindex=53, eHTMLTag_kbd=54,
|
||||
eHTMLTag_keygen=55, eHTMLTag_label=56, eHTMLTag_layer=57,
|
||||
eHTMLTag_legend=58, eHTMLTag_li=59, eHTMLTag_link=60, eHTMLTag_listing=61,
|
||||
eHTMLTag_map=62, eHTMLTag_menu=63, eHTMLTag_meta=64, eHTMLTag_multicol=65,
|
||||
eHTMLTag_nobr=66, eHTMLTag_noembed=67, eHTMLTag_noframes=68,
|
||||
eHTMLTag_nolayer=69, eHTMLTag_noscript=70, eHTMLTag_object=71,
|
||||
eHTMLTag_ol=72, eHTMLTag_optgroup=73, eHTMLTag_option=74, eHTMLTag_p=75,
|
||||
eHTMLTag_param=76, eHTMLTag_plaintext=77, eHTMLTag_pre=78, eHTMLTag_q=79,
|
||||
eHTMLTag_s=80, eHTMLTag_samp=81, eHTMLTag_script=82, eHTMLTag_select=83,
|
||||
eHTMLTag_server=84, eHTMLTag_small=85, eHTMLTag_sound=86,
|
||||
eHTMLTag_spacer=87, eHTMLTag_span=88, eHTMLTag_strike=89,
|
||||
eHTMLTag_strong=90, eHTMLTag_style=91, eHTMLTag_sub=92, eHTMLTag_sup=93,
|
||||
eHTMLTag_table=94, eHTMLTag_tbody=95, eHTMLTag_td=96, eHTMLTag_textarea=97,
|
||||
eHTMLTag_tfoot=98, eHTMLTag_th=99, eHTMLTag_thead=100, eHTMLTag_title=101,
|
||||
eHTMLTag_tr=102, eHTMLTag_tt=103, eHTMLTag_u=104, eHTMLTag_ul=105,
|
||||
eHTMLTag_var=106, eHTMLTag_wbr=107, eHTMLTag_xmp=108,
|
||||
|
||||
/* The remaining enums are not for tags */
|
||||
eHTMLTag_text=109, eHTMLTag_whitespace=110, eHTMLTag_newline=111,
|
||||
eHTMLTag_comment=112, eHTMLTag_entity=113, eHTMLTag_userdefined=114,
|
||||
eHTMLTag_secret_h1style=115, eHTMLTag_secret_h2style=116,
|
||||
eHTMLTag_secret_h3style=117, eHTMLTag_secret_h4style=118,
|
||||
eHTMLTag_secret_h5style=119, eHTMLTag_secret_h6style=120
|
||||
};
|
||||
#define NS_HTML_TAG_MAX 108
|
||||
|
||||
extern NS_HTMLPARS nsHTMLTag NS_TagToEnum(const char* aTag);
|
||||
extern NS_HTMLPARS const char* NS_EnumToTag(nsHTMLTag aEnum);
|
||||
|
||||
#endif /* nsHTMLTags_h___ */
|
|
@ -0,0 +1,97 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
|
||||
/* Do not edit - generated by gentags.pl */
|
||||
#include "nsCRT.h"
|
||||
#include "nsHTMLTags.h"
|
||||
|
||||
static char* tagTable[] = {
|
||||
"a", "abbr", "acronym", "address", "applet", "area", "b", "base",
|
||||
"basefont", "bdo", "bgsound", "big", "blink", "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", "ilayer", "img", "input", "ins", "isindex",
|
||||
"kbd", "keygen", "label", "layer", "legend", "li", "link", "listing",
|
||||
"map", "menu", "meta", "multicol", "nobr", "noembed", "noframes",
|
||||
"nolayer", "noscript", "object", "ol", "optgroup", "option", "p", "param",
|
||||
"plaintext", "pre", "q", "s", "samp", "script", "select", "server",
|
||||
"small", "sound", "spacer", "span", "strike", "strong", "style", "sub",
|
||||
"sup", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "title",
|
||||
"tr", "tt", "u", "ul", "var", "wbr", "xmp"
|
||||
};
|
||||
|
||||
nsHTMLTag NS_TagToEnum(const char* aTagName) {
|
||||
int low = 0;
|
||||
int high = NS_HTML_TAG_MAX - 1;
|
||||
while (low <= high) {
|
||||
int middle = (low + high) >> 1;
|
||||
int result = nsCRT::strcasecmp(aTagName, tagTable[middle]);
|
||||
if (result == 0)
|
||||
return (nsHTMLTag) (middle + 1);
|
||||
if (result < 0)
|
||||
high = middle - 1;
|
||||
else
|
||||
low = middle + 1;
|
||||
}
|
||||
return eHTMLTag_userdefined;
|
||||
}
|
||||
|
||||
const char* NS_EnumToTag(nsHTMLTag aTagID) {
|
||||
if ((int(aTagID) <= 0) || (int(aTagID) > NS_HTML_TAG_MAX)) {
|
||||
return 0;
|
||||
}
|
||||
return tagTable[int(aTagID) - 1];
|
||||
}
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
#include <stdio.h>
|
||||
|
||||
class nsTestTagTable {
|
||||
public:
|
||||
nsTestTagTable() {
|
||||
const char *tag;
|
||||
nsHTMLTag id;
|
||||
|
||||
// Make sure we can find everything we are supposed to
|
||||
for (int i = 0; i < NS_HTML_TAG_MAX; i++) {
|
||||
tag = tagTable[i];
|
||||
id = NS_TagToEnum(tag);
|
||||
NS_ASSERTION(id != eHTMLTag_userdefined, "can't find tag id");
|
||||
const char* check = NS_EnumToTag(id);
|
||||
NS_ASSERTION(check == tag, "can't map id back to tag");
|
||||
}
|
||||
|
||||
// Make sure we don't find things that aren't there
|
||||
id = NS_TagToEnum("@");
|
||||
NS_ASSERTION(id == eHTMLTag_userdefined, "found @");
|
||||
id = NS_TagToEnum("zzzzz");
|
||||
NS_ASSERTION(id == eHTMLTag_userdefined, "found zzzzz");
|
||||
|
||||
tag = NS_EnumToTag((nsHTMLTag) 0);
|
||||
NS_ASSERTION(0 == tag, "found enum 0");
|
||||
tag = NS_EnumToTag((nsHTMLTag) -1);
|
||||
NS_ASSERTION(0 == tag, "found enum -1");
|
||||
tag = NS_EnumToTag((nsHTMLTag) (NS_HTML_TAG_MAX + 1));
|
||||
NS_ASSERTION(0 == tag, "found past max enum");
|
||||
}
|
||||
};
|
||||
nsTestTagTable validateTagTable;
|
||||
#endif
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
|
||||
/* Do not edit - generated by gentags.pl */
|
||||
#ifndef nsHTMLTags_h___
|
||||
#define nsHTMLTags_h___
|
||||
#include "nshtmlpars.h"
|
||||
enum nsHTMLTag {
|
||||
/* this enum must be first and must be zero */
|
||||
eHTMLTag_unknown=0,
|
||||
|
||||
/* begin tag enums */
|
||||
eHTMLTag_a=1, eHTMLTag_abbr=2, eHTMLTag_acronym=3, eHTMLTag_address=4,
|
||||
eHTMLTag_applet=5, eHTMLTag_area=6, eHTMLTag_b=7, eHTMLTag_base=8,
|
||||
eHTMLTag_basefont=9, eHTMLTag_bdo=10, eHTMLTag_bgsound=11, eHTMLTag_big=12,
|
||||
eHTMLTag_blink=13, eHTMLTag_blockquote=14, eHTMLTag_body=15,
|
||||
eHTMLTag_br=16, eHTMLTag_button=17, eHTMLTag_caption=18,
|
||||
eHTMLTag_center=19, eHTMLTag_cite=20, eHTMLTag_code=21, eHTMLTag_col=22,
|
||||
eHTMLTag_colgroup=23, eHTMLTag_dd=24, eHTMLTag_del=25, eHTMLTag_dfn=26,
|
||||
eHTMLTag_dir=27, eHTMLTag_div=28, eHTMLTag_dl=29, eHTMLTag_dt=30,
|
||||
eHTMLTag_em=31, eHTMLTag_embed=32, eHTMLTag_fieldset=33, eHTMLTag_font=34,
|
||||
eHTMLTag_form=35, eHTMLTag_frame=36, eHTMLTag_frameset=37, eHTMLTag_h1=38,
|
||||
eHTMLTag_h2=39, eHTMLTag_h3=40, eHTMLTag_h4=41, eHTMLTag_h5=42,
|
||||
eHTMLTag_h6=43, eHTMLTag_head=44, eHTMLTag_hr=45, eHTMLTag_html=46,
|
||||
eHTMLTag_i=47, eHTMLTag_iframe=48, eHTMLTag_ilayer=49, eHTMLTag_img=50,
|
||||
eHTMLTag_input=51, eHTMLTag_ins=52, eHTMLTag_isindex=53, eHTMLTag_kbd=54,
|
||||
eHTMLTag_keygen=55, eHTMLTag_label=56, eHTMLTag_layer=57,
|
||||
eHTMLTag_legend=58, eHTMLTag_li=59, eHTMLTag_link=60, eHTMLTag_listing=61,
|
||||
eHTMLTag_map=62, eHTMLTag_menu=63, eHTMLTag_meta=64, eHTMLTag_multicol=65,
|
||||
eHTMLTag_nobr=66, eHTMLTag_noembed=67, eHTMLTag_noframes=68,
|
||||
eHTMLTag_nolayer=69, eHTMLTag_noscript=70, eHTMLTag_object=71,
|
||||
eHTMLTag_ol=72, eHTMLTag_optgroup=73, eHTMLTag_option=74, eHTMLTag_p=75,
|
||||
eHTMLTag_param=76, eHTMLTag_plaintext=77, eHTMLTag_pre=78, eHTMLTag_q=79,
|
||||
eHTMLTag_s=80, eHTMLTag_samp=81, eHTMLTag_script=82, eHTMLTag_select=83,
|
||||
eHTMLTag_server=84, eHTMLTag_small=85, eHTMLTag_sound=86,
|
||||
eHTMLTag_spacer=87, eHTMLTag_span=88, eHTMLTag_strike=89,
|
||||
eHTMLTag_strong=90, eHTMLTag_style=91, eHTMLTag_sub=92, eHTMLTag_sup=93,
|
||||
eHTMLTag_table=94, eHTMLTag_tbody=95, eHTMLTag_td=96, eHTMLTag_textarea=97,
|
||||
eHTMLTag_tfoot=98, eHTMLTag_th=99, eHTMLTag_thead=100, eHTMLTag_title=101,
|
||||
eHTMLTag_tr=102, eHTMLTag_tt=103, eHTMLTag_u=104, eHTMLTag_ul=105,
|
||||
eHTMLTag_var=106, eHTMLTag_wbr=107, eHTMLTag_xmp=108,
|
||||
|
||||
/* The remaining enums are not for tags */
|
||||
eHTMLTag_text=109, eHTMLTag_whitespace=110, eHTMLTag_newline=111,
|
||||
eHTMLTag_comment=112, eHTMLTag_entity=113, eHTMLTag_userdefined=114,
|
||||
eHTMLTag_secret_h1style=115, eHTMLTag_secret_h2style=116,
|
||||
eHTMLTag_secret_h3style=117, eHTMLTag_secret_h4style=118,
|
||||
eHTMLTag_secret_h5style=119, eHTMLTag_secret_h6style=120
|
||||
};
|
||||
#define NS_HTML_TAG_MAX 108
|
||||
|
||||
extern NS_HTMLPARS nsHTMLTag NS_TagToEnum(const char* aTag);
|
||||
extern NS_HTMLPARS const char* NS_EnumToTag(nsHTMLTag aEnum);
|
||||
|
||||
#endif /* nsHTMLTags_h___ */
|
Загрузка…
Ссылка в новой задаче