diff options
| author | Thomas E. Dickey <dickey@invisible-island.net> | 1999-05-20 12:53:14 -0400 |
|---|---|---|
| committer | Thomas E. Dickey <dickey@invisible-island.net> | 1999-05-20 12:53:14 -0400 |
| commit | 479f8d01393c541fede1688676f860bb49d44668 (patch) | |
| tree | 8d7194665440c01cae7f2d5015a1333c19348a67 /src | |
| parent | c7742b57ba05ecb66932512320e2a7e8adaf11c5 (diff) | |
| download | lynx-snapshots-479f8d01393c541fede1688676f860bb49d44668.tar.gz | |
snapshot of project "lynx", label v2-8-2pre_5
Diffstat (limited to 'src')
| -rw-r--r-- | src/GridText.c | 2 | ||||
| -rw-r--r-- | src/HTML.c | 2 | ||||
| -rw-r--r-- | src/LYHash.c | 12 | ||||
| -rw-r--r-- | src/LYHash.h | 2 | ||||
| -rw-r--r-- | src/LYHistory.c | 2 | ||||
| -rw-r--r-- | src/LYHistory.h | 2 | ||||
| -rw-r--r-- | src/LYMainLoop.c | 35 | ||||
| -rw-r--r-- | src/LYOptions.c | 32 | ||||
| -rw-r--r-- | src/LYOptions.h | 1 | ||||
| -rw-r--r-- | src/LYPrettySrc.c | 2 | ||||
| -rw-r--r-- | src/LYReadCFG.c | 10 | ||||
| -rw-r--r-- | src/chrtrans/cp1256_uni.tbl | 20 |
12 files changed, 78 insertions, 44 deletions
diff --git a/src/GridText.c b/src/GridText.c index edaca017..3ce36bb3 100644 --- a/src/GridText.c +++ b/src/GridText.c @@ -4077,7 +4077,7 @@ PUBLIC int HTGetRelLinkNum ARGS3( int, cur) { TextAnchor *a, *l = 0; - int scrtop = HText_getTopOfScreen()+1; + int scrtop = HText_getTopOfScreen(); /*XXX +1? */ int curline = links[cur].anchor_line_num; int curpos = links[cur].lx; int on_screen = ( curline >= scrtop && curline < (scrtop + display_lines) ); @@ -915,7 +915,7 @@ PRIVATE void HTML_start_element ARGS6( # endif hcode = hash_code_aggregate_char('.', hcode); - hcode = hash_code_aggregate_lower_on_fly(class_name, hcode); + hcode = hash_code_aggregate_lower_str(class_name, hcode); #endif } #if !OPT_SCN diff --git a/src/LYHash.c b/src/LYHash.c index 42f9fdac..a40f392b 100644 --- a/src/LYHash.c +++ b/src/LYHash.c @@ -34,13 +34,15 @@ PUBLIC int hash_code_rp ARGS1(char*,string) #define HASH_SIZE CSHASHSIZE #endif +#define HASH_OF(h, v) ((int)((h) * 3 + (unsigned char)(v)) % HASH_SIZE) + PUBLIC int hash_code ARGS1 (char*, string) { int hash; unsigned char *p; for (p = (unsigned char *)string, hash = 0; *p; p++) - hash = (int) (hash * 3 + (*(unsigned char *)p)) % HASH_SIZE; + hash = HASH_OF(hash,*p); return hash; } @@ -51,23 +53,23 @@ PUBLIC int hash_code_lowercase_on_fly ARGS1 (char*, string) unsigned char *p; for (p = (unsigned char *)string, hash = 0; *p; p++) - hash = (int) (hash * 3 + (unsigned char)tolower(*(char*)p) ) % HASH_SIZE; + hash = HASH_OF(hash,tolower(*(char *)p)); return hash; } PUBLIC int hash_code_aggregate_char ARGS2 (char, c,int,hash) { - return (int)(hash*3 + (unsigned char)c) % HASH_SIZE; + return HASH_OF(hash,c); } -PUBLIC int hash_code_aggregate_lower_on_fly ARGS2 (char*, string,int,hash_was) +PUBLIC int hash_code_aggregate_lower_str ARGS2 (char*, string,int,hash_was) { int hash; unsigned char *p; for (p = (unsigned char *)string, hash = hash_was ; *p; p++) - hash = (int) (hash * 3 + (unsigned char)tolower(*(char*)p) ) % HASH_SIZE; + hash = HASH_OF(hash,tolower(*(char *)p)); return hash; } diff --git a/src/LYHash.h b/src/LYHash.h index d12e4406..7945051c 100644 --- a/src/LYHash.h +++ b/src/LYHash.h @@ -35,7 +35,7 @@ extern bucket nostyle_bucket;/*initialized properly - to be used in CTRACE when extern int hash_code_lowercase_on_fly PARAMS((char* string)); extern int hash_code_aggregate_char PARAMS((char c,int hash)); -extern int hash_code_aggregate_lower_on_fly PARAMS((char* c,int hash_was)); +extern int hash_code_aggregate_lower_str PARAMS((char* c,int hash_was)); #ifdef NOT_USED diff --git a/src/LYHistory.c b/src/LYHistory.c index a345b31f..ae60493f 100644 --- a/src/LYHistory.c +++ b/src/LYHistory.c @@ -716,7 +716,7 @@ PUBLIC int LYshow_statusline_messages ARGS1( * will be very useful on exit. * (Don't expect everyone will look a trace log in case of difficulties:)) */ -PUBLIC void LYprint_statusline_messages_on_exit ARGS1( +PUBLIC void LYstatusline_messages_on_exit ARGS1( char **, buf) { int i; diff --git a/src/LYHistory.h b/src/LYHistory.h index e65e2ea8..75156806 100644 --- a/src/LYHistory.h +++ b/src/LYHistory.h @@ -17,6 +17,6 @@ extern void LYpush PARAMS((document *doc, BOOLEAN force_push)); extern void LYstore_message2 PARAMS((CONST char *message, CONST char *argument)); extern void LYstore_message PARAMS((CONST char *message)); extern int LYshow_statusline_messages PARAMS((document *newdoc)); -extern void LYprint_statusline_messages_on_exit PARAMS((char **buf)); +extern void LYstatusline_messages_on_exit PARAMS((char **buf)); #endif /* LYHISTORY_H */ diff --git a/src/LYMainLoop.c b/src/LYMainLoop.c index 41cc0c8e..385dd714 100644 --- a/src/LYMainLoop.c +++ b/src/LYMainLoop.c @@ -3952,32 +3952,39 @@ if (!LYUseFormsOptions) { #endif /* !NO_OPTION_MENU */ #ifndef NO_OPTION_FORMS /* - * FIXME: Blatantly stolen from LYK_PRINT below, - * except ForcePush special. + * Generally stolen from LYK_COOKIE_JAR. Options menu handling is + * done in postoptions(), called from getfile() currently. + * + * postoptions() is also responsible for reloading the document + * before the 'options menu' but only when (a few) important + * options were changed. + * + * It is critical that post_data is freed here since the + * submission of changed options is done via the same protocol as + * LYNXOPTIONS: */ /* * Don't do if already viewing options page. */ if (strcmp((curdoc.title ? curdoc.title : ""), OPTIONS_TITLE)) { - if (gen_options(&newdoc.address) < 0) - break; - StrAllocCopy(newdoc.title, OPTIONS_TITLE); + StrAllocCopy(newdoc.address, "LYNXOPTIONS:/"); FREE(newdoc.post_data); FREE(newdoc.post_content_type); FREE(newdoc.bookmark); newdoc.isHEAD = FALSE; newdoc.safe = FALSE; - if (check_realm) + newdoc.internal_link = FALSE; + LYforce_no_cache = TRUE; + if (LYValidate || check_realm) { LYPermitURL = TRUE; - + } + } else { /* - * FIXME: this was a temporary solution until we find the - * correct place in postoptions() to reload the document - * before the 'options menu' only when (few) important options - * were changed. + * If already in the options menu, get out. */ - /* HTuncache_current_document(); */ + cmd = LYK_PREV_DOC; + goto new_cmd; } #endif /* !NO_OPTION_FORMS */ break; @@ -4919,6 +4926,8 @@ if (!LYUseFormsOptions) { DOWNLOAD_OPTIONS_TITLE) && strcmp((curdoc.title ? curdoc.title : ""), COOKIE_JAR_TITLE) && + strcmp((curdoc.title ? curdoc.title : ""), + OPTIONS_TITLE) && ((nlinks <= 0) || (links[curdoc.link].lname != NULL && strncmp(links[curdoc.link].lname, @@ -6211,7 +6220,7 @@ PRIVATE void exit_immediately_with_error_message ARGS2( if (first_file) { /* print statusline messages as a hint, if any */ - LYprint_statusline_messages_on_exit(&buf2); + LYstatusline_messages_on_exit(&buf2); } if (state == NOT_FOUND) diff --git a/src/LYOptions.c b/src/LYOptions.c index 524e91e4..cc635c5d 100644 --- a/src/LYOptions.c +++ b/src/LYOptions.c @@ -3493,6 +3493,7 @@ PRIVATE PostPair * break_data ARGS1( return q; } +PRIVATE int gen_options PARAMS((char **newfile)); /* * Handle options from the pseudo-post. I think we really only need * post_data here, but bring along everything just in case. It's only a @@ -3549,7 +3550,6 @@ PUBLIC int postoptions ARGS1( if (strstr(newdoc->address, "LYNXOPTIONS://MBM_MENU")) { FREE(newdoc->post_data); - FREE(data); if (!no_bookmark) edit_bookmarks(); else /* anonymous */ @@ -3557,6 +3557,30 @@ PUBLIC int postoptions ARGS1( return(NULLFILE); } + + /*------------------------------------------------- + * kludge gen_options() call: + *--------------------------------------------------*/ + + if (strstr(newdoc->address, "LYNXOPTIONS:/") && !newdoc->post_data) { + int status = gen_options(&newdoc->address); + if (status == NOT_FOUND) + return(NOT_FOUND); + + /* exit to getfile() cyrcle */ + WWWDoc.address = newdoc->address; + WWWDoc.post_data = newdoc->post_data; + WWWDoc.post_content_type = newdoc->post_content_type; + WWWDoc.bookmark = newdoc->bookmark; + WWWDoc.isHEAD = newdoc->isHEAD; + WWWDoc.safe = newdoc->safe; + + if (!HTLoadAbsolute(&WWWDoc)) + return(NOT_FOUND); + return(NORMAL); + } + + data = break_data(newdoc->post_data); for (i = 0; data[i].tag != NULL; i++) { @@ -4052,7 +4076,7 @@ PRIVATE char *NewSecureValue NOARGS * This function is synchronized with postoptions(). Read the comments in * postoptions() header if you change something in gen_options(). */ -PUBLIC int gen_options ARGS1( +PRIVATE int gen_options ARGS1( char **, newfile) { int i; @@ -4068,7 +4092,7 @@ PUBLIC int gen_options ARGS1( fp0 = LYOpenTemp(tempfile, HTML_SUFFIX, "w"); if (fp0 == NULL) { HTAlert(UNABLE_TO_OPEN_TEMPFILE); - return(-1); + return(NOT_FOUND); } LYLocalFileToURL(newfile, tempfile); @@ -4459,6 +4483,6 @@ PUBLIC int gen_options ARGS1( EndInternalPage(fp0); LYCloseTempFP(fp0); - return(0); + return(NORMAL); } #endif /* !NO_OPTION_FORMS */ diff --git a/src/LYOptions.h b/src/LYOptions.h index 5fab617d..60cb6c6e 100644 --- a/src/LYOptions.h +++ b/src/LYOptions.h @@ -16,7 +16,6 @@ extern int popup_choice PARAMS(( #ifndef NO_OPTION_FORMS extern int postoptions PARAMS((document *newdoc)); -extern int gen_options PARAMS((char **newfile)); #endif /* !NO_OPTION_FORMS */ #ifndef NO_OPTION_MENU diff --git a/src/LYPrettySrc.c b/src/LYPrettySrc.c index 79a292a2..3ff99b35 100644 --- a/src/LYPrettySrc.c +++ b/src/LYPrettySrc.c @@ -146,7 +146,7 @@ PRIVATE void append_open_tag ARGS4( # endif hcode = hash_code_aggregate_char('.', hcode); - hcode = hash_code_aggregate_lower_on_fly(classname, hcode); + hcode = hash_code_aggregate_lower_str(classname, hcode); StrAllocCopy(subj->class_name, classname); } else { subj->class_name = ""; diff --git a/src/LYReadCFG.c b/src/LYReadCFG.c index 6855fa0d..f7142ac6 100644 --- a/src/LYReadCFG.c +++ b/src/LYReadCFG.c @@ -1734,8 +1734,8 @@ PUBLIC int lynx_cfg_infopage ARGS1( #if defined(HAVE_CONFIG_H) || defined(VMS) if (strcmp(lynx_cfg_file, LYNX_CFG_FILE)) { fprintf(fp0, "<em>%s\n%s", - gettext("This is read from your lynx.cfg file,"), - gettext("please \"read\" distribution's")); + gettext("The following is read from your lynx.cfg file."), + gettext("Please read the distribution")); LYLocalFileToURL(&temp, LYNX_CFG_FILE); fprintf(fp0, " <a href=\"%s\">lynx.cfg</a> ", temp); @@ -1747,8 +1747,8 @@ PUBLIC int lynx_cfg_infopage ARGS1( { /* no absolute path... for lynx.cfg on DOS/Win32 */ fprintf(fp0, "<em>%s\n%s", - gettext("This is read from your lynx.cfg file,"), - gettext("please \"read\" distribution's")); + gettext("The following is read from your lynx.cfg file."), + gettext("Please read the distribution")); fprintf(fp0, " </em>lynx.cfg<em> "); fprintf(fp0, "%s</em>\n", gettext("for more comments.")); @@ -1775,7 +1775,7 @@ PUBLIC int lynx_cfg_infopage ARGS1( } else #endif /* !NO_CONFIG_INFO */ - fprintf(fp0, "<em>%s</em>\n\n", gettext("This is read from your lynx.cfg file:")); + fprintf(fp0, "<em>%s</em>\n\n", gettext("The following is read from your lynx.cfg file.")); /* * Process the configuration file. diff --git a/src/chrtrans/cp1256_uni.tbl b/src/chrtrans/cp1256_uni.tbl index c1bbcfde..267aaefd 100644 --- a/src/chrtrans/cp1256_uni.tbl +++ b/src/chrtrans/cp1256_uni.tbl @@ -9,10 +9,10 @@ C1256 # # Name: cp1256 to Unicode table -# Unicode version: 2.0 +# Unicode version: 2.1 # Table version: 2.01 # Table format: Format A -# Date: 04/15/98 +# Date: 01/5/99 # # Contact: cpxlate@microsoft.com # @@ -39,12 +39,12 @@ C1256 0x87 U+2021 #DOUBLE DAGGER 0x88 U+02C6 #MODIFIER LETTER CIRCUMFLEX ACCENT 0x89 U+2030 #PER MILLE SIGN -0x8A #UNDEFINED +0x8A U+0679 #ARABIC LETTER TTEH 0x8B U+2039 #SINGLE LEFT-POINTING ANGLE QUOTATION MARK 0x8C U+0152 #LATIN CAPITAL LIGATURE OE 0x8D U+0686 #ARABIC LETTER TCHEH 0x8E U+0698 #ARABIC LETTER JEH -0x8F #UNDEFINED +0x8F U+0688 #ARABIC LETTER DDAL 0x90 U+06AF #ARABIC LETTER GAF 0x91 U+2018 #LEFT SINGLE QUOTATION MARK 0x92 U+2019 #RIGHT SINGLE QUOTATION MARK @@ -53,14 +53,14 @@ C1256 0x95 U+2022 #BULLET 0x96 U+2013 #EN DASH 0x97 U+2014 #EM DASH -0x98 #UNDEFINED +0x98 U+06A9 #ARABIC LETTER KEHEH 0x99 U+2122 #TRADE MARK SIGN -0x9A #UNDEFINED +0x9A U+0691 #ARABIC LETTER RREH 0x9B U+203A #SINGLE RIGHT-POINTING ANGLE QUOTATION MARK 0x9C U+0153 #LATIN SMALL LIGATURE OE 0x9D U+200C #ZERO WIDTH NON-JOINER 0x9E U+200D #ZERO WIDTH JOINER -0x9F #UNDEFINED +0x9F U+06BA #ARABIC LETTER NOON GHUNNA 0xA0 U+00A0 #NO-BREAK SPACE 0xA1 U+060C #ARABIC COMMA 0xA2 U+00A2 #CENT SIGN @@ -71,7 +71,7 @@ C1256 0xA7 U+00A7 #SECTION SIGN 0xA8 U+00A8 #DIAERESIS 0xA9 U+00A9 #COPYRIGHT SIGN -0xAA #UNDEFINED +0xAA U+06BE #ARABIC LETTER HEH DOACHASHMEE 0xAB U+00AB #LEFT-POINTING DOUBLE ANGLE QUOTATION MARK 0xAC U+00AC #NOT SIGN 0xAD U+00AD #SOFT HYPHEN @@ -93,7 +93,7 @@ C1256 0xBD U+00BD #VULGAR FRACTION ONE HALF 0xBE U+00BE #VULGAR FRACTION THREE QUARTERS 0xBF U+061F #ARABIC QUESTION MARK -0xC0 #UNDEFINED +0xC0 U+06C1 #ARABIC LETTER HEH GOAL 0xC1 U+0621 #ARABIC LETTER HAMZA 0xC2 U+0622 #ARABIC LETTER ALEF WITH MADDA ABOVE 0xC3 U+0623 #ARABIC LETTER ALEF WITH HAMZA ABOVE @@ -156,4 +156,4 @@ C1256 0xFC U+00FC #LATIN SMALL LETTER U WITH DIAERESIS 0xFD U+200E #LEFT-TO-RIGHT MARK 0xFE U+200F #RIGHT-TO-LEFT MARK -0xFF #UNDEFINED +0xFF U+06D2 #ARABIC LETTER YEH BARREE |