diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 1999-03-04 10:56:18 -0500 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 1999-03-04 10:56:18 -0500 |
commit | f7c3c4ca429260c4d056b1e032e05162e25554ca (patch) | |
tree | 8317fd8852ed2996cf2edf2838c7f43f4023bcd5 /WWW/Library/Implementation | |
parent | c5fef0d4ab035d8fd988270a39ed6f9d0e9b214c (diff) | |
download | lynx-snapshots-f7c3c4ca429260c4d056b1e032e05162e25554ca.tar.gz |
snapshot of project "lynx", label v2-8-2dev_18
Diffstat (limited to 'WWW/Library/Implementation')
-rw-r--r-- | WWW/Library/Implementation/HTAccess.c | 9 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTAnchor.c | 20 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTGopher.c | 6 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTMIME.c | 1 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTPlain.c | 2 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTUtils.h | 6 | ||||
-rw-r--r-- | WWW/Library/Implementation/SGML.c | 38 | ||||
-rw-r--r-- | WWW/Library/Implementation/UCMap.h | 5 |
8 files changed, 52 insertions, 35 deletions
diff --git a/WWW/Library/Implementation/HTAccess.c b/WWW/Library/Implementation/HTAccess.c index 402afaaf..77517472 100644 --- a/WWW/Library/Implementation/HTAccess.c +++ b/WWW/Library/Implementation/HTAccess.c @@ -141,8 +141,10 @@ extern GLOBALREF (HTProtocol, HTNewsReply); extern GLOBALREF (HTProtocol, HTSNews); extern GLOBALREF (HTProtocol, HTSNewsPost); extern GLOBALREF (HTProtocol, HTSNewsReply); +#ifndef DISABLE_GOPHER extern GLOBALREF (HTProtocol, HTGopher); extern GLOBALREF (HTProtocol, HTCSO); +#endif /* not DISABLE_GOPHER */ extern GLOBALREF (HTProtocol, HTFinger); #ifdef DIRECT_WAIS extern GLOBALREF (HTProtocol, HTWAIS); @@ -153,7 +155,10 @@ GLOBALREF HTProtocol HTTP, HTTPS, HTFile, HTTelnet, HTTn3270, HTRlogin; #ifndef DECNET GLOBALREF HTProtocol HTFTP, HTNews, HTNNTP, HTNewsPost, HTNewsReply; GLOBALREF HTProtocol HTSNews, HTSNewsPost, HTSNewsReply; -GLOBALREF HTProtocol HTGopher, HTCSO, HTFinger; +#ifndef DISABLE_GOPHER +GLOBALREF HTProtocol HTGopher, HTCSO; +#endif /* not DISABLE_GOPHER */ +GLOBALREF HTProtocol HTFinger; #ifdef DIRECT_WAIS GLOBALREF HTProtocol HTWAIS; #endif /* DIRECT_WAIS */ @@ -177,8 +182,10 @@ PRIVATE void HTAccessInit NOARGS /* Call me once */ HTRegisterProtocol(&HTSNews); HTRegisterProtocol(&HTSNewsPost); HTRegisterProtocol(&HTSNewsReply); +#ifndef DISABLE_GOPHER HTRegisterProtocol(&HTGopher); HTRegisterProtocol(&HTCSO); +#endif /* not DISABLE_GOPHER */ HTRegisterProtocol(&HTFinger); #ifdef DIRECT_WAIS HTRegisterProtocol(&HTWAIS); diff --git a/WWW/Library/Implementation/HTAnchor.c b/WWW/Library/Implementation/HTAnchor.c index 9e3933ad..9be41d00 100644 --- a/WWW/Library/Implementation/HTAnchor.c +++ b/WWW/Library/Implementation/HTAnchor.c @@ -901,11 +901,21 @@ PUBLIC void HTAnchor_setTitle ARGS2( int i; if (me) { - StrAllocCopy(me->title, title); - for (i = 0; me->title[i]; i++) { - if ((unsigned char)me->title[i] == 1 || - (unsigned char)me->title[i] == 2) { - me->title[i] = ' '; + if (title) { + StrAllocCopy(me->title, title); + for (i = 0; me->title[i]; i++) { + if ((unsigned char)me->title[i] == 1 || + (unsigned char)me->title[i] == 2) { + me->title[i] = ' '; + } + } + } else { + CTRACE(tfp,"HTAnchor_setTitle: New title is NULL! "); + if (me->title) { + CTRACE(tfp,"Old title was \"%s\".\n", me->title); + FREE(me->title); + } else { + CTRACE(tfp,"Old title was NULL.\n"); } } } diff --git a/WWW/Library/Implementation/HTGopher.c b/WWW/Library/Implementation/HTGopher.c index 276569b5..5b4ee335 100644 --- a/WWW/Library/Implementation/HTGopher.c +++ b/WWW/Library/Implementation/HTGopher.c @@ -16,6 +16,8 @@ */ #include <HTUtils.h> /* Coding convention macros */ + +#ifndef DISABLE_GOPHER #include <HTAlert.h> #include <HTParse.h> #include <HTTCP.h> @@ -58,9 +60,7 @@ #define GOPHER_PLUS_SOUND '<' #define GOPHER_PLUS_PDF 'P' -#include <HTParse.h> #include <HTFormat.h> -#include <HTTCP.h> /* ** Hypertext object building machinery. @@ -1928,3 +1928,5 @@ GLOBALDEF (HTProtocol, HTCSO, _HTCSO_C_1_INIT); GLOBALDEF PUBLIC HTProtocol HTGopher = { "gopher", HTLoadGopher, NULL }; GLOBALDEF PUBLIC HTProtocol HTCSO = { "cso", HTLoadCSO, NULL }; #endif /* GLOBALDEF_IS_MACRO */ + +#endif /* not DISABLE_GOPHER */ diff --git a/WWW/Library/Implementation/HTMIME.c b/WWW/Library/Implementation/HTMIME.c index 4228b570..c27e1f3b 100644 --- a/WWW/Library/Implementation/HTMIME.c +++ b/WWW/Library/Implementation/HTMIME.c @@ -1991,7 +1991,6 @@ PUBLIC void HTmmdecode ARGS2( int LYhndl; *qm2 = '\0'; - LYLowerCase(s+2); invalid = ((LYhndl = UCGetLYhndl_byMIME(s+2)) < 0 || UCCanTranslateFromTo(LYhndl, current_char_set)); diff --git a/WWW/Library/Implementation/HTPlain.c b/WWW/Library/Implementation/HTPlain.c index a07ede9d..91973126 100644 --- a/WWW/Library/Implementation/HTPlain.c +++ b/WWW/Library/Implementation/HTPlain.c @@ -21,8 +21,6 @@ #define BUFFER_SIZE 4096; /* Tradeoff */ -#include <HText.h> -#include <HTStyle.h> #include <HTMLDTD.h> #include <HTCJK.h> #include <UCMap.h> diff --git a/WWW/Library/Implementation/HTUtils.h b/WWW/Library/Implementation/HTUtils.h index 9f209044..70c2813d 100644 --- a/WWW/Library/Implementation/HTUtils.h +++ b/WWW/Library/Implementation/HTUtils.h @@ -5,9 +5,9 @@ */ -#ifndef DEBUG -#define DEBUG /* Noone ever turns this off as trace is too important */ -#endif /* Keep option for really small memory applications tho */ +#ifndef NO_LYNX_TRACE +#define DEBUG /* Turns on trace; turn off for smaller binary */ +#endif #ifndef HTUTILS_H #define HTUTILS_H diff --git a/WWW/Library/Implementation/SGML.c b/WWW/Library/Implementation/SGML.c index 8dd191b3..41292c9b 100644 --- a/WWW/Library/Implementation/SGML.c +++ b/WWW/Library/Implementation/SGML.c @@ -312,7 +312,7 @@ PRIVATE void handle_attribute_value ARGS2( } #endif } else { - CTRACE(tfp, "SGML: Attribute value %s ignored\n", s); + CTRACE(tfp, "SGML: Attribute value %s ***ignored\n", s); } context->current_attribute_number = INVALID; /* can't have two assignments! */ } @@ -690,13 +690,13 @@ PRIVATE void end_element ARGS2( if (canclose_check != close_NO) { CTRACE(tfp, "SGML: End </%s> \t<- %s end </%s>\n", context->element_stack->tag->name, - canclose_check == close_valid ? "supplied," : "forced by", + canclose_check == close_valid ? "supplied," : "***forced by", old_tag->name); do_close_stacked(context); extra_action_taken = YES; stackpos = is_on_stack(context, old_tag); } else { - CTRACE(tfp, "SGML: Still open %s \t<- invalid end </%s>\n", + CTRACE(tfp, "SGML: Still open %s \t<- ***invalid end </%s>\n", context->element_stack->tag->name, old_tag->name); return; @@ -712,7 +712,7 @@ PRIVATE void end_element ARGS2( return; } if (stackpos > 1) { - CTRACE(tfp, "SGML: Nesting <%s>...<%s> \t<- invalid end </%s>\n", + CTRACE(tfp, "SGML: Nesting <%s>...<%s> \t<- ***invalid end </%s>\n", old_tag->name, context->element_stack->tag->name, old_tag->name); @@ -737,7 +737,7 @@ PRIVATE void end_element ARGS2( /* ** Ignore the end tag. - FM */ - CTRACE(tfp, "SGML: Ignoring end tag </%s> in SELECT block.\n", + CTRACE(tfp, "SGML: ***Ignoring end tag </%s> in SELECT block.\n", old_tag->name); return; } @@ -747,7 +747,7 @@ PRIVATE void end_element ARGS2( */ CTRACE(tfp, "SGML: End </%s>\n", old_tag->name); if (old_tag->contents == SGML_EMPTY) { - CTRACE(tfp, "SGML: Illegal end tag </%s> found.\n", + CTRACE(tfp, "SGML: ***Illegal end tag </%s> found.\n", old_tag->name); return; } @@ -762,10 +762,10 @@ PRIVATE void end_element ARGS2( if (old_tag != t) { /* Mismatch: syntax error */ if (context->element_stack->next) { /* This is not the last level */ - CTRACE(tfp, "SGML: Found </%s> when expecting </%s>. </%s> assumed.\n", - old_tag->name, t->name, t->name); + CTRACE(tfp, "SGML: Found </%s> when expecting </%s>. </%s> ***assumed.\n", + old_tag->name, t->name, t->name); } else { /* last level */ - CTRACE(tfp, "SGML: Found </%s> when expecting </%s>. </%s> Ignored.\n", + CTRACE(tfp, "SGML: Found </%s> when expecting </%s>. </%s> ***Ignored.\n", old_tag->name, t->name, old_tag->name); return; /* Ignore */ } @@ -815,14 +815,14 @@ PRIVATE void start_element ARGS1( if (canclose_check != close_NO) { CTRACE(tfp, "SGML: End </%s> \t<- %s start <%s>\n", context->element_stack->tag->name, - canclose_check == close_valid ? "supplied," : "forced by", + canclose_check == close_valid ? "supplied," : "***forced by", new_tag->name); do_close_stacked(context); extra_action_taken = YES; if (canclose_check == close_error) direct_container = NO; } else { - CTRACE(tfp, "SGML: Still open %s \t<- invalid start <%s>\n", + CTRACE(tfp, "SGML: Still open %s \t<- ***invalid start <%s>\n", context->element_stack->tag->name, new_tag->name); } @@ -831,7 +831,7 @@ PRIVATE void start_element ARGS1( (context->element_stack->tag->flags & Tgf_strict) && !(valid = element_valid_within(new_tag, context->element_stack->tag, direct_container))) { - CTRACE(tfp, "SGML: Still open %s \t<- ignoring start <%s>\n", + CTRACE(tfp, "SGML: Still open %s \t<- ***ignoring start <%s>\n", context->element_stack->tag->name, new_tag->name); return; @@ -859,7 +859,7 @@ PRIVATE void start_element ARGS1( new_tag, context->element_stack->tag, direct_container))) { - CTRACE(tfp, "SGML: Still open %s \t<- invalid start <%s>\n", + CTRACE(tfp, "SGML: Still open %s \t<- ***invalid start <%s>\n", context->element_stack->tag->name, new_tag->name); } @@ -905,14 +905,14 @@ PRIVATE void start_element ARGS1( ** It is another form-related start tag, so terminate ** the current SELECT block and fall through. - FM */ - CTRACE(tfp, "SGML: Faking SELECT end tag before <%s> start tag.\n", + CTRACE(tfp, "SGML: ***Faking SELECT end tag before <%s> start tag.\n", new_tag->name); end_element(context, SGMLFindTag(context->dtd, "SELECT")); } else { /* ** Ignore the start tag. - FM */ - CTRACE(tfp, "SGML: Ignoring start tag <%s> in SELECT block.\n", + CTRACE(tfp, "SGML: ***Ignoring start tag <%s> in SELECT block.\n", new_tag->name); return; } @@ -2744,7 +2744,7 @@ top1: ** 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; @@ -2782,14 +2782,14 @@ top1: /* ** It is not at FORM end tag, so ignore it. - FM */ - CTRACE(tfp, "SGML: Ignoring end tag </%s> in SELECT block.\n", + CTRACE(tfp, "SGML: ***Ignoring end tag </%s> in SELECT block.\n", string->data); } else { /* ** End the SELECT block and then ** handle the FORM end tag. - FM */ - CTRACE(tfp, "SGML: Faking SELECT end tag before </%s> end tag.\n", + CTRACE(tfp, "SGML: ***Faking SELECT end tag before </%s> end tag.\n", string->data); end_element(context, SGMLFindTag(context->dtd, "SELECT")); @@ -2805,7 +2805,7 @@ top1: ** Treat a P end tag like a P start tag (Ugh, ** what a hack! 8-). - FM */ - CTRACE(tfp, "SGML: `</%s%c' found! Treating as '<%s%c'.\n", + CTRACE(tfp, "SGML: `</%s%c' found! ***Treating as '<%s%c'.\n", string->data, c, string->data, c); { int i; diff --git a/WWW/Library/Implementation/UCMap.h b/WWW/Library/Implementation/UCMap.h index 15df5f02..0ca58290 100644 --- a/WWW/Library/Implementation/UCMap.h +++ b/WWW/Library/Implementation/UCMap.h @@ -45,8 +45,9 @@ extern int UCLYhndl_HTFile_for_unspec; extern int UCLYhndl_HTFile_for_unrec; /* easy to type: */ -#define LATIN1 UCGetLYhndl_byMIME("iso-8859-1") -#define US_ASCII UCGetLYhndl_byMIME("us-ascii") +extern int LATIN1; /* UCGetLYhndl_byMIME("iso-8859-1") */ +extern int US_ASCII; /* UCGetLYhndl_byMIME("us-ascii") */ +extern int UTF8; /* UCGetLYhndl_byMIME("utf-8") */ /* In general, Lynx translates letters from document charset to display charset. |