diff options
Diffstat (limited to 'WWW')
30 files changed, 2571 insertions, 1654 deletions
diff --git a/WWW/Library/Implementation/CommonMakefile b/WWW/Library/Implementation/CommonMakefile index c176beda..ff548663 100644 --- a/WWW/Library/Implementation/CommonMakefile +++ b/WWW/Library/Implementation/CommonMakefile @@ -75,7 +75,7 @@ CERNLIBBIN = $(WWW)/bin COMMON = $(LOB)/HTParse.o $(LOB)/HTAccess.o $(LOB)/HTTP.o \ $(LOB)/HTFile.o $(LOB)/HTBTree.o $(LOB)/HTFTP.o $(LOB)/HTTCP.o \ $(LOB)/SGML.o $(LOB)/HTMLDTD.o $(LOB)/HTChunk.o \ - $(LOB)/HTPlain.o $(LOB)/HTWriter.o \ + $(LOB)/HTPlain.o \ $(LOB)/HTMLGen.o \ $(LOB)/HTAtom.o $(LOB)/HTAnchor.o $(LOB)/HTStyle.o \ $(LOB)/HTList.o $(LOB)/HTString.o \ @@ -92,7 +92,7 @@ CFILES = $(CMN)HTParse.c $(CMN)HTAccess.c $(CMN)HTTP.c $(CMN)HTFile.c \ $(CMN)HTBTree.c \ $(CMN)HTFTP.c $(CMN)HTTCP.c $(CMN)SGML.c \ $(CMN)HTMLDTD.c \ - $(CMN)HTPlain.c $(CMN)HTWriter.c \ + $(CMN)HTPlain.c \ $(CMN)HTMLGen.c \ $(CMN)HTChunk.c $(CMN)HTAtom.c $(CMN)HTAnchor.c $(CMN)HTStyle.c \ $(CMN)HTList.c $(CMN)HTString.c $(CMN)HTRules.c \ @@ -107,7 +107,7 @@ CFILES = $(CMN)HTParse.c $(CMN)HTAccess.c $(CMN)HTTP.c $(CMN)HTFile.c \ HFILES = $(CMN)HTParse.h $(CMN)HTAccess.h $(CMN)HTTP.h $(CMN)HTFile.h \ $(CMN)HTBTree.h $(CMN)HTFTP.h $(CMN)HTTCP.h \ $(CMN)SGML.h $(CMN)HTML.h $(CMN)HTMLDTD.h $(CMN)HTChunk.h \ - $(CMN)HTPlain.h $(CMN)HTWriter.h \ + $(CMN)HTPlain.h \ $(CMN)HTFWriter.h $(CMN)HTMLGen.h \ $(CMN)HTStream.h \ $(CMN)HTAtom.h $(CMN)HTAnchor.h $(CMN)HTStyle.h \ @@ -284,10 +284,6 @@ $(LOB)/HTWAIS.o : $(OE) $(CMN)HTWAIS.c $(CMN)HTUtils.h $(CMN)HTList.h $(LOB)/HTWSRC.o : $(OE) $(CMN)HTWSRC.c $(CMN)HTUtils.h $(CMN)HTList.h $(COMPILE) $(CMN)HTWSRC.c -$(LOB)/HTWriter.o : $(OE) $(CMN)HTWriter.c $(CMN)HTWriter.h $(CMN)HTStream.h - $(COMPILE) $(CMN)HTWriter.c - - # Access Authorization $(LOB)/HTAAUtil.o : $(OE) $(CMN)HTAAUtil.c $(CMN)HTAAUtil.h \ diff --git a/WWW/Library/Implementation/HTAABrow.c b/WWW/Library/Implementation/HTAABrow.c index ca7979fe..0f72cc71 100644 --- a/WWW/Library/Implementation/HTAABrow.c +++ b/WWW/Library/Implementation/HTAABrow.c @@ -837,7 +837,9 @@ PUBLIC char *HTAA_composeAuth ARGS4( ** Setup atexit() freeing if not done already. - FM */ if (!free_HTAAGlobalsSet) { +#ifdef LY_FIND_LEAKS atexit(free_HTAAGlobals); +#endif free_HTAAGlobalsSet = TRUE; } @@ -1065,7 +1067,9 @@ PUBLIC BOOL HTAA_shouldRetryWithAuth ARGS4( ** Setup atexit() freeing if not done already. - FM */ if (!free_HTAAGlobalsSet) { +#ifdef LY_FIND_LEAKS atexit(free_HTAAGlobals); +#endif free_HTAAGlobalsSet = TRUE; } diff --git a/WWW/Library/Implementation/HTAAProt.c b/WWW/Library/Implementation/HTAAProt.c index 27e038f9..7a607e66 100644 --- a/WWW/Library/Implementation/HTAAProt.c +++ b/WWW/Library/Implementation/HTAAProt.c @@ -607,7 +607,9 @@ PRIVATE void save_gid_info ARGS2(char *, name, int, user) if (!known_grp) { known_grp = HTList_new(); if (!uidgid_cache_inited) { +#ifdef LY_FIND_LEAKS atexit(clear_uidgid_cache); +#endif uidgid_cache_inited = YES; } } @@ -624,7 +626,9 @@ PRIVATE void save_uid_info ARGS2(char *, name, int, user) if (!known_pwd) { known_pwd = HTList_new(); if (!uidgid_cache_inited) { +#ifdef LY_FIND_LEAKS atexit(clear_uidgid_cache); +#endif uidgid_cache_inited = YES; } } diff --git a/WWW/Library/Implementation/HTAAUtil.c b/WWW/Library/Implementation/HTAAUtil.c index 30dc677d..c978d24d 100644 --- a/WWW/Library/Implementation/HTAAUtil.c +++ b/WWW/Library/Implementation/HTAAUtil.c @@ -498,7 +498,9 @@ PUBLIC void HTAA_setupReader ARGS3(char *, start_of_headers, (size_t)(sizeof(char)*(buffer_length + 1))); } if (buffer == NULL) outofmem(__FILE__, "HTAA_setupReader"); +#ifdef LY_FIND_LEAKS atexit(FreeHTAAUtil); +#endif start_pointer = buffer; if (start_of_headers) { strncpy(buffer, start_of_headers, length); diff --git a/WWW/Library/Implementation/HTAccess.c b/WWW/Library/Implementation/HTAccess.c index 9d49018d..cc180e88 100644 --- a/WWW/Library/Implementation/HTAccess.c +++ b/WWW/Library/Implementation/HTAccess.c @@ -105,7 +105,9 @@ PUBLIC BOOL HTRegisterProtocol ARGS1( { if (!protocols) { protocols = HTList_new(); +#ifdef LY_FIND_LEAKS atexit(free_protocols); +#endif } HTList_addObject(protocols, protocol); return YES; diff --git a/WWW/Library/Implementation/HTAnchor.c b/WWW/Library/Implementation/HTAnchor.c index aa6a8875..22af2bfb 100644 --- a/WWW/Library/Implementation/HTAnchor.c +++ b/WWW/Library/Implementation/HTAnchor.c @@ -377,7 +377,9 @@ PUBLIC HTAnchor * HTAnchor_findAddress ARGS1( adult_table = (HTList **)calloc(HASH_SIZE, sizeof(HTList *)); if (!adult_table) outofmem(__FILE__, "HTAnchor_findAddress"); +#ifdef LY_FIND_LEAKS atexit(free_adult_table); +#endif } if (!adult_table[hash]) adult_table[hash] = HTList_new(); diff --git a/WWW/Library/Implementation/HTAssoc.c b/WWW/Library/Implementation/HTAssoc.c index f5dcbf11..05b631cd 100644 --- a/WWW/Library/Implementation/HTAssoc.c +++ b/WWW/Library/Implementation/HTAssoc.c @@ -18,9 +18,7 @@ #include <HTUtils.h> -#include <HTAAUtil.h> #include <HTAssoc.h> -#include <HTString.h> #include <LYLeaks.h> diff --git a/WWW/Library/Implementation/HTAtom.c b/WWW/Library/Implementation/HTAtom.c index 66e666dd..44ac6c7a 100644 --- a/WWW/Library/Implementation/HTAtom.c +++ b/WWW/Library/Implementation/HTAtom.c @@ -54,7 +54,9 @@ PUBLIC HTAtom * HTAtom_for ARGS1(CONST char *, string) for (i = 0; i < HASH_SIZE; i++) hash_table[i] = (HTAtom *) 0; initialised = YES; +#ifdef LY_FIND_LEAKS atexit(free_atoms); +#endif } /* Generate hash function diff --git a/WWW/Library/Implementation/HTChunk.c b/WWW/Library/Implementation/HTChunk.c index 7cab693c..0149dfff 100644 --- a/WWW/Library/Implementation/HTChunk.c +++ b/WWW/Library/Implementation/HTChunk.c @@ -70,6 +70,8 @@ PUBLIC void HTChunkFree ARGS1 (HTChunk *,ch) /* Append a character ** ------------------ */ +/* Warning: the code of this function is defined as macro in SGML.c. Change + the macro or undefine it in SGML.c when changing this function. -VH */ PUBLIC void HTChunkPutc ARGS2 (HTChunk *,ch, char,c) { if (ch->size >= ch->allocated) { diff --git a/WWW/Library/Implementation/HTFTP.c b/WWW/Library/Implementation/HTFTP.c index 4ec025ab..bd077644 100644 --- a/WWW/Library/Implementation/HTFTP.c +++ b/WWW/Library/Implementation/HTFTP.c @@ -636,7 +636,9 @@ PRIVATE int get_connection ARGS2( /* ** Set up freeing at exit. - FM */ +#ifdef LY_FIND_LEAKS atexit(free_FTPGlobals); +#endif firstuse = FALSE; } diff --git a/WWW/Library/Implementation/HTFile.c b/WWW/Library/Implementation/HTFile.c index 3a16e31e..3b82c090 100644 --- a/WWW/Library/Implementation/HTFile.c +++ b/WWW/Library/Implementation/HTFile.c @@ -23,7 +23,11 @@ #include <HTUtils.h> #ifndef VMS -/* #define LONG_LIST */ /* Define this for long style unix listings (ls -l) */ +#ifdef DOSPATH +#define LONG_LIST /* Define this for long style unix listings (ls -l), + the actual style is configurable from lynx.cfg */ +#define lstat stat +#endif /* #define NO_PARENT_DIR_REFERENCE */ /* Define this for no parent links */ #endif /* !VMS */ @@ -53,7 +57,6 @@ #include <HTAnchor.h> #include <HTAtom.h> #include <HTAAProt.h> -#include <HTWriter.h> #include <HTFWriter.h> #include <HTInit.h> #include <HTBTree.h> @@ -404,7 +407,7 @@ PRIVATE void LYListFmtParse ARGS5( } FREE(buf); END(HTML_PRE); - PUTS("\n"); + PUTC('\n'); FREE(str); } #endif /* LONG_LIST */ @@ -458,7 +461,9 @@ PUBLIC void HTSetSuffix5 ARGS5( */ if (!HTSuffixes) { HTSuffixes = HTList_new(); +#ifdef LY_FIND_LEAKS atexit(free_suffixes); +#endif } HTList_addObject(HTSuffixes, suff); @@ -516,6 +521,8 @@ PRIVATE void free_suffixes NOARGS } #endif /* LY_FIND_LEAKS */ +extern void HTDisplayPartial NOARGS; + /* Send README file. ** ----------------- ** @@ -565,6 +572,7 @@ Bug removed thanks to joe@athena.mit.edu */ #endif /* NOTDEFINED */ } END(HTML_PRE); + HTDisplayPartial(); fclose(fp); } } @@ -1310,26 +1318,26 @@ PUBLIC BOOL HTDirTitles ARGS3( #endif /* DIRED_SUPPORT */ START(HTML_HEAD); - PUTS("\n"); + PUTC('\n'); START(HTML_TITLE); PUTS(*printable ? printable : WELCOME_MSG); PUTS(SEGMENT_DIRECTORY); END(HTML_TITLE); - PUTS("\n"); + PUTC('\n'); END(HTML_HEAD); - PUTS("\n"); + PUTC('\n'); #ifdef DIRED_SUPPORT START(HTML_H2); PUTS(*printable ? SEGMENT_CURRENT_DIR : ""); PUTS(*printable ? printable : WELCOME_MSG); END(HTML_H2); - PUTS("\n"); + PUTC('\n'); #else START(HTML_H1); PUTS(*printable ? printable : WELCOME_MSG); END(HTML_H1); - PUTS("\n"); + PUTC('\n'); #endif /* DIRED_SUPPORT */ if (((0 == strncasecomp(printable, "vmsysu:", 7)) && (cp = strchr(printable, '.')) != NULL && @@ -1455,6 +1463,7 @@ PUBLIC BOOL HTDirTitles ARGS3( PUTS("/"); } END(HTML_A); + PUTC('\n'); } #endif /* !NO_PARENT_DIR_REFERENCE */ @@ -1463,6 +1472,361 @@ PUBLIC BOOL HTDirTitles ARGS3( return(need_parent_link); } +PRIVATE int print_local_dir ARGS5( + DIR *, dp, + char *, localname, + HTParentAnchor *, anchor, + HTFormat, format_out, + HTStream *, sink) +{ + HTStructured *target; /* HTML object */ + HTStructuredClass targetClass; + STRUCT_DIRENT * dirbuf; + char *logical = NULL; + char *pathname = NULL; + char *tail = NULL; + BOOL present[HTML_A_ATTRIBUTES]; + char * tmpfilename = NULL; + BOOL need_parent_link = FALSE; + struct stat file_info; + int status; + + CTRACE(tfp, "print_local_dir() started\n"); + + logical = HTAnchor_address((HTAnchor*)anchor); + pathname = HTParse(logical, "", + PARSE_PATH + PARSE_PUNCTUATION); + + if (!strcmp(pathname,"/")) { + /* + ** Root path. + */ + StrAllocCopy (tail, "/foo/.."); + } else { + char *p = strrchr(pathname, '/'); /* find last slash */ + + if (!p) { + /* + ** This probably should not happen, + ** but be prepared if it does. - KW + */ + StrAllocCopy (tail, "/foo/.."); + } else { + /* + ** Take slash off the beginning. + */ + StrAllocCopy(tail, (p + 1)); + } + } + FREE(pathname); + + if (UCLYhndl_HTFile_for_unspec >= 0) { + HTAnchor_setUCInfoStage(anchor, + UCLYhndl_HTFile_for_unspec, + UCT_STAGE_PARSER, + UCT_SETBY_DEFAULT); + } + + target = HTML_new(anchor, format_out, sink); + targetClass = *target->isa; /* Copy routine entry points */ + + { int i; + for (i = 0; i < HTML_A_ATTRIBUTES; i++) + present[i] = (i == HTML_A_HREF); + } + + /* + ** The need_parent_link flag will be set if an + ** "Up to <parent>" link was not created for a + ** readable parent in HTDirTitles() because + ** LONG_LIST is defined and NO_PARENT_DIR_REFERENCE + ** is not defined so that need we to create the + ** link via an LYListFmtParse() call. - FM + */ + need_parent_link = HTDirTitles(target, + (HTAnchor *)anchor, FALSE); + +#ifdef DIRED_SUPPORT + if (strncmp(anchor->address, "lynxcgi:", 8)) { + HTAnchor_setFormat((HTParentAnchor *) anchor, WWW_DIRED); + lynx_edit_mode = TRUE; + } +#endif /* DIRED_SUPPORT */ + if (HTDirReadme == HT_DIR_README_TOP) + do_readme(target, localname); + + + { + HTBTree * bt = HTBTree_new((HTComparer)strcmp); + int num_of_entries = 0; /* lines counter */ + + _HTProgress (gettext("Reading directory...")); + status = HT_LOADED; /* assume we don't get interrupted */ + while ((dirbuf = readdir(dp)) != NULL) { + /* + ** While there are directory entries to be read... + */ + char * dirname = NULL; + +#ifndef DOSPATH + if (dirbuf->d_ino == 0) + /* + ** If the entry is not being used, skip it. + */ + continue; +#endif + /* + ** Skip self, parent if handled in HTDirTitles() + ** or if NO_PARENT_DIR_REFERENCE is not defined, + ** and any dot files if no_dotfiles is set or + ** show_dotfiles is not set. - FM + */ + if (!strcmp(dirbuf->d_name, ".") /* self */ || + (!strcmp(dirbuf->d_name, "..") /* parent */ && + need_parent_link == FALSE) || + ((strcmp(dirbuf->d_name, "..")) && + (dirbuf->d_name[0] == '.' && + (no_dotfiles || !show_dotfiles)))) + continue; + + StrAllocCopy(tmpfilename, localname); + if (strcmp(localname, "/")) + /* + ** If filename is not root directory. + */ + StrAllocCat(tmpfilename, "/"); + + StrAllocCat(tmpfilename, dirbuf->d_name); + stat(tmpfilename, &file_info); + if (S_ISDIR(file_info.st_mode)) +#ifndef DIRED_SUPPORT + HTSprintf0(&dirname, "D%s",dirbuf->d_name); + else + HTSprintf0(&dirname, "F%s",dirbuf->d_name); + /* D & F to have first directories, then files */ +#else + { + if (dir_list_style == MIXED_STYLE) + HTSprintf0(&dirname, " %s/", dirbuf->d_name); + else if (!strcmp(dirbuf->d_name, "..")) + HTSprintf0(&dirname, "A%s", dirbuf->d_name); + else + HTSprintf0(&dirname, "D%s", dirbuf->d_name); + } + else if (dir_list_style == MIXED_STYLE) + HTSprintf0(&dirname, " %s", dirbuf->d_name); + else if (dir_list_style == FILES_FIRST) + HTSprintf0(&dirname, "C%s", dirbuf->d_name); + /* C & D to have first files, then directories */ + else + HTSprintf0(&dirname, "F%s", dirbuf->d_name); +#endif /* !DIRED_SUPPORT */ + /* + ** Sort dirname in the tree bt. + */ + HTBTree_add(bt, dirname); + +#ifdef DISP_PARTIAL + /* optimize for expensive operation: */ + if (num_of_entries % (partial_threshold > 0 ? + partial_threshold : display_lines) + == 0) { + if (HTCheckForInterrupt()) { + status = HT_PARTIAL_CONTENT; + break; + } + } + num_of_entries++; +#endif /* DISP_PARTIAL */ + + } /* end while directory entries left to read */ + + if (status != HT_PARTIAL_CONTENT) + _HTProgress (gettext("OK")); + else + CTRACE(tfp, "Reading the directory interrupred by user\n"); + + + /* + ** Run through tree printing out in order. + */ + { + HTBTElement * next_element = HTBTree_next(bt,NULL); + /* pick up the first element of the list */ + int num_of_entries_partial = 0; /* lines counter */ + + char state; + /* I for initial (.. file), + D for directory file, + F for file */ + +#ifdef DIRED_SUPPORT + char test; +#endif /* DIRED_SUPPORT */ + state = 'I'; + + while (next_element != NULL) { + char *entry, *file_extra; + + StrAllocCopy(tmpfilename,localname); + if (strcmp(localname, "/")) + /* + ** If filename is not root directory. + */ + StrAllocCat(tmpfilename, "/"); + + StrAllocCat(tmpfilename, + (char *)HTBTree_object(next_element)+1); + /* + ** Append the current entry's filename + ** to the path. + */ + HTSimplify(tmpfilename); + /* + ** Output the directory entry. + */ + if (strcmp((char *) + (HTBTree_object(next_element)), "D..") && + strcmp((char *) + (HTBTree_object(next_element)), "A..")) + { +#ifdef DIRED_SUPPORT + test = (*(char *)(HTBTree_object(next_element)) + == 'D' ? 'D' : 'F'); + if (state != test) { +#ifndef LONG_LIST + if (dir_list_style == FILES_FIRST) { + if (state == 'F') { + END(HTML_DIR); + PUTC('\n'); + } + } else if (dir_list_style != MIXED_STYLE) + if (state == 'D') { + END(HTML_DIR); + PUTC('\n'); + } +#endif /* !LONG_LIST */ + state = + (*(char *)(HTBTree_object(next_element)) + == 'D' ? 'D' : 'F'); + START(HTML_H2); + if (dir_list_style != MIXED_STYLE) { + START(HTML_EM); + PUTS(state == 'D' + ? LABEL_SUBDIRECTORIES + : LABEL_FILES); + END(HTML_EM); + } + END(HTML_H2); + PUTC('\n'); +#ifndef LONG_LIST + START(HTML_DIR); + PUTC('\n'); +#endif /* !LONG_LIST */ + } +#else + if (state != *(char *)(HTBTree_object( + next_element))) { +#ifndef LONG_LIST + if (state == 'D') { + END(HTML_DIR); + PUTC('\n'); + } +#endif /* !LONG_LIST */ + state = + (*(char *)(HTBTree_object(next_element)) + == 'D' ? 'D' : 'F'); + START(HTML_H2); + START(HTML_EM); + PUTS(state == 'D' + ? LABEL_SUBDIRECTORIES + : LABEL_FILES); + END(HTML_EM); + END(HTML_H2); + PUTC('\n'); +#ifndef LONG_LIST + START(HTML_DIR); + PUTC('\n'); +#endif /* !LONG_LIST */ + } +#endif /* DIRED_SUPPORT */ +#ifndef LONG_LIST + START(HTML_LI); +#endif /* !LONG_LIST */ + } + entry = (char*)HTBTree_object(next_element)+1; + file_extra = NULL; + +#ifdef LONG_LIST + LYListFmtParse(list_format, tmpfilename, target, + entry, tail); +#else + HTDirEntry(target, tail, entry); + PUTS(entry); + END(HTML_A); + if (file_extra) { + PUTS(file_extra); + FREE(file_extra); + } + MAYBE_END(HTML_LI); + PUTC('\n'); +#endif /* LONG_LIST */ + + next_element = HTBTree_next(bt, next_element); + /* pick up the next element of the list; + if none, return NULL*/ + + /* optimize for expensive operation: */ +#ifdef DISP_PARTIAL + if (num_of_entries_partial % + (partial_threshold > 0 ? partial_threshold : display_lines) + == 0) { + /* num_of_entries, num_of_entries_partial... */ + /* HTReadProgress...(bytes, 0); */ + HTDisplayPartial(); + + if (HTCheckForInterrupt()) { + _HTProgress (TRANSFER_INTERRUPTED); + status = HT_PARTIAL_CONTENT; + break; + } + } + num_of_entries_partial++; +#endif /* DISP_PARTIAL */ + + } /* end while next_element */ + + if (status == HT_LOADED) { + if (state == 'I') { + START(HTML_P); + PUTS("Empty Directory"); + } +#ifndef LONG_LIST + else + END(HTML_DIR); +#endif /* !LONG_LIST */ + } + } /* end printing out the tree in order */ + + closedir(dp); + FREE(logical); + FREE(tmpfilename); + FREE(tail); + HTBTreeAndObject_free(bt); + + if (status == HT_LOADED) { + if (HTDirReadme == HT_DIR_README_BOTTOM) + do_readme(target, localname); + FREE_TARGET; + } else { + ABORT_TARGET; + } + } + return status; /* document loaded, maybe partial */ +} + + + /* Load a document. ** ---------------- ** @@ -1931,16 +2295,7 @@ PUBLIC int HTLoadFile ARGS4( /* ** If localname is a directory. */ - HTStructured *target; /* HTML object */ - HTStructuredClass targetClass; DIR *dp; - STRUCT_DIRENT * dirbuf; - char *logical = NULL; - char *pathname = NULL; - char *tail = NULL; - BOOL present[HTML_A_ATTRIBUTES]; - char * tmpfilename = NULL; - BOOL need_parent_link = FALSE; struct stat file_info; CTRACE(tfp, "%s is a directory\n", localname); @@ -1983,288 +2338,14 @@ PUBLIC int HTLoadFile ARGS4( /* ** Directory access is allowed and possible. */ - logical = HTAnchor_address((HTAnchor*)anchor); - pathname = HTParse(logical, "", - PARSE_PATH + PARSE_PUNCTUATION); - - if (!strcmp(pathname,"/")) { - /* - ** Root path. - */ - StrAllocCopy (tail, "/foo/.."); - } else { - char *p = strrchr(pathname, '/'); /* find last slash */ - - if (!p) { - /* - ** This probably should not happen, - ** but be prepared if it does. - KW - */ - StrAllocCopy (tail, "/foo/.."); - } else { - /* - ** Take slash off the beginning. - */ - StrAllocCopy(tail, (p + 1)); - } - } - FREE(pathname); - - if (UCLYhndl_HTFile_for_unspec >= 0) { - HTAnchor_setUCInfoStage(anchor, - UCLYhndl_HTFile_for_unspec, - UCT_STAGE_PARSER, - UCT_SETBY_DEFAULT); - } - - target = HTML_new(anchor, format_out, sink); - targetClass = *target->isa; /* Copy routine entry points */ - - { int i; - for (i = 0; i < HTML_A_ATTRIBUTES; i++) - present[i] = (i == HTML_A_HREF); - } - - /* - ** The need_parent_link flag will be set if an - ** "Up to <parent>" link was not created for a - ** readable parent in HTDirTitles() because - ** LONG_LIST is defined and NO_PARENT_DIR_REFERENCE - ** is not defined so that need we to create the - ** link via an LYListFmtParse() call. - FM - */ - need_parent_link = HTDirTitles(target, - (HTAnchor *)anchor, FALSE); - -#ifdef DIRED_SUPPORT - if (strncmp(anchor->address, "lynxcgi:", 8)) { - HTAnchor_setFormat((HTParentAnchor *) anchor, WWW_DIRED); - lynx_edit_mode = TRUE; - } -#endif /* DIRED_SUPPORT */ - if (HTDirReadme == HT_DIR_README_TOP) - do_readme(target, localname); - { - HTBTree * bt = HTBTree_new((HTComparer)strcmp); - - status = HT_LOADED; /* assume we don't get interrupted */ - while ((dirbuf = readdir(dp)) != NULL) { - /* - ** While there are directory entries to be read... - */ - char * dirname = NULL; - -#ifndef DOSPATH - if (dirbuf->d_ino == 0) - /* - ** If the entry is not being used, skip it. - */ - continue; -#endif - /* - ** Skip self, parent if handled in HTDirTitles() - ** or if NO_PARENT_DIR_REFERENCE is not defined, - ** and any dot files if no_dotfiles is set or - ** show_dotfiles is not set. - FM - */ - if (!strcmp(dirbuf->d_name, ".") /* self */ || - (!strcmp(dirbuf->d_name, "..") /* parent */ && - need_parent_link == FALSE) || - ((strcmp(dirbuf->d_name, "..")) && - (dirbuf->d_name[0] == '.' && - (no_dotfiles || !show_dotfiles)))) - continue; - - StrAllocCopy(tmpfilename, localname); - if (strcmp(localname, "/")) - /* - ** If filename is not root directory. - */ - StrAllocCat(tmpfilename, "/"); - - StrAllocCat(tmpfilename, dirbuf->d_name); - stat(tmpfilename, &file_info); - if (S_ISDIR(file_info.st_mode)) -#ifndef DIRED_SUPPORT - HTSprintf0(&dirname, "D%s",dirbuf->d_name); - else - HTSprintf0(&dirname, "F%s",dirbuf->d_name); - /* D & F to have first directories, then files */ -#else - { - if (dir_list_style == MIXED_STYLE) - HTSprintf0(&dirname, " %s/", dirbuf->d_name); - else if (!strcmp(dirbuf->d_name, "..")) - HTSprintf0(&dirname, "A%s", dirbuf->d_name); - else - HTSprintf0(&dirname, "D%s", dirbuf->d_name); - } - else if (dir_list_style == MIXED_STYLE) - HTSprintf0(&dirname, " %s", dirbuf->d_name); - else if (dir_list_style == FILES_FIRST) - HTSprintf0(&dirname, "C%s", dirbuf->d_name); - /* C & D to have first files, then directories */ - else - HTSprintf0(&dirname, "F%s", dirbuf->d_name); -#endif /* !DIRED_SUPPORT */ - /* - ** Sort dirname in the tree bt. - */ - HTBTree_add(bt, dirname); - } - - /* - ** Run through tree printing out in order. - */ - { - HTBTElement * next_element = HTBTree_next(bt,NULL); - /* pick up the first element of the list */ - char state; - /* I for initial (.. file), - D for directory file, - F for file */ - -#ifdef DIRED_SUPPORT - char test; -#endif /* DIRED_SUPPORT */ - state = 'I'; - while (next_element != NULL) { - char *entry, *file_extra; - - if (HTCheckForInterrupt()) { - _HTProgress ("Data transfer interrupted."); - status = HT_PARTIAL_CONTENT; - break; - } - StrAllocCopy(tmpfilename,localname); - if (strcmp(localname, "/")) - /* - ** If filename is not root directory. - */ - StrAllocCat(tmpfilename, "/"); - - StrAllocCat(tmpfilename, - (char *)HTBTree_object(next_element)+1); - /* - ** Append the current entry's filename - ** to the path. - */ - HTSimplify(tmpfilename); - /* - ** Output the directory entry. - */ - if (strcmp((char *) - (HTBTree_object(next_element)), "D..") && - strcmp((char *) - (HTBTree_object(next_element)), "A..")) - { -#ifdef DIRED_SUPPORT - test = (*(char *)(HTBTree_object(next_element)) - == 'D' ? 'D' : 'F'); - if (state != test) { -#ifndef LONG_LIST - if (dir_list_style == FILES_FIRST) { - if (state == 'F') - END(HTML_DIR); - } else if (dir_list_style != MIXED_STYLE) - if (state == 'D') - END(HTML_DIR); -#endif /* !LONG_LIST */ - state = - (*(char *)(HTBTree_object(next_element)) - == 'D' ? 'D' : 'F'); - START(HTML_H2); - if (dir_list_style != MIXED_STYLE) { - START(HTML_EM); - PUTS(state == 'D' - ? LABEL_SUBDIRECTORIES - : LABEL_FILES); - END(HTML_EM); - } - END(HTML_H2); -#ifndef LONG_LIST - START(HTML_DIR); -#endif /* !LONG_LIST */ - } -#else - if (state != *(char *)(HTBTree_object( - next_element))) { -#ifndef LONG_LIST - if (state == 'D') - END(HTML_DIR); -#endif /* !LONG_LIST */ - state = - (*(char *)(HTBTree_object(next_element)) - == 'D' ? 'D' : 'F'); - START(HTML_H2); - START(HTML_EM); - PUTS(state == 'D' - ? LABEL_SUBDIRECTORIES - : LABEL_FILES); - END(HTML_EM); - END(HTML_H2); -#ifndef LONG_LIST - START(HTML_DIR); -#endif /* !LONG_LIST */ - } -#endif /* DIRED_SUPPORT */ -#ifndef LONG_LIST - START(HTML_LI); -#endif /* !LONG_LIST */ - } - entry = (char*)HTBTree_object(next_element)+1; - file_extra = NULL; - -#ifdef LONG_LIST - LYListFmtParse(list_format, tmpfilename, target, - entry, tail); -#else - HTDirEntry(target, tail, entry); - PUTS(entry); - END(HTML_A); - if (file_extra) { - PUTS(file_extra); - FREE(file_extra); - } - MAYBE_END(HTML_LI); -#endif /* LONG_LIST */ - - next_element = HTBTree_next(bt, next_element); - /* pick up the next element of the list; - if none, return NULL*/ - } - if (status == HT_LOADED) { - if (state == 'I') { - START(HTML_P); - PUTS("Empty Directory"); - } -#ifndef LONG_LIST - else - END(HTML_DIR); -#endif /* !LONG_LIST */ - } - } - /* end while directory entries left to read */ - closedir(dp); - FREE(logical); - FREE(tmpfilename); - FREE(tail); - HTBTreeAndObject_free(bt); - - if (status == HT_LOADED) { - if (HTDirReadme == HT_DIR_README_BOTTOM) - do_readme(target, localname); - FREE_TARGET; - } else { - ABORT_TARGET; - } - FREE(localname); - FREE(nodename); - return status; /* document loaded, maybe partial */ - } + status = print_local_dir(dp, localname, + anchor, format_out, sink); + FREE(localname); + FREE(nodename); + return status; /* document loaded, maybe partial */ - } /* end if localname is directory */ + } /* end if localname is a directory */ } /* end if file stat worked */ diff --git a/WWW/Library/Implementation/HTFormat.c b/WWW/Library/Implementation/HTFormat.c index 9ca69568..f06692a3 100644 --- a/WWW/Library/Implementation/HTFormat.c +++ b/WWW/Library/Implementation/HTFormat.c @@ -96,7 +96,7 @@ PUBLIC void HTSetPresentation ARGS6( pres->rep = HTAtom_for(representation); pres->rep_out = WWW_PRESENT; /* Fixed for now ... :-) */ - pres->converter = HTSaveAndExecute; /* Fixed for now ... */ + pres->converter = HTSaveAndExecute; /* Fixed for now ... */ pres->quality = quality; pres->secs = secs; pres->secs_per_byte = secs_per_byte; @@ -110,7 +110,9 @@ PUBLIC void HTSetPresentation ARGS6( */ if (!HTPresentations) { HTPresentations = HTList_new(); +#ifdef LY_FIND_LEAKS atexit(HTFreePresentations); +#endif } if (strcmp(representation, "*")==0) { @@ -153,7 +155,9 @@ PUBLIC void HTSetConversion ARGS7( */ if (!HTPresentations) { HTPresentations = HTList_new(); +#ifdef LY_FIND_LEAKS atexit(HTFreePresentations); +#endif } HTList_addObject(HTPresentations, pres); @@ -478,11 +482,12 @@ PUBLIC float HTStackValue ARGS4( ** ------------------------------------------- ** ** Repaint the page only when necessary. +** This is a traverse call for HText_pageDisplay() - it works!. ** */ -#ifdef DISP_PARTIAL -PRIVATE void HTDisplayPartial NOARGS +PUBLIC void HTDisplayPartial NOARGS { +#ifdef DISP_PARTIAL if (display_partial) { /* ** HText_getNumOfLines() = "current" number of lines received @@ -491,7 +496,7 @@ PRIVATE void HTDisplayPartial NOARGS ** We update NumOfLines_partial only when we repaint the display. ** -1 is the special value: ** This is a synchronization flag switched to 0 when HText_new() - ** starts a new HTMainText object - all hypertext functions use it, + ** starts a new HTMainText object - all HText_ functions use it, ** lines counter in particular [we call it from HText_getNumOfLines()]. ** ** Otherwise HTMainText holds info from the previous document @@ -502,25 +507,27 @@ PRIVATE void HTDisplayPartial NOARGS ** So repaint the page only when necessary: */ if ((NumOfLines_partial != -1) - /* new hypertext document available */ + /* new HText object available */ && ((Newline_partial + display_lines) > NumOfLines_partial) /* current page not complete... */ - && (partial_threshold > 0 ? ((Newline_partial + partial_threshold) < HText_getNumOfLines()) : - ((Newline_partial + display_lines) < HText_getNumOfLines()))) { + && (partial_threshold > 0 ? + ((Newline_partial + partial_threshold) < HText_getNumOfLines()) : + ((Newline_partial + display_lines) < HText_getNumOfLines())) /* * Originally we rendered by increments of 2 lines, * but that got annoying on slow network connections. * Then we switched to full-pages. Now it's configurable. - * If partial_threshold < 0, then it's a full page + * If partial_threshold <= 0, then it's a full page */ + ) { NumOfLines_partial = HText_getNumOfLines(); HText_pageDisplay(Newline_partial, ""); } } +#else /* nothing */ +#endif /* DISP_PARTIAL */ } -#else -#define HTDisplayPartial() /*nothing*/ -#endif + /* Push data from a socket down a stream ** ------------------------------------- @@ -714,7 +721,7 @@ finished: ** always fp still open, target stream still valid. */ PUBLIC int HTFileCopy ARGS2( - FILE *, fp, + FILE *, fp, HTStream*, sink) { HTStreamClass targetClass; @@ -764,6 +771,50 @@ PUBLIC int HTFileCopy ARGS2( return rv; } +#ifdef SOURCE_CACHE +/* Push data from an HTChunk down a stream +** --------------------------------------- +** +** This routine is responsible for creating and PRESENTING any +** graphic (or other) objects described by the file. +** +** State of memory and target stream on entry: +** HTChunk* (chunk) and target (sink) assumed valid. +** +** Return values: +** HT_LOADED All data sent. +** +** State of memory and target stream on return: +** always chunk unchanged, target stream still valid. +*/ +PUBLIC int HTMemCopy ARGS2( + HTChunk *, chunk, + HTStream *, sink) +{ + HTStreamClass targetClass = *(sink->isa); + int bytes = 0; + CONST char *data = chunk->data; + + HTReadProgress(0, 0); + for (;;) { + /* Push the data down the stream a piece at a time, in case we're + ** running a large document on a slow machine. + */ + int n = INPUT_BUFFER_SIZE; + if (n > chunk->size - bytes) + n = chunk->size - bytes; + if (n == 0) + break; + (*targetClass.put_block)(sink, data, n); + bytes += n; + data += n; + HTReadProgress(bytes, 0); + HTDisplayPartial(); + } + return HT_LOADED; +} +#endif + #ifdef USE_ZLIB /* Push data from a gzip file pointer down a stream ** ------------------------------------- @@ -786,7 +837,7 @@ PUBLIC int HTFileCopy ARGS2( ** always gzfp still open, target stream still valid. */ PRIVATE int HTGzFileCopy ARGS2( - gzFile, gzfp, + gzFile, gzfp, HTStream*, sink) { HTStreamClass targetClass; @@ -979,7 +1030,7 @@ PUBLIC int HTParseFile ARGS5( HTFormat, rep_in, HTFormat, format_out, HTParentAnchor *, anchor, - FILE *, fp, + FILE *, fp, HTStream*, sink) { HTStream * stream; @@ -1026,9 +1077,57 @@ PUBLIC int HTParseFile ARGS5( return HT_LOADED; } +#ifdef SOURCE_CACHE +/* Parse a document in memory given format and memory block pointer +** +** This routine is responsible for creating and PRESENTING any +** graphic (or other) objects described by the file. +** +** State of memory and target stream on entry: +** HTChunk* (chunk) assumed valid, +** target (sink) usually NULL (will call stream stack). +** +** Return values: +** -501 Stream stack failed (cannot present or convert). +** HT_LOADED All data sent. +** +** Stat of memory and target stream on return: +** always chunk unchanged; target freed, aborted, or NULL. +*/ +PUBLIC int HTParseMem ARGS5( + HTFormat, rep_in, + HTFormat, format_out, + HTParentAnchor *, anchor, + HTChunk *, chunk, + HTStream *, sink) +{ + HTStream * stream; + HTStreamClass targetClass; + int rv; + + stream = HTStreamStack(rep_in, format_out, sink, anchor); + if (!stream) { + char *buffer = 0; + HTSprintf0(&buffer, CANNOT_CONVERT_I_TO_O, + HTAtom_name(rep_in), HTAtom_name(format_out)); + CTRACE(tfp, "HTFormat(in HTParseMem): %s\n", buffer); + rv = HTLoadError(sink, 501, buffer); + FREE(buffer); + return rv; + } + + /* Push the data down the stream + */ + targetClass = *(stream->isa); + rv = HTMemCopy(chunk, stream); + (*targetClass._free)(stream); + return HT_LOADED; +} +#endif + #ifdef USE_ZLIB PRIVATE int HTCloseGzFile ARGS1( - gzFile, gzfp) + gzFile, gzfp) { int gzres; if (gzfp == NULL) @@ -1064,7 +1163,7 @@ PUBLIC int HTParseGzFile ARGS5( HTFormat, rep_in, HTFormat, format_out, HTParentAnchor *, anchor, - gzFile, gzfp, + gzFile, gzfp, HTStream*, sink) { HTStream * stream; diff --git a/WWW/Library/Implementation/HTFormat.h b/WWW/Library/Implementation/HTFormat.h index 95302a1d..df10425c 100644 --- a/WWW/Library/Implementation/HTFormat.h +++ b/WWW/Library/Implementation/HTFormat.h @@ -284,6 +284,15 @@ extern float HTStackValue PARAMS(( #define NO_VALUE_FOUND -1e20 /* returned if none found */ +/* Display the page while transfer in progress +** ------------------------------------------- +** +** Repaint the page only when necessary. +** This is a traverse call for HText_pageDispaly() - it works!. +** +*/ +extern void HTDisplayPartial NOPARAMS; + /* HTCopy: Copy a socket to a stream @@ -312,6 +321,22 @@ extern int HTFileCopy PARAMS(( HTStream* sink)); +#ifdef SOURCE_CACHE +#include <HTChunk.h> +/* + +HTFileCopy: Copy a file to a stream + + This is used by the protocol engines to send data down a stream, typically one which + has been generated by HTStreamStack. It is currently called by HTParseFile + + */ +extern int HTMemCopy PARAMS(( + HTChunk * chunk, + HTStream* sink)); +#endif + + /* HTCopyNoCR: Copy a socket to a stream, stripping CR characters. @@ -377,6 +402,24 @@ extern int HTParseFile PARAMS(( FILE *fp, HTStream* sink)); +#ifdef SOURCE_CACHE +/* + +HTParseMem: Parse a document in memory + + This routine is called by protocols modules to load an object. uses + HTStreamStack and HTMemCopy. Returns HT_LOADED if successful, can also + return <0 for failure. + + */ +extern int HTParseMem PARAMS(( + HTFormat format_in, + HTFormat format_out, + HTParentAnchor *anchor, + HTChunk* chunk, + HTStream* sink)); +#endif + #ifdef USE_ZLIB #ifdef USE_ZLIB diff --git a/WWW/Library/Implementation/HTGopher.c b/WWW/Library/Implementation/HTGopher.c index 225d6dfb..6046e039 100644 --- a/WWW/Library/Implementation/HTGopher.c +++ b/WWW/Library/Implementation/HTGopher.c @@ -1802,6 +1802,8 @@ PRIVATE int HTLoadGopher ARGS4( } else { /* Not index */ command = (char *)malloc(strlen(selector)+2+1); + if (command == NULL) + outofmem(__FILE__, "HTLoadGopher"); de_escape(command, selector); } FREE(p1); diff --git a/WWW/Library/Implementation/HTLex.c b/WWW/Library/Implementation/HTLex.c index 20a5d7ba..59901fb3 100644 --- a/WWW/Library/Implementation/HTLex.c +++ b/WWW/Library/Implementation/HTLex.c @@ -15,7 +15,6 @@ #include <HTUtils.h> -#include <HTAAUtil.h> #include <HTLex.h> /* Implemented here */ #include <LYLeaks.h> diff --git a/WWW/Library/Implementation/HTMLDTD.c b/WWW/Library/Implementation/HTMLDTD.c index f71ab852..a631bce6 100644 --- a/WWW/Library/Implementation/HTMLDTD.c +++ b/WWW/Library/Implementation/HTMLDTD.c @@ -145,893 +145,913 @@ static CONST char* entities[] = { ** Lists must be in alphabetical order by attribute name ** The tag elements contain the number of attributes */ +#ifdef USE_PSRC +# define N HTMLA_NORMAL +# define i HTMLA_ANAME +# define h HTMLA_HREF +# define c HTMLA_CLASS +# define x HTMLA_AUXCLASS +# define T(t) , t +#else +# define T(t) +#endif + static attr a_attr[] = { /* Anchor attributes */ - { "ACCESSKEY" }, - { "CHARSET" }, - { "CLASS" }, - { "CLEAR" }, - { "COORDS" }, - { "DIR" }, - { "HREF" }, - { "ID" }, - { "ISMAP" }, - { "LANG" }, - { "MD" }, - { "NAME" }, - { "NOTAB" }, - { "ONCLICK" }, - { "ONMOUSEOUT" }, - { "ONMOUSEOVER" }, - { "REL" }, - { "REV" }, - { "SHAPE" }, - { "STYLE" }, - { "TABINDEX" }, - { "TARGET" }, - { "TITLE" }, - { "TYPE" }, - { "URN" }, - { 0 } /* Terminate list */ + { "ACCESSKEY" T(N) }, + { "CHARSET" T(N) }, + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "COORDS" T(N) }, + { "DIR" T(N) }, + { "HREF" T(h) }, + { "ID" T(i) }, + { "ISMAP" T(N) }, + { "LANG" T(N) }, + { "MD" T(N) }, + { "NAME" T(i) }, + { "NOTAB" T(N) }, + { "ONCLICK" T(N) }, + { "ONMOUSEOUT" T(N) }, + { "ONMOUSEOVER" T(N) }, + { "REL" T(N) }, + { "REV" T(N) }, + { "SHAPE" T(N) }, + { "STYLE" T(N) }, + { "TABINDEX" T(N) }, + { "TARGET" T(N) }, + { "TITLE" T(N) }, + { "TYPE" T(N) }, + { "URN" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr address_attr[] = { /* ADDRESS attributes */ - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "ID" }, - { "LANG" }, - { "NOWRAP" }, - { "STYLE" }, - { "TITLE" }, - { 0 } /* Terminate list */ + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "NOWRAP" T(N) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr applet_attr[] = { /* APPLET attributes */ - { "ALIGN" }, - { "ALT" }, - { "CLASS" }, - { "CLEAR" }, - { "CODE" }, - { "CODEBASE" }, - { "DIR" }, - { "DOWNLOAD" }, - { "HEIGHT" }, - { "HSPACE" }, - { "ID" }, - { "LANG" }, - { "NAME" }, - { "STYLE" }, - { "TITLE" }, - { "VSPACE" }, - { "WIDTH" }, - { 0 } /* Terminate list */ + { "ALIGN" T(N) }, + { "ALT" T(N) }, + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "CODE" T(N) }, + { "CODEBASE" T(h) }, + { "DIR" T(N) }, + { "DOWNLOAD" T(N) }, + { "HEIGHT" T(N) }, + { "HSPACE" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "NAME" T(i) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { "VSPACE" T(N) }, + { "WIDTH" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr area_attr[] = { /* AREA attributes */ - { "ALT" }, - { "CLASS" }, - { "CLEAR" }, - { "COORDS" }, - { "DIR" }, - { "HREF" }, - { "ID" }, - { "LANG" }, - { "NOHREF" }, - { "NOTAB" }, - { "ONCLICK" }, - { "ONMOUSEOUT" }, - { "ONMOUSEOVER" }, - { "SHAPE" }, - { "STYLE" }, - { "TABINDEX" }, - { "TARGET" }, - { "TITLE" }, - { 0 } /* Terminate list */ + { "ALT" T(N) }, + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "COORDS" T(N) }, + { "DIR" T(N) }, + { "HREF" T(h) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "NOHREF" T(N) }, + { "NOTAB" T(N) }, + { "ONCLICK" T(N) }, + { "ONMOUSEOUT" T(N) }, + { "ONMOUSEOVER" T(N) }, + { "SHAPE" T(N) }, + { "STYLE" T(N) }, + { "TABINDEX" T(N) }, + { "TARGET" T(N) }, + { "TITLE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr base_attr[] = { /* BASE attributes */ - { "HREF" }, - { "TARGET" }, - { "TITLE" }, - { 0 } /* Terminate list */ + { "HREF" T(h) }, + { "TARGET" T(N) }, + { "TITLE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr bgsound_attr[] = { /* BGSOUND attributes */ - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "ID" }, - { "LANG" }, - { "LOOP" }, - { "SRC" }, - { "STYLE" }, - { "TITLE" }, - { 0 } /* Terminate list */ + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "LOOP" T(N) }, + { "SRC" T(h) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr body_attr[] = { /* BODY attributes */ - { "ALINK" }, - { "BACKGROUND" }, - { "BGCOLOR" }, - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "ID" }, - { "LANG" }, - { "LINK" }, - { "ONLOAD" }, - { "ONUNLOAD" }, - { "STYLE" }, - { "TITLE" }, - { "TEXT" }, - { "VLINK" }, - { 0 } /* Terminate list */ + { "ALINK" T(N) }, + { "BACKGROUND" T(h) }, + { "BGCOLOR" T(N) }, + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "LINK" T(N) }, + { "ONLOAD" T(N) }, + { "ONUNLOAD" T(N) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { "TEXT" T(N) }, + { "VLINK" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr bodytext_attr[] = { /* BODYTEXT attributes */ - { "CLASS" }, - { "CLEAR" }, - { "DATA" }, - { "DIR" }, - { "ID" }, - { "LANG" }, - { "NAME" }, - { "OBJECT" }, - { "REF" }, - { "STYLE" }, - { "TITLE" }, - { "TYPE" }, - { "VALUE" }, - { "VALUETYPE" }, - { 0 } /* Terminate list */ + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DATA" T(N) }, + { "DIR" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "NAME" T(N) }, + { "OBJECT" T(N) }, + { "REF" T(N) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { "TYPE" T(N) }, + { "VALUE" T(N) }, + { "VALUETYPE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr bq_attr[] = { /* BQ (BLOCKQUOTE) attributes */ - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "ID" }, - { "LANG" }, - { "NOWRAP" }, - { "STYLE" }, - { "TITLE" }, - { 0 } /* Terminate list */ + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "NOWRAP" T(N) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr button_attr[] = { /* BUTTON attributes */ - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "DISABLED" }, - { "ID" }, - { "LANG" }, - { "NAME" }, - { "ONFOCUS" }, - { "ONBLUR" }, - { "STYLE" }, - { "TABINDEX" }, - { "TITLE" }, - { "TYPE" }, - { "VALUE" }, - { 0 } /* Terminate list */ + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "DISABLED" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "NAME" T(N) }, + { "ONFOCUS" T(N) }, + { "ONBLUR" T(N) }, + { "STYLE" T(N) }, + { "TABINDEX" T(N) }, + { "TITLE" T(N) }, + { "TYPE" T(N) }, + { "VALUE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr caption_attr[] = { /* CAPTION attributes */ - { "ACCESSKEY" }, - { "ALIGN" }, - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "ID" }, - { "LANG" }, - { "STYLE" }, - { "TITLE" }, - { 0 } /* Terminate list */ + { "ACCESSKEY" T(N) }, + { "ALIGN" T(N) }, + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr col_attr[] = { /* COL and COLGROUP attributes */ - { "ALIGN" }, - { "CHAR" }, - { "CHAROFF" }, - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "ID" }, - { "LANG" }, - { "SPAN" }, - { "STYLE" }, - { "TITLE" }, - { "VALIGN" }, - { "WIDTH" }, - { 0 } /* Terminate list */ + { "ALIGN" T(N) }, + { "CHAR" T(N) }, + { "CHAROFF" T(N) }, + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "SPAN" T(N) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { "VALIGN" T(N) }, + { "WIDTH" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr credit_attr[] = { /* CREDIT attributes */ - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "ID" }, - { "LANG" }, - { "STYLE" }, - { "TITLE" }, - { 0 } /* Terminate list */ + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr div_attr[] = { /* DIV attributes */ - { "ALIGN" }, - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "ID" }, - { "LANG" }, - { "STYLE" }, - { "TITLE" }, - { 0 } /* Terminate list */ + { "ALIGN" T(N) }, + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr embed_attr[] = { /* EMBED attributes */ - { "ALIGN" }, /* (including, for now, those from FIG and IMG) */ - { "ALT" }, - { "BORDER" }, - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "HEIGHT" }, - { "ID" }, - { "IMAGEMAP" }, - { "ISMAP" }, - { "LANG" }, - { "MD" }, - { "NAME" }, - { "NOFLOW" }, - { "PARAMS" }, - { "SRC" }, - { "STYLE" }, - { "TITLE" }, - { "UNITS" }, - { "USEMAP" }, - { "WIDTH" }, - { 0 } /* Terminate list */ + { "ALIGN" T(N) }, /* (including, for now, those from FIG and IMG) */ + { "ALT" T(N) }, + { "BORDER" T(N) }, + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "HEIGHT" T(N) }, + { "ID" T(i) }, + { "IMAGEMAP" T(N) }, + { "ISMAP" T(N) }, + { "LANG" T(N) }, + { "MD" T(N) }, + { "NAME" T(i) }, + { "NOFLOW" T(N) }, + { "PARAMS" T(N) }, + { "SRC" T(h) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { "UNITS" T(N) }, + { "USEMAP" T(N) }, + { "WIDTH" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr fig_attr[] = { /* FIG attributes */ - { "ALIGN" }, - { "BORDER" }, - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "HEIGHT" }, - { "ID" }, - { "IMAGEMAP" }, - { "ISOBJECT" }, - { "LANG" }, - { "MD" }, - { "NOFLOW" }, - { "SRC" }, - { "STYLE" }, - { "TITLE" }, - { "UNITS" }, - { "WIDTH" }, - { 0 } /* Terminate list */ + { "ALIGN" T(N) }, + { "BORDER" T(N) }, + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "HEIGHT" T(N) }, + { "ID" T(i) }, + { "IMAGEMAP" T(N) }, + { "ISOBJECT" T(N) }, + { "LANG" T(N) }, + { "MD" T(N) }, + { "NOFLOW" T(N) }, + { "SRC" T(h) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { "UNITS" T(N) }, + { "WIDTH" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr fieldset_attr[] = { /* FIELDSET attributes */ - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "ID" }, - { "LANG" }, - { "STYLE" }, - { "TITLE" }, - { 0 } /* Terminate list */ + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr fn_attr[] = { /* FN attributes */ - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "ID" }, - { "LANG" }, - { "STYLE" }, - { "TITLE" }, - { 0 } /* Terminate list */ + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr font_attr[] = { /* FONT attributes */ - { "CLASS" }, - { "CLEAR" }, - { "COLOR" }, - { "DIR" }, - { "END" }, - { "FACE" }, - { "ID" }, - { "LANG" }, - { "SIZE" }, - { "STYLE" }, - { 0 } /* Terminate list */ + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "COLOR" T(N) }, + { "DIR" T(N) }, + { "END" T(N) }, + { "FACE" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "SIZE" T(N) }, + { "STYLE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr form_attr[] = { /* FORM attributes */ - { "ACCEPT-CHARSET"}, /* HTML 4.0 draft - kw */ - { "ACTION"}, - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "ENCTYPE" }, - { "ID" }, - { "LANG" }, - { "METHOD" }, - { "ONSUBMIT" }, - { "SCRIPT" }, - { "STYLE" }, - { "SUBJECT" }, - { "TARGET" }, - { "TITLE" }, - { 0 } /* Terminate list */ + { "ACCEPT-CHARSET" T(N) }, /* HTML 4.0 draft - kw */ + { "ACTION" T(h) }, + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "ENCTYPE" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "METHOD" T(N) }, + { "ONSUBMIT" T(N) }, + { "SCRIPT" T(N) }, + { "STYLE" T(N) }, + { "SUBJECT" T(N) }, + { "TARGET" T(N) }, + { "TITLE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr frame_attr[] = { /* FRAME attributes */ - { "ID" }, - { "MARGINHEIGHT"}, - { "MARGINWIDTH" }, - { "NAME" }, - { "NORESIZE" }, - { "SCROLLING" }, - { "SRC" }, - { 0 } /* Terminate list */ + { "ID" T(i) }, + { "MARGINHEIGHT" T(N) }, + { "MARGINWIDTH" T(N) }, + { "NAME" T(N) }, + { "NORESIZE" T(N) }, + { "SCROLLING" T(N) }, + { "SRC" T(h) }, + { 0 T(N) } /* Terminate list */ }; static attr frameset_attr[] = { /* FRAMESET attributes */ - { "COLS"}, - { "ROWS" }, - { 0 } /* Terminate list */ + { "COLS" T(N) }, + { "ROWS" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr gen_attr[] = { /* Minimum HTML 3.0 */ - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "ID" }, - { "LANG" }, - { "STYLE" }, - { "TITLE" }, - { 0 } /* Terminate list */ + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr glossary_attr[] = { /* DL (and DLC) attributes */ - { "CLASS" }, - { "CLEAR" }, - { "COMPACT" }, - { "DIR" }, - { "ID" }, - { "LANG" }, - { "STYLE" }, - { "TITLE" }, - { 0 } /* Terminate list */ + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "COMPACT" T(N) }, + { "DIR" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr h_attr[] = { /* H1 - H6 attributes */ - { "ALIGN" }, - { "CLASS" }, - { "CLEAR" }, - { "DINGBAT" }, - { "DIR" }, - { "ID" }, - { "LANG" }, - { "MD" }, - { "NOWRAP" }, - { "SEQNUM" }, - { "SKIP" }, - { "SRC" }, - { "STYLE" }, - { "TITLE" }, - { 0 } /* Terminate list */ + { "ALIGN" T(N) }, + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DINGBAT" T(N) }, + { "DIR" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "MD" T(N) }, + { "NOWRAP" T(N) }, + { "SEQNUM" T(N) }, + { "SKIP" T(N) }, + { "SRC" T(h) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr hr_attr[] = { /* HR attributes */ - { "ALIGN" }, - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "ID" }, - { "MD" }, - { "NOSHADE" }, - { "SIZE" }, - { "SRC" }, - { "STYLE" }, - { "TITLE" }, - { "WIDTH" }, - { 0 } /* Terminate list */ + { "ALIGN" T(N) }, + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "ID" T(i) }, + { "MD" T(N) }, + { "NOSHADE" T(N) }, + { "SIZE" T(N) }, + { "SRC" T(h) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { "WIDTH" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr iframe_attr[] = { /* IFRAME attributes */ - { "ALIGN" }, - { "FRAMEBORDER" }, - { "HEIGHT" }, - { "ID" }, - { "MARGINHEIGHT"}, - { "MARGINWIDTH" }, - { "NAME" }, - { "SCROLLING" }, - { "SRC" }, - { "STYLE" }, - { "WIDTH" }, - { 0 } /* Terminate list */ + { "ALIGN" T(N) }, + { "FRAMEBORDER" T(N) }, + { "HEIGHT" T(N) }, + { "ID" T(i) }, + { "MARGINHEIGHT" T(N) }, + { "MARGINWIDTH" T(N) }, + { "NAME" T(N) }, + { "SCROLLING" T(N) }, + { "SRC" T(h) }, + { "STYLE" T(N) }, + { "WIDTH" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr img_attr[] = { /* IMG attributes */ - { "ALIGN" }, - { "ALT" }, - { "BORDER" }, - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "HEIGHT" }, - { "ID" }, - { "ISMAP" }, - { "ISOBJECT" }, - { "LANG" }, - { "MD" }, - { "SRC" }, - { "STYLE" }, - { "TITLE" }, - { "UNITS" }, - { "USEMAP" }, - { "WIDTH" }, - { 0 } /* Terminate list */ + { "ALIGN" T(N) }, + { "ALT" T(N) }, + { "BORDER" T(N) }, + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "HEIGHT" T(N) }, + { "ID" T(i) }, + { "ISMAP" T(N) }, + { "ISOBJECT" T(N) }, + { "LANG" T(N) }, + { "MD" T(N) }, + { "SRC" T(h) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { "UNITS" T(N) }, + { "USEMAP" T(h) }, + { "WIDTH" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr input_attr[] = { /* INPUT attributes */ - { "ACCEPT" }, - { "ACCEPT-CHARSET" }, /* RFC 2070 HTML i18n - kw */ - { "ALIGN" }, - { "ALT" }, - { "CHECKED" }, - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "DISABLED" }, - { "ERROR" }, - { "HEIGHT" }, - { "ID" }, - { "LANG" }, - { "MAX" }, - { "MAXLENGTH" }, - { "MD" }, - { "MIN" }, - { "NAME" }, - { "NOTAB" }, - { "ONBLUR" }, - { "ONCHANGE" }, - { "ONCLICK" }, - { "ONFOCUS" }, - { "ONSELECT" }, - { "SIZE" }, - { "SRC" }, - { "STYLE" }, - { "TABINDEX" }, - { "TITLE" }, - { "TYPE" }, - { "VALUE" }, - { "WIDTH" }, - { 0 } /* Terminate list */ + { "ACCEPT" T(N) }, + { "ACCEPT-CHARSET" T(N) }, /* RFC 2070 HTML i18n - kw */ + { "ALIGN" T(N) }, + { "ALT" T(N) }, + { "CHECKED" T(N) }, + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "DISABLED" T(N) }, + { "ERROR" T(N) }, + { "HEIGHT" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "MAX" T(N) }, + { "MAXLENGTH" T(N) }, + { "MD" T(N) }, + { "MIN" T(N) }, + { "NAME" T(N) }, + { "NOTAB" T(N) }, + { "ONBLUR" T(N) }, + { "ONCHANGE" T(N) }, + { "ONCLICK" T(N) }, + { "ONFOCUS" T(N) }, + { "ONSELECT" T(N) }, + { "SIZE" T(N) }, + { "SRC" T(h) }, + { "STYLE" T(N) }, + { "TABINDEX" T(N) }, + { "TITLE" T(N) }, + { "TYPE" T(N) }, + { "VALUE" T(N) }, + { "WIDTH" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr isindex_attr[] = { /* ISINDEX attributes */ - { "ACTION" }, /* Not in spec. Lynx treats it as HREF. - FM */ - { "DIR" }, - { "HREF" }, /* HTML 3.0 attribute for search action. - FM */ - { "ID" }, - { "LANG" }, - { "PROMPT" }, /* HTML 3.0 attribute for prompt string. - FM */ - { "TITLE" }, - { 0 } /* Terminate list */ + { "ACTION" T(h) }, /* Not in spec. Lynx treats it as HREF. - FM */ + { "DIR" T(N) }, + { "HREF" T(h) }, /* HTML 3.0 attribute for search action. - FM */ + { "ID" T(i) }, + { "LANG" T(N) }, + { "PROMPT" T(N) }, /* HTML 3.0 attribute for prompt string. - FM */ + { "TITLE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr keygen_attr[] = { /* KEYGEN attributes */ - { "CHALLENGE" }, - { "CLASS" }, - { "DIR" }, - { "ID" }, - { "LANG" }, - { "NAME" }, - { "STYLE" }, - { "TITLE" }, - { 0 } /* Terminate list */ + { "CHALLENGE" T(N) }, + { "CLASS" T(c) }, + { "DIR" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "NAME" T(N) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr label_attr[] = { /* LABEL attributes */ - { "ACCESSKEY" }, - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "FOR" }, - { "ID" }, - { "LANG" }, - { "ONCLICK" }, - { "STYLE" }, - { "TITLE" }, - { 0 } /* Terminate list */ + { "ACCESSKEY" T(N) }, + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "FOR" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "ONCLICK" T(N) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr legend_attr[] = { /* LEGEND attributes */ - { "ACCESSKEY" }, - { "ALIGN" }, - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "ID" }, - { "LANG" }, - { "STYLE" }, - { "TITLE" }, - { 0 } /* Terminate list */ + { "ACCESSKEY" T(N) }, + { "ALIGN" T(N) }, + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr link_attr[] = { /* LINK attributes */ - { "CHARSET" }, /* RFC 2070 HTML i18n -- hint for UA -- - kw */ - { "CLASS" }, - { "HREF" }, - { "ID" }, - { "MEDIA" }, - { "REL" }, - { "REV" }, - { "STYLE" }, - { "TARGET" }, - { "TITLE" }, - { "TYPE" }, - { 0 } /* Terminate list */ + { "CHARSET" T(N) }, /* RFC 2070 HTML i18n -- hint for UA -- - kw */ + { "CLASS" T(c) }, + { "HREF" T(h) }, + { "ID" T(i) }, + { "MEDIA" T(N) }, + { "REL" T(N) }, + { "REV" T(N) }, + { "STYLE" T(N) }, + { "TARGET" T(N) }, + { "TITLE" T(N) }, + { "TYPE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr list_attr[] = { /* LI attributes */ - { "CLASS" }, - { "CLEAR" }, - { "DINGBAT" }, - { "DIR" }, - { "ID" }, - { "LANG" }, - { "MD" }, - { "SKIP" }, - { "SRC" }, - { "STYLE" }, - { "TITLE" }, - { "TYPE" }, - { "VALUE" }, - { 0 } /* Terminate list */ + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DINGBAT" T(N) }, + { "DIR" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "MD" T(N) }, + { "SKIP" T(N) }, + { "SRC" T(h) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { "TYPE" T(N) }, + { "VALUE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr map_attr[] = { /* MAP attributes */ - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "ID" }, - { "LANG" }, - { "NAME" }, - { "STYLE" }, - { "TITLE" }, - { 0 } /* Terminate list */ + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "NAME" T(N) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr math_attr[] = { /* MATH attributes */ - { "BOX" }, - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "ID" }, - { "LANG" }, - { "STYLE" }, - { "TITLE" }, - { 0 } /* Terminate list */ + { "BOX" T(N) }, + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr meta_attr[] = { /* META attributes */ - { "CONTENT" }, - { "HTTP-EQUIV" }, - { "NAME" }, - { 0 } /* Terminate list */ + { "CONTENT" T(N) }, + { "HTTP-EQUIV" T(N) }, + { "NAME" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr nextid_attr[] = { /* NEXTID attributes */ - { "N" } + { "N" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr note_attr[] = { /* NOTE attributes */ - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "ID" }, - { "LANG" }, - { "MD" }, - { "ROLE" }, - { "SRC" }, - { "STYLE" }, - { "TITLE" }, - { 0 } /* Terminate list */ + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "MD" T(N) }, + { "ROLE" T(x) }, + { "SRC" T(h) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr object_attr[] = { /* OBJECT attributes */ - { "ALIGN" }, - { "BORDER" }, - { "CLASS" }, - { "CLASSID" }, - { "CODEBASE" }, - { "CODETYPE" }, - { "DATA" }, - { "DECLARE" }, - { "DIR" }, - { "HEIGHT" }, - { "HSPACE" }, - { "ID" }, - { "ISMAP" }, - { "LANG" }, - { "NAME" }, - { "NOTAB" }, - { "SHAPES" }, - { "STANDBY" }, - { "STYLE" }, - { "TABINDEX" }, - { "TITLE" }, - { "TYPE" }, - { "USEMAP" }, - { "VSPACE" }, - { "WIDTH" }, - { 0 } /* Terminate list */ + { "ALIGN" T(N) }, + { "BORDER" T(N) }, + { "CLASS" T(c) }, + { "CLASSID" T(h) }, + { "CODEBASE" T(h) }, + { "CODETYPE" T(N) }, + { "DATA" T(h) }, + { "DECLARE" T(N) }, + { "DIR" T(N) }, + { "HEIGHT" T(N) }, + { "HSPACE" T(N) }, + { "ID" T(i) }, + { "ISMAP" T(N) }, + { "LANG" T(N) }, + { "NAME" T(N) }, + { "NOTAB" T(N) }, + { "SHAPES" T(N) }, + { "STANDBY" T(N) }, + { "STYLE" T(N) }, + { "TABINDEX" T(N) }, + { "TITLE" T(N) }, + { "TYPE" T(N) }, + { "USEMAP" T(h) }, + { "VSPACE" T(N) }, + { "WIDTH" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr olist_attr[] = { /* OL attributes */ - { "CLASS" }, - { "CLEAR" }, - { "COMPACT" }, - { "CONTINUE" }, - { "DIR" }, - { "ID" }, - { "LANG" }, - { "SEQNUM" }, - { "START" }, - { "STYLE" }, - { "TITLE" }, - { "TYPE" }, - { 0 } /* Terminate list */ + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "COMPACT" T(N) }, + { "CONTINUE" T(N) }, + { "DIR" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "SEQNUM" T(N) }, + { "START" T(N) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { "TYPE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr option_attr[] = { /* OPTION attributes */ - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "DISABLED" }, - { "ERROR" }, - { "ID" }, - { "LANG" }, - { "SELECTED" }, - { "SHAPE" }, - { "STYLE" }, - { "TITLE" }, - { "VALUE" }, - { 0 } /* Terminate list */ + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "DISABLED" T(N) }, + { "ERROR" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "SELECTED" T(N) }, + { "SHAPE" T(N) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { "VALUE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr overlay_attr[] = { /* OVERLAY attributes */ - { "CLASS" }, - { "HEIGHT" }, - { "ID" }, - { "IMAGEMAP" }, - { "MD" }, - { "SRC" }, - { "STYLE" }, - { "TITLE" }, - { "UNITS" }, - { "WIDTH" }, - { "X" }, - { "Y" }, - { 0 } /* Terminate list */ + { "CLASS" T(c) }, + { "HEIGHT" T(N) }, + { "ID" T(i) }, + { "IMAGEMAP" T(N) }, + { "MD" T(N) }, + { "SRC" T(h) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { "UNITS" T(N) }, + { "WIDTH" T(N) }, + { "X" T(N) }, + { "Y" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr p_attr[] = { /* P attributes */ - { "ALIGN" }, - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "ID" }, - { "LANG" }, - { "NOWRAP" }, - { "STYLE" }, - { "TITLE" }, - { 0 } /* Terminate list */ + { "ALIGN" T(N) }, + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "NOWRAP" T(N) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr param_attr[] = { /* PARAM attributes */ - { "ACCEPT" }, - { "ACCEPT-CHARSET" }, - { "ACCEPT-ENCODING" }, - { "CLASS" }, - { "CLEAR" }, - { "DATA" }, - { "DIR" }, - { "ID" }, - { "LANG" }, - { "NAME" }, - { "OBJECT" }, - { "REF" }, - { "STYLE" }, - { "TITLE" }, - { "TYPE" }, - { "VALUE" }, - { "VALUEREF" }, - { "VALUETYPE" }, - { 0 } /* Terminate list */ + { "ACCEPT" T(N) }, + { "ACCEPT-CHARSET" T(N) }, + { "ACCEPT-ENCODING" T(N) }, + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DATA" T(N) }, + { "DIR" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "NAME" T(N) }, + { "OBJECT" T(N) }, + { "REF" T(N) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { "TYPE" T(N) }, + { "VALUE" T(N) }, + { "VALUEREF" T(N) }, + { "VALUETYPE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr script_attr[] = { /* SCRIPT attributes */ - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "EVENT" }, - { "FOR" }, - { "ID" }, - { "LANG" }, - { "LANGUAGE" }, - { "NAME" }, - { "SCRIPTENGINE" }, - { "SRC" }, - { "STYLE" }, - { "TITLE" }, - { "TYPE" }, - { 0 } /* Terminate list */ + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "EVENT" T(N) }, + { "FOR" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "LANGUAGE" T(N) }, + { "NAME" T(N) }, + { "SCRIPTENGINE" T(N) }, + { "SRC" T(h) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { "TYPE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr select_attr[] = { /* SELECT attributes */ - { "ALIGN" }, - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "DISABLED" }, - { "ERROR" }, - { "HEIGHT" }, - { "ID" }, - { "LANG" }, - { "MD" }, - { "MULTIPLE" }, - { "NAME" }, - { "NOTAB" }, - { "ONBLUR" }, - { "ONCHANGE" }, - { "ONFOCUS" }, - { "SIZE" }, - { "STYLE" }, - { "TABINDEX" }, - { "TITLE" }, - { "UNITS" }, - { "WIDTH" }, - { 0 } /* Terminate list */ + { "ALIGN" T(N) }, + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "DISABLED" T(N) }, + { "ERROR" T(N) }, + { "HEIGHT" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "MD" T(N) }, + { "MULTIPLE" T(N) }, + { "NAME" T(N) }, + { "NOTAB" T(N) }, + { "ONBLUR" T(N) }, + { "ONCHANGE" T(N) }, + { "ONFOCUS" T(N) }, + { "SIZE" T(N) }, + { "STYLE" T(N) }, + { "TABINDEX" T(N) }, + { "TITLE" T(N) }, + { "UNITS" T(N) }, + { "WIDTH" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr style_attr[] = { /* STYLE attributes */ - { "DIR" }, - { "LANG" }, - { "NOTATION" }, - { "TITLE" }, - { 0 } /* Terminate list */ + { "DIR" T(N) }, + { "LANG" T(N) }, + { "NOTATION" T(N) }, + { "TITLE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr tab_attr[] = { /* TAB attributes */ - { "ALIGN" }, - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "DP" }, - { "ID" }, - { "INDENT" }, - { "LANG" }, - { "STYLE" }, - { "TITLE" }, - { "TO" }, - { 0 } /* Terminate list */ + { "ALIGN" T(N) }, + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "DP" T(N) }, + { "ID" T(i) }, + { "INDENT" T(N) }, + { "LANG" T(N) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { "TO" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr table_attr[] = { /* TABLE attributes */ - { "ALIGN" }, - { "BORDER" }, - { "CELLPADDING" }, - { "CELLSPACING" }, - { "CLASS" }, - { "CLEAR" }, - { "COLS" }, - { "COLSPEC" }, - { "DIR" }, - { "DP" }, - { "FRAME" }, - { "ID" }, - { "LANG" }, - { "NOFLOW" }, - { "NOWRAP" }, - { "RULES" }, - { "STYLE" }, - { "SUMMARY" }, - { "TITLE" }, - { "UNITS" }, - { "WIDTH" }, - { 0 } /* Terminate list */ + { "ALIGN" T(N) }, + { "BORDER" T(N) }, + { "CELLPADDING" T(N) }, + { "CELLSPACING" T(N) }, + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "COLS" T(N) }, + { "COLSPEC" T(N) }, + { "DIR" T(N) }, + { "DP" T(N) }, + { "FRAME" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "NOFLOW" T(N) }, + { "NOWRAP" T(N) }, + { "RULES" T(N) }, + { "STYLE" T(N) }, + { "SUMMARY" T(N) }, + { "TITLE" T(N) }, + { "UNITS" T(N) }, + { "WIDTH" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr td_attr[] = { /* TD and TH attributes */ - { "ALIGN" }, - { "AXES" }, - { "AXIS" }, - { "CHAR" }, - { "CHAROFF" }, - { "CLASS" }, - { "CLEAR" }, - { "COLSPAN" }, - { "DIR" }, - { "DP" }, - { "ID" }, - { "LANG" }, - { "NOWRAP" }, - { "ROWSPAN" }, - { "STYLE" }, - { "TITLE" }, - { "VALIGN" }, - { 0 } /* Terminate list */ + { "ALIGN" T(N) }, + { "AXES" T(N) }, + { "AXIS" T(N) }, + { "CHAR" T(N) }, + { "CHAROFF" T(N) }, + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "COLSPAN" T(N) }, + { "DIR" T(N) }, + { "DP" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "NOWRAP" T(N) }, + { "ROWSPAN" T(N) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { "VALIGN" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr textarea_attr[] = { /* TEXTAREA attributes */ - { "ACCEPT-CHARSET" }, /* RFC 2070 HTML i18n - kw */ - { "ALIGN" }, - { "CLASS" }, - { "CLEAR" }, - { "COLS" }, - { "DIR" }, - { "DISABLED" }, - { "ERROR" }, - { "ID" }, - { "LANG" }, - { "NAME" }, - { "NOTAB" }, - { "ONBLUR" }, - { "ONCHANGE" }, - { "ONFOCUS" }, - { "ONSELECT" }, - { "ROWS" }, - { "STYLE" }, - { "TABINDEX" }, - { "TITLE" }, - { 0 } /* Terminate list */ + { "ACCEPT-CHARSET" T(N) }, /* RFC 2070 HTML i18n - kw */ + { "ALIGN" T(N) }, + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "COLS" T(N) }, + { "DIR" T(N) }, + { "DISABLED" T(N) }, + { "ERROR" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "NAME" T(N) }, + { "NOTAB" T(N) }, + { "ONBLUR" T(N) }, + { "ONCHANGE" T(N) }, + { "ONFOCUS" T(N) }, + { "ONSELECT" T(N) }, + { "ROWS" T(N) }, + { "STYLE" T(N) }, + { "TABINDEX" T(N) }, + { "TITLE" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr tr_attr[] = { /* TR, THEAD, TFOOT, and TBODY attributes */ - { "ALIGN" }, - { "CHAR" }, - { "CHAROFF" }, - { "CLASS" }, - { "CLEAR" }, - { "DIR" }, - { "DP" }, - { "ID" }, - { "LANG" }, - { "NOWRAP" }, - { "STYLE" }, - { "TITLE" }, - { "VALIGN" }, - { 0 } /* Terminate list */ + { "ALIGN" T(N) }, + { "CHAR" T(N) }, + { "CHAROFF" T(N) }, + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "DIR" T(N) }, + { "DP" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "NOWRAP" T(N) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { "VALIGN" T(N) }, + { 0 T(N) } /* Terminate list */ }; static attr ulist_attr[] = { /* UL attributes */ - { "CLASS" }, - { "CLEAR" }, - { "COMPACT" }, - { "DINGBAT" }, - { "DIR" }, - { "ID" }, - { "LANG" }, - { "MD" }, - { "PLAIN" }, - { "SRC" }, - { "STYLE" }, - { "TITLE" }, - { "TYPE" }, - { "WRAP" }, - { 0 } /* Terminate list */ + { "CLASS" T(c) }, + { "CLEAR" T(N) }, + { "COMPACT" T(N) }, + { "DINGBAT" T(N) }, + { "DIR" T(N) }, + { "ID" T(i) }, + { "LANG" T(N) }, + { "MD" T(N) }, + { "PLAIN" T(N) }, + { "SRC" T(h) }, + { "STYLE" T(N) }, + { "TITLE" T(N) }, + { "TYPE" T(N) }, + { "WRAP" T(N) }, + { 0 T(N) } /* Terminate list */ }; +#undef N +#undef i +#undef h +#undef c +#undef x + +#undef T + /* From Peter Flynn's intro to the HTML Pro DTD: %structure; @@ -1335,257 +1355,266 @@ static attr ulist_attr[] = { /* UL attributes */ ** ** Name, Attributes, No. of attributes, content, extra info... */ +#ifdef USE_PSRC +#define P(x) x , (sizeof x) -1 +#define NULL_HTTag NULL, 0 +#else +#define P(x) x +#define NULL_HTTag NULL +#endif + static CONST HTTag tags_old[HTML_ELEMENTS] = { - { "A" , a_attr, HTML_A_ATTRIBUTES, SGML_EMPTY,T_A}, - { "ABBREV" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_ABBREV}, - { "ACRONYM" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_ACRONYM}, - { "ADDRESS" , address_attr, HTML_ADDRESS_ATTRIBUTES, SGML_MIXED,T_ADDRESS}, - { "APPLET" , applet_attr, HTML_APPLET_ATTRIBUTES, SGML_MIXED,T_APPLET}, - { "AREA" , area_attr, HTML_AREA_ATTRIBUTES, SGML_EMPTY,T_AREA}, - { "AU" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_AU}, - { "AUTHOR" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_AUTHOR}, - { "B" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_B}, - { "BANNER" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_BANNER}, - { "BASE" , base_attr, HTML_BASE_ATTRIBUTES, SGML_EMPTY,T_BASE}, - { "BASEFONT", font_attr, HTML_FONT_ATTRIBUTES, SGML_EMPTY,T_BASEFONT}, - { "BDO" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_BDO}, - { "BGSOUND" , bgsound_attr, HTML_BGSOUND_ATTRIBUTES, SGML_EMPTY,T_BGSOUND}, - { "BIG" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_BIG}, - { "BLINK" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_BLINK}, - { "BLOCKQUOTE", bq_attr, HTML_BQ_ATTRIBUTES, SGML_MIXED,T_BLOCKQUOTE}, - { "BODY" , body_attr, HTML_BODY_ATTRIBUTES, SGML_MIXED,T_BODY}, - { "BODYTEXT", bodytext_attr,HTML_BODYTEXT_ATTRIBUTES, SGML_MIXED,T_BODYTEXT}, - { "BQ" , bq_attr, HTML_BQ_ATTRIBUTES, SGML_MIXED,T_BQ}, - { "BR" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_BR}, - { "BUTTON" , button_attr, HTML_BUTTON_ATTRIBUTES, SGML_MIXED,T_BUTTON}, - { "CAPTION" , caption_attr, HTML_CAPTION_ATTRIBUTES, SGML_MIXED,T_CAPTION}, - { "CENTER" , div_attr, HTML_DIV_ATTRIBUTES, SGML_MIXED,T_CENTER}, - { "CITE" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_CITE}, - { "CODE" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_CODE}, - { "COL" , col_attr, HTML_COL_ATTRIBUTES, SGML_EMPTY,T_COL}, - { "COLGROUP", col_attr, HTML_COL_ATTRIBUTES, SGML_EMPTY,T_COLGROUP}, - { "COMMENT" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_COMMENT}, - { "CREDIT" , credit_attr, HTML_CREDIT_ATTRIBUTES, SGML_MIXED,T_CREDIT}, - { "DD" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_DD}, - { "DEL" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_DEL}, - { "DFN" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_DFN}, - { "DIR" , ulist_attr, HTML_UL_ATTRIBUTES, SGML_MIXED,T_DIR}, - { "DIV" , div_attr, HTML_DIV_ATTRIBUTES, SGML_MIXED,T_DIV}, - { "DL" , glossary_attr, HTML_DL_ATTRIBUTES, SGML_MIXED,T_DL}, - { "DLC" , glossary_attr, HTML_DL_ATTRIBUTES, SGML_MIXED,T_DLC}, - { "DT" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_DT}, - { "EM" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_EM}, - { "EMBED" , embed_attr, HTML_EMBED_ATTRIBUTES, SGML_EMPTY,T_EMBED}, - { "FIELDSET", fieldset_attr,HTML_FIELDSET_ATTRIBUTES, SGML_MIXED,T_FIELDSET}, - { "FIG" , fig_attr, HTML_FIG_ATTRIBUTES, SGML_MIXED,T_FIG}, - { "FN" , fn_attr, HTML_FN_ATTRIBUTES, SGML_MIXED,T_FN}, - { "FONT" , font_attr, HTML_FONT_ATTRIBUTES, SGML_EMPTY,T_FONT}, - { "FORM" , form_attr, HTML_FORM_ATTRIBUTES, SGML_EMPTY,T_FORM}, - { "FRAME" , frame_attr, HTML_FRAME_ATTRIBUTES, SGML_EMPTY,T_FRAME}, - { "FRAMESET", frameset_attr,HTML_FRAMESET_ATTRIBUTES, SGML_MIXED,T_FRAMESET}, - { "H1" , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H1}, - { "H2" , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H2}, - { "H3" , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H3}, - { "H4" , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H4}, - { "H5" , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H5}, - { "H6" , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H6}, - { "HEAD" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_HEAD}, - { "HR" , hr_attr, HTML_HR_ATTRIBUTES, SGML_EMPTY,T_HR}, - { "HTML" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_HTML}, - { "HY" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_HY}, - { "I" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_I}, - { "IFRAME" , iframe_attr, HTML_IFRAME_ATTRIBUTES, SGML_MIXED,T_IFRAME}, - { "IMG" , img_attr, HTML_IMG_ATTRIBUTES, SGML_EMPTY,T_IMG}, - { "INPUT" , input_attr, HTML_INPUT_ATTRIBUTES, SGML_EMPTY,T_INPUT}, - { "INS" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_INS}, - { "ISINDEX" , isindex_attr, HTML_ISINDEX_ATTRIBUTES,SGML_EMPTY,T_ISINDEX}, - { "KBD" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_KBD}, - { "KEYGEN" , keygen_attr, HTML_KEYGEN_ATTRIBUTES, SGML_EMPTY,T_KEYGEN}, - { "LABEL" , label_attr, HTML_LABEL_ATTRIBUTES, SGML_MIXED,T_LABEL}, - { "LEGEND" , legend_attr, HTML_LEGEND_ATTRIBUTES, SGML_MIXED,T_LEGEND}, - { "LH" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_LH}, - { "LI" , list_attr, HTML_LI_ATTRIBUTES, SGML_EMPTY,T_LI}, - { "LINK" , link_attr, HTML_LINK_ATTRIBUTES, SGML_EMPTY,T_LINK}, - { "LISTING" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_LITTERAL,T_LISTING}, - { "MAP" , map_attr, HTML_MAP_ATTRIBUTES, SGML_MIXED,T_MAP}, - { "MARQUEE" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_MARQUEE}, - { "MATH" , math_attr, HTML_MATH_ATTRIBUTES, SGML_LITTERAL,T_MATH}, - { "MENU" , ulist_attr, HTML_UL_ATTRIBUTES, SGML_MIXED,T_MENU}, - { "META" , meta_attr, HTML_META_ATTRIBUTES, SGML_EMPTY,T_META}, - { "NEXTID" , nextid_attr, 1, SGML_EMPTY,T_NEXTID}, - { "NOFRAMES", gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_NOFRAMES}, - { "NOTE" , note_attr, HTML_NOTE_ATTRIBUTES, SGML_MIXED,T_NOTE}, - { "OBJECT" , object_attr, HTML_OBJECT_ATTRIBUTES, SGML_LITTERAL,T_OBJECT}, - { "OL" , olist_attr, HTML_OL_ATTRIBUTES, SGML_MIXED,T_OL}, - { "OPTION" , option_attr, HTML_OPTION_ATTRIBUTES, SGML_EMPTY,T_OPTION}, - { "OVERLAY" , overlay_attr, HTML_OVERLAY_ATTRIBUTES, SGML_EMPTY,T_OVERLAY}, - { "P" , p_attr, HTML_P_ATTRIBUTES, SGML_EMPTY,T_P}, - { "PARAM" , param_attr, HTML_PARAM_ATTRIBUTES, SGML_EMPTY,T_PARAM}, - { "PLAINTEXT", gen_attr, HTML_GEN_ATTRIBUTES, SGML_LITTERAL,T_PLAINTEXT}, - { "PRE" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_PRE}, - { "Q" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_Q}, - { "S" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_S}, - { "SAMP" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_SAMP}, - { "SCRIPT" , script_attr, HTML_SCRIPT_ATTRIBUTES, SGML_LITTERAL,T_SCRIPT}, - { "SELECT" , select_attr, HTML_SELECT_ATTRIBUTES, SGML_MIXED,T_SELECT}, - { "SHY" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_SHY}, - { "SMALL" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_SMALL}, - { "SPAN" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_SPAN}, - { "SPOT" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_SPOT}, - { "STRIKE" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_STRIKE}, - { "STRONG" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_STRONG}, - { "STYLE" , style_attr, HTML_STYLE_ATTRIBUTES, SGML_LITTERAL,T_STYLE}, - { "SUB" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_SUB}, - { "SUP" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_SUP}, - { "TAB" , tab_attr, HTML_TAB_ATTRIBUTES, SGML_EMPTY,T_TAB}, - { "TABLE" , table_attr, HTML_TABLE_ATTRIBUTES, SGML_MIXED,T_TABLE}, - { "TBODY" , tr_attr, HTML_TR_ATTRIBUTES, SGML_EMPTY,T_TBODY}, - { "TD" , td_attr, HTML_TD_ATTRIBUTES, SGML_EMPTY,T_TD}, - { "TEXTAREA", textarea_attr,HTML_TEXTAREA_ATTRIBUTES, SGML_LITTERAL,T_TEXTAREA}, - { "TEXTFLOW", bodytext_attr,HTML_BODYTEXT_ATTRIBUTES, SGML_MIXED,T_TEXTFLOW}, - { "TFOOT" , tr_attr, HTML_TR_ATTRIBUTES, SGML_EMPTY,T_TFOOT}, - { "TH" , td_attr, HTML_TD_ATTRIBUTES, SGML_EMPTY,T_TH}, - { "THEAD" , tr_attr, HTML_TR_ATTRIBUTES, SGML_EMPTY,T_THEAD}, - { "TITLE", gen_attr, HTML_GEN_ATTRIBUTES, SGML_RCDATA,T_TITLE}, - { "TR" , tr_attr, HTML_TR_ATTRIBUTES, SGML_EMPTY,T_TR}, - { "TT" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_TT}, - { "U" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_U}, - { "UL" , ulist_attr, HTML_UL_ATTRIBUTES, SGML_MIXED,T_UL}, - { "VAR" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_VAR}, - { "WBR" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_WBR}, - { "XMP" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_LITTERAL,T_XMP}, + { P("A") , a_attr, HTML_A_ATTRIBUTES, SGML_EMPTY,T_A}, + { P("ABBREV") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_ABBREV}, + { P("ACRONYM") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_ACRONYM}, + { P("ADDRESS") , address_attr, HTML_ADDRESS_ATTRIBUTES, SGML_MIXED,T_ADDRESS}, + { P("APPLET") , applet_attr, HTML_APPLET_ATTRIBUTES, SGML_MIXED,T_APPLET}, + { P("AREA") , area_attr, HTML_AREA_ATTRIBUTES, SGML_EMPTY,T_AREA}, + { P("AU") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_AU}, + { P("AUTHOR") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_AUTHOR}, + { P("B") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_B}, + { P("BANNER") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_BANNER}, + { P("BASE") , base_attr, HTML_BASE_ATTRIBUTES, SGML_EMPTY,T_BASE}, + { P("BASEFONT"), font_attr, HTML_FONT_ATTRIBUTES, SGML_EMPTY,T_BASEFONT}, + { P("BDO") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_BDO}, + { P("BGSOUND") , bgsound_attr, HTML_BGSOUND_ATTRIBUTES, SGML_EMPTY,T_BGSOUND}, + { P("BIG") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_BIG}, + { P("BLINK") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_BLINK}, + { P("BLOCKQUOTE"), bq_attr, HTML_BQ_ATTRIBUTES, SGML_MIXED,T_BLOCKQUOTE}, + { P("BODY") , body_attr, HTML_BODY_ATTRIBUTES, SGML_MIXED,T_BODY}, + { P("BODYTEXT"), bodytext_attr,HTML_BODYTEXT_ATTRIBUTES, SGML_MIXED,T_BODYTEXT}, + { P("BQ") , bq_attr, HTML_BQ_ATTRIBUTES, SGML_MIXED,T_BQ}, + { P("BR") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_BR}, + { P("BUTTON") , button_attr, HTML_BUTTON_ATTRIBUTES, SGML_MIXED,T_BUTTON}, + { P("CAPTION") , caption_attr, HTML_CAPTION_ATTRIBUTES, SGML_MIXED,T_CAPTION}, + { P("CENTER") , div_attr, HTML_DIV_ATTRIBUTES, SGML_MIXED,T_CENTER}, + { P("CITE") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_CITE}, + { P("CODE") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_CODE}, + { P("COL") , col_attr, HTML_COL_ATTRIBUTES, SGML_EMPTY,T_COL}, + { P("COLGROUP"), col_attr, HTML_COL_ATTRIBUTES, SGML_EMPTY,T_COLGROUP}, + { P("COMMENT") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_COMMENT}, + { P("CREDIT") , credit_attr, HTML_CREDIT_ATTRIBUTES, SGML_MIXED,T_CREDIT}, + { P("DD") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_DD}, + { P("DEL") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_DEL}, + { P("DFN") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_DFN}, + { P("DIR") , ulist_attr, HTML_UL_ATTRIBUTES, SGML_MIXED,T_DIR}, + { P("DIV") , div_attr, HTML_DIV_ATTRIBUTES, SGML_MIXED,T_DIV}, + { P("DL") , glossary_attr, HTML_DL_ATTRIBUTES, SGML_MIXED,T_DL}, + { P("DLC") , glossary_attr, HTML_DL_ATTRIBUTES, SGML_MIXED,T_DLC}, + { P("DT") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_DT}, + { P("EM") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_EM}, + { P("EMBED") , embed_attr, HTML_EMBED_ATTRIBUTES, SGML_EMPTY,T_EMBED}, + { P("FIELDSET"), fieldset_attr,HTML_FIELDSET_ATTRIBUTES, SGML_MIXED,T_FIELDSET}, + { P("FIG") , fig_attr, HTML_FIG_ATTRIBUTES, SGML_MIXED,T_FIG}, + { P("FN") , fn_attr, HTML_FN_ATTRIBUTES, SGML_MIXED,T_FN}, + { P("FONT") , font_attr, HTML_FONT_ATTRIBUTES, SGML_EMPTY,T_FONT}, + { P("FORM") , form_attr, HTML_FORM_ATTRIBUTES, SGML_EMPTY,T_FORM}, + { P("FRAME") , frame_attr, HTML_FRAME_ATTRIBUTES, SGML_EMPTY,T_FRAME}, + { P("FRAMESET"), frameset_attr,HTML_FRAMESET_ATTRIBUTES, SGML_MIXED,T_FRAMESET}, + { P("H1") , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H1}, + { P("H2") , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H2}, + { P("H3") , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H3}, + { P("H4") , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H4}, + { P("H5") , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H5}, + { P("H6") , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H6}, + { P("HEAD") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_HEAD}, + { P("HR") , hr_attr, HTML_HR_ATTRIBUTES, SGML_EMPTY,T_HR}, + { P("HTML") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_HTML}, + { P("HY") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_HY}, + { P("I") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_I}, + { P("IFRAME") , iframe_attr, HTML_IFRAME_ATTRIBUTES, SGML_MIXED,T_IFRAME}, + { P("IMG") , img_attr, HTML_IMG_ATTRIBUTES, SGML_EMPTY,T_IMG}, + { P("INPUT") , input_attr, HTML_INPUT_ATTRIBUTES, SGML_EMPTY,T_INPUT}, + { P("INS") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_INS}, + { P("ISINDEX") , isindex_attr, HTML_ISINDEX_ATTRIBUTES,SGML_EMPTY,T_ISINDEX}, + { P("KBD") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_KBD}, + { P("KEYGEN") , keygen_attr, HTML_KEYGEN_ATTRIBUTES, SGML_EMPTY,T_KEYGEN}, + { P("LABEL") , label_attr, HTML_LABEL_ATTRIBUTES, SGML_MIXED,T_LABEL}, + { P("LEGEND") , legend_attr, HTML_LEGEND_ATTRIBUTES, SGML_MIXED,T_LEGEND}, + { P("LH") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_LH}, + { P("LI") , list_attr, HTML_LI_ATTRIBUTES, SGML_EMPTY,T_LI}, + { P("LINK") , link_attr, HTML_LINK_ATTRIBUTES, SGML_EMPTY,T_LINK}, + { P("LISTING") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_LITTERAL,T_LISTING}, + { P("MAP") , map_attr, HTML_MAP_ATTRIBUTES, SGML_MIXED,T_MAP}, + { P("MARQUEE") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_MARQUEE}, + { P("MATH") , math_attr, HTML_MATH_ATTRIBUTES, SGML_LITTERAL,T_MATH}, + { P("MENU") , ulist_attr, HTML_UL_ATTRIBUTES, SGML_MIXED,T_MENU}, + { P("META") , meta_attr, HTML_META_ATTRIBUTES, SGML_EMPTY,T_META}, + { P("NEXTID") , nextid_attr, 1, SGML_EMPTY,T_NEXTID}, + { P("NOFRAMES"), gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_NOFRAMES}, + { P("NOTE") , note_attr, HTML_NOTE_ATTRIBUTES, SGML_MIXED,T_NOTE}, + { P("OBJECT") , object_attr, HTML_OBJECT_ATTRIBUTES, SGML_LITTERAL,T_OBJECT}, + { P("OL") , olist_attr, HTML_OL_ATTRIBUTES, SGML_MIXED,T_OL}, + { P("OPTION") , option_attr, HTML_OPTION_ATTRIBUTES, SGML_EMPTY,T_OPTION}, + { P("OVERLAY") , overlay_attr, HTML_OVERLAY_ATTRIBUTES, SGML_EMPTY,T_OVERLAY}, + { P("P") , p_attr, HTML_P_ATTRIBUTES, SGML_EMPTY,T_P}, + { P("PARAM") , param_attr, HTML_PARAM_ATTRIBUTES, SGML_EMPTY,T_PARAM}, + { P("PLAINTEXT"), gen_attr, HTML_GEN_ATTRIBUTES, SGML_LITTERAL,T_PLAINTEXT}, + { P("PRE") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_PRE}, + { P("Q") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_Q}, + { P("S") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_S}, + { P("SAMP") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_SAMP}, + { P("SCRIPT") , script_attr, HTML_SCRIPT_ATTRIBUTES, SGML_LITTERAL,T_SCRIPT}, + { P("SELECT") , select_attr, HTML_SELECT_ATTRIBUTES, SGML_MIXED,T_SELECT}, + { P("SHY") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_SHY}, + { P("SMALL") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_SMALL}, + { P("SPAN") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_SPAN}, + { P("SPOT") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_SPOT}, + { P("STRIKE") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_STRIKE}, + { P("STRONG") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_STRONG}, + { P("STYLE") , style_attr, HTML_STYLE_ATTRIBUTES, SGML_LITTERAL,T_STYLE}, + { P("SUB") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_SUB}, + { P("SUP") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_SUP}, + { P("TAB") , tab_attr, HTML_TAB_ATTRIBUTES, SGML_EMPTY,T_TAB}, + { P("TABLE") , table_attr, HTML_TABLE_ATTRIBUTES, SGML_MIXED,T_TABLE}, + { P("TBODY") , tr_attr, HTML_TR_ATTRIBUTES, SGML_EMPTY,T_TBODY}, + { P("TD") , td_attr, HTML_TD_ATTRIBUTES, SGML_EMPTY,T_TD}, + { P("TEXTAREA"), textarea_attr,HTML_TEXTAREA_ATTRIBUTES, SGML_LITTERAL,T_TEXTAREA}, + { P("TEXTFLOW"), bodytext_attr,HTML_BODYTEXT_ATTRIBUTES, SGML_MIXED,T_TEXTFLOW}, + { P("TFOOT") , tr_attr, HTML_TR_ATTRIBUTES, SGML_EMPTY,T_TFOOT}, + { P("TH") , td_attr, HTML_TD_ATTRIBUTES, SGML_EMPTY,T_TH}, + { P("THEAD") , tr_attr, HTML_TR_ATTRIBUTES, SGML_EMPTY,T_THEAD}, + { P("TITLE"), gen_attr, HTML_GEN_ATTRIBUTES, SGML_RCDATA,T_TITLE}, + { P("TR") , tr_attr, HTML_TR_ATTRIBUTES, SGML_EMPTY,T_TR}, + { P("TT") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_TT}, + { P("U") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_U}, + { P("UL") , ulist_attr, HTML_UL_ATTRIBUTES, SGML_MIXED,T_UL}, + { P("VAR") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_VAR}, + { P("WBR") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_WBR}, + { P("XMP") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_LITTERAL,T_XMP}, }; static CONST HTTag tags_new[HTML_ELEMENTS] = { - { "A" , a_attr, HTML_A_ATTRIBUTES, SGML_MIXED,T_A}, - { "ABBREV" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_ABBREV}, - { "ACRONYM" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_ACRONYM}, - { "ADDRESS" , address_attr, HTML_ADDRESS_ATTRIBUTES, SGML_MIXED,T_ADDRESS}, - { "APPLET" , applet_attr, HTML_APPLET_ATTRIBUTES, SGML_MIXED,T_APPLET}, - { "AREA" , area_attr, HTML_AREA_ATTRIBUTES, SGML_EMPTY,T_AREA}, - { "AU" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_AU}, - { "AUTHOR" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_AUTHOR}, - { "B" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_B}, - { "BANNER" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_BANNER}, - { "BASE" , base_attr, HTML_BASE_ATTRIBUTES, SGML_EMPTY,T_BASE}, - { "BASEFONT", font_attr, HTML_FONT_ATTRIBUTES, SGML_EMPTY,T_BASEFONT}, - { "BDO" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_BDO}, - { "BGSOUND" , bgsound_attr, HTML_BGSOUND_ATTRIBUTES, SGML_EMPTY,T_BGSOUND}, - { "BIG" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_BIG}, - { "BLINK" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_BLINK}, - { "BLOCKQUOTE", bq_attr, HTML_BQ_ATTRIBUTES, SGML_MIXED,T_BLOCKQUOTE}, - { "BODY" , body_attr, HTML_BODY_ATTRIBUTES, SGML_MIXED,T_BODY}, - { "BODYTEXT", bodytext_attr,HTML_BODYTEXT_ATTRIBUTES, SGML_MIXED,T_BODYTEXT}, - { "BQ" , bq_attr, HTML_BQ_ATTRIBUTES, SGML_MIXED,T_BQ}, - { "BR" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_BR}, - { "BUTTON" , button_attr, HTML_BUTTON_ATTRIBUTES, SGML_MIXED,T_BUTTON}, - { "CAPTION" , caption_attr, HTML_CAPTION_ATTRIBUTES, SGML_MIXED,T_CAPTION}, - { "CENTER" , div_attr, HTML_DIV_ATTRIBUTES, SGML_MIXED,T_CENTER}, - { "CITE" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_CITE}, - { "CODE" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_CODE}, - { "COL" , col_attr, HTML_COL_ATTRIBUTES, SGML_EMPTY,T_COL}, - { "COLGROUP", col_attr, HTML_COL_ATTRIBUTES, SGML_ELEMENT,T_COLGROUP}, - { "COMMENT" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_PCDATA,T_COMMENT}, - { "CREDIT" , credit_attr, HTML_CREDIT_ATTRIBUTES, SGML_MIXED,T_CREDIT}, - { "DD" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_DD}, - { "DEL" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_DEL}, - { "DFN" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_DFN}, - { "DIR" , ulist_attr, HTML_UL_ATTRIBUTES, SGML_MIXED,T_DIR}, - { "DIV" , div_attr, HTML_DIV_ATTRIBUTES, SGML_MIXED,T_DIV}, - { "DL" , glossary_attr, HTML_DL_ATTRIBUTES, SGML_MIXED,T_DL}, - { "DLC" , glossary_attr, HTML_DL_ATTRIBUTES, SGML_MIXED,T_DLC}, - { "DT" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_DT}, - { "EM" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_EM}, - { "EMBED" , embed_attr, HTML_EMBED_ATTRIBUTES, SGML_EMPTY,T_EMBED}, - { "FIELDSET", fieldset_attr,HTML_FIELDSET_ATTRIBUTES, SGML_MIXED,T_FIELDSET}, - { "FIG" , fig_attr, HTML_FIG_ATTRIBUTES, SGML_MIXED,T_FIG}, - { "FN" , fn_attr, HTML_FN_ATTRIBUTES, SGML_MIXED,T_FN}, - { "FONT" , font_attr, HTML_FONT_ATTRIBUTES, SGML_MIXED,T_FONT}, - { "FORM" , form_attr, HTML_FORM_ATTRIBUTES, SGML_MIXED,T_FORM}, - { "FRAME" , frame_attr, HTML_FRAME_ATTRIBUTES, SGML_EMPTY,T_FRAME}, - { "FRAMESET", frameset_attr,HTML_FRAMESET_ATTRIBUTES, SGML_ELEMENT,T_FRAMESET}, + { P("A") , a_attr, HTML_A_ATTRIBUTES, SGML_MIXED,T_A}, + { P("ABBREV") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_ABBREV}, + { P("ACRONYM") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_ACRONYM}, + { P("ADDRESS") , address_attr, HTML_ADDRESS_ATTRIBUTES, SGML_MIXED,T_ADDRESS}, + { P("APPLET") , applet_attr, HTML_APPLET_ATTRIBUTES, SGML_MIXED,T_APPLET}, + { P("AREA") , area_attr, HTML_AREA_ATTRIBUTES, SGML_EMPTY,T_AREA}, + { P("AU") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_AU}, + { P("AUTHOR") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_AUTHOR}, + { P("B") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_B}, + { P("BANNER") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_BANNER}, + { P("BASE") , base_attr, HTML_BASE_ATTRIBUTES, SGML_EMPTY,T_BASE}, + { P("BASEFONT"), font_attr, HTML_FONT_ATTRIBUTES, SGML_EMPTY,T_BASEFONT}, + { P("BDO") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_BDO}, + { P("BGSOUND") , bgsound_attr, HTML_BGSOUND_ATTRIBUTES, SGML_EMPTY,T_BGSOUND}, + { P("BIG") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_BIG}, + { P("BLINK") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_BLINK}, + { P("BLOCKQUOTE"), bq_attr, HTML_BQ_ATTRIBUTES, SGML_MIXED,T_BLOCKQUOTE}, + { P("BODY") , body_attr, HTML_BODY_ATTRIBUTES, SGML_MIXED,T_BODY}, + { P("BODYTEXT"), bodytext_attr,HTML_BODYTEXT_ATTRIBUTES, SGML_MIXED,T_BODYTEXT}, + { P("BQ") , bq_attr, HTML_BQ_ATTRIBUTES, SGML_MIXED,T_BQ}, + { P("BR") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_BR}, + { P("BUTTON") , button_attr, HTML_BUTTON_ATTRIBUTES, SGML_MIXED,T_BUTTON}, + { P("CAPTION") , caption_attr, HTML_CAPTION_ATTRIBUTES, SGML_MIXED,T_CAPTION}, + { P("CENTER") , div_attr, HTML_DIV_ATTRIBUTES, SGML_MIXED,T_CENTER}, + { P("CITE") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_CITE}, + { P("CODE") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_CODE}, + { P("COL") , col_attr, HTML_COL_ATTRIBUTES, SGML_EMPTY,T_COL}, + { P("COLGROUP"), col_attr, HTML_COL_ATTRIBUTES, SGML_ELEMENT,T_COLGROUP}, + { P("COMMENT") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_PCDATA,T_COMMENT}, + { P("CREDIT") , credit_attr, HTML_CREDIT_ATTRIBUTES, SGML_MIXED,T_CREDIT}, + { P("DD") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_DD}, + { P("DEL") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_DEL}, + { P("DFN") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_DFN}, + { P("DIR") , ulist_attr, HTML_UL_ATTRIBUTES, SGML_MIXED,T_DIR}, + { P("DIV") , div_attr, HTML_DIV_ATTRIBUTES, SGML_MIXED,T_DIV}, + { P("DL") , glossary_attr, HTML_DL_ATTRIBUTES, SGML_MIXED,T_DL}, + { P("DLC") , glossary_attr, HTML_DL_ATTRIBUTES, SGML_MIXED,T_DLC}, + { P("DT") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_DT}, + { P("EM") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_EM}, + { P("EMBED") , embed_attr, HTML_EMBED_ATTRIBUTES, SGML_EMPTY,T_EMBED}, + { P("FIELDSET"), fieldset_attr,HTML_FIELDSET_ATTRIBUTES, SGML_MIXED,T_FIELDSET}, + { P("FIG") , fig_attr, HTML_FIG_ATTRIBUTES, SGML_MIXED,T_FIG}, + { P("FN") , fn_attr, HTML_FN_ATTRIBUTES, SGML_MIXED,T_FN}, + { P("FONT") , font_attr, HTML_FONT_ATTRIBUTES, SGML_MIXED,T_FONT}, + { P("FORM") , form_attr, HTML_FORM_ATTRIBUTES, SGML_MIXED,T_FORM}, + { P("FRAME") , frame_attr, HTML_FRAME_ATTRIBUTES, SGML_EMPTY,T_FRAME}, + { P("FRAMESET"), frameset_attr,HTML_FRAMESET_ATTRIBUTES, SGML_ELEMENT,T_FRAMESET}, #ifndef EBCDIC /* S/390 -- gil -- 0177 */ - { "H1" , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H1}, - { "H2" , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H2}, - { "H3" , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H3}, - { "H4" , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H4}, - { "H5" , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H5}, - { "H6" , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H6}, + { P("H1") , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H1}, + { P("H2") , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H2}, + { P("H3") , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H3}, + { P("H4") , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H4}, + { P("H5") , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H5}, + { P("H6") , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H6}, #endif /* EBCDIC S/390 -- gil -- 0187 */ - { "HEAD" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_ELEMENT,T_HEAD}, - { "HR" , hr_attr, HTML_HR_ATTRIBUTES, SGML_EMPTY,T_HR}, - { "HTML" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_HTML}, - { "HY" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_HY}, + { P("HEAD") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_ELEMENT,T_HEAD}, + { P("HR") , hr_attr, HTML_HR_ATTRIBUTES, SGML_EMPTY,T_HR}, + { P("HTML") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_HTML}, + { P("HY") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_HY}, #ifdef EBCDIC - { "H1" , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H1}, - { "H2" , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H2}, - { "H3" , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H3}, - { "H4" , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H4}, - { "H5" , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H5}, - { "H6" , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H6}, + { P("H1") , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H1}, + { P("H2") , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H2}, + { P("H3") , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H3}, + { P("H4") , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H4}, + { P("H5") , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H5}, + { P("H6") , h_attr, HTML_H_ATTRIBUTES, SGML_MIXED,T_H6}, #endif /* EBCDIC <heavy sigh> -- gil */ - { "I" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_I}, - { "IFRAME" , iframe_attr, HTML_IFRAME_ATTRIBUTES, SGML_MIXED,T_IFRAME}, - { "IMG" , img_attr, HTML_IMG_ATTRIBUTES, SGML_EMPTY,T_IMG}, - { "INPUT" , input_attr, HTML_INPUT_ATTRIBUTES, SGML_EMPTY,T_INPUT}, - { "INS" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_INS}, - { "ISINDEX" , isindex_attr, HTML_ISINDEX_ATTRIBUTES,SGML_EMPTY,T_ISINDEX}, - { "KBD" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_KBD}, - { "KEYGEN" , keygen_attr, HTML_KEYGEN_ATTRIBUTES, SGML_EMPTY,T_KEYGEN}, - { "LABEL" , label_attr, HTML_LABEL_ATTRIBUTES, SGML_MIXED,T_LABEL}, - { "LEGEND" , legend_attr, HTML_LEGEND_ATTRIBUTES, SGML_MIXED,T_LEGEND}, - { "LH" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_LH}, - { "LI" , list_attr, HTML_LI_ATTRIBUTES, SGML_MIXED,T_LI}, - { "LINK" , link_attr, HTML_LINK_ATTRIBUTES, SGML_EMPTY,T_LINK}, - { "LISTING" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_LITTERAL,T_LISTING}, - { "MAP" , map_attr, HTML_MAP_ATTRIBUTES, SGML_ELEMENT,T_MAP}, - { "MARQUEE" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_MARQUEE}, - { "MATH" , math_attr, HTML_MATH_ATTRIBUTES, SGML_LITTERAL,T_MATH}, - { "MENU" , ulist_attr, HTML_UL_ATTRIBUTES, SGML_MIXED,T_MENU}, - { "META" , meta_attr, HTML_META_ATTRIBUTES, SGML_EMPTY,T_META}, - { "NEXTID" , nextid_attr, 1, SGML_EMPTY,T_NEXTID}, - { "NOFRAMES", gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_NOFRAMES}, - { "NOTE" , note_attr, HTML_NOTE_ATTRIBUTES, SGML_MIXED,T_NOTE}, - { "OBJECT" , object_attr, HTML_OBJECT_ATTRIBUTES, SGML_LITTERAL,T_OBJECT}, - { "OL" , olist_attr, HTML_OL_ATTRIBUTES, SGML_MIXED,T_OL}, - { "OPTION" , option_attr, HTML_OPTION_ATTRIBUTES, SGML_PCDATA,T_OPTION}, - { "OVERLAY" , overlay_attr, HTML_OVERLAY_ATTRIBUTES, SGML_PCDATA,T_OVERLAY}, - { "P" , p_attr, HTML_P_ATTRIBUTES, SGML_MIXED,T_P}, - { "PARAM" , param_attr, HTML_PARAM_ATTRIBUTES, SGML_EMPTY,T_PARAM}, - { "PLAINTEXT", gen_attr, HTML_GEN_ATTRIBUTES, SGML_LITTERAL,T_PLAINTEXT}, - { "PRE" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_PRE}, - { "Q" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_Q}, - { "S" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_S}, - { "SAMP" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_SAMP}, - { "SCRIPT" , script_attr, HTML_SCRIPT_ATTRIBUTES, SGML_LITTERAL,T_SCRIPT}, - { "SELECT" , select_attr, HTML_SELECT_ATTRIBUTES, SGML_ELEMENT,T_SELECT}, - { "SHY" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_SHY}, - { "SMALL" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_SMALL}, - { "SPAN" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_SPAN}, - { "SPOT" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_SPOT}, - { "STRIKE" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_STRIKE}, - { "STRONG" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_STRONG}, - { "STYLE" , style_attr, HTML_STYLE_ATTRIBUTES, SGML_LITTERAL,T_STYLE}, - { "SUB" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_SUB}, - { "SUP" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_SUP}, - { "TAB" , tab_attr, HTML_TAB_ATTRIBUTES, SGML_EMPTY,T_TAB}, - { "TABLE" , table_attr, HTML_TABLE_ATTRIBUTES, SGML_ELEMENT,T_TABLE}, - { "TBODY" , tr_attr, HTML_TR_ATTRIBUTES, SGML_ELEMENT,T_TBODY}, - { "TD" , td_attr, HTML_TD_ATTRIBUTES, SGML_MIXED,T_TD}, - { "TEXTAREA", textarea_attr,HTML_TEXTAREA_ATTRIBUTES, SGML_LITTERAL,T_TEXTAREA}, - { "TEXTFLOW", bodytext_attr,HTML_BODYTEXT_ATTRIBUTES, SGML_MIXED,T_TEXTFLOW}, - { "TFOOT" , tr_attr, HTML_TR_ATTRIBUTES, SGML_ELEMENT,T_TFOOT}, - { "TH" , td_attr, HTML_TD_ATTRIBUTES, SGML_MIXED,T_TH}, - { "THEAD" , tr_attr, HTML_TR_ATTRIBUTES, SGML_ELEMENT,T_THEAD}, - { "TITLE" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_PCDATA,T_TITLE}, - { "TR" , tr_attr, HTML_TR_ATTRIBUTES, SGML_MIXED,T_TR}, - { "TT" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_TT}, - { "U" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_U}, - { "UL" , ulist_attr, HTML_UL_ATTRIBUTES, SGML_MIXED,T_UL}, - { "VAR" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_VAR}, - { "WBR" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_WBR}, - { "XMP" , gen_attr, HTML_GEN_ATTRIBUTES, SGML_LITTERAL,T_XMP}, + { P("I") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_I}, + { P("IFRAME") , iframe_attr, HTML_IFRAME_ATTRIBUTES, SGML_MIXED,T_IFRAME}, + { P("IMG") , img_attr, HTML_IMG_ATTRIBUTES, SGML_EMPTY,T_IMG}, + { P("INPUT") , input_attr, HTML_INPUT_ATTRIBUTES, SGML_EMPTY,T_INPUT}, + { P("INS") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_INS}, + { P("ISINDEX") , isindex_attr, HTML_ISINDEX_ATTRIBUTES,SGML_EMPTY,T_ISINDEX}, + { P("KBD") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_KBD}, + { P("KEYGEN") , keygen_attr, HTML_KEYGEN_ATTRIBUTES, SGML_EMPTY,T_KEYGEN}, + { P("LABEL") , label_attr, HTML_LABEL_ATTRIBUTES, SGML_MIXED,T_LABEL}, + { P("LEGEND") , legend_attr, HTML_LEGEND_ATTRIBUTES, SGML_MIXED,T_LEGEND}, + { P("LH") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_LH}, + { P("LI") , list_attr, HTML_LI_ATTRIBUTES, SGML_MIXED,T_LI}, + { P("LINK") , link_attr, HTML_LINK_ATTRIBUTES, SGML_EMPTY,T_LINK}, + { P("LISTING") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_LITTERAL,T_LISTING}, + { P("MAP") , map_attr, HTML_MAP_ATTRIBUTES, SGML_ELEMENT,T_MAP}, + { P("MARQUEE") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_MARQUEE}, + { P("MATH") , math_attr, HTML_MATH_ATTRIBUTES, SGML_LITTERAL,T_MATH}, + { P("MENU") , ulist_attr, HTML_UL_ATTRIBUTES, SGML_MIXED,T_MENU}, + { P("META") , meta_attr, HTML_META_ATTRIBUTES, SGML_EMPTY,T_META}, + { P("NEXTID") , nextid_attr, 1, SGML_EMPTY,T_NEXTID}, + { P("NOFRAMES"), gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_NOFRAMES}, + { P("NOTE") , note_attr, HTML_NOTE_ATTRIBUTES, SGML_MIXED,T_NOTE}, + { P("OBJECT") , object_attr, HTML_OBJECT_ATTRIBUTES, SGML_LITTERAL,T_OBJECT}, + { P("OL") , olist_attr, HTML_OL_ATTRIBUTES, SGML_MIXED,T_OL}, + { P("OPTION") , option_attr, HTML_OPTION_ATTRIBUTES, SGML_PCDATA,T_OPTION}, + { P("OVERLAY") , overlay_attr, HTML_OVERLAY_ATTRIBUTES, SGML_PCDATA,T_OVERLAY}, + { P("P") , p_attr, HTML_P_ATTRIBUTES, SGML_MIXED,T_P}, + { P("PARAM") , param_attr, HTML_PARAM_ATTRIBUTES, SGML_EMPTY,T_PARAM}, + { P("PLAINTEXT"), gen_attr, HTML_GEN_ATTRIBUTES, SGML_LITTERAL,T_PLAINTEXT}, + { P("PRE") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_PRE}, + { P("Q") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_Q}, + { P("S") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_S}, + { P("SAMP") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_SAMP}, + { P("SCRIPT") , script_attr, HTML_SCRIPT_ATTRIBUTES, SGML_LITTERAL,T_SCRIPT}, + { P("SELECT") , select_attr, HTML_SELECT_ATTRIBUTES, SGML_ELEMENT,T_SELECT}, + { P("SHY") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_SHY}, + { P("SMALL") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_SMALL}, + { P("SPAN") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_SPAN}, + { P("SPOT") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_SPOT}, + { P("STRIKE") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_STRIKE}, + { P("STRONG") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_STRONG}, + { P("STYLE") , style_attr, HTML_STYLE_ATTRIBUTES, SGML_LITTERAL,T_STYLE}, + { P("SUB") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_SUB}, + { P("SUP") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_SUP}, + { P("TAB") , tab_attr, HTML_TAB_ATTRIBUTES, SGML_EMPTY,T_TAB}, + { P("TABLE") , table_attr, HTML_TABLE_ATTRIBUTES, SGML_ELEMENT,T_TABLE}, + { P("TBODY") , tr_attr, HTML_TR_ATTRIBUTES, SGML_ELEMENT,T_TBODY}, + { P("TD") , td_attr, HTML_TD_ATTRIBUTES, SGML_MIXED,T_TD}, + { P("TEXTAREA"), textarea_attr,HTML_TEXTAREA_ATTRIBUTES, SGML_LITTERAL,T_TEXTAREA}, + { P("TEXTFLOW"), bodytext_attr,HTML_BODYTEXT_ATTRIBUTES, SGML_MIXED,T_TEXTFLOW}, + { P("TFOOT") , tr_attr, HTML_TR_ATTRIBUTES, SGML_ELEMENT,T_TFOOT}, + { P("TH") , td_attr, HTML_TD_ATTRIBUTES, SGML_MIXED,T_TH}, + { P("THEAD") , tr_attr, HTML_TR_ATTRIBUTES, SGML_ELEMENT,T_THEAD}, + { P("TITLE") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_PCDATA,T_TITLE}, + { P("TR") , tr_attr, HTML_TR_ATTRIBUTES, SGML_MIXED,T_TR}, + { P("TT") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_TT}, + { P("U") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_U}, + { P("UL") , ulist_attr, HTML_UL_ATTRIBUTES, SGML_MIXED,T_UL}, + { P("VAR") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_MIXED,T_VAR}, + { P("WBR") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_EMPTY,T_WBR}, + { P("XMP") , gen_attr, HTML_GEN_ATTRIBUTES, SGML_LITTERAL,T_XMP}, }; +#undef P /* Dummy space, will be filled with the contents of either tags_new or tags_old on calling HTSwitchDTD - kw */ @@ -1621,7 +1650,8 @@ PUBLIC void HTSwitchDTD ARGS1( } PUBLIC HTTag HTTag_unrecognized = - { NULL, NULL, 0, SGML_EMPTY,T__UNREC_}; + + { NULL_HTTag, NULL, 0, SGML_EMPTY,T__UNREC_}; /* ** Utility Routine: Useful for people building HTML objects. diff --git a/WWW/Library/Implementation/HTMLDTD.h b/WWW/Library/Implementation/HTMLDTD.h index 59e8012b..600cf161 100644 --- a/WWW/Library/Implementation/HTMLDTD.h +++ b/WWW/Library/Implementation/HTMLDTD.h @@ -949,6 +949,15 @@ Attribute numbers #define HTML_UL_WRAP 13 #define HTML_UL_ATTRIBUTES 14 +#ifdef USE_PSRC +/* values of HTML attributes' types */ +#define HTMLA_NORMAL 0 /* nothing specific */ +#define HTMLA_ANAME 1 /* anchor name - 'id' or a's 'name' */ +#define HTMLA_HREF 2 /* href */ +#define HTMLA_CLASS 4 /* class name. */ +#define HTMLA_AUXCLASS 8 /* attribute, the value of which also designates + a class name */ +#endif extern CONST SGML_dtd HTML_dtd; extern void HTSwitchDTD PARAMS(( diff --git a/WWW/Library/Implementation/HTNews.c b/WWW/Library/Implementation/HTNews.c index 61858d30..5b16ee3c 100644 --- a/WWW/Library/Implementation/HTNews.c +++ b/WWW/Library/Implementation/HTNews.c @@ -213,7 +213,9 @@ PRIVATE BOOL initialize NOARGS #endif /* NeXTStep */ s = -1; /* Disconnected */ +#ifdef LY_FIND_LEAKS atexit(free_news_globals); +#endif return YES; } @@ -343,7 +345,9 @@ PRIVATE NNTPAuthResult HTHandleAuthInfo ARGS1( } } else { NNTP_AuthInfo = HTList_new(); +#ifdef LY_FIND_LEAKS atexit(free_NNTP_AuthInfo); +#endif } /* diff --git a/WWW/Library/Implementation/HTRules.c b/WWW/Library/Implementation/HTRules.c index b97a01aa..97df34e6 100644 --- a/WWW/Library/Implementation/HTRules.c +++ b/WWW/Library/Implementation/HTRules.c @@ -102,7 +102,9 @@ PUBLIC int HTAddRule ARGS3( } if (!rules) { +#ifdef LY_FIND_LEAKS atexit(HTClearRules); +#endif } #ifdef PUT_ON_HEAD temp->next = rules; @@ -290,7 +292,7 @@ char * HTTranslate ARGS1( ** returns 0 OK, < 0 syntax error. */ PUBLIC int HTSetConfiguration ARGS1( - CONST char *, config) + char *, config) { HTRuleOp op; char * line = NULL; diff --git a/WWW/Library/Implementation/HTRules.h b/WWW/Library/Implementation/HTRules.h index 06d2ea7a..61a90a4f 100644 --- a/WWW/Library/Implementation/HTRules.h +++ b/WWW/Library/Implementation/HTRules.h @@ -114,7 +114,7 @@ HTSetConfiguration: Load one line of configuration information the rule file, for example INI files for X resources. */ -extern int HTSetConfiguration PARAMS((CONST char * config)); +extern int HTSetConfiguration PARAMS((char * config)); /* diff --git a/WWW/Library/Implementation/HTTCP.c b/WWW/Library/Implementation/HTTCP.c index 99f0b8ff..243749eb 100644 --- a/WWW/Library/Implementation/HTTCP.c +++ b/WWW/Library/Implementation/HTTCP.c @@ -668,7 +668,9 @@ PUBLIC struct hostent * LYGetHostByName ARGS1( if (!valid_hostname(host)) { lynx_nsl_status = HT_NOT_ACCEPTABLE; +#ifdef NO_RECOVERY h_errno = NO_RECOVERY; +#endif return NULL; } @@ -693,11 +695,12 @@ PUBLIC struct hostent * LYGetHostByName ARGS1( { int got_rehostent = 0; /* - ** Pipe, child pid, status buffers, cycle count, select() + ** Pipe, child pid, status buffers, start time, select() ** control variables. - */ + */ pid_t fpid, waitret; - int pfd[2], selret, readret, waitstat = 0, cycle = 0; + int pfd[2], selret, readret, waitstat = 0; + time_t start_time = time(NULL); fd_set readfds; struct timeval timeout; int dns_patience = 30; /* how many seconds will we wait for DNS? */ @@ -723,18 +726,18 @@ PUBLIC struct hostent * LYGetHostByName ARGS1( struct hostent *phost; /* Pointer to host - See netdb.h */ /* ** Child - for the long call. - ** - ** Make sure parent can kill us at will. -BL - */ + ** + ** Make sure parent can kill us at will. -BL + */ (void) signal(SIGTERM, quench); /* - ** Also make sure the child does not run one of the - ** signal handlers that may have been installed by - ** Lynx if one of those signals occurs. For example - ** we don't want the child to remove temp files on - ** ^C, let the parent deal with that. - kw - */ + ** Also make sure the child does not run one of the + ** signal handlers that may have been installed by + ** Lynx if one of those signals occurs. For example + ** we don't want the child to remove temp files on + ** ^C, let the parent deal with that. - kw + */ (void) signal(SIGINT, quench); #ifndef NOSIGHUP (void) signal(SIGHUP, quench); @@ -814,11 +817,12 @@ PUBLIC struct hostent * LYGetHostByName ARGS1( close(pfd[1]); /* parent won't use write side -BL */ - while (cycle < dns_patience) { - /* - ** Avoid infinite loop in the face of the unexpected. -BL - */ - cycle++; + if (fpid < 0) { /* fork failed */ + close(pfd[0]); + goto failed; + } + + while (child_exited || time(NULL) - start_time < dns_patience) { FD_ZERO(&readfds); /* @@ -884,8 +888,8 @@ PUBLIC struct hostent * LYGetHostByName ARGS1( lynx_nsl_status = HT_ERROR; } /* - ** Make sure child is cleaned up. -BL - */ + ** Make sure child is cleaned up. -BL + */ if (!child_exited) waitret = waitpid(fpid, &waitstat, WNOHANG); if (!WIFEXITED(waitstat) && !WIFSIGNALED(waitstat)) { @@ -896,15 +900,15 @@ PUBLIC struct hostent * LYGetHostByName ARGS1( } /* - ** Clean up if child exited before & no data received. -BL - */ + ** Clean up if child exited before & no data received. -BL + */ if (child_exited) { waitret = waitpid(fpid, &waitstat, WNOHANG); break; } /* - ** If child exited, loop once more looking for data. -BL - */ + ** If child exited, loop once more looking for data. -BL + */ if ((waitret = waitpid(fpid, &waitstat, WNOHANG)) > 0) { /* ** Data will be arriving right now, so make sure we @@ -912,7 +916,6 @@ PUBLIC struct hostent * LYGetHostByName ARGS1( ** skip the interrupt check. -BL */ child_exited = 1; - cycle--; continue; } @@ -1000,7 +1003,7 @@ PUBLIC struct hostent * LYGetHostByName ARGS1( #else /* !NSL_FORK, !_WINDOWS_NSL: */ { struct hostent *phost; - phost = gethostbyname(host); /* See netdb.h */ + phost = gethostbyname((char *)host); /* See netdb.h */ #ifdef MVS CTRACE(tfp, "LYGetHostByName: gethostbyname() returned %d\n", phost); #endif /* MVS */ @@ -1262,7 +1265,9 @@ PRIVATE void get_host_details NOARGS return; /* Already done */ gethostname(name, namelength); /* Without domain */ StrAllocCopy(hostname, name); +#ifdef LY_FIND_LEAKS atexit(free_HTTCP_hostname); +#endif #ifdef UCX /* ** UCX doesn't give the complete domain name. diff --git a/WWW/Library/Implementation/HTUtils.h b/WWW/Library/Implementation/HTUtils.h index 9065ef01..b6f03d0b 100644 --- a/WWW/Library/Implementation/HTUtils.h +++ b/WWW/Library/Implementation/HTUtils.h @@ -335,7 +335,7 @@ are generally not the response status from any specific protocol. #define HT_BAD_EOF -12 /* Premature EOF */ #ifndef va_arg -# if HAVE_STDARG_H +# if HAVE_STDARG_H && ANSI_VARARGS # include <stdarg.h> # else # if HAVE_VARARGS_H diff --git a/WWW/Library/Implementation/HTWriter.c b/WWW/Library/Implementation/HTWriter.c deleted file mode 100644 index c4dba35b..00000000 --- a/WWW/Library/Implementation/HTWriter.c +++ /dev/null @@ -1,183 +0,0 @@ -/* FILE WRITER HTWrite.c -** =========== -** -*/ - -#include <HTUtils.h> - -#include <HTWriter.h> - -#define BUFFER_SIZE 4096 /* Tradeoff */ - -#include <LYLeaks.h> - -/* HTML Object -** ----------- -*/ - -struct _HTStream { - CONST HTStreamClass * isa; - - int soc; - char *write_pointer; - char buffer[BUFFER_SIZE]; -#ifdef NOT_ASCII - BOOL make_ascii; /* Are we writing to the net? */ -#endif -}; - - -/* Write the buffer out to the socket -** ---------------------------------- -*/ - -PRIVATE void flush ARGS1(HTStream *, me) -{ - char *read_pointer = me->buffer; - char *write_pointer = me->write_pointer; - -#ifdef NOT_ASCII - if (me->make_ascii) { - char * p; - for(p = me->buffer; p < me->write_pointer; p++) - *p = TOASCII(*p); - } -#endif - while (read_pointer < write_pointer) { - int status; - status = NETWRITE(me->soc, me->buffer, /* Put timeout? @@@ */ - write_pointer - read_pointer); - if (status<0) { - CTRACE(tfp, "HTWrite: Error: write() on socket returns %d !!!\n", status); - return; - } - read_pointer = read_pointer + status; - } - me->write_pointer = me->buffer; -} - - -/*_________________________________________________________________________ -** -** A C T I O N R O U T I N E S -*/ - -/* Character handling -** ------------------ -*/ - -PRIVATE void HTWriter_put_character ARGS2(HTStream *, me, char, c) -{ - if (me->write_pointer == &me->buffer[BUFFER_SIZE]) flush(me); - *me->write_pointer++ = c; -} - - - -/* String handling -** --------------- -** -** Strings must be smaller than this buffer size. -*/ -PRIVATE void HTWriter_put_string ARGS2(HTStream *, me, CONST char*, s) -{ - int l = strlen(s); - if (me->write_pointer + l > &me->buffer[BUFFER_SIZE]) flush(me); - strcpy(me->write_pointer, s); - me->write_pointer = me->write_pointer + l; -} - - -/* Buffer write. Buffers can (and should!) be big. -** ------------ -*/ -PRIVATE void HTWriter_write ARGS3(HTStream *, me, CONST char*, s, int, l) -{ - - CONST char *read_pointer = s; - CONST char *write_pointer = s+l; - - flush(me); /* First get rid of our buffer */ - - while (read_pointer < write_pointer) { - int status = NETWRITE(me->soc, (char *)read_pointer, - write_pointer - read_pointer); - if (status<0) { - CTRACE(tfp, "HTWriter_write: Error on socket output stream!!!\n"); - return; - } - read_pointer = read_pointer + status; - } -} - - - - -/* Free an HTML object -** ------------------- -** -** Note that the SGML parsing context is freed, but the created object is not, -** as it takes on an existence of its own unless explicitly freed. -*/ -PRIVATE void HTWriter_free ARGS1(HTStream *, me) -{ - flush(me); - NETCLOSE(me->soc); - FREE(me); -} - -PRIVATE void HTWriter_abort ARGS2(HTStream *, me, HTError, e GCC_UNUSED) -{ - HTWriter_free(me); -} - - -/* Structured Object Class -** ----------------------- -*/ -PRIVATE CONST HTStreamClass HTWriter = /* As opposed to print etc */ -{ - "SocketWriter", - HTWriter_free, - HTWriter_abort, - HTWriter_put_character, HTWriter_put_string, - HTWriter_write -}; - - -/* Subclass-specific Methods -** ------------------------- -*/ - -PUBLIC HTStream* HTWriter_new ARGS1(int, soc) -{ - HTStream* me = (HTStream*)malloc(sizeof(*me)); - if (me == NULL) outofmem(__FILE__, "HTML_new"); - me->isa = &HTWriter; - -#ifdef NOT_ASCII - me->make_ascii = NO; -#endif - me->soc = soc; - me->write_pointer = me->buffer; - return me; -} - -/* Subclass-specific Methods -** ------------------------- -*/ - -PUBLIC HTStream* HTASCIIWriter ARGS1(int, soc) -{ - HTStream* me = (HTStream*)malloc(sizeof(*me)); - if (me == NULL) outofmem(__FILE__, "HTML_new"); - me->isa = &HTWriter; - -#ifdef NOT_ASCII - me->make_ascii = YES; -#endif - me->soc = soc; - me->write_pointer = me->buffer; - return me; -} - diff --git a/WWW/Library/Implementation/HTWriter.h b/WWW/Library/Implementation/HTWriter.h deleted file mode 100644 index c5306351..00000000 --- a/WWW/Library/Implementation/HTWriter.h +++ /dev/null @@ -1,28 +0,0 @@ -/* */ - -/* Unix File or Socket Writer HTWriter.c -** -------------------------- -** -** This version of the stream object just writes to a socket. -** The socket is assumed open and closed afterward. -** -** There are two versions (identical on ASCII machines) -** one of which converts to ASCII on output. -** -** Bugs: -** strings written must be less than buffer size. -*/ - -#ifndef HTWRITE_H -#define HTWRITE_H - -#include <HTStream.h> - -extern HTStream * HTWriter_new PARAMS((int soc)); - -extern HTStream * HTASCIIWriter PARAMS((int soc)); - -#endif -/* - - */ diff --git a/WWW/Library/Implementation/LYexit.h b/WWW/Library/Implementation/LYexit.h index b8e7cd0c..4723344b 100644 --- a/WWW/Library/Implementation/LYexit.h +++ b/WWW/Library/Implementation/LYexit.h @@ -30,12 +30,8 @@ #define exit LYexit -#ifdef LY_FIND_LEAKS #define atexit LYatexit #define ATEXITSIZE 40 -#else -#define atexit(func) /*nothing*/ -#endif /* * Data structures diff --git a/WWW/Library/Implementation/SGML.c b/WWW/Library/Implementation/SGML.c index 91e0a0be..12003736 100644 --- a/WWW/Library/Implementation/SGML.c +++ b/WWW/Library/Implementation/SGML.c @@ -28,12 +28,67 @@ #include <HTChunk.h> #include <LYCharSets.h> -#include <LYCharVals.h> /* S/390 -- gil -- 0635 */ +#include <LYCharVals.h> /* S/390 -- gil -- 0635 */ #include <LYStrings.h> #include <LYLeaks.h> +#ifdef USE_COLOR_STYLE +# include <LYStyle.h> +# include <LYPrettySrc.h> +#endif + #define INVALID (-1) +#ifdef USE_PSRC + +# define PSRC(x) if (psrc_view) { x }; +# define NPSRC(x) if (!psrc_view) { x }; +# define IFDEFPSRC(x) x +# define IFNDEFPSRC(x) + +char* entity_string; /* this is used for printing entity name. + Unconditionally added since redundant assigments don't hurt much*/ + +PRIVATE void fake_put_character ARGS2( + void*, p GCC_UNUSED, + char, c GCC_UNUSED) +{ +} + +#define START TRUE +#define STOP FALSE + +#else +# define PSRC(x) +# define NPSRC(x) +# define IFDEFPSRC(x) +# define IFNDEFPSRC(x) x +#endif + + /* will use an inlined version */ +#ifdef USE_INLINE_PUTC +#undef HTChunkPutc +#define HTChunkPutc(ch,c)\ + if (ch->size >= ch->allocated) {\ + ch->allocated = ch->allocated + ch->growby;\ + ch->data = ch->data ? (char *)realloc(ch->data, ch->allocated)\ + : (char *)calloc(1, ch->allocated);\ + if (!ch->data)\ + outofmem(__FILE__, "HTChunkPutc");\ + }\ + ch->data[ch->size++] = c; +#endif + +#define PUTS(str) ((*context->actions->put_string)(context->target, str)) + + +#define OPT 0 /* don't make it 1 otherwise something wrong will be with + TagSoup parser mode - I was unable to undestand why it works incorrectly -HV*/ +#define OPT1 1 /* set to 1 for several optimizations */ + +/*the following macros are used for pretty source view. */ +#define IS_C(attr) (attr.type == HTMLA_CLASS) + PUBLIC HTCJKlang HTCJK = NOCJK; /* CJK enum value. */ PUBLIC BOOL HTPassEightBitRaw = FALSE; /* Pass 161-172,174-255 raw. */ PUBLIC BOOL HTPassEightBitNum = FALSE; /* Pass ^ numeric entities raw. */ @@ -71,7 +126,7 @@ struct _HTStream { CONST HTStreamClass * isa; /* inherited from HTStream */ CONST SGML_dtd *dtd; - CONST HTStructuredClass *actions; /* target class */ + CONST HTStructuredClass *actions; /* target class */ HTStructured *target; /* target object */ HTTag *current_tag; @@ -86,7 +141,7 @@ struct _HTStream { S_exclamation, S_comment, S_doctype, S_marked, S_sgmlent, S_sgmlele, S_sgmlatt, S_squoted, S_dquoted, S_end, S_entity, - S_esc, S_dollar, S_paren, S_nonascii_text, + S_esc, S_dollar, S_paren, S_nonascii_text, S_dollar_paren, S_esc_sq, S_dollar_sq, S_paren_sq, S_nonascii_text_sq, S_dollar_paren_sq, @@ -128,6 +183,50 @@ struct _HTStream { int csi_index; } ; +#ifdef USE_PSRC +static BOOL seen_letter_in_junk_tag; + +PRIVATE void HTMLSRC_apply_markup ARGS3( + HTStream*, context, + HTlexem, lexem, + BOOL, start) +{ + HT_tagspec* ts = *( ( start ? lexem_start : lexem_end ) + lexem); + + while (ts) { +#ifdef USE_COLOR_STYLE + if (ts->start) { + current_tag_style = ts->style; + force_current_tag_style = TRUE; + forced_classname = ts->class_name; + force_classname = TRUE; + } +#endif + CTRACE(tfp,ts->start ? "SRCSTART %d\n" : "SRCSTOP %d\n",(int)lexem); + if (ts->start) + (*context->actions->start_element)( + context->target, + ts->element, + ts->present, + (CONST char **)ts->value, + context->current_tag_charset, + (char **)&context->include); + else + (*context->actions->end_element)( + context->target, + ts->element, + (char **)&context->include); + ts = ts->next; + } +} + +# define PSRCSTART(x) HTMLSRC_apply_markup(context,HTL_##x,START) +# define PSRCSTOP(x) HTMLSRC_apply_markup(context,HTL_##x,STOP) + +PRIVATE BOOL cur_attr_is_href; +PRIVATE BOOL cur_attr_is_name; +#endif + PRIVATE void set_chartrans_handling ARGS3( HTStream *, context, HTParentAnchor *, anchor, @@ -166,9 +265,9 @@ PRIVATE void set_chartrans_handling ARGS3( ** Get the chartrans info for output to the HTML parser. - FM */ context->outUCI = HTAnchor_getUCInfoStage(anchor, - UCT_STAGE_STRUCTURED); + UCT_STAGE_STRUCTURED); context->outUCLYhndl = HTAnchor_getUCLYhndl(context->node_anchor, - UCT_STAGE_STRUCTURED); + UCT_STAGE_STRUCTURED); } /* ** Set the in->out transformation parameters. - FM @@ -257,10 +356,20 @@ PRIVATE void handle_attribute_name ARGS2( attr * attributes = tag->attributes; int high, low, i, diff; +#ifdef USE_PSRC + if (psrc_view) { + cur_attr_is_href = FALSE; + cur_attr_is_name = FALSE; + } +#endif /* ** Ignore unknown tag. - KW */ if (tag == context->unknown_tag) { +#ifdef USE_PSRC + if (psrc_view) + context->current_attribute_number = 1; /* anything !=INVALID */ +#endif return; } @@ -274,12 +383,30 @@ PRIVATE void handle_attribute_name ARGS2( diff = strcasecomp(attributes[i].name, s); if (diff == 0) { /* success: found it */ context->current_attribute_number = i; +#ifdef USE_PSRC + if (!psrc_view) { +#endif context->present[i] = YES; FREE(context->value[i]); #ifdef USE_COLOR_STYLE - current_is_class=(!strcasecomp("class", s)); +# ifdef USE_PSRC +# if !OPT1 + current_is_class = (!strcasecomp("class", s)); +# else + current_is_class = IS_C(attributes[i]); +# endif +# else + current_is_class = (!strcasecomp("class", s)); +# endif CTRACE(tfp, "SGML: found attribute %s, %d\n", s, current_is_class); #endif + +#ifdef USE_PSRC + } else { + cur_attr_is_name = (attributes[i].type == HTMLA_ANAME); + cur_attr_is_href = (attributes[i].type == HTMLA_HREF); + } +#endif return; } /* if */ @@ -336,11 +463,17 @@ PRIVATE BOOL put_special_unicodes ARGS2( /* ** Use Lynx special character for nbsp. */ +#ifdef USE_PSRC + if (!psrc_view) +#endif PUTC(HT_NON_BREAK_SPACE); } else if (code == CH_SHY) { /* ** Use Lynx special character for shy. */ +#ifdef USE_PSRC + if (!psrc_view) +#endif PUTC(LY_SOFT_HYPHEN); } else if (code == 8194 || code == 8201) { /* @@ -355,13 +488,22 @@ PRIVATE BOOL put_special_unicodes ARGS2( ** with a single '32' for all (but do line wrapping more fancy). ** Assume emsp as two ensp (below). */ +#ifdef USE_PSRC + if (!psrc_view) +#endif PUTC(HT_EN_SPACE); } else if (code == 8195) { /* ** Use Lynx special character for emsp. */ +#ifdef USE_PSRC + if (!psrc_view) { +#endif /* PUTC(HT_EN_SPACE); let's stay with a single space :) */ PUTC(HT_EN_SPACE); +#ifdef USE_PSRC + } +#endif } else { /* ** Return NO if nothing done. @@ -411,6 +553,16 @@ PRIVATE void handle_entity ARGS2( ** Check for special Unicodes. - FM */ if (put_special_unicodes(context, code)) { +#ifdef USE_PSRC + if (psrc_view) { + HTMLSRC_apply_markup(context,HTL_entity,START); + PUTC('&'); + PUTS(entity_string); + if (term) + PUTC(term); + HTMLSRC_apply_markup(context,HTL_entity,STOP); + } +#endif FoundEntity = TRUE; return; } @@ -422,6 +574,13 @@ PRIVATE void handle_entity ARGS2( uck < 256 && (uck < 127 || uck >= LYlowest_eightbit[context->outUCLYhndl])) { +#ifdef USE_PSRC + if (psrc_view) { + HTMLSRC_apply_markup(context,HTL_entity,START); + PUTC('&'); PUTS(entity_string); if (term) PUTC(term); + HTMLSRC_apply_markup(context,HTL_entity,STOP); + } else +#endif PUTC(FROMASCII((char)uck)); FoundEntity = TRUE; return; @@ -433,6 +592,16 @@ PRIVATE void handle_entity ARGS2( */ (uck = UCTransUniCharStr(replace_buf, 60, code, context->outUCLYhndl, 0) >= 0)) { +#ifdef USE_PSRC + if (psrc_view) { + HTMLSRC_apply_markup(context,HTL_entity,START); + PUTC('&'); + PUTS(entity_string); + if (term) + PUTC(term); + HTMLSRC_apply_markup(context,HTL_entity,STOP); + } else +#endif for (p = replace_buf; *p; p++) PUTC(*p); FoundEntity = TRUE; @@ -441,14 +610,41 @@ PRIVATE void handle_entity ARGS2( /* ** If we're displaying UTF-8, try that now. - FM */ +#ifndef USE_PSRC if (context->T.output_utf8 && PUTUTF8(code)) { FoundEntity = TRUE; return; } +#else + if (context->T.output_utf8 && (psrc_view ? + (UCPutUtf8_charstring((HTStream *)context->target, + (putc_func_t*)(&fake_put_character), code)): PUTUTF8(code) ) ) { + + if (psrc_view) { + HTMLSRC_apply_markup(context,HTL_entity,START); + PUTC('&'); PUTS(entity_string); if (term) PUTC(term); + HTMLSRC_apply_markup(context,HTL_entity,STOP); + } + + FoundEntity = TRUE; + return; + } +#endif /* ** If it's safe ASCII, use it. - FM */ if (code >= 32 && code < 127) { +#ifdef USE_PSRC + if (psrc_view) { + HTMLSRC_apply_markup(context,HTL_entity,START); + PUTC('&'); + PUTS(entity_string); + if (term) + PUTC(term); + HTMLSRC_apply_markup(context,HTL_entity,STOP); + } else +#endif + PUTC(FROMASCII((char)code)); FoundEntity = TRUE; return; @@ -462,6 +658,16 @@ PRIVATE void handle_entity ARGS2( if (!strcmp(s, "zwnj") || !strcmp(s, "zwj")) { CTRACE(tfp, "handle_entity: Ignoring '%s'.\n", s); +#ifdef USE_PSRC + if (psrc_view) { + HTMLSRC_apply_markup(context,HTL_entity,START); + PUTC('&'); + PUTS(entity_string); + if (term) + PUTC(term); + HTMLSRC_apply_markup(context,HTL_entity,STOP); + } +#endif FoundEntity = TRUE; return; } @@ -471,6 +677,16 @@ PRIVATE void handle_entity ARGS2( if (!strcmp(s, "lrm") || !strcmp(s, "rlm")) { CTRACE(tfp, "handle_entity: Ignoring '%s'.\n", s); +#ifdef USE_PSRC + if (psrc_view) { + HTMLSRC_apply_markup(context,HTL_entity,START); + PUTC('&'); + PUTS(entity_string); + if (term) + PUTC(term); + HTMLSRC_apply_markup(context,HTL_entity,STOP); + } +#endif FoundEntity = TRUE; return; } @@ -479,6 +695,10 @@ PRIVATE void handle_entity ARGS2( /* ** If entity string not found, display as text. */ +#ifdef USE_PSRC + if (psrc_view) + PSRCSTART(badseq); +#endif CTRACE(tfp, "SGML: Unknown entity '%s' %ld %ld\n", s, (long)code, uck); /* S/390 -- gil -- 0695 */ PUTC('&'); for (p = s; *p; p++) { @@ -486,6 +706,10 @@ PRIVATE void handle_entity ARGS2( } if (term != '\0') PUTC(term); +#ifdef USE_PSRC + if (psrc_view) + PSRCSTOP(badseq); +#endif } @@ -795,6 +1019,10 @@ PRIVATE void start_element ARGS1( HTStream *, context) { HTTag * new_tag = context->current_tag; +#if OPT1 + HTMLElement e = new_tag - context->dtd->tags; + BOOL ok = FALSE; +#endif #ifdef EXTENDED_HTMLDTD @@ -892,6 +1120,7 @@ PRIVATE void start_element ARGS1( /* ** Ugh, it is not an OPTION. - FM */ +#if !OPT1 if (!strcasecomp(new_tag->name, "INPUT") || !strcasecomp(new_tag->name, "TEXTAREA") || !strcasecomp(new_tag->name, "SELECT") || @@ -900,6 +1129,18 @@ PRIVATE void start_element ARGS1( !strcasecomp(new_tag->name, "LABEL") || !strcasecomp(new_tag->name, "LEGEND") || !strcasecomp(new_tag->name, "FORM")) { +#else + switch (e) { + case HTML_INPUT: case HTML_TEXTAREA: case HTML_SELECT: + case HTML_BUTTON: case HTML_FIELDSET: case HTML_LABEL: + case HTML_LEGEND: case HTML_FORM: + ok = TRUE; + break; + default: + break; + } + if (ok) { +#endif /* ** It is another form-related start tag, so terminate ** the current SELECT block and fall through. - FM @@ -935,7 +1176,11 @@ PRIVATE void start_element ARGS1( N->next = context->element_stack; N->tag = new_tag; context->element_stack = N; +#if !OPT } else if (!strcasecomp(new_tag->name, "META")) { +#else + } else if (e == HTML_META ) { +#endif /* ** Check for result of META tag. - KW & FM */ @@ -961,9 +1206,10 @@ PUBLIC HTTag * SGMLFindTag ARGS2( CONST char *, string) { int high, low, i, diff; + for (low = 0, high=dtd->number_of_tags; high > low; - diff < 0 ? (low = i+1) : (high = i)) { /* Binary search */ + diff < 0 ? (low = i+1) : (high = i)) { /* Binary search */ i = (low + (high-low)/2); diff = strcasecomp(dtd->tags[i].name, string); /* Case insensitive */ if (diff == 0) { /* success: found it */ @@ -1027,6 +1273,10 @@ PRIVATE void SGML_free ARGS1( for (i = 0; i < MAX_ATTRIBUTES; i++) FREE(context->value[i]); FREE(context); + +#ifdef USE_PSRC + sgml_in_psrc_was_initialized =FALSE; +#endif } PRIVATE void SGML_abort ARGS2( @@ -1065,6 +1315,11 @@ PRIVATE void SGML_abort ARGS2( for (i = 0; i < MAX_ATTRIBUTES; i++) FREE(context->value[i]); FREE(context); + +#ifdef USE_PSRC + sgml_in_psrc_was_initialized =FALSE; +#endif + } @@ -1191,7 +1446,7 @@ PRIVATE void SGML_character ARGS2( *(context->utf_buf_p) = '\0'; /* goto top; */ } - } /* end of context->T.decode_utf8 S/390 -- gil -- 0726 */ + } /* end of context->T.decode_utf8 S/390 -- gil -- 0726 */ #ifdef NOTDEFINED /* @@ -1265,7 +1520,7 @@ PRIVATE void SGML_character ARGS2( } goto top0a; } /* Next line end of ugly stuff for C0. - KW */ - } else { /* end of context->T.trans_to_uni S/390 -- gil -- 0791 */ + } else { /* end of context->T.trans_to_uni S/390 -- gil -- 0791 */ goto top0a; } @@ -1277,7 +1532,7 @@ PRIVATE void SGML_character ARGS2( /* ** We jump up to here from below if we have ** stuff in the recover, insert, or csi buffers -** to process. We zero saved_char_in, in effect +** to process. We zero saved_char_in, in effect ** as a flag that the octet in not that of the ** actual call to this function. This may be OK ** for now, for the stuff this function adds to @@ -1314,7 +1569,7 @@ top1: */ /* ** Works for both ASCII and EBCDIC. -- gil - */ /* S/390 -- gil -- 0811 */ + */ /* S/390 -- gil -- 0811 */ if (TOASCII(unsign_c) < 32 && c != '\t' && c != '\n' && c != '\r' && HTCJK == NOCJK) @@ -1347,7 +1602,7 @@ top1: /* ** Note that if we don't have a CJK input, then this ** is not the second byte of a CJK di-byte, and we're - ** trashing the input. That's why 8-bit characters + ** trashing the input. That's why 8-bit characters ** followed by, for example, '<' can cause the tag to ** be treated as text, not markup. We could try to deal ** with it by holding each first byte and then checking @@ -1382,7 +1637,7 @@ top1: PUTC(c); break; } - if (c == '&' && TOASCII(unsign_c) < 127 && /* S/390 -- gil -- 0898 */ + if (c == '&' && TOASCII(unsign_c) < 127 && /* S/390 -- gil -- 0898 */ (!context->element_stack || (context->element_stack->tag && (context->element_stack->tag->contents == SGML_MIXED || @@ -1432,7 +1687,7 @@ top1: PUTC(saved_char_in); saved_char_in = '\0'; /****************************************************************** - * I. LATIN-1 OR UCS2 TO DISPLAY CHARSET + * I. LATIN-1 OR UCS2 TO DISPLAY CHARSET ******************************************************************/ } else if ((chk = (context->T.trans_from_uni && TOASCII(unsign_c) >= 160)) && /* S/390 -- gil -- 0968 */ (uck = UCTransUniChar(unsign_c, @@ -1484,13 +1739,28 @@ top1: !(PASSHI8BIT || HTCJK != NOCJK) && !IncludesLatin1Enc) { int i; +#ifdef USE_PSRC + int psrc_view_backup = 0; +#endif string->size = 0; EntityName = HTMLGetEntityName((int)(unsign_c - 160)); for (i = 0; EntityName[i]; i++) HTChunkPutc(string, EntityName[i]); HTChunkTerminate(string); +#ifdef USE_PSRC + /* we need to disable it temporary*/ + if (psrc_view) { + psrc_view_backup =1; psrc_view =0; + } +#endif handle_entity(context, '\0'); +#ifdef USE_PSRC + /* we need to disable it temporary*/ + if (psrc_view_backup) + psrc_view = TRUE; +#endif + string->size = 0; if (!FoundEntity) PUTC(';'); @@ -1530,7 +1800,7 @@ top1: ** If we don't actually want the character, ** make it safe and output that now. - FM */ - } else if (TOASCII((unsigned char)c) < /* S/390 -- gil -- 0997 */ + } else if (TOASCII((unsigned char)c) < /* S/390 -- gil -- 0997 */ LYlowest_eightbit[context->outUCLYhndl] || (context->T.trans_from_uni && !HTPassEightBitRaw)) { #ifdef NOTUSED_FOTEMODS @@ -1586,7 +1856,7 @@ top1: ** In litteral mode, waits only for specific end tag (for ** compatibility with old servers, and for Lynx). - FM */ - case S_litteral: + case S_litteral: /*PSRC:this case not understood completely by HV, not done*/ HTChunkPutc(string, c); if (TOUPPER(c) != ((string->size == 1) ? '/' : @@ -1633,7 +1903,7 @@ top1: ** Handle possible named entity. */ case S_entity: - if (TOASCII(unsign_c) < 127 && (string->size ? /* S/390 -- gil -- 1029 */ + if (TOASCII(unsign_c) < 127 && (string->size ? /* S/390 -- gil -- 1029 */ isalnum((unsigned char)c) : isalpha((unsigned char)c))) { /* ** Accept valid ASCII character. - FM @@ -1644,7 +1914,15 @@ top1: ** It was an ampersand that's just text, so output ** the ampersand and recycle this character. - FM */ +#ifdef USE_PSRC + if (psrc_view) + PSRCSTART(badseq); +#endif PUTC('&'); +#ifdef USE_PSRC + if (psrc_view) + PSRCSTOP(badseq); +#endif context->state = S_text; goto top1; } else { @@ -1652,6 +1930,9 @@ top1: ** Terminate entity name and try to handle it. - FM */ HTChunkTerminate(string); +#ifdef USE_PSRC + entity_string = string->data; +#endif /* S/390 -- gil -- 1039 */ /* CTRACE(tfp, "%s: %d: %s\n", __FILE__, __LINE__, string->data); */ if (!strcmp(string->data, "zwnj") && @@ -1714,8 +1995,16 @@ top1: ** No 'x' or digit following the "&#" so recover ** them and recycle the character. - FM */ +#ifdef USE_PSRC + if (psrc_view) + PSRCSTART(badseq); +#endif PUTC('&'); PUTC('#'); +#ifdef USE_PSRC + if (psrc_view) + PSRCSTOP(badseq); +#endif context->state = S_text; goto top1; } @@ -1739,9 +2028,17 @@ top1: ** No hex digit following the "&#x" so recover ** them and recycle the character. - FM */ +#ifdef USE_PSRC + if (psrc_view) + PSRCSTART(badseq); +#endif PUTC('&'); PUTC('#'); PUTC('x'); +#ifdef USE_PSRC + if (psrc_view) + PSRCSTOP(badseq); +#endif context->isHex = FALSE; context->state = S_text; goto top1; @@ -1752,6 +2049,9 @@ top1: UCode_t code; int i; HTChunkTerminate(string); +#ifdef USE_PSRC + entity_string = string->data; +#endif if ((context->isHex ? sscanf(string->data, "%lx", &code) : sscanf(string->data, "%ld", &code)) == 1) { /* =============== work in ASCII below here =============== S/390 -- gil -- 1092 */ @@ -1932,6 +2232,16 @@ top1: ** We handled the value as a special character, ** so recycle the terminator or break. - FM */ +#ifdef USE_PSRC + if (psrc_view) { + PSRCSTART(entity); + PUTS( (context->isHex ? "&#x" : "&#") ); + PUTS(entity_string); + if (c == ';') + PUTC(';'); + PSRCSTOP(entity); + } +#endif string->size = 0; context->isHex = FALSE; context->state = S_text; @@ -1947,7 +2257,19 @@ top1: uck < 256 && (uck < 127 || uck >= LYlowest_eightbit[context->outUCLYhndl])) { +#ifdef USE_PSRC + if (!psrc_view) { +#endif PUTC(FROMASCII((char)uck)); +#ifdef USE_PSRC + } else { + PSRCSTART(entity); + PUTS( (context->isHex ? "&#x" : "&#") ); + PUTS(entity_string); + PUTC(';'); + PSRCSTOP(entity); + } +#endif } else if ((uck == -4 || (context->T.repl_translated_C0 && uck > 0 && uck < 32)) && @@ -1957,6 +2279,15 @@ top1: (uck = UCTransUniCharStr(replace_buf, 60, code, context->outUCLYhndl, 0) >= 0)) { +#ifdef USE_PSRC + if (psrc_view) { + PSRCSTART(entity); + PUTS( (context->isHex ? "&#x" : "&#") ); + PUTS(entity_string); + PUTC(';'); + PSRCSTOP(entity); + } else +#endif for (p = replace_buf; *p; p++) { PUTC(*p); } @@ -1981,6 +2312,15 @@ top1: /* ** Got an ASCII character (yippey). - FM */ +#ifdef USE_PSRC + if (psrc_view) { + PSRCSTART(entity); + PUTS( (context->isHex ? "&#x" : "&#") ); + PUTS(entity_string); + PUTC(';'); + PSRCSTOP(entity); + } else +#endif PUTC(((char)FROMASCII(uck & 0xff))); /* =============== work in ASCII above here =============== S/390 -- gil -- 1118 */ } else if ((chk && uck == -4) && @@ -1991,6 +2331,15 @@ top1: /* ** Got a replacement string (yippey). - FM */ +#ifdef USE_PSRC + if (psrc_view) { + PSRCSTART(entity); + PUTS( (context->isHex ? "&#x" : "&#") ); + PUTS(entity_string); + PUTC(';'); + PSRCSTOP(entity); + } else +#endif for (p = replace_buf; *p; p++) PUTC(*p); #endif /* NOTUSED_FOTEMODS */ @@ -2011,6 +2360,16 @@ top1: (context->isHex ? "&#x" : "&#"), replace_buf); } +#ifdef USE_PSRC + if (psrc_view) { + PSRCSTART(badseq); + PUTS( (context->isHex ? "&#x" : "&#") ); + PUTS(entity_string); + if (c == ';') + PUTC(';'); + PSRCSTOP(badseq); + } +#endif string->size = 0; context->isHex = FALSE; context->state = S_text; @@ -2039,10 +2398,15 @@ top1: (TOASCII(code) > 127 && code < 160 && !HTPassHighCtrlNum)) { /* - ** Unhandled or illegal value. Recover the + ** Unhandled or illegal value. Recover the ** "&#" or "&#x" and digit(s), and recycle ** the terminator. - FM */ +#ifdef USE_PSRC + if (psrc_view) { + PSRCSTART(badseq); + } +#endif PUTC('&'); PUTC('#'); if (context->isHex) { @@ -2052,6 +2416,11 @@ top1: string->size--; for (i = 0; i < string->size; i++) /* recover */ PUTC(string->data[i]); +#ifdef USE_PSRC + if (psrc_view) { + PSRCSTOP(badseq); + } +#endif string->size = 0; context->isHex = FALSE; context->state = S_text; @@ -2062,6 +2431,15 @@ top1: /* ** No conversion needed. - FM */ +#ifdef USE_PSRC + if (psrc_view) { + PSRCSTART(entity); + PUTS( (context->isHex ? "&#x" : "&#") ); + PUTS(entity_string); + PUTC(';'); + PSRCSTOP(entity); + } else +#endif PUTC(FROMASCII((char)code)); } else { /* @@ -2087,6 +2465,10 @@ top1: ** Our conversion failed, so recover the "&#" ** and digit(s), and recycle the terminator. - FM */ +#ifdef USE_PSRC + if (psrc_view) + PSRCSTART(badseq); +#endif PUTC('&'); PUTC('#'); if (context->isHex) { @@ -2096,6 +2478,10 @@ top1: string->size--; for (i = 0; i < string->size; i++) /* recover */ PUTC(string->data[i]); +#ifdef USE_PSRC + if (psrc_view) + PSRCSTOP(badseq); +#endif string->size = 0; context->isHex = FALSE; context->state = S_text; @@ -2125,8 +2511,16 @@ top1: string->size--; HTChunkPutc(string, c); HTChunkTerminate(string); +#ifdef USE_PSRC + if (psrc_view) + PSRCSTART(badseq); +#endif PUTC('&'); PUTC('#'); +#ifdef USE_PSRC + if (psrc_view) + PSRCSTOP(badseq); +#endif if (context->isHex) { PUTC('x'); context->isHex = FALSE; @@ -2149,7 +2543,7 @@ top1: ** Tag */ case S_tag: /* new tag */ - if (TOASCII(unsign_c) < 127 && (string->size ? /* S/390 -- gil -- 1179 */ + if (TOASCII(unsign_c) < 127 && (string->size ? /* S/390 -- gil -- 1179 */ isalnum((unsigned char)c) : isalpha((unsigned char)c))) { /* ** Add valid ASCII character. - FM @@ -2167,7 +2561,7 @@ top1: HTChunkPutc(string, c); break; } else if (!string->size && - (TOASCII(unsign_c) <= 160 && /* S/390 -- gil -- 1196 */ + (TOASCII(unsign_c) <= 160 && /* S/390 -- gil -- 1196 */ (c != '/' && c != '?' && c != '_' && c != ':'))) { /* ** '<' must be followed by an ASCII letter to be a valid @@ -2178,7 +2572,15 @@ top1: ** So recover the '<' and following character as data. - FM & KW */ context->state = S_text; +#ifdef USE_PSRC + if (psrc_view) + PSRCSTART(badseq); +#endif PUTC('<'); +#ifdef USE_PSRC + if (psrc_view) + PSRCSTOP(badseq); +#endif goto top1; } else { /* End of tag name */ /* @@ -2201,10 +2603,18 @@ top1: ** so we display it and the URL (Lynxism 8-). - FM */ int i; +#ifdef USE_PSRC + if (psrc_view) + PSRCSTART(badseq); +#endif PUTC('<'); for (i = 0; i < 3; i++) /* recover */ PUTC(string->data[i]); PUTC(c); +#ifdef USE_PSRC + if (psrc_view) + PSRCSTOP(badseq); +#endif CTRACE(tfp, "SGML: Treating <%s%c as text\n", string->data, c); string->size = 0; @@ -2213,6 +2623,25 @@ top1: } else if (!t) { CTRACE(tfp, "SGML: *** Invalid element %s\n", string->data); + +#ifdef USE_PSRC + if (psrc_view) { + PSRCSTART(abracket);PUTC('<');PSRCSTOP(abracket); + PSRCSTART(badtag); + if (tagname_transform != 1) { + if (tagname_transform == 0) + LYLowerCase(string->data); + else + LYUpperCase(string->data); + } + PUTS(string->data); + + if (c == '>' ) { + PSRCSTOP(badtag); + PSRCSTART(abracket);PUTC('>');PSRCSTOP(abracket); + } + } +#endif context->state = (c == '>') ? S_text : S_junk_tag; break; } else if (t == context->unknown_tag) { @@ -2222,20 +2651,59 @@ top1: ** Fall through and treat like valid ** tag for attribute parsing. - KW */ + } context->current_tag = t; /* ** Clear out attributes. */ +#ifdef USE_PSRC + if (psrc_view) { + PSRCSTART(abracket);PUTC('<');PSRCSTOP(abracket); + if (t != context->unknown_tag) + PSRCSTART(tag); + else + PSRCSTART(badtag); + if (tagname_transform != 1) { + if (tagname_transform == 0) + LYLowerCase(string->data); + else + LYUpperCase(string->data); + } + PUTS(string->data); + } + if (!psrc_view) /*don't waste time */ +#endif { +#if !OPT1 int i; for (i = 0; i < context->current_tag->number_of_attributes; i++) context->present[i] = NO; +#else + memset( (void*)context->present, 0 , sizeof(BOOL)* + context->current_tag->number_of_attributes); +#endif } + string->size = 0; context->current_attribute_number = INVALID; - +#ifdef USE_PSRC + if (psrc_view) { + if (c == '>') { + if (t != context->unknown_tag) + PSRCSTOP(tag); + else + PSRCSTOP(badtag); + PSRCSTART(abracket); + PUTC('>'); + PSRCSTOP(abracket); + context->state = S_text; + } else { + context->state = S_tag_gap; + } + } else +#endif if (c == '>') { if (context->current_tag->name) start_element(context); @@ -2285,6 +2753,15 @@ top1: ** Try to handle identifier. - FM */ HTChunkTerminate(string); +#ifdef USE_PSRC + if (psrc_view) { + PSRCSTART(sgmlspecial); + PUTC('<'); + PUTS(string->data); + PUTC('>'); + PSRCSTOP(sgmlspecial); + } else +#endif handle_identifier(context); string->size = 0; context->state = S_text; @@ -2345,6 +2822,15 @@ top1: */ if (c == '>') { HTChunkTerminate(string); +#ifdef USE_PSRC + if (psrc_view) { + PSRCSTART(comm); + PUTC('<'); + PUTS(string->data); + PUTC('>'); + PSRCSTOP(comm); + } else +#endif handle_comment(context); string->size = 0; context->end_comment = FALSE; @@ -2378,6 +2864,15 @@ top1: ** Terminate and handle the comment. - FM */ HTChunkTerminate(string); +#ifdef USE_PSRC + if (psrc_view) { + PSRCSTART(comm); + PUTC('<'); + PUTS(string->data); + PUTC('>'); + PSRCSTOP(comm); + } else +#endif handle_comment(context); string->size = 0; context->end_comment = FALSE; @@ -2405,6 +2900,15 @@ top1: } if (c == '>') { HTChunkTerminate(string); +#ifdef USE_PSRC + if (psrc_view) { + PSRCSTART(sgmlspecial); + PUTC('<'); + PUTS(string->data); + PUTC('>'); + PSRCSTOP(sgmlspecial); + } else +#endif handle_doctype(context); string->size = 0; context->state = S_text; @@ -2428,6 +2932,15 @@ top1: } if (!context->second_bracket && c == '>') { HTChunkTerminate(string); +#ifdef USE_PSRC + if (psrc_view) { + PSRCSTART(sgmlspecial); + PUTC('<'); + PUTS(string->data); + PUTC('>'); + PSRCSTOP(sgmlspecial); + } else +#endif handle_marked(context); string->size = 0; context->state = S_text; @@ -2453,6 +2966,15 @@ top1: } if (context->end_comment && c == '>') { HTChunkTerminate(string); +#ifdef USE_PSRC + if (psrc_view) { + PSRCSTART(sgmlspecial); + PUTC('<'); + PUTS(string->data); + PUTC('>'); + PSRCSTOP(sgmlspecial); + } else +#endif handle_sgmlent(context); string->size = 0; context->end_comment = FALSE; @@ -2481,6 +3003,15 @@ top1: } if (context->end_comment && c == '>') { HTChunkTerminate(string); +#ifdef USE_PSRC + if (psrc_view) { + PSRCSTART(sgmlspecial); + PUTC('<'); + PUTS(string->data); + PUTC('>'); + PSRCSTOP(sgmlspecial); + } else +#endif handle_sgmlele(context); string->size = 0; context->end_comment = FALSE; @@ -2509,6 +3040,15 @@ top1: } if (context->end_comment && c == '>') { HTChunkTerminate(string); +#ifdef USE_PSRC + if (psrc_view) { + PSRCSTART(sgmlspecial); + PUTC('<'); + PUTS(string->data); + PUTC('>'); + PSRCSTOP(sgmlspecial); + } else +#endif handle_sgmlatt(context); string->size = 0; context->end_comment = FALSE; @@ -2524,8 +3064,22 @@ top1: if (WHITE(c)) break; /* Gap between attributes */ if (c == '>') { /* End of tag */ +#ifdef USE_PSRC + if (!psrc_view) +#endif if (context->current_tag->name) start_element(context); +#ifdef USE_PSRC + if (psrc_view) { + if (context->current_tag != context->unknown_tag) + PSRCSTOP(tag); + else + PSRCSTOP(badtag); + PSRCSTART(abracket); + PUTC('>'); + PSRCSTOP(abracket); + } +#endif context->state = S_text; break; } @@ -2538,6 +3092,9 @@ top1: if (WHITE(c) || (c == '>') || (c == '=')) { /* End of word */ HTChunkTerminate(string); handle_attribute_name(context, string->data); +#ifdef USE_PSRC + if (!psrc_view) { +#endif string->size = 0; if (c == '>') { /* End of tag */ if (context->current_tag->name) @@ -2545,6 +3102,41 @@ top1: context->state = S_text; break; } +#ifdef USE_PSRC + } else { + PUTC(' '); + if (context->current_attribute_number == INVALID) + PSRCSTART(badattr); + else + PSRCSTART(attrib); + if (attrname_transform != 1) { + if (attrname_transform == 0) + LYLowerCase(string->data); + else + LYUpperCase(string->data); + } + PUTS(string->data); + if (c == '=' || c == '>') { + if (c == '=' ) PUTC('='); + if (context->current_attribute_number == INVALID) + PSRCSTOP(badattr); + else + PSRCSTOP(attrib); + } + if (c == '>') { + if (context->current_tag != context->unknown_tag) + PSRCSTOP(tag); + else + PSRCSTOP(badtag); + PSRCSTART(abracket); + PUTC('>'); + PSRCSTOP(abracket); + context->state = S_text; + break; + } + string->size = 0; + } +#endif context->state = (c == '=' ? S_equals: S_attr_gap); } else { HTChunkPutc(string, c); @@ -2555,11 +3147,35 @@ top1: if (WHITE(c)) break; /* Gap after attribute */ if (c == '>') { /* End of tag */ +#ifdef USE_PSRC + if (psrc_view) { + if (context->current_attribute_number == INVALID) + PSRCSTOP(badattr); + else + PSRCSTOP(attrib); + if (context->current_tag != context->unknown_tag) + PSRCSTOP(tag); + else + PSRCSTOP(badtag); + PSRCSTART(abracket); + PUTC('>'); + PSRCSTOP(abracket); + } else +#endif if (context->current_tag->name) start_element(context); context->state = S_text; break; } else if (c == '=') { +#ifdef USE_PSRC + if (psrc_view) { + PUTC('='); + if (context->current_attribute_number == INVALID) + PSRCSTOP(badattr); + else + PSRCSTOP(attrib); + } +#endif context->state = S_equals; break; } @@ -2572,28 +3188,90 @@ top1: break; /* Before attribute value */ if (c == '>') { /* End of tag */ CTRACE(tfp, "SGML: found = but no value\n"); +#ifdef USE_PSRC + if (psrc_view) { + if (context->current_tag != context->unknown_tag) + PSRCSTOP(tag); + else + PSRCSTOP(badtag); + PSRCSTART(abracket); + PUTC('>'); + PSRCSTOP(abracket); + } else +#endif if (context->current_tag->name) start_element(context); context->state = S_text; break; } else if (c == '\'') { +#ifdef USE_PSRC + if (psrc_view) { + PSRCSTART(attrval); + PUTC(c); + } +#endif context->state = S_squoted; break; } else if (c == '"') { +#ifdef USE_PSRC + if (psrc_view) { + PSRCSTART(attrval); + PUTC(c); + } +#endif context->state = S_dquoted; break; } +#ifdef USE_PSRC + if (psrc_view) + PSRCSTART(attrval); +#endif context->state = S_value; - /* no break! fall through to S_value and proccess current `c` */ + /* no break! fall through to S_value and proccess current `c` */ case S_value: if (WHITE(c) || (c == '>')) { /* End of word */ HTChunkTerminate(string) ; +#ifdef USE_PSRC + if (psrc_view) { + /*PSRCSTART(attrval);*/ + if (cur_attr_is_name) { + HTStartAnchor(context->target, string->data, NULL); + (*context->actions->end_element)( + context->target, + HTML_A, + (char **)&context->include); + } else if (cur_attr_is_href) { + PSRCSTART(href); + HTStartAnchor(context->target,NULL,string->data); + } + PUTS(string->data); + if (cur_attr_is_href) { + (*context->actions->end_element)( + context->target, + HTML_A, + (char **)&context->include); + PSRCSTOP(href); + } + PSRCSTOP(attrval); + } else +#endif handle_attribute_value(context, string->data); string->size = 0; if (c == '>') { /* End of tag */ +#ifdef USE_PSRC + if (psrc_view) { + if (context->current_tag != context->unknown_tag) + PSRCSTOP(tag); + else + PSRCSTOP(badtag); + PSRCSTART(abracket); + PUTC('>'); + PSRCSTOP(abracket); + } else +#endif if (context->current_tag->name) start_element(context); context->state = S_text; @@ -2627,6 +3305,31 @@ top1: case S_squoted: /* Quoted attribute value */ if (c == '\'') { /* End of attribute value */ HTChunkTerminate(string) ; +#ifdef USE_PSRC + if (psrc_view) { + /*PSRCSTART(attrval);*/ + if (cur_attr_is_name) { + HTStartAnchor(context->target,string->data,NULL); + (*context->actions->end_element)( + context->target, + HTML_A, + (char **)&context->include); + } else if (cur_attr_is_href) { + PSRCSTART(href); + HTStartAnchor(context->target,NULL,string->data); + } + PUTS(string->data); + if (cur_attr_is_href) { + (*context->actions->end_element)( + context->target, + HTML_A, + (char **)&context->include); + PSRCSTOP(href); + } + PUTC('\''); + PSRCSTOP(attrval); + } else +#endif handle_attribute_value(context, string->data); string->size = 0; context->state = S_tag_gap; @@ -2666,6 +3369,32 @@ top1: (soft_dquotes && /* If emulating old Netscape bug, treat '>' */ c == '>')) { /* as a co-terminator of dquoted and tag */ HTChunkTerminate(string) ; +#ifdef USE_PSRC + if (psrc_view) { + /*PSRCSTART(attrval);*/ + if (cur_attr_is_name) { + HTStartAnchor(context->target,string->data,NULL); + (*context->actions->end_element)( + context->target, + HTML_A, + (char **)&context->include); + } else if (cur_attr_is_href) { + PSRCSTART(href); + HTStartAnchor(context->target,NULL,string->data); + } + PUTS(string->data); + if (cur_attr_is_href) { + (*context->actions->end_element)( + context->target, + HTML_A, + (char **)&context->include); + PSRCSTOP(href); + } + PUTC(c); + PSRCSTOP(attrval); + } else +#endif + handle_attribute_value(context, string->data); string->size = 0; context->state = S_tag_gap; @@ -2707,6 +3436,9 @@ top1: HTChunkPutc(string, c); } else { /* End of end tag name */ HTTag * t = 0; +#ifdef USE_PSRC + BOOL psrc_tagname_processed = FALSE; +#endif HTChunkTerminate(string); if (!*string->data) { /* Empty end tag */ @@ -2717,9 +3449,54 @@ top1: } if (!t || t == context->unknown_tag) { CTRACE(tfp, "Unknown end tag </%s>\n", string->data); +#ifdef USE_PSRC + if (psrc_view) { + PSRCSTART(abracket); + PUTC('<'); + PUTC('/'); + PSRCSTOP(abracket); + PSRCSTART(badtag); + if (tagname_transform != 1) { + if (tagname_transform == 0) + LYLowerCase(string->data); + else + LYUpperCase(string->data); + } + PUTS(string->data); PSRCSTOP(badtag); + PSRCSTART(abracket); PUTC('>'); PSRCSTOP(abracket); + psrc_tagname_processed=TRUE; + } + } else if (psrc_view) { +#endif } else { BOOL tag_OK = (c == '>' || WHITE(c)); +#if OPT + HTMLElement e = context->current_tag - context->dtd->tags; + int branch = 2; /* it can be 0,1,2*/ +#endif context->current_tag = t; +#if OPT +#ifdef EXTENDED_HTMLDTD + if (tag_OK && Old_DTD) { +#else + if (tag_OK) { +#endif + switch (e) { + case HTML_DD: case HTML_DT: case HTML_LI: case HTML_LH : + case HTML_TD: case HTML_TH: case HTML_TR: case HTML_THEAD: + case HTML_TFOOT : case HTML_TBODY : case HTML_COLGROUP: + branch = 0; + break; + + case HTML_A: case HTML_B: case HTML_BLINK: case HTML_CITE: + case HTML_EM: case HTML_FONT: case HTML_FORM: case HTML_I: + case HTML_P: case HTML_STRONG: case HTML_TT: case HTML_U: + branch = 1; + break; + } + } +#endif + #ifdef EXTENDED_HTMLDTD /* ** Just handle ALL end tags normally :-) - kw @@ -2728,6 +3505,9 @@ top1: end_element( context, context->current_tag); } else #endif /* EXTENDED_HTMLDTD */ + + +#if !OPT if (tag_OK && (!strcasecomp(string->data, "DD") || !strcasecomp(string->data, "DT") || @@ -2740,11 +3520,14 @@ top1: !strcasecomp(string->data, "TFOOT") || !strcasecomp(string->data, "TBODY") || !strcasecomp(string->data, "COLGROUP"))) { +#else + if (tag_OK && branch == 0) { +#endif /* ** Don't treat these end tags as invalid, ** nor act on them. - FM */ - CTRACE(tfp, "SGML: `</%s%c' found! ***Ignoring it.\n", + CTRACE(tfp, "SGML: `</%s%c' found! ***Ignoring it.\n", string->data, c); string->size = 0; context->current_attribute_number = INVALID; @@ -2754,6 +3537,7 @@ top1: context->state = S_text; } break; +#if !OPT } else if (tag_OK && (!strcasecomp(string->data, "A") || !strcasecomp(string->data, "B") || @@ -2767,6 +3551,9 @@ top1: !strcasecomp(string->data, "STRONG") || !strcasecomp(string->data, "TT") || !strcasecomp(string->data, "U"))) { +#else + } else if (tag_OK && branch == 1) { +#endif /* ** Handle end tags for container elements declared ** as SGML_EMPTY to prevent "expected tag substitution" @@ -2841,6 +3628,30 @@ top1: } } +#ifdef USE_PSRC + if (psrc_view && !psrc_tagname_processed) { + PSRCSTART(abracket); + PUTC('<'); + PUTC('/'); + PSRCSTOP(abracket); + PSRCSTART(tag); + if (tagname_transform != 1) { + if (tagname_transform == 0) + LYLowerCase(string->data); + else + LYUpperCase(string->data); + } + PUTS(string->data); PSRCSTOP(tag); + if ( c != '>' ) + PSRCSTART(badtag); + else { + PSRCSTART(abracket); + PUTC('>'); + PSRCSTOP(abracket); + } + } +#endif + string->size = 0; context->current_attribute_number = INVALID; if (c != '>') { @@ -2997,8 +3808,30 @@ top1: case S_junk_tag: if (c == '>') { +#ifdef USE_PSRC + if (psrc_view) { + PSRCSTOP(badtag); + PSRCSTART(abracket); + PUTC('>'); + PSRCSTOP(abracket); + seen_letter_in_junk_tag = FALSE; + } +#endif context->state = S_text; } +#ifdef USE_PSRC + else if (psrc_view) { + /*pack spaces until first non-space is seen*/ + if (!seen_letter_in_junk_tag) { + if (!WHITE(c)) { + seen_letter_in_junk_tag = TRUE; + PUTC(c); + }; + } else + PUTC(c); + }; +#endif + } /* switch on context->state */ /* @@ -3155,6 +3988,17 @@ PUBLIC HTStream* SGML_new ARGS3( context->csi = NULL; context->csi_index = 0; +#ifdef USE_PSRC + if (psrc_view) { + psrc_view = FALSE; + SGML_string(context, "<HTML><HEAD><TITLE>source</TITLE></HEAD>" + "<BODY><PRE>") ; + psrc_view = TRUE; + sgml_in_psrc_was_initialized = TRUE; + seen_letter_in_junk_tag = FALSE; + } +#endif + return context; } @@ -3496,7 +4340,7 @@ PUBLIC void TO_SJIS ARGS2( unsigned char *euc; if (!any || !sjis) - return; + return; euc = (unsigned char*)malloc(strlen((CONST char *)any)+1); if (euc == NULL) @@ -3514,7 +4358,7 @@ PUBLIC void TO_JIS ARGS2( unsigned char *euc; if (!any || !jis) - return; + return; euc = (unsigned char*)malloc(strlen((CONST char *)any)+1); if (euc == NULL) diff --git a/WWW/Library/Implementation/SGML.h b/WWW/Library/Implementation/SGML.h index 3e4575bd..261eb54a 100644 --- a/WWW/Library/Implementation/SGML.h +++ b/WWW/Library/Implementation/SGML.h @@ -1,8 +1,8 @@ -/* SGML parse and stream definition for libwww - SGML AND STRUCTURED STREAMS +/* SGML parse and stream definition for libwww + SGML AND STRUCTURED STREAMS - The SGML parser is a state machine. It is called for every character - of the input stream. The DTD data structure contains pointers + The SGML parser is a state machine. It is called for every character + of the input stream. The DTD data structure contains pointers to functions which are called to implement the actual effect of the text read. When these functions are called, the attribute structures pointed to by the DTD are valid, and the function is passed a pointer to the current tag structure, and an @@ -26,90 +26,96 @@ SGML content types */ typedef enum _SGMLContent { - SGML_EMPTY, /* No content. */ + SGML_EMPTY, /* No content. */ SGML_LITTERAL, /* Literal character data. Recognize exact close tag only. Old www server compatibility only! Not SGML */ - SGML_CDATA, /* Character data. Recognize </ only. */ + SGML_CDATA, /* Character data. Recognize </ only. */ SGML_RCDATA, /* Replaceable character data. Recognize </ and &ref; */ - SGML_MIXED, /* Elements and parsed character data. + SGML_MIXED, /* Elements and parsed character data. Recognize all markup. */ SGML_ELEMENT, /* Any data found will be returned as an error. */ - SGML_PCDATA /* Added by KW. */ + SGML_PCDATA /* Added by KW. */ } SGMLContent; typedef struct { - char * name; /* The (constant) name of the attribute */ - /* Could put type info in here */ + char * name; /* The (constant) name of the attribute */ +#ifdef USE_PSRC + char type; /* code of the type of the attribute. Code + values are in HTMLDTD.h */ +#endif } attr; typedef int TagClass; /* textflow */ -#define Tgc_FONTlike 0x00001 /* S,STRIKE,I,B,TT,U,BIG,SMALL,STYLE,BLINK;BR,TAB */ -#define Tgc_EMlike 0x00002 /* EM,STRONG,DFN,CODE,SAMP,KBD,VAR,CITE,Q,INS,DEL,SPAN,.. */ -#define Tgc_MATHlike 0x00004 /* SUB,SUP,MATH,COMMENT */ -#define Tgc_Alike 0x00008 /* A */ -#define Tgc_formula 0x00010 /* not used until math is supported better... */ +#define Tgc_FONTlike 0x00001 /* S,STRIKE,I,B,TT,U,BIG,SMALL,STYLE,BLINK;BR,TAB */ +#define Tgc_EMlike 0x00002 /* EM,STRONG,DFN,CODE,SAMP,KBD,VAR,CITE,Q,INS,DEL,SPAN,.. */ +#define Tgc_MATHlike 0x00004 /* SUB,SUP,MATH,COMMENT */ +#define Tgc_Alike 0x00008 /* A */ +#define Tgc_formula 0x00010 /* not used until math is supported better... */ /* used for special structures: forms, tables,... */ -#define Tgc_TRlike 0x00020 /* TR and similar */ -#define Tgc_SELECTlike 0x00040 /* SELECT,INPUT,TEXTAREA(,...) */ +#define Tgc_TRlike 0x00020 /* TR and similar */ +#define Tgc_SELECTlike 0x00040 /* SELECT,INPUT,TEXTAREA(,...) */ /* structure */ -#define Tgc_FORMlike 0x00080 /* FORM itself */ -#define Tgc_Plike 0x00100 /* P,H1..H6,... structures containing text or +#define Tgc_FORMlike 0x00080 /* FORM itself */ +#define Tgc_Plike 0x00100 /* P,H1..H6,... structures containing text or insertion but not other structures */ -#define Tgc_DIVlike 0x00200 /* ADDRESS,FIG,BDO,NOTE,FN,DIV,CENTER;FIG +#define Tgc_DIVlike 0x00200 /* ADDRESS,FIG,BDO,NOTE,FN,DIV,CENTER;FIG structures which can contain other structures */ -#define Tgc_LIlike 0x00400 /* LH,LI,DT,DD;TH,TD structure-like, only valid +#define Tgc_LIlike 0x00400 /* LH,LI,DT,DD;TH,TD structure-like, only valid within certain other structures */ -#define Tgc_ULlike 0x00800 /* UL,OL,DL,DIR,MENU;TABLE;XMP,LISTING +#define Tgc_ULlike 0x00800 /* UL,OL,DL,DIR,MENU;TABLE;XMP,LISTING special in some way, cannot contain (parsed) text directly */ /* insertions */ -#define Tgc_BRlike 0x01000 /* BR,IMG,TAB allowed in any text */ -#define Tgc_APPLETlike 0x02000 /* APPLET,OBJECT,EMBED,SCRIPT */ -#define Tgc_HRlike 0x04000 /* HR,MARQUEE can contain all kinds of things +#define Tgc_BRlike 0x01000 /* BR,IMG,TAB allowed in any text */ +#define Tgc_APPLETlike 0x02000 /* APPLET,OBJECT,EMBED,SCRIPT */ +#define Tgc_HRlike 0x04000 /* HR,MARQUEE can contain all kinds of things and/or are not allowed (?) in running text */ -#define Tgc_MAPlike 0x08000 /* MAP,AREA some specials that never contain +#define Tgc_MAPlike 0x08000 /* MAP,AREA some specials that never contain (directly or indirectly) other things than special insertions */ -#define Tgc_outer 0x10000 /* HTML,FRAMESET,FRAME,PLAINTEXT; */ -#define Tgc_BODYlike 0x20000 /* BODY,BODYTEXT,NOFRAMES,TEXTFLOW; */ -#define Tgc_HEADstuff 0x40000 /* HEAD,BASE,STYLE,TITLE; */ +#define Tgc_outer 0x10000 /* HTML,FRAMESET,FRAME,PLAINTEXT; */ +#define Tgc_BODYlike 0x20000 /* BODY,BODYTEXT,NOFRAMES,TEXTFLOW; */ +#define Tgc_HEADstuff 0x40000 /* HEAD,BASE,STYLE,TITLE; */ /* special relations */ #define Tgc_same 0x80000 /* Some more properties of tags (or rather, elements) and rules how to deal with them. - kw */ typedef int TagFlags; -#define Tgf_endO 0x00001 /* end tag can be Omitted */ -#define Tgf_startO 0x00002 /* start tag can be Omitted */ -#define Tgf_mafse 0x00004 /* Make Attribute-Free Start-tag End instead +#define Tgf_endO 0x00001 /* end tag can be Omitted */ +#define Tgf_startO 0x00002 /* start tag can be Omitted */ +#define Tgf_mafse 0x00004 /* Make Attribute-Free Start-tag End instead (if found invalid) */ -#define Tgf_strict 0x00008 /* Ignore contained invalid elements, +#define Tgf_strict 0x00008 /* Ignore contained invalid elements, don't pass them on */ -#define Tgf_nreie 0x00010 /* Not Really Empty If Empty, +#define Tgf_nreie 0x00010 /* Not Really Empty If Empty, used by color style code */ -/* A tag structure describes an SGML element. -** ----------------------------------------- +/* A tag structure describes an SGML element. +** ----------------------------------------- ** ** -** name is the string which comes after the tag opener "<". +** name is the string which comes after the tag opener "<". ** -** attributes points to a zero-terminated array -** of attribute names. +** attributes points to a zero-terminated array +** of attribute names. ** -** litteral determines how the SGML engine parses the characters -** within the element. If set, tag openers are ignored -** except for that which opens a matching closing tag. +** litteral determines how the SGML engine parses the characters +** within the element. If set, tag openers are ignored +** except for that which opens a matching closing tag. ** */ typedef struct _tag HTTag; struct _tag{ - char * name; /* The name of the tag */ - attr * attributes; /* The list of acceptable attributes */ - int number_of_attributes; /* Number of possible attributes */ - SGMLContent contents; /* End only on end tag @@ */ + char * name; /* The name of the tag */ +#ifdef USE_PSRC + int name_len; /* The length of the name */ +#endif + attr * attributes; /* The list of acceptable attributes */ + int number_of_attributes; /* Number of possible attributes */ + SGMLContent contents; /* End only on end tag @@ */ TagClass tagclass, contains, /* which classes of elements this one can contain directly */ icontains, /* which classes of elements this one can contain indirectly */ @@ -121,25 +127,25 @@ struct _tag{ }; -/* DTD Information -** --------------- +/* DTD Information +** --------------- ** ** Not the whole DTD, but all this parser uses of it. */ typedef struct { - HTTag * tags; /* Must be in strcmp order by name */ - int number_of_tags; - CONST char ** entity_names; /* Must be in strcmp order by name */ - size_t number_of_entities; + HTTag * tags; /* Must be in strcmp order by name */ + int number_of_tags; + CONST char ** entity_names; /* Must be in strcmp order by name */ + size_t number_of_entities; /* "entity_names" table probably unused, ** see comments in HTMLDTD.c near the top */ } SGML_dtd; -/* SGML context passed to parsers +/* SGML context passed to parsers */ -typedef struct _HTSGMLContext *HTSGMLContext; /* Hidden */ +typedef struct _HTSGMLContext *HTSGMLContext; /* Hidden */ /*__________________________________________________________________________ @@ -156,7 +162,7 @@ Structured Object definition can output its contents to another Structured Object. It's a kind of typed stream. The architecture is largely Dan Conolly's. Elements and entities are passed to the sob by number, implying a knowledge of the - DTD. Knowledge of the SGML syntax is not here, though. + DTD. Knowledge of the SGML syntax is not here, though. Superclass: HTStream @@ -168,44 +174,44 @@ typedef struct _HTStructured HTStructured; typedef struct _HTStructuredClass{ - char* name; /* Just for diagnostics */ + char* name; /* Just for diagnostics */ - void (*_free) PARAMS(( - HTStructured* me)); + void (*_free) PARAMS(( + HTStructured* me)); - void (*_abort) PARAMS(( - HTStructured* me, - HTError e)); + void (*_abort) PARAMS(( + HTStructured* me, + HTError e)); - void (*put_character) PARAMS(( - HTStructured* me, - char ch)); + void (*put_character) PARAMS(( + HTStructured* me, + char ch)); - void (*put_string) PARAMS(( - HTStructured* me, - CONST char * str)); + void (*put_string) PARAMS(( + HTStructured* me, + CONST char * str)); - void (*_write) PARAMS(( - HTStructured* me, - CONST char * str, - int len)); + void (*_write) PARAMS(( + HTStructured* me, + CONST char * str, + int len)); - void (*start_element) PARAMS(( - HTStructured* me, - int element_number, - CONST BOOL* attribute_present, - CONST char** attribute_value, + void (*start_element) PARAMS(( + HTStructured* me, + int element_number, + CONST BOOL* attribute_present, + CONST char** attribute_value, int charset, char ** include)); - void (*end_element) PARAMS(( - HTStructured* me, - int element_number, + void (*end_element) PARAMS(( + HTStructured* me, + int element_number, char ** include)); - int (*put_entity) PARAMS(( - HTStructured* me, - int entity_number)); + int (*put_entity) PARAMS(( + HTStructured* me, + int entity_number)); }HTStructuredClass; @@ -237,11 +243,11 @@ Create an SGML parser */ /* ** On entry, -** dtd must point to a DTD structure as defined above -** callbacks must point to user routines. -** callData is returned in callbacks transparently. +** dtd must point to a DTD structure as defined above +** callbacks must point to user routines. +** callData is returned in callbacks transparently. ** On exit, -** The default tag starter has been processed. +** The default tag starter has been processed. */ extern HTStream * SGML_new PARAMS(( CONST SGML_dtd * dtd, @@ -250,7 +256,7 @@ extern HTStream * SGML_new PARAMS(( extern CONST HTStreamClass SGMLParser; -#endif /* SGML_H */ +#endif /* SGML_H */ /* diff --git a/WWW/Library/djgpp/CommonMakefile b/WWW/Library/djgpp/CommonMakefile index e991f9af..f4bdad38 100644 --- a/WWW/Library/djgpp/CommonMakefile +++ b/WWW/Library/djgpp/CommonMakefile @@ -76,7 +76,7 @@ CERNLIBBIN = $(WWW)/bin COMMON = $(LOB)/HTParse.o $(LOB)/HTAccess.o $(LOB)/HTTP.o \ $(LOB)/HTFile.o $(LOB)/HTBTree.o $(LOB)/HTFTP.o $(LOB)/HTTCP.o \ $(LOB)/SGML.o $(LOB)/HTMLDTD.o $(LOB)/HTChunk.o \ - $(LOB)/HTPlain.o $(LOB)/HTWriter.o \ + $(LOB)/HTPlain.o \ $(LOB)/HTMLGen.o \ $(LOB)/HTAtom.o $(LOB)/HTAnchor.o $(LOB)/HTStyle.o \ $(LOB)/HTList.o $(LOB)/HTString.o $(LOB)/HTDOS.o \ @@ -92,7 +92,7 @@ CFILES = $(CMN)HTParse.c $(CMN)HTAccess.c $(CMN)HTTP.c $(CMN)HTFile.c \ $(CMN)HTBTree.c \ $(CMN)HTFTP.c $(CMN)HTTCP.c $(CMN)SGML.c \ $(CMN)HTMLDTD.c \ - $(CMN)HTPlain.c $(CMN)HTWriter.c \ + $(CMN)HTPlain.c \ $(CMN)HTDOS.c $(CMN)HTMLGen.c \ $(CMN)HTChunk.c $(CMN)HTAtom.c $(CMN)HTAnchor.c $(CMN)HTStyle.c \ $(CMN)HTList.c $(CMN)HTString.c $(CMN)HTRules.c \ @@ -107,7 +107,7 @@ CFILES = $(CMN)HTParse.c $(CMN)HTAccess.c $(CMN)HTTP.c $(CMN)HTFile.c \ HFILES = $(CMN)HTParse.h $(CMN)HTAccess.h $(CMN)HTTP.h $(CMN)HTFile.h \ $(CMN)HTBTree.h $(CMN)HTFTP.h $(CMN)HTTCP.h \ $(CMN)SGML.h $(CMN)HTML.h $(CMN)HTMLDTD.h $(CMN)HTChunk.h \ - $(CMN)HTPlain.h $(CMN)HTWriter.h \ + $(CMN)HTPlain.h \ $(CMN)HTFWriter.h $(CMN)HTMLGen.h $(CMN)HTDOS.h \ $(CMN)HTStream.h \ $(CMN)HTAtom.h $(CMN)HTAnchor.h $(CMN)HTStyle.h \ @@ -278,10 +278,6 @@ $(LOB)/HTWAIS.o : $(OE) $(CMN)HTWAIS.c $(CMN)HTUtils.h $(CMN)HTList.h $(LOB)/HTWSRC.o : $(OE) $(CMN)HTWSRC.c $(CMN)HTUtils.h $(CMN)HTList.h $(CC) -c $(CFLAGS2) $(CMN)HTWSRC.c -$(LOB)/HTWriter.o : $(OE) $(CMN)HTWriter.c $(CMN)HTWriter.h $(CMN)HTStream.h - $(CC) -c $(CFLAGS2) $(CMN)HTWriter.c - - # Access Authorization $(LOB)/HTAAUtil.o : $(OE) $(CMN)HTAAUtil.c $(CMN)HTAAUtil.h \ diff --git a/WWW/Library/vms/descrip.mms b/WWW/Library/vms/descrip.mms index 86f043e2..e0d065a5 100644 --- a/WWW/Library/vms/descrip.mms +++ b/WWW/Library/vms/descrip.mms @@ -167,7 +167,7 @@ CC = gcc ! HTParse.h, HTAccess.h, HTTP.h, HTFile.h, - ! HTBTree.h, HTTCP.h, SGML.h, - ! HTML.h, HTMLDTD.h, HTChunk.h, HTPlain.h, - -! HTWriter.h, HTFwriter.h, HTMLGen.h, - +! HTFwriter.h, HTMLGen.h, - ! HTAtom.h, HTAnchor.h, HTStyle.h, - ! HTList.h, HTString.h, HTAlert.h, - ! HTRules.h, HTFormat.h, HTInit.h, - @@ -178,7 +178,7 @@ CC = gcc ! HTVMSUtils.h, ufc-crypt.h, patchlevel.h MODULES = HTParse, HTAccess, HTTP, HTFile, HTBTree, HTFTP, HTTCP, HTString, - - SGML, HTMLDTD, HTChunk, HTPlain, HTWriter, HTMLGen, - + SGML, HTMLDTD, HTChunk, HTPlain, HTMLGen, - HTAtom, HTAnchor, HTStyle, HTList, HTRules, HTFormat, - HTMIME, HTNews, HTGopher, HTTelnet, HTFinger, - HTWSRC, HTAAUtil, HTAABrow, HTGroup, - @@ -219,7 +219,6 @@ clean : !HTBTree.obj : HTBTree.c HTBTree.h HTUtils.h !HTMLDTD.obj : HTMLDTD.c HTMLDTD.h SGML.h !HTPlain.obj : HTPlain.c HTPlain.h HTStream.h -!HTWriter.obj : HTWriter.c HTWriter.h HTStream.h !HTMLGen.obj : HTMLGen.c HTMLGen.h HTUtils.h HTMLDTD.h !HTRules.obj : HTRules.c HTRules.h HTUtils.h Version.make !HTMIME.obj : HTMIME.c HTMIME.h HTUtils.h HTList.h diff --git a/WWW/Library/vms/libmake.com b/WWW/Library/vms/libmake.com index cfa6d975..7329b0d4 100644 --- a/WWW/Library/vms/libmake.com +++ b/WWW/Library/vms/libmake.com @@ -154,7 +154,6 @@ $ cc [-.Implementation]SGML.c $ cc [-.Implementation]HTMLDTD.c $ cc [-.Implementation]HTChunk.c $ cc [-.Implementation]HTPlain.c -$ cc [-.Implementation]HTWriter.c $ cc [-.Implementation]HTMLGen.c $ cc [-.Implementation]HTAtom.c $ cc [-.Implementation]HTAnchor.c |