aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>1998-08-15 22:09:45 -0400
committerThomas E. Dickey <dickey@invisible-island.net>1998-08-15 22:09:45 -0400
commit0eae931d4f0fd1194dfcd978c3d94079b710923f (patch)
tree5713fc8c66fffb144192357464fe616522c6c7fe /src
parentd7e8d7e419ae58610a9988ff09910670a59526ff (diff)
downloadlynx-snapshots-0eae931d4f0fd1194dfcd978c3d94079b710923f.tar.gz
snapshot of project "lynx", label v2-8-1dev_21
Diffstat (limited to 'src')
-rw-r--r--src/GridText.c48
-rw-r--r--src/HTAlert.c43
-rw-r--r--src/HTAlert.h3
-rw-r--r--src/HTFWriter.c24
-rw-r--r--src/HTInit.c1
-rw-r--r--src/HTML.c60
-rw-r--r--src/LYBookmark.c134
-rw-r--r--src/LYCgi.c28
-rw-r--r--src/LYCharSets.c15
-rw-r--r--src/LYCharUtils.c12
-rw-r--r--src/LYCookie.c16
-rw-r--r--src/LYCurses.c7
-rw-r--r--src/LYDownload.c12
-rw-r--r--src/LYEdit.c12
-rw-r--r--src/LYExtern.c7
-rw-r--r--src/LYForms.c72
-rw-r--r--src/LYGetFile.c98
-rw-r--r--src/LYGlobalDefs.h1
-rw-r--r--src/LYHistory.c12
-rw-r--r--src/LYJump.c15
-rw-r--r--src/LYKeymap.c35
-rw-r--r--src/LYList.c10
-rw-r--r--src/LYLocal.c186
-rw-r--r--src/LYMail.c33
-rw-r--r--src/LYMain.c8
-rw-r--r--src/LYMainLoop.c412
-rw-r--r--src/LYNews.c21
-rw-r--r--src/LYOptions.c1008
-rw-r--r--src/LYPrint.c67
-rw-r--r--src/LYReadCFG.c2
-rw-r--r--src/LYSearch.c13
-rw-r--r--src/LYShowInfo.c3
-rw-r--r--src/LYStrings.c81
-rw-r--r--src/LYUpload.c20
-rw-r--r--src/LYUtils.c49
-rw-r--r--src/LYUtils.h2
-rw-r--r--src/makefile.wsl2
37 files changed, 1192 insertions, 1380 deletions
diff --git a/src/GridText.c b/src/GridText.c
index 192b9d21..a678ad48 100644
--- a/src/GridText.c
+++ b/src/GridText.c
@@ -112,8 +112,8 @@ typedef struct _stylechange {
typedef struct _line {
struct _line *next;
struct _line *prev;
- int unsigned offset; /* Implicit initial spaces */
- int unsigned size; /* Number of characters */
+ unsigned offset; /* Implicit initial spaces */
+ unsigned size; /* Number of characters */
BOOL split_after; /* Can we split after? */
BOOL bullet; /* Do we bullet? */
#if defined(USE_COLOR_STYLE)
@@ -1489,8 +1489,7 @@ PRIVATE void display_page ARGS3(
* to use half-page or two-line scrolling. - FM
*/
if (LYCursesON) {
- _statusline(MAXLINKS_REACHED);
- sleep(AlertSecs);
+ HTAlert(MAXLINKS_REACHED);
}
CTRACE(tfp, "\ndisplay_page: MAXLINKS reached.\n");
break;
@@ -2021,6 +2020,8 @@ PUBLIC void HText_appendCharacter ARGS2(
HTStyle * style;
int indent;
+ CTRACE(tfp, "add(%c) %d/%d\n", ch,
+ HTisDocumentSource(), HTOutputFormat != WWW_SOURCE);
/*
* Make sure we don't crash on NULLs.
*/
@@ -2343,16 +2344,17 @@ PUBLIC void HText_appendCharacter ARGS2(
line->data[--line->size] = '\0';
ctrl_chars_on_this_line--;
}
- here = (((int)line->size + (int)line->offset) + indent)
+ here = ((int)(line->size + line->offset) + indent)
- ctrl_chars_on_this_line; /* Consider special chars GAB */
if (style->tabs) { /* Use tab table */
for (Tab = style->tabs;
Tab->position <= here;
- Tab++)
+ Tab++) {
if (!Tab->position) {
new_line(text);
return;
}
+ }
target = Tab->position;
} else if (text->in_line_1) { /* Use 2nd indent */
if (here >= (int)style->leftIndent) {
@@ -2374,7 +2376,6 @@ PUBLIC void HText_appendCharacter ARGS2(
if (target > (LYcols-1) - (int)style->rightIndent &&
HTOutputFormat != WWW_SOURCE) {
new_line(text);
- return;
} else {
/*
* Can split here. - FM
@@ -2389,10 +2390,24 @@ PUBLIC void HText_appendCharacter ARGS2(
line->data[line->size] = '\0';
}
}
- return;
}
- /*NOTREACHED*/
+ return;
} /* if tab */
+ else {
+ /*
+ * If we're displaying document source, wrap long lines to keep all of
+ * the source visible. Note that we splice the pieces together with
+ * a recursion on this function to supply the character that is removed
+ * by 'split_line'.
+ */
+ int target = (int)(line->offset + line->size);
+ if ((target > (LYcols-1) - style->rightIndent) &&
+ HTisDocumentSource()) {
+ int gap = line->data[line->size - 1];
+ new_line(text);
+ HText_appendCharacter (text, gap);
+ }
+ }
if (ch == ' ') {
@@ -4509,8 +4524,7 @@ get_query:
/*
* Search cancelled.
*/
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
return(NULLFILE);
}
@@ -4519,8 +4533,7 @@ get_query:
*/
LYTrimLeading(searchstring);
if (!(*searchstring)) {
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
return(NULLFILE);
}
LYTrimTrailing(searchstring);
@@ -4529,8 +4542,7 @@ get_query:
* Don't resubmit the same query unintentionally.
*/
if (!LYforce_no_cache && 0 == strcmp(temp, searchstring)) {
- _statusline(USE_C_R_TO_RESUB_CUR_QUERY);
- sleep(MessageSecs);
+ HTUserMsg(USE_C_R_TO_RESUB_CUR_QUERY);
return(NULLFILE);
}
@@ -5154,8 +5166,7 @@ PUBLIC void www_user_search ARGS3(
tentative_result = count;
break;
} else if (count > start_line) { /* next line */
- _user_message(STRING_NOT_FOUND, target);
- sleep(MessageSecs);
+ HTUserMsg2(STRING_NOT_FOUND, target);
return; /* end */
} else {
line = line->next;
@@ -7716,7 +7727,7 @@ PUBLIC void HText_SubmitForm ARGS4(
FREE(previous_blanks);
if (submit_item->submit_method == URL_MAIL_METHOD) {
- _user_message("Submitting %s", submit_item->submit_action);
+ HTUserMsg2("Submitting %s", submit_item->submit_action);
CTRACE(tfp, "\nGridText - mailto_address: %s\n",
(submit_item->submit_action+7));
CTRACE(tfp, "GridText - mailto_subject: %s\n",
@@ -7726,7 +7737,6 @@ PUBLIC void HText_SubmitForm ARGS4(
(HText_getTitle() ?
HText_getTitle() : "")));
CTRACE(tfp,"GridText - mailto_content: %s\n",query);
- sleep(MessageSecs);
mailform((submit_item->submit_action+7),
((submit_item->submit_title &&
*submit_item->submit_title) ?
diff --git a/src/HTAlert.c b/src/HTAlert.c
index fd5440d2..7ef0d1ca 100644
--- a/src/HTAlert.c
+++ b/src/HTAlert.c
@@ -39,6 +39,37 @@ PUBLIC void HTAlert ARGS1(
sleep(AlertSecs);
}
+/* Issue an informational message. HTInfoMsg()
+** --------------------------------
+*/
+PUBLIC void HTInfoMsg ARGS1(
+ CONST char *, Msg)
+{
+ _statusline(Msg);
+ if (Msg && *Msg)
+ sleep(InfoSecs);
+}
+
+/* Issue an important message. HTUserMsg()
+** --------------------------------
+*/
+PUBLIC void HTUserMsg ARGS1(
+ CONST char *, Msg)
+{
+ _statusline(Msg);
+ if (Msg && *Msg)
+ sleep(MessageSecs);
+}
+
+PUBLIC void HTUserMsg2 ARGS2(
+ CONST char *, Msg,
+ CONST char *, Arg)
+{
+ _user_message(Msg, Arg);
+ if (Msg && *Msg)
+ sleep(MessageSecs);
+}
+
/* Issue a progress message. HTProgress()
** -------------------------
*/
@@ -454,8 +485,7 @@ PUBLIC BOOL HTConfirmCookie ARGS4(
** Set to accept all cookies for this domain.
*/
de->bv = ACCEPT_ALWAYS;
- _user_message(ALWAYS_ALLOWING_COOKIES, de->domain);
- sleep(MessageSecs);
+ HTUserMsg2(ALWAYS_ALLOWING_COOKIES, de->domain);
return TRUE;
case 'N':
@@ -464,8 +494,7 @@ PUBLIC BOOL HTConfirmCookie ARGS4(
/*
** Reject the cookie.
*/
- _statusline(REJECTING_COOKIE);
- sleep(MessageSecs);
+ HTUserMsg(REJECTING_COOKIE);
return FALSE;
case 'V':
@@ -473,16 +502,14 @@ PUBLIC BOOL HTConfirmCookie ARGS4(
** Set to reject all cookies from this domain.
*/
de->bv = REJECT_ALWAYS;
- _user_message(NEVER_ALLOWING_COOKIES, de->domain);
- sleep(MessageSecs);
+ HTUserMsg2(NEVER_ALLOWING_COOKIES, de->domain);
return FALSE;
case 'Y':
/*
** Accept the cookie.
*/
- _statusline(ALLOWING_COOKIE);
- sleep(InfoSecs);
+ HTInfoMsg(ALLOWING_COOKIE);
return TRUE;
default:
diff --git a/src/HTAlert.h b/src/HTAlert.h
index 9327bb2d..018bf503 100644
--- a/src/HTAlert.h
+++ b/src/HTAlert.h
@@ -27,6 +27,9 @@ extern char * HTPrompt PARAMS((CONST char * Msg, CONST char * deflt));
** The input is a list of parameters for printf.
*/
extern void HTAlert PARAMS((CONST char * Msg));
+extern void HTInfoMsg PARAMS((CONST char * Msg));
+extern void HTUserMsg PARAMS((CONST char * Msg));
+extern void HTUserMsg2 PARAMS((CONST char * Msg, CONST char * Arg));
/* Display a progress message for information (and diagnostics) only
diff --git a/src/HTFWriter.c b/src/HTFWriter.c
index 49884d79..3d9ae874 100644
--- a/src/HTFWriter.c
+++ b/src/HTFWriter.c
@@ -512,8 +512,7 @@ PUBLIC HTStream* HTSaveAndExecute ARGS3(
return(NULL);
}
if (no_exec) {
- _statusline(EXECUTION_DISABLED);
- sleep(AlertSecs);
+ HTAlert(EXECUTION_DISABLED);
return HTPlainPresent(pres, anchor, sink);
}
if (!local_exec)
@@ -526,8 +525,7 @@ PUBLIC HTStream* HTSaveAndExecute ARGS3(
sprintf(buf, EXECUTION_DISABLED_FOR_FILE,
key_for_func(LYK_OPTIONS));
- _statusline(buf);
- sleep(AlertSecs);
+ HTAlert(buf);
return HTPlainPresent(pres, anchor, sink);
}
}
@@ -547,7 +545,7 @@ PUBLIC HTStream* HTSaveAndExecute ARGS3(
me->sink = sink;
if (LYCachedTemp(fnam, &(anchor->FileCache))) {
- me->fp = LYNewBinFile (fnam);
+ me->fp = LYNewBinFile (fnam);
} else {
/*
* Check for a suffix.
@@ -652,8 +650,7 @@ PUBLIC HTStream* HTSaveToFile ARGS3(
if (traversal ||
(no_download && !override_no_download && no_disk_save)) {
if (!traversal) {
- _statusline(CANNOT_DISPLAY_FILE);
- sleep(AlertSecs);
+ HTAlert(CANNOT_DISPLAY_FILE);
}
LYCancelDownload = TRUE;
if (traversal)
@@ -744,8 +741,7 @@ PUBLIC HTStream* HTSaveToFile ARGS3(
* Unix folks don't need to know this, but we'll show it to
* them, too. - FM
*/
- user_message("Content-type: %s", pres->rep->name);
- sleep(MessageSecs);
+ HTUserMsg2("Content-type: %s", pres->rep->name);
StrAllocCopy(WWW_Download_File,fnam);
@@ -796,6 +792,8 @@ Prepend_BASE:
* Note that the markup will be technically invalid if a DOCTYPE
* declaration, or HTML or HEAD tags, are present, and thus the
* file may need editing for perfection. - FM
+ *
+ * Add timestamp (last reload).
*/
char *temp = NULL;
@@ -812,8 +810,12 @@ Prepend_BASE:
}
fprintf(ret_obj->fp,
- "<!-- X-URL: %s -->\n<BASE HREF=\"%s\">\n\n",
- anchor->address, (temp ? temp : anchor->address));
+ "<!-- X-URL: %s -->\n", anchor->address);
+ if (anchor->date && *anchor->date)
+ fprintf(ret_obj->fp,
+ "<!-- Date: %s -->\n", anchor->date);
+ fprintf(ret_obj->fp,
+ "<BASE HREF=\"%s\">\n\n", (temp ? temp : anchor->address));
FREE(temp);
}
if (LYPrependCharsetToSource &&
diff --git a/src/HTInit.c b/src/HTInit.c
index 4d7227ec..69efa8e7 100644
--- a/src/HTInit.c
+++ b/src/HTInit.c
@@ -848,6 +848,7 @@ PUBLIC void HTFileInit NOARGS
HTSetSuffix(".ht3", "text/html", "8bit", 1.0);
HTSetSuffix(".phtml", "text/html", "8bit", 1.0);
HTSetSuffix(".shtml", "text/html", "8bit", 1.0);
+ HTSetSuffix(".sht", "text/html", "8bit", 1.0);
HTSetSuffix(".htmlx", "text/html", "8bit", 1.0);
HTSetSuffix(".htm", "text/html", "8bit", 1.0);
HTSetSuffix(".html", "text/html", "8bit", 1.0);
diff --git a/src/HTML.c b/src/HTML.c
index 39ed1ae8..5ecbbada 100644
--- a/src/HTML.c
+++ b/src/HTML.c
@@ -4052,9 +4052,8 @@ PRIVATE void HTML_start_element ARGS6(
fprintf(tfp,
"Bad HTML: BUTTON tag not within FORM tag\n");
} else if (!me->inBadHTML) {
- _statusline(BAD_HTML_USE_TRACE);
+ HTUserMsg(BAD_HTML_USE_TRACE);
me->inBadHTML = TRUE;
- sleep(MessageSecs);
}
/*
* We'll process it, since the chances of a crash are
@@ -4298,9 +4297,8 @@ PRIVATE void HTML_start_element ARGS6(
fprintf(tfp,
"Bad HTML: INPUT tag not within FORM tag\n");
} else if (!me->inBadHTML) {
- _statusline(BAD_HTML_USE_TRACE);
+ HTUserMsg(BAD_HTML_USE_TRACE);
me->inBadHTML = TRUE;
- sleep(MessageSecs);
}
/*
* We'll process it, since the chances of a crash are
@@ -4318,9 +4316,8 @@ PRIVATE void HTML_start_element ARGS6(
fprintf(tfp,
"Bad HTML: Missing TEXTAREA end tag.\n");
} else if (!me->inBadHTML) {
- _statusline(BAD_HTML_USE_TRACE);
+ HTUserMsg(BAD_HTML_USE_TRACE);
me->inBadHTML = TRUE;
- sleep(MessageSecs);
}
}
@@ -4669,9 +4666,8 @@ PRIVATE void HTML_start_element ARGS6(
fprintf(tfp,
"Bad HTML: TEXTAREA start tag not within FORM tag\n");
} else if (!me->inBadHTML) {
- _statusline(BAD_HTML_USE_TRACE);
+ HTUserMsg(BAD_HTML_USE_TRACE);
me->inBadHTML = TRUE;
- sleep(MessageSecs);
}
/*
* Too likely to cause a crash, so we'll ignore it. - FM
@@ -4760,9 +4756,8 @@ PRIVATE void HTML_start_element ARGS6(
fprintf(tfp,
"Bad HTML: SELECT start tag in SELECT element. Faking SELECT end tag. *****\n");
} else if (!me->inBadHTML) {
- _statusline(BAD_HTML_USE_TRACE);
+ HTUserMsg(BAD_HTML_USE_TRACE);
me->inBadHTML = TRUE;
- sleep(MessageSecs);
}
if (me->sp->tag_number != HTML_SELECT) {
SET_SKIP_STACK(HTML_SELECT);
@@ -4794,9 +4789,8 @@ PRIVATE void HTML_start_element ARGS6(
fprintf(tfp,
"Bad HTML: OPTION tag not within SELECT tag\n");
} else if (!me->inBadHTML) {
- _statusline(BAD_HTML_USE_TRACE);
+ HTUserMsg(BAD_HTML_USE_TRACE);
me->inBadHTML = TRUE;
- sleep(MessageSecs);
}
/*
@@ -5384,9 +5378,8 @@ PRIVATE void HTML_end_element ARGS3(
if (TRACE) {
fprintf(tfp, "Bad HTML: Missing TEXTAREA end tag\n");
} else if (!me->inBadHTML) {
- _statusline(BAD_HTML_USE_TRACE);
+ HTUserMsg(BAD_HTML_USE_TRACE);
me->inBadHTML = TRUE;
- sleep(MessageSecs);
}
}
@@ -5410,9 +5403,8 @@ PRIVATE void HTML_end_element ARGS3(
((me->inSELECT || me->inTEXTAREA) && me->inA) ? ", " : "",
me->inA ? "A" : "");
} else if (!me->inBadHTML) {
- _statusline(BAD_HTML_USE_TRACE);
+ HTUserMsg(BAD_HTML_USE_TRACE);
me->inBadHTML = TRUE;
- sleep(MessageSecs);
}
}
break;
@@ -5513,9 +5505,8 @@ PRIVATE void HTML_end_element ARGS3(
((me->inSELECT || me->inTEXTAREA) && me->inA) ? ", " : "",
me->inA ? "A" : "");
} else if (!me->inBadHTML) {
- _statusline(BAD_HTML_USE_TRACE);
+ HTUserMsg(BAD_HTML_USE_TRACE);
me->inBadHTML = TRUE;
- sleep(MessageSecs);
}
}
break;
@@ -5876,9 +5867,8 @@ PRIVATE void HTML_end_element ARGS3(
"Bad HTML: Unmatched OBJECT start and end tags. Discarding content:\n%s\n",
me->object.data);
} else if (!me->inBadHTML) {
- _statusline(BAD_HTML_USE_TRACE);
+ HTUserMsg(BAD_HTML_USE_TRACE);
me->inBadHTML = TRUE;
- sleep(MessageSecs);
}
goto End_Object;
}
@@ -5949,9 +5939,8 @@ PRIVATE void HTML_end_element ARGS3(
fprintf(tfp,
"Bad HTML: Unmatched OBJECT start and end tags. Discarding content.\n");
} else if (!me->inBadHTML) {
- _statusline(BAD_HTML_USE_TRACE);
+ HTUserMsg(BAD_HTML_USE_TRACE);
me->inBadHTML = TRUE;
- sleep(MessageSecs);
}
goto End_Object;
}
@@ -6148,9 +6137,8 @@ End_Object:
if (TRACE) {
fprintf(tfp, "Bad HTML: Unmatched FORM end tag\n");
} else if (!me->inBadHTML) {
- _statusline(BAD_HTML_USE_TRACE);
+ HTUserMsg(BAD_HTML_USE_TRACE);
me->inBadHTML = TRUE;
- sleep(MessageSecs);
}
}
@@ -6170,9 +6158,8 @@ End_Object:
fprintf(tfp,
"Bad HTML: Open SELECT at FORM end. Faking SELECT end tag. *****\n");
} else if (!me->inBadHTML) {
- _statusline(BAD_HTML_USE_TRACE);
+ HTUserMsg(BAD_HTML_USE_TRACE);
me->inBadHTML = TRUE;
- sleep(MessageSecs);
}
if (me->sp->tag_number != HTML_SELECT) {
SET_SKIP_STACK(HTML_SELECT);
@@ -6228,9 +6215,8 @@ End_Object:
if (TRACE) {
fprintf(tfp, "Bad HTML: Unmatched TEXTAREA end tag\n");
} else if (!me->inBadHTML) {
- _statusline(BAD_HTML_USE_TRACE);
+ HTUserMsg(BAD_HTML_USE_TRACE);
me->inBadHTML = TRUE;
- sleep(MessageSecs);
}
break;
}
@@ -6408,9 +6394,8 @@ End_Object:
if (TRACE) {
fprintf(tfp, "Bad HTML: Unmatched SELECT end tag *****\n");
} else if (!me->inBadHTML) {
- _statusline(BAD_HTML_USE_TRACE);
+ HTUserMsg(BAD_HTML_USE_TRACE);
me->inBadHTML = TRUE;
- sleep(MessageSecs);
}
break;
}
@@ -6433,9 +6418,8 @@ End_Object:
fprintf(tfp,
"Bad HTML: SELECT end tag not within FORM element *****\n");
} else if (!me->inBadHTML) {
- _statusline(BAD_HTML_USE_TRACE);
+ HTUserMsg(BAD_HTML_USE_TRACE);
me->inBadHTML = TRUE;
- sleep(MessageSecs);
}
/*
* Hopefully won't crash, so we'll ignore it. - kw
@@ -6731,9 +6715,8 @@ PRIVATE void HTML_free ARGS1(HTStructured *, me)
fprintf(tfp,
"Bad HTML: SELECT or OPTION not ended properly *****\n");
} else if (!me->inBadHTML) {
- _statusline(BAD_HTML_USE_TRACE);
+ HTUserMsg(BAD_HTML_USE_TRACE);
me->inBadHTML = TRUE;
- sleep(MessageSecs);
}
HTChunkTerminate(&me->option);
/*
@@ -6755,9 +6738,8 @@ PRIVATE void HTML_free ARGS1(HTStructured *, me)
fprintf(tfp,
"Bad HTML: TEXTAREA not used properly *****\n");
} else if (!me->inBadHTML) {
- _statusline(BAD_HTML_USE_TRACE);
+ HTUserMsg(BAD_HTML_USE_TRACE);
me->inBadHTML = TRUE;
- sleep(MessageSecs);
}
HTChunkTerminate(&me->textarea);
/*
@@ -6802,9 +6784,8 @@ PRIVATE void HTML_free ARGS1(HTStructured *, me)
fprintf(tfp,
"Bad HTML: SELECT or OPTION not ended properly *****\n");
} else if (!me->inBadHTML) {
- _statusline(BAD_HTML_USE_TRACE);
+ HTUserMsg(BAD_HTML_USE_TRACE);
me->inBadHTML = TRUE;
- sleep(MessageSecs);
}
if (TRACE) {
HTChunkTerminate(&me->option);
@@ -6823,9 +6804,8 @@ PRIVATE void HTML_free ARGS1(HTStructured *, me)
fprintf(tfp,
"Bad HTML: TEXTAREA not used properly *****\n");
} else if (!me->inBadHTML) {
- _statusline(BAD_HTML_USE_TRACE);
+ HTUserMsg(BAD_HTML_USE_TRACE);
me->inBadHTML = TRUE;
- sleep(MessageSecs);
}
if (TRACE) {
HTChunkTerminate(&me->textarea);
diff --git a/src/LYBookmark.c b/src/LYBookmark.c
index b08ea97f..a75c5eaa 100644
--- a/src/LYBookmark.c
+++ b/src/LYBookmark.c
@@ -7,7 +7,8 @@
#include <LYSignal.h>
#include <LYSystem.h>
#include <LYKeymap.h>
-#include <LYCharUtils.h>
+#include <LYCharUtils.h> /* need for META charset */
+#include <LYCharSets.h> /* need for LYHaveCJKCharacterSet */
#include <LYCurses.h>
#include <GridText.h>
@@ -64,8 +65,7 @@ PUBLIC char * get_bookmark_filename ARGS1(
sprintf(string_buffer,
BOOKMARK_FILE_NOT_DEFINED,
key_for_func(LYK_OPTIONS));
- _statusline(string_buffer);
- sleep(AlertSecs);
+ HTAlert(string_buffer);
/*
* Space flags an undefined selection. - FMG
*/
@@ -178,6 +178,9 @@ PRIVATE char * convert_mosaic_bookmark_file ARGS1(
return(newfile);
}
+PRIVATE BOOLEAN have8bit PARAMS((char *Title));
+PRIVATE char* title_convert8bit PARAMS((char *Title));
+
/*
* Adds a link to a bookmark file, creating the file
* if it doesn't already exist, and making sure that
@@ -279,9 +282,16 @@ PUBLIC void save_bookmark_link ARGS2(
* Create the Title with any left-angle-brackets
* converted to &lt; entities and any ampersands
* converted to &amp; entities. - FM
+ *
+ * Convert 8-bit letters to &#xUUUU to avoid dependencies
+ * from display character set which may need changing.
+ * Do NOT convert any 8-bit chars if we have CJK display. - LP
*/
StrAllocCopy(Title, string_buffer);
LYEntify(&Title, TRUE);
+ if (LYSaveBookmarksInUnicode &&
+ have8bit(Title) && (!LYHaveCJKCharacterSet))
+ StrAllocCopy(Title, title_convert8bit(Title));
/*
* Create the bookmark file, if it doesn't exist already,
@@ -315,6 +325,7 @@ PUBLIC void save_bookmark_link ARGS2(
/*
* If we created a new bookmark file, write the headers. - FM
+ * Once and forever...
*/
if (first_time) {
fprintf(fp,"<head>\n");
@@ -325,8 +336,13 @@ PUBLIC void save_bookmark_link ARGS2(
the 'R' key but may have been remapped by you or your system\n\
administrator.<br>\n\
This file also may be edited with a standard text editor to delete\n\
- outdated or invalid links, or to change their order, but you should\n\
- not change the format within the lines or add other HTML markup.\n\n\
+ outdated or invalid links, or to change their order.\n\n\
+<!--\n\
+Note: if you edit this file manually\n\
+ you should not change the format within the lines\n\
+ or add other HTML markup.\n\
+ Make sure any bookmark link saved as a single line\n\
+-->\n\n\
<p>\n<ol>\n");
}
@@ -419,16 +435,14 @@ PUBLIC void remove_bookmark_link ARGS2(
CTRACE(tfp, "\nremove_bookmark_link: SEEKING %s\n AS %s\n\n",
cur_bookmark_page, filename_buffer);
if ((fp = fopen(filename_buffer, "r")) == NULL) {
- _statusline(BOOKMARK_OPEN_FAILED_FOR_DEL);
- sleep(AlertSecs);
+ HTAlert(BOOKMARK_OPEN_FAILED_FOR_DEL);
return;
}
LYAddPathToHome(homepath, sizeof(homepath), "");
if ((nfp = LYOpenScratch(newfile, homepath)) == 0) {
fclose(fp);
- _statusline(BOOKSCRA_OPEN_FAILED_FOR_DEL);
- sleep(AlertSecs);
+ HTAlert(BOOKSCRA_OPEN_FAILED_FOR_DEL);
return;
}
@@ -441,8 +455,7 @@ PUBLIC void remove_bookmark_link ARGS2(
(void) chmod(newfile, mode);
if ((nfp = LYReopenTemp(newfile)) == NULL) {
(void) fclose(fp);
- _statusline(BOOKTEMP_REOPEN_FAIL_FOR_DEL);
- sleep(AlertSecs);
+ HTAlert(BOOKTEMP_REOPEN_FAIL_FOR_DEL);
return;
}
}
@@ -474,8 +487,7 @@ PUBLIC void remove_bookmark_link ARGS2(
if (++n == cur) {
if (seen != 1 || !LYstrstr(buf, "</a>") ||
LYstrstr((cp + 1), "<a href=")) {
- _statusline(BOOKMARK_LINK_NOT_ONE_LINE);
- sleep(AlertSecs);
+ HTAlert(BOOKMARK_LINK_NOT_ONE_LINE);
goto failure;
}
CTRACE(tfp, "remove_bookmark_link: skipping link %d\n", n);
@@ -514,8 +526,7 @@ PUBLIC void remove_bookmark_link ARGS2(
CTRACE(tfp, "remove_bookmark_link: %s\n", buffer);
if( system( buffer ) ) {
- _statusline(BOOKTEMP_COPY_FAIL);
- sleep(AlertSecs);
+ HTAlert(BOOKTEMP_COPY_FAIL);
} else {
return;
}
@@ -558,19 +569,17 @@ PUBLIC void remove_bookmark_link ARGS2(
#endif /* !VMS */
#ifdef VMS
- _statusline(ERROR_RENAMING_SCRA);
+ HTAlert(ERROR_RENAMING_SCRA);
#else
- _statusline(ERROR_RENAMING_TEMP);
+ HTAlert(ERROR_RENAMING_TEMP);
#endif /* VMS */
if (TRACE)
perror("renaming the file");
- sleep(AlertSecs);
}
#endif /* UNIX */
failure:
- _statusline(BOOKMARK_DEL_FAILED);
- sleep(AlertSecs);
+ HTAlert(BOOKMARK_DEL_FAILED);
LYCloseTempFP(nfp);
if (fp != NULL)
fclose(fp);
@@ -707,8 +716,7 @@ PUBLIC int select_menu_multi_bookmarks NOARGS
/*
* Too small.
*/
- _statusline(MULTIBOOKMARKS_SMALL);
- sleep(AlertSecs);
+ HTAlert(MULTIBOOKMARKS_SMALL);
return (-2);
}
/*
@@ -880,7 +888,7 @@ PUBLIC BOOLEAN LYHaveSubBookmarks NOARGS
* _statusline() so that any multibyte/CJK characters in the
* string will be handled properly. - FM
*/
- PUBLIC void LYMBM_statusline ARGS1(
+PUBLIC void LYMBM_statusline ARGS1(
char *, text)
{
if (LYMultiBookmarks == TRUE && user_mode == NOVICE_MODE) {
@@ -891,3 +899,83 @@ PUBLIC BOOLEAN LYHaveSubBookmarks NOARGS
_statusline(text);
}
}
+
+/*
+ * Check whether string have 8 bit chars.
+ */
+PRIVATE BOOLEAN have8bit ARGS1(char *, Title)
+{
+ CONST char *p = Title;
+
+ for ( ; *p; p++) {
+ if ((unsigned char)*p > 127)
+ return(TRUE);
+ }
+ return(FALSE); /* if we came here */
+}
+
+/*
+ * Ok, title have 8-bit characters and they are in display charset.
+ * Bookmarks is a permanent file. To avoid dependencies from display
+ * character set which may be changed with time
+ * we store 8-bit characters as numeric character reference (NCR),
+ * so where the character encoded as unicode number in form of &#xUUUU;
+ *
+ * To make bookmarks more readable for human (&#xUUUU certainly not)
+ * we add a comment with '7-bit approximation' from the converted string.
+ * This is a valid HTML and bookmarks code.
+ *
+ * We do not want use META charset tag in bookmarks file:
+ * it will never be changed later :-(
+ * NCR's translation is part of I18N and HTML4.0
+ * supported starting with Lynx 2.7.2,
+ * Netscape 4.0 and MSIE 4.0.
+ * Older versions fail.
+ *
+ */
+PRIVATE char* title_convert8bit ARGS1(char *, Title)
+{
+ CONST char *p = Title;
+ char temp[256];
+ char *q = temp;
+ char *comment = NULL;
+ char *ncr = NULL;
+ char *buf = NULL;
+
+ for ( ; *p; p++) {
+ LYstrncpy(q, p, 1);
+ if ((unsigned char)*q <= 127) {
+ StrAllocCat(comment, q);
+ StrAllocCat(ncr, q);
+ } else {
+ int charset_in, charset_out, uck;
+ long unicode;
+ char replace_buf [10], replace_buf2 [10];
+
+ charset_in = current_char_set;
+ charset_out = UCGetLYhndl_byMIME("us-ascii");
+
+ uck = UCTransCharStr(replace_buf, sizeof(replace_buf), *q,
+ charset_in, charset_out, YES);
+ if (uck >0)
+ StrAllocCat(comment, replace_buf);
+
+ unicode = UCTransToUni( *q, charset_in);
+
+ StrAllocCat(ncr, "&#");
+ sprintf(replace_buf2, "%ld", unicode);
+ StrAllocCat(ncr, replace_buf2);
+ StrAllocCat(ncr, ";");
+ }
+ }
+
+ /*
+ * valid bookmark should be a single line (no linebreaks!).
+ */
+ StrAllocCat(buf, "<!-- ");
+ StrAllocCat(buf, comment);
+ StrAllocCat(buf, " -->");
+ StrAllocCat(buf, ncr);
+
+ return(buf);
+}
diff --git a/src/LYCgi.c b/src/LYCgi.c
index c70db2d4..5c51fe9b 100644
--- a/src/LYCgi.c
+++ b/src/LYCgi.c
@@ -46,6 +46,10 @@
#include <LYLeaks.h>
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+
struct _HTStream
{
HTStreamClass * isa;
@@ -118,7 +122,7 @@ PRIVATE int LYLoadCGI ARGS4(
HTFormat, format_out,
HTStream*, sink)
{
- int status;
+ int status = 0;
#ifdef LYNXCGI_LINKS
#ifndef VMS
char *cp;
@@ -249,8 +253,7 @@ PRIVATE int LYLoadCGI ARGS4(
status = HT_NOT_LOADED;
} else if (no_lynxcgi) {
- _statusline(CGI_DISABLED);
- sleep(MessageSecs);
+ HTUserMsg(CGI_DISABLED);
status = HT_NOT_LOADED;
} else if (no_bookmark_exec &&
@@ -265,8 +268,7 @@ PRIVATE int LYLoadCGI ARGS4(
* no_bookmark_exec is TRUE an we are not now coming from a
* bookmark page. - kw
*/
- _statusline(BOOKMARK_EXEC_DISABLED);
- sleep(MessageSecs);
+ HTUserMsg(BOOKMARK_EXEC_DISABLED);
status = HT_NOT_LOADED;
} else if (anAnchor != HTMainAnchor &&
@@ -312,8 +314,7 @@ PRIVATE int LYLoadCGI ARGS4(
if (!target || target == NULL) {
sprintf(buf, CANNOT_CONVERT_I_TO_O,
HTAtom_name(format_in), HTAtom_name(format_out));
- _statusline(buf);
- sleep(AlertSecs);
+ HTAlert(buf);
status = HT_NOT_LOADED;
} else if (anAnchor->post_data && pipe(fd1) < 0) {
@@ -426,7 +427,7 @@ PRIVATE int LYLoadCGI ARGS4(
char post_len[32];
int argv_cnt = 3; /* name, one arg and terminator */
char **cur_argv = NULL;
- char buf[BUFSIZ];
+ char buf2[BUFSIZ];
/* Set up output pipe */
close(fd2[0]);
@@ -434,10 +435,10 @@ PRIVATE int LYLoadCGI ARGS4(
dup2(fd2[1], fileno(stderr));
close(fd2[1]);
- sprintf(buf, "HTTP_ACCEPT_LANGUAGE=%.*s",
- (int)(sizeof(buf) - 22), language);
- buf[(sizeof(buf) - 1)] = '\0';
- add_environment_value(buf);
+ sprintf(buf2, "HTTP_ACCEPT_LANGUAGE=%.*s",
+ (int)(sizeof(buf2) - 22), language);
+ buf2[(sizeof(buf2) - 1)] = '\0';
+ add_environment_value(buf2);
if (pref_charset) {
cp = NULL;
@@ -618,8 +619,7 @@ PRIVATE int LYLoadCGI ARGS4(
status = HT_LOADED;
#endif /* VMS */
#else /* LYNXCGI_LINKS */
- _statusline(CGI_NOT_COMPILED);
- sleep(MessageSecs);
+ HTUserMsg(CGI_NOT_COMPILED);
status = HT_NOT_LOADED;
#endif /* LYNXCGI_LINKS */
return(status);
diff --git a/src/LYCharSets.c b/src/LYCharSets.c
index 81cfa9af..13a76f5a 100644
--- a/src/LYCharSets.c
+++ b/src/LYCharSets.c
@@ -684,17 +684,20 @@ PRIVATE void HTMLSetDisplayCharsetMatchLocale ARGS1(int,i)
}
#if !defined(LOCALE)
- DisplayCharsetMatchLocale = FALSE;
-#endif
-#if defined(EXP_8BIT_TOUPPER)
/*
- ** Force disable locale,
- ** but we have no intention to pass CJK via UCTransChar if that happened.
+ ** But we have no intention to pass CJK via UCTransChar if that happened.
** Let someone from CJK correct this if necessary.
*/
if (!LYHaveCJKCharacterSet)
DisplayCharsetMatchLocale = FALSE;
#endif
+#if defined(LOCALE) && defined(EXP_8BIT_TOUPPER)
+ /*
+ ** Force disable locale
+ */
+ if (!LYHaveCJKCharacterSet)
+ DisplayCharsetMatchLocale = FALSE;
+#endif
return;
}
@@ -944,7 +947,7 @@ PUBLIC UCode_t HTMLGetEntityUCValue ARGS1(
PUBLIC void HTMLUseCharacterSet ARGS1(int,i)
{
p_entity_values = LYCharSets[i];
- HTMLSetCharacterHandling(i);
+ HTMLSetCharacterHandling(i); /* deals with assume_char_set and LYRawMode */
HTMLSetHaveCJKCharacterSet(i);
HTMLSetDisplayCharsetMatchLocale(i);
return;
diff --git a/src/LYCharUtils.c b/src/LYCharUtils.c
index 572da3cb..f77f27a7 100644
--- a/src/LYCharUtils.c
+++ b/src/LYCharUtils.c
@@ -3229,9 +3229,8 @@ PUBLIC void LYHandleSELECT ARGS5(
fprintf(tfp,
"Bad HTML: SELECT start tag not within FORM tag\n");
} else if (!me->inBadHTML) {
- _statusline(BAD_HTML_USE_TRACE);
+ HTUserMsg(BAD_HTML_USE_TRACE);
me->inBadHTML = TRUE;
- sleep(MessageSecs);
}
/*
@@ -3252,9 +3251,8 @@ PUBLIC void LYHandleSELECT ARGS5(
if (TRACE) {
fprintf(tfp, "Bad HTML: Missing TEXTAREA end tag\n");
} else if (!me->inBadHTML) {
- _statusline(BAD_HTML_USE_TRACE);
+ HTUserMsg(BAD_HTML_USE_TRACE);
me->inBadHTML = TRUE;
- sleep(MessageSecs);
}
}
@@ -3337,9 +3335,8 @@ PUBLIC void LYHandleSELECT ARGS5(
if (TRACE) {
fprintf(tfp, "Bad HTML: Unmatched SELECT end tag\n");
} else if (!me->inBadHTML) {
- _statusline(BAD_HTML_USE_TRACE);
+ HTUserMsg(BAD_HTML_USE_TRACE);
me->inBadHTML = TRUE;
- sleep(MessageSecs);
}
return;
}
@@ -3541,9 +3538,8 @@ PUBLIC int LYLegitimizeHREF ARGS4(
fprintf(tfp,
" Stripping lead dots.\n");
} else if (!me->inBadHREF) {
- _statusline(BAD_PARTIAL_REFERENCE);
+ HTAlert(BAD_PARTIAL_REFERENCE);
me->inBadHREF = TRUE;
- sleep(AlertSecs);
}
}
if (*cp == '\0') {
diff --git a/src/LYCookie.c b/src/LYCookie.c
index 4d7d496b..6ca036cd 100644
--- a/src/LYCookie.c
+++ b/src/LYCookie.c
@@ -2136,9 +2136,8 @@ PRIVATE int LYHandleCookies ARGS4 (
* from this domain. - FM
*/
de->bv = QUERY_USER;
- _user_message(ALWAYS_ALLOWING_COOKIES,
+ HTUserMsg2(ALWAYS_ALLOWING_COOKIES,
de->domain);
- sleep(MessageSecs);
return(HT_NO_DATA);
case 'C':
@@ -2147,8 +2146,7 @@ PRIVATE int LYHandleCookies ARGS4 (
/*
* Cancelled. - FM
*/
- _statusline(CANCELLED);
- sleep(MessageSecs);
+ HTUserMsg(CANCELLED);
return(HT_NO_DATA);
case 'D':
@@ -2213,9 +2211,8 @@ Delete_all_cookies_in_domain:
* from this domain. - FM
*/
de->bv = QUERY_USER;
- _user_message(PROMPTING_TO_ALLOW_COOKIES,
- de->domain);
- sleep(MessageSecs);
+ HTUserMsg2(PROMPTING_TO_ALLOW_COOKIES,
+ de->domain);
return(HT_NO_DATA);
case 'V':
@@ -2224,9 +2221,8 @@ Delete_all_cookies_in_domain:
* from this domain. - FM
*/
de->bv = REJECT_ALWAYS;
- _user_message(NEVER_ALLOWING_COOKIES,
- de->domain);
- sleep(MessageSecs);
+ HTUserMsg2(NEVER_ALLOWING_COOKIES,
+ de->domain);
if ((!HTList_isEmpty(de->cookie_list)) &&
HTConfirm(DELETE_ALL_COOKIES_IN_DOMAIN))
goto Delete_all_cookies_in_domain;
diff --git a/src/LYCurses.c b/src/LYCurses.c
index 8bf79563..1794d363 100644
--- a/src/LYCurses.c
+++ b/src/LYCurses.c
@@ -851,6 +851,10 @@ PUBLIC void lynx_enable_mouse ARGS1(int,state)
{
#ifdef __BORLANDC__
+/* modify lynx_enable_mouse() for pdcurses configuration so that mouse support
+ is disabled unless -use_mouse is specified. This is ifdef'd with
+ __BORLANDC__ for the time being (WB).
+*/
HANDLE hConIn = INVALID_HANDLE_VALUE;
hConIn = GetStdHandle(STD_INPUT_HANDLE);
if (LYUseMouse == 0)
@@ -1314,8 +1318,7 @@ PUBLIC void VMSexit NOARGS
(void) getchar();
}
} else if (LYCursesON) {
- _statusline(MEMORY_EXHAUSTED_ABORT);
- sleep(AlertSecs);
+ HTAlert(MEMORY_EXHAUSTED_ABORT);
}
cleanup();
}
diff --git a/src/LYDownload.c b/src/LYDownload.c
index 33e81896..a1394d77 100644
--- a/src/LYDownload.c
+++ b/src/LYDownload.c
@@ -330,8 +330,7 @@ check_recall:
}
SecondS = TRUE;
- _statusline(SAVING);
- sleep(InfoSecs);
+ HTInfoMsg(SAVING);
#ifdef VMS
/*
* Try rename() first. - FM
@@ -537,8 +536,7 @@ check_recall:
#endif /* VMS */
} else {
- _statusline(MISCONF_DOWNLOAD_COMMAND);
- sleep(AlertSecs);
+ HTAlert(MISCONF_DOWNLOAD_COMMAND);
goto failed;
}
@@ -572,14 +570,12 @@ check_recall:
return;
failed:
- _statusline(CANNOT_DOWNLOAD_FILE);
- sleep(AlertSecs);
+ HTAlert(CANNOT_DOWNLOAD_FILE);
FREE(Line);
return;
cancelled:
- _statusline(CANCELLING);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLING);
FREE(Line);
return;
}
diff --git a/src/LYEdit.c b/src/LYEdit.c
index 36da56c2..3c8997c6 100644
--- a/src/LYEdit.c
+++ b/src/LYEdit.c
@@ -40,8 +40,7 @@ PUBLIC int edit_current_file ARGS3(
* If its a remote file then we can't edit it.
*/
if (!LYisLocalFile(newfile)) {
- _statusline(CANNOT_EDIT_REMOTE_FILES);
- sleep(MessageSecs);
+ HTUserMsg(CANNOT_EDIT_REMOTE_FILES);
return FALSE;
}
@@ -103,8 +102,7 @@ PUBLIC int edit_current_file ARGS3(
#endif /* VMS */
#endif /* DOSPATH */
{
- _statusline(NOAUTH_TO_EDIT_FILE);
- sleep(MessageSecs);
+ HTUserMsg(NOAUTH_TO_EDIT_FILE);
goto failure;
}
fclose(fp);
@@ -154,10 +152,8 @@ PUBLIC int edit_current_file ARGS3(
#endif /* DOSPATH */
#endif /* __DJGPP__ */
#endif /* VMS */
- if (TRACE) {
- fprintf(tfp, "LYEdit: %s\n", command);
- sleep(MessageSecs);
- }
+ CTRACE(tfp, "LYEdit: %s\n", command);
+ CTRACE_SLEEP(MessageSecs);
#ifndef __EMX__
FREE(filename);
#endif
diff --git a/src/LYExtern.c b/src/LYExtern.c
index fb52cea7..78e7c235 100644
--- a/src/LYExtern.c
+++ b/src/LYExtern.c
@@ -16,6 +16,7 @@
*/
#include <LYUtils.h>
+#include <HTAlert.h>
#include <LYGlobalDefs.h>
#include <LYExtern.h>
#include <LYCurses.h>
@@ -44,8 +45,7 @@ void run_external ARGS1(char *, c)
if(no_externals && !externals2->always_enabled)
{
- statusline(EXTERNALS_DISABLED);
- sleep(MessageSecs);
+ HTUserMsg(EXTERNALS_DISABLED);
return;
}
@@ -66,8 +66,7 @@ void run_external ARGS1(char *, c)
if (*command != '\0')
{
- statusline(command);
- sleep(MessageSecs);
+ HTUserMsg(command);
stop_curses();
fflush(stdout);
diff --git a/src/LYForms.c b/src/LYForms.c
index 4935e2f1..eb44fa14 100644
--- a/src/LYForms.c
+++ b/src/LYForms.c
@@ -12,9 +12,6 @@
#include <LYGlobalDefs.h>
#include <LYKeymap.h>
#include <LYSignal.h>
-#ifdef DJGPP_KEYHANDLER
-#include <keys.h>
-#endif /* DJGPP_KEYHANDLER */
#include <LYLeaks.h>
@@ -140,9 +137,7 @@ PUBLIC int change_form_link ARGS5(
* only one down at a time!
*/
if (form->num_value) {
- _statusline(NEED_CHECKED_RADIO_BUTTON);
- sleep(MessageSecs);
-
+ HTUserMsg(NEED_CHECKED_RADIO_BUTTON);
} else {
int i;
/*
@@ -203,8 +198,7 @@ PUBLIC int change_form_link ARGS5(
if (c == '\r' || c == '\n') {
form_link->hightext = form->value;
if (!form->submit_action || *form->submit_action == '\0') {
- _statusline(NO_FORM_ACTION);
- sleep(MessageSecs);
+ HTUserMsg(NO_FORM_ACTION);
c = DO_NOTHING;
break;
} else if (form->submit_method == URL_MAIL_METHOD && no_mail) {
@@ -305,8 +299,7 @@ PRIVATE int form_getstr ARGS1(
/*
* If we can edit it, report that we are using the tail. - FM
*/
- _statusline(FORM_VALUE_TOO_LONG);
- sleep(MessageSecs);
+ HTUserMsg(FORM_VALUE_TOO_LONG);
switch(form->type) {
case F_PASSWORD_TYPE:
statusline(FORM_LINK_PASSWORD_MESSAGE);
@@ -383,20 +376,6 @@ again:
if (keymap[ch + 1] == LYK_REFRESH)
break;
switch (ch) {
-#ifdef DJGPP_KEYHANDLER
- case K_Down:
- case K_EDown:
- case K_Up:
- case K_EUp:
- case K_PageUp:
- case K_EPageUp:
- case K_PageDown:
- case K_EPageDown:
- case K_Home:
- case K_EHome:
- case K_End:
- case K_EEnd:
-#else
case DNARROW:
case UPARROW:
case PGUP:
@@ -407,19 +386,13 @@ again:
case FIND_KEY:
case SELECT_KEY:
#endif /* NOTDEFINED */
-#endif /* DJGPP_KEYHANDLER */
goto breakfor;
/*
* Left arrrow in column 0 deserves special treatment here,
* else you can get trapped in a form without submit button!
*/
-#ifdef DJGPP_KEYHANDLER
- case K_Left:
- case K_ELeft:
-#else
case LTARROW:
-#endif /* DJGPP_KEYHANDLER */
if (MyEdit.pos == 0) {
int c = 'Y'; /* Go back immediately if no changes */
if (strcmp(MyEdit.buffer, value)) {
@@ -476,8 +449,7 @@ breakfor:
*/
form->value[(strlen(form->value) - strlen(value))] = '\0';
StrAllocCat(form->value, MyEdit.buffer);
- _statusline(FORM_TAIL_COMBINED_WITH_HEAD);
- sleep(MessageSecs);
+ HTUserMsg(FORM_TAIL_COMBINED_WITH_HEAD);
}
/*
@@ -529,8 +501,7 @@ PRIVATE int get_popup_option_number ARGS1(
* Get the number, possibly with a suffix, from the user.
*/
if (LYgetstr(temp, VISIBLE, sizeof(temp), NORECALL) < 0 || *temp == 0) {
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
*c = '\0';
return(0);
}
@@ -893,8 +864,7 @@ redraw:
*/
if (number <= 1) {
if (window_offset == 0) {
- _statusline(ALREADY_AT_OPTION_BEGIN);
- sleep(MessageSecs);
+ HTUserMsg(ALREADY_AT_OPTION_BEGIN);
if (disabled) {
_statusline(FORM_LINK_OPTION_LIST_UNM_MSG);
} else {
@@ -918,8 +888,7 @@ redraw:
*/
if (number >= npages) {
if (window_offset >= ((num_options - length) + 1)) {
- _statusline(ALREADY_AT_OPTION_END);
- sleep(MessageSecs);
+ HTUserMsg(ALREADY_AT_OPTION_END);
if (disabled) {
_statusline(FORM_LINK_OPTION_LIST_UNM_MSG);
} else {
@@ -946,8 +915,7 @@ redraw:
*/
if (((number - 1) * length) == window_offset) {
sprintf(buffer, ALREADY_AT_OPTION_PAGE, number);
- _statusline(buffer);
- sleep(MessageSecs);
+ HTUserMsg(buffer);
if (disabled) {
_statusline(FORM_LINK_OPTION_LIST_UNM_MSG);
} else {
@@ -997,8 +965,7 @@ redraw:
*/
sprintf(buffer,
OPTION_ALREADY_CURRENT, (number + 1));
- _statusline(buffer);
- sleep(MessageSecs);
+ HTUserMsg(buffer);
if (disabled) {
_statusline(FORM_LINK_OPTION_LIST_UNM_MSG);
} else {
@@ -1036,8 +1003,7 @@ redraw:
/*
* Not in range. - FM
*/
- _statusline(BAD_OPTION_NUM_ENTERED);
- sleep(MessageSecs);
+ HTUserMsg(BAD_OPTION_NUM_ENTERED);
}
}
@@ -1272,8 +1238,7 @@ redraw:
/*
* User cancelled the search via ^G. - FM
*/
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
goto restore_popup_statusline;
}
}
@@ -1284,8 +1249,7 @@ check_recall:
/*
* No entry. Simply break. - FM
*/
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
goto restore_popup_statusline;
}
@@ -1338,8 +1302,7 @@ check_recall:
/*
* User cancelled the search via ^G. - FM
*/
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
goto restore_popup_statusline;
}
goto check_recall;
@@ -1395,8 +1358,7 @@ check_recall:
/*
* User cancelled the search via ^G. - FM
*/
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
goto restore_popup_statusline;
}
goto check_recall;
@@ -1442,8 +1404,7 @@ check_recall:
* If we started at the beginning, it can't be present. - FM
*/
if (cur_selection == 0) {
- _user_message(STRING_NOT_FOUND, prev_target_buffer);
- sleep(MessageSecs);
+ HTUserMsg2(STRING_NOT_FOUND, prev_target_buffer);
goto restore_popup_statusline;
}
@@ -1481,8 +1442,7 @@ check_recall:
/*
* Didn't find it in the preceding options either. - FM
*/
- _user_message(STRING_NOT_FOUND, prev_target_buffer);
- sleep(MessageSecs);
+ HTUserMsg2(STRING_NOT_FOUND, prev_target_buffer);
restore_popup_statusline:
/*
diff --git a/src/LYGetFile.c b/src/LYGetFile.c
index 7d40e685..1a54c161 100644
--- a/src/LYGetFile.c
+++ b/src/LYGetFile.c
@@ -199,8 +199,7 @@ Try_Redirected_URL:
(lynxjumpfile != NULL &&
0==strncasecomp(WWWDoc.address, lynxjumpfile,
strlen(lynxjumpfile))))) {
- _statusline(NOT_HTTP_URL_OR_ACTION);
- sleep(MessageSecs);
+ HTUserMsg(NOT_HTTP_URL_OR_ACTION);
return(NULLFILE);
}
}
@@ -240,8 +239,7 @@ Try_Redirected_URL:
(lynxjumpfile != NULL &&
0==strncasecomp(WWWDoc.address, lynxjumpfile,
strlen(lynxjumpfile))))) {
- _statusline(NOT_IN_STARTING_REALM);
- sleep(MessageSecs);
+ HTUserMsg(NOT_IN_STARTING_REALM);
return(NULLFILE);
}
}
@@ -294,8 +292,7 @@ Try_Redirected_URL:
url_type == SNEWSREPLY_URL_TYPE) {
if (no_newspost) {
- _statusline(NEWSPOSTING_DISABLED);
- sleep(MessageSecs);
+ HTUserMsg(NEWSPOSTING_DISABLED);
return(NULLFILE);
} else {
HTLoadAbsolute(&WWWDoc);
@@ -323,8 +320,7 @@ Try_Redirected_URL:
} else if (url_type == LYNXDIRED_URL_TYPE) {
#ifdef DIRED_SUPPORT
if (no_dired_support) {
- _statusline(DIRED_DISABLED);
- sleep(MessageSecs);
+ HTUserMsg(DIRED_DISABLED);
return(NULLFILE);
} else {
local_dired(doc);
@@ -340,8 +336,7 @@ Try_Redirected_URL:
return(NORMAL);
}
#else
- _statusline(DIRED_DISABLED);
- sleep(MessageSecs);
+ HTUserMsg(DIRED_DISABLED);
return(NULLFILE);
#endif /* DIRED_SUPPORT */
@@ -386,12 +381,10 @@ Try_Redirected_URL:
if (no_exec &&
!exec_ok(HTLoadedDocumentURL(),
doc->address+9, ALWAYS_EXEC_PATH)) {
- statusline(EXECUTION_DISABLED);
- sleep(MessageSecs);
+ HTUserMsg(EXECUTION_DISABLED);
} else if (no_bookmark_exec &&
HTLoadedDocumentBookmark()) {
- statusline(BOOKMARK_EXEC_DISABLED);
- sleep(MessageSecs);
+ HTUserMsg(BOOKMARK_EXEC_DISABLED);
} else if (local_exec || (local_exec_on_local_files &&
exec_ok(HTLoadedDocumentURL(),
doc->address+9, EXEC_PATH))) {
@@ -428,8 +421,7 @@ Try_Redirected_URL:
/*
* Show URL before executing it.
*/
- statusline(doc->address);
- sleep(InfoSecs);
+ HTInfoMsg(doc->address);
stop_curses();
/*
* Run the command.
@@ -472,19 +464,16 @@ Try_Redirected_URL:
sprintf(buf,
EXECUTION_DISABLED_FOR_FILE,
key_for_func(LYK_OPTIONS));
- _statusline(buf);
- sleep(AlertSecs);
+ HTAlert(buf);
}
#else /* no exec_links */
- _statusline(EXECUTION_NOT_COMPILED);
- sleep(MessageSecs);
+ HTUserMsg(EXECUTION_NOT_COMPILED);
#endif /* EXEC_LINKS */
return(NULLFILE);
} else if (url_type == MAILTO_URL_TYPE) {
if (no_mail) {
- _statusline(MAIL_DISABLED);
- sleep(MessageSecs);
+ HTUserMsg(MAIL_DISABLED);
} else {
HTParentAnchor *tmpanchor;
CONST char *title;
@@ -518,8 +507,7 @@ Try_Redirected_URL:
url_type != LYNXCGI_URL_TYPE &&
!(LYisLocalHost(doc->address) ||
LYisLocalAlias(doc->address))) {
- statusline(ACCESS_ONLY_LOCALHOST);
- sleep(MessageSecs);
+ HTUserMsg(ACCESS_ONLY_LOCALHOST);
return(NULLFILE);
/*
@@ -529,11 +517,9 @@ Try_Redirected_URL:
url_type == TN3270_URL_TYPE ||
url_type == TELNET_GOPHER_URL_TYPE) {
if (!telnet_ok) {
- _statusline(TELNET_DISABLED);
- sleep(MessageSecs);
+ HTUserMsg(TELNET_DISABLED);
} else if (no_telnet_port && strchr(doc->address+7, ':')) {
- statusline(TELNET_PORT_SPECS_DISABLED);
- sleep(MessageSecs);
+ HTUserMsg(TELNET_PORT_SPECS_DISABLED);
} else {
stop_curses();
HTLoadAbsolute(&WWWDoc);
@@ -547,14 +533,12 @@ Try_Redirected_URL:
* Disable www news access if not news_ok.
*/
} else if (url_type == NEWS_URL_TYPE && !news_ok) {
- _statusline(NEWS_DISABLED);
- sleep(MessageSecs);
+ HTUserMsg(NEWS_DISABLED);
return(NULLFILE);
} else if (url_type == RLOGIN_URL_TYPE) {
if (!rlogin_ok) {
- statusline(RLOGIN_DISABLED);
- sleep(MessageSecs);
+ HTUserMsg(RLOGIN_DISABLED);
} else {
stop_curses();
HTLoadAbsolute(&WWWDoc);
@@ -615,8 +599,7 @@ Try_Redirected_URL:
} else {
if (url_type == FTP_URL_TYPE && !ftp_ok) {
- statusline(FTP_DISABLED);
- sleep(MessageSecs);
+ HTUserMsg(FTP_DISABLED);
return(NULLFILE);
}
@@ -702,12 +685,8 @@ Try_Redirected_URL:
}
FREE(cp);
}
- if (TRACE && LYTraceLogFP == NULL)
- sleep(MessageSecs);
+ CTRACE_SLEEP(MessageSecs);
user_message(WWW_WAIT_MESSAGE, doc->address);
-#ifdef NOTDEFINED
- sleep(InfoSecs);
-#endif /* NOTDEFINED */
if (TRACE) {
#ifdef USE_SLANG
if (LYCursesON) {
@@ -777,6 +756,9 @@ Try_Redirected_URL:
url_type == LYNXDIRED_URL_TYPE ||
#endif /* DIRED_SUPPORT */
url_type == LYNXPRINT_URL_TYPE ||
+#ifdef EXP_FORMS_OPTIONS
+ url_type == LYNXOPTIONS_URL_TYPE ||
+#endif
url_type == LYNXHIST_URL_TYPE ||
url_type == LYNXCOOKIE_URL_TYPE ||
(LYValidate &&
@@ -847,8 +829,7 @@ Try_Redirected_URL:
pound);
StrAllocCat(use_this_url_instead, pound);
}
- if (TRACE && LYTraceLogFP == NULL)
- sleep(MessageSecs);
+ CTRACE_SLEEP(MessageSecs);
_user_message(WWW_USING_MESSAGE,
use_this_url_instead);
sleep(InfoSecs);
@@ -985,11 +966,9 @@ Try_Redirected_URL:
}
}
} else {
- if (TRACE && LYTraceLogFP == NULL)
- sleep(MessageSecs);
- _user_message(WWW_BAD_ADDR_MESSAGE, doc->address);
+ CTRACE_SLEEP(MessageSecs);
+ HTUserMsg2(WWW_BAD_ADDR_MESSAGE, doc->address);
CTRACE(tfp,"\n");
- sleep(MessageSecs);
return(NULLFILE);
}
}
@@ -1028,8 +1007,7 @@ PUBLIC int follow_link_number ARGS4(
* Get the number, possibly with a letter suffix, from the user.
*/
if (LYgetstr(temp, VISIBLE, sizeof(temp), NORECALL) < 0 || *temp == 0) {
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
return(DO_NOTHING);
}
*num = atoi(temp);
@@ -1217,7 +1195,7 @@ PUBLIC void add_trusted ARGS2(
*/
PUBLIC BOOLEAN exec_ok ARGS3(
CONST char *, source,
- CONST char *, link,
+ CONST char *, linktext,
int, type)
{
struct trust *tp;
@@ -1248,7 +1226,7 @@ PUBLIC BOOLEAN exec_ok ARGS3(
/*
* Security: reject on relative path.
*/
- if ((cp = strchr(link, '[')) != NULL) {
+ if ((cp = strchr(linktext, '[')) != NULL) {
char *cp1;
if (((cp1 = strchr(cp, '-')) != NULL) &&
strchr(cp1, ']') != NULL) {
@@ -1265,7 +1243,7 @@ PUBLIC BOOLEAN exec_ok ARGS3(
/*
* Security: reject on relative path.
*/
- if (strstr(link, "../") != NULL) {
+ if (strstr(linktext, "../") != NULL) {
HTAlert(RELPATH_IN_EXEC_LINK);
return FALSE;
}
@@ -1273,7 +1251,7 @@ PUBLIC BOOLEAN exec_ok ARGS3(
/*
* Security: reject on strange character.
*/
- for (cp = link; *cp != '\0'; cp++) {
+ for (cp = linktext; *cp != '\0'; cp++) {
if (!isalnum(*cp) &&
*cp != '_' && *cp != '-' && *cp != ' ' &&
*cp != ':' && *cp != '.' && *cp != '/' &&
@@ -1294,9 +1272,9 @@ PUBLIC BOOLEAN exec_ok ARGS3(
check_tp_for_entry:
while (tp) {
if (tp->type == Type) {
- char CONST *command = link;
+ char CONST *command = linktext;
- if (strstr(command,"//") == link) {
+ if (strstr(command,"//") == linktext) {
command += 2;
}
#ifdef VMS
@@ -1358,11 +1336,8 @@ PRIVATE int fix_http_urls ARGS1(
*/
CTRACE(tfp, "fix_http_urls: URL '%s'\n", doc->address);
doc->address[strlen(doc->address)-1] = '\0';
- if (TRACE) {
- fprintf(tfp, " changed to '%s'\n", doc->address);
- if (!LYTraceLogFP)
- sleep(MessageSecs);
- }
+ CTRACE(tfp, " changed to '%s'\n", doc->address);
+ CTRACE_SLEEP(MessageSecs);
}
/*
@@ -1375,11 +1350,8 @@ PRIVATE int fix_http_urls ARGS1(
}
CTRACE(tfp, "fix_http_urls: URL '%s'\n", doc->address);
StrAllocCat(doc->address, "/");
- if (TRACE) {
- fprintf(tfp, " changed to '%s'\n",doc->address);
- if (!LYTraceLogFP)
- sleep(MessageSecs);
- }
+ CTRACE(tfp, " changed to '%s'\n",doc->address);
+ CTRACE_SLEEP(MessageSecs);
return(1);
}
diff --git a/src/LYGlobalDefs.h b/src/LYGlobalDefs.h
index 3dcb7e2f..95f6f308 100644
--- a/src/LYGlobalDefs.h
+++ b/src/LYGlobalDefs.h
@@ -273,6 +273,7 @@ extern BOOLEAN LYUseDefaultRawMode;
extern char *UCAssume_MIMEcharset;
extern char *UCAssume_localMIMEcharset;
extern char *UCAssume_unrecMIMEcharset;
+extern BOOLEAN LYSaveBookmarksInUnicode; /* in titles, chars >127 save as &#xUUUU */
extern BOOLEAN LYisConfiguredForX;
extern char *URLDomainPrefixes;
extern char *URLDomainSuffixes;
diff --git a/src/LYHistory.c b/src/LYHistory.c
index 9355d979..f273d999 100644
--- a/src/LYHistory.c
+++ b/src/LYHistory.c
@@ -7,6 +7,9 @@
#include <LYHistory.h>
#include <LYPrint.h>
#include <LYDownload.h>
+#ifdef EXP_FORMS_OPTIONS
+#include <LYOptions.h>
+#endif
#include <LYKeymap.h>
#include <LYList.h>
#include <LYShowInfo.h>
@@ -67,6 +70,9 @@ PUBLIC void LYAddVisitedLink ARGS1(
!strcmp((doc->title ? doc->title : ""), HISTORY_PAGE_TITLE) ||
!strcmp((doc->title ? doc->title : ""), PRINT_OPTIONS_TITLE) ||
!strcmp((doc->title ? doc->title : ""), DOWNLOAD_OPTIONS_TITLE) ||
+#ifdef EXP_FORMS_OPTIONS
+ !strcmp((doc->title ? doc->title : ""), OPTIONS_TITLE) ||
+#endif
#ifdef DIRED_SUPPORT
!strcmp((doc->title ? doc->title : ""), DIRED_MENU_TITLE) ||
!strcmp((doc->title ? doc->title : ""), UPLOAD_OPTIONS_TITLE) ||
@@ -314,8 +320,7 @@ PUBLIC void LYpush ARGS2(
doc->address, doc->title);
} else {
if (LYCursesON) {
- _statusline(MAXHIST_REACHED);
- sleep(AlertSecs);
+ HTAlert(MAXHIST_REACHED);
}
CTRACE(tfp, "\nLYpush: MAXHIST reached for:\n address:%s\n title:%s\n",
doc->address, doc->title);
@@ -506,8 +511,7 @@ PUBLIC BOOLEAN historytarget ARGS1(
LYforce_no_cache = FALSE;
LYoverride_no_cache = TRUE;
} else {
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
return(FALSE);
}
}
diff --git a/src/LYJump.c b/src/LYJump.c
index aab39263..9e4f1884 100644
--- a/src/LYJump.c
+++ b/src/LYJump.c
@@ -225,8 +225,7 @@ PUBLIC char *LYJump ARGS1(int, key)
/*
* User cancelled the Jump via ^G. - FM
*/
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
return NULL;
}
@@ -242,8 +241,7 @@ check_recall:
*/
*buf = '\0';
StrAllocCopy(jtp->shortcut, buf);
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
return NULL;
}
#ifdef PERMIT_GOTO_FROM_JUMP
@@ -254,8 +252,7 @@ check_recall:
if (no_goto) {
*buf = '\0';
StrAllocCopy(jtp->shortcut, buf);
- _statusline(RANDOM_URL_DISALLOWED);
- sleep(MessageSecs);
+ HTUserMsg(RANDOM_URL_DISALLOWED);
return NULL;
}
StrAllocCopy(temp, "Go ");
@@ -301,8 +298,7 @@ check_recall:
/*
* User cancelled the jump via ^G.
*/
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
return NULL;
}
goto check_recall;
@@ -342,8 +338,7 @@ check_recall:
/*
* User cancelled the jump via ^G.
*/
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
return NULL;
}
goto check_recall;
diff --git a/src/LYKeymap.c b/src/LYKeymap.c
index 4386ebde..f6ba51ca 100644
--- a/src/LYKeymap.c
+++ b/src/LYKeymap.c
@@ -183,22 +183,13 @@ LYK_PIPE, 0, 0, LYK_HISTORY,
0, 0, 0, 0,
/* 100..10E function key definitions in LYStrings.h */
-#if defined(__DJGPP__) && defined(USE_SLANG) && !defined(DJGPP_KEYHANDLER)
- 0, LYK_PREV_LINK, LYK_NEXT_LINK, LYK_PREV_DOC,
- /* UPARROW */ /* DNARROW */ /* LTARROW */
-
-LYK_ACTIVATE, LYK_PREV_PAGE, LYK_NEXT_PAGE, LYK_HOME,
-/* RTARROW */ /* PGUP */ /* PGDOWN */ /* HOME */
-
-#else
LYK_PREV_LINK, LYK_NEXT_LINK, LYK_ACTIVATE, LYK_PREV_DOC,
/* UPARROW */ /* DNARROW */ /* RTARROW */ /* LTARROW */
LYK_NEXT_PAGE, LYK_PREV_PAGE, LYK_HOME, LYK_END,
/* PGDOWN */ /* PGUP */ /* HOME */ /* END */
-#endif /* __DJGPP__ && USE_SLANG && !DJGPP_KEYHANDLER */
-#ifdef __DJGPP__
+#if defined(__DJGPP__) || defined(_WINDOWS)
#ifdef USE_SLANG
LYK_END, LYK_HOME, LYK_PREV_PAGE, 0,
/* END */ /* HOME */ /* PGUP */ /* B2 Key */
@@ -222,7 +213,7 @@ LYK_UP_TWO, LYK_DOWN_TWO,
LYK_DO_NOTHING,
/* DO_NOTHING*/
-#endif /* __DJGPP__ */
+#endif /* __DJGPP__ || _WINDOWS */
/* 10F..18F */
0,
@@ -253,21 +244,10 @@ LYK_DO_NOTHING,
#endif /* DJGPP_KEYHANDLER */
0, 0, 0, 0,
0, 0, 0, 0,
-#ifdef DJGPP_KEYHANDLER
- 0, 0, 0, LYK_HOME,
- /* HOME */
-LYK_PREV_LINK, LYK_PREV_PAGE, 0, LYK_PREV_DOC,
-/* UPARROW */ /* Page Up */ /* LEFTARROW */
- 0, LYK_ACTIVATE, 0, LYK_END,
- /* RTARROW */ /* END */
-LYK_NEXT_LINK, LYK_NEXT_PAGE, 0, 0,
-/* DNARROW */ /* Page Down */
-#else
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
-#endif /* DJGPP_KEYHANDLER */
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
@@ -341,21 +321,10 @@ LYK_NEXT_LINK, LYK_NEXT_PAGE, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
-#ifdef DJGPP_KEYHANDLER
- 0, 0, 0, LYK_HOME,
- /* HOME */
-LYK_PREV_LINK, LYK_PREV_PAGE, 0, LYK_PREV_DOC,
-/* UPARROW */ /* Page Up */ /* LEFTARROW */
- 0, LYK_ACTIVATE, 0, LYK_END,
- /* RTARROW */ /* END */
-LYK_NEXT_LINK, LYK_NEXT_PAGE, 0, 0,
-/* DNARROW */ /* Page Down */
-#else
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
-#endif /* DJGPP_KEYHANDLER */
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
diff --git a/src/LYList.c b/src/LYList.c
index 54a78b7b..b49032cc 100644
--- a/src/LYList.c
+++ b/src/LYList.c
@@ -6,6 +6,7 @@
*/
#include <HTUtils.h>
+#include <HTAlert.h>
#include <LYUtils.h>
#include <GridText.h>
#include <LYList.h>
@@ -59,20 +60,17 @@ PUBLIC int showlist ARGS2(
hidden_links = HText_HiddenLinkCount(HTMainText);
if (refs <= 0 && hidden_links > 0 &&
LYHiddenLinks != HIDDENLINKS_SEPARATE) {
- _statusline(NO_VISIBLE_REFS_FROM_DOC);
- sleep(MessageSecs);
+ HTUserMsg(NO_VISIBLE_REFS_FROM_DOC);
return(-1);
}
if (refs <= 0 && hidden_links <= 0) {
- _statusline(NO_REFS_FROM_DOC);
- sleep(MessageSecs);
+ HTUserMsg(NO_REFS_FROM_DOC);
return(-1);
}
LYRemoveTemp(tempfile);
if ((fp0 = LYOpenTemp(tempfile, HTML_SUFFIX, "w")) == NULL) {
- _statusline(CANNOT_OPEN_TEMP);
- sleep(MessageSecs);
+ HTUserMsg(CANNOT_OPEN_TEMP);
return(-1);
}
diff --git a/src/LYLocal.c b/src/LYLocal.c
index c22c6b79..a744637a 100644
--- a/src/LYLocal.c
+++ b/src/LYLocal.c
@@ -280,8 +280,7 @@ PRIVATE BOOLEAN remove_tagged NOARGS
sprintf(tmpbuf,
"System error - failed to get status of '%s'.",
testpath);
- _statusline(tmpbuf);
- sleep(AlertSecs);
+ HTAlert(tmpbuf);
return count;
} else {
args[0] = "rm";
@@ -373,8 +372,7 @@ PRIVATE BOOLEAN modify_tagged ARGS1(
HTUnEscape(savepath);
if (stat(savepath, &dir_info) == -1) {
sprintf(tmpbuf, "Unable to get status of '%s'.", savepath);
- _statusline(tmpbuf);
- sleep(AlertSecs);
+ HTAlert(tmpbuf);
FREE(savepath);
return 0;
}
@@ -396,8 +394,7 @@ PRIVATE BOOLEAN modify_tagged ARGS1(
StrAllocCat(cp1, (tmpbuf + 1));
if (strlen(cp1) > (sizeof(tmpbuf) - 1)) {
sprintf(tmpbuf, "%s", "Path too long");
- _statusline(tmpbuf);
- sleep(AlertSecs);
+ HTAlert(tmpbuf);
FREE(savepath);
FREE(cp1);
return 0;
@@ -422,8 +419,7 @@ PRIVATE BOOLEAN modify_tagged ARGS1(
*/
if (stat(savepath, &dir_info) == -1) {
sprintf(tmpbuf,"Unable to get status of '%s'.",savepath);
- _statusline(tmpbuf);
- sleep(AlertSecs);
+ HTAlert(tmpbuf);
FREE(savepath);
return 0;
}
@@ -432,9 +428,7 @@ PRIVATE BOOLEAN modify_tagged ARGS1(
* Make sure the source and target locations are not the same place.
*/
if (dev == dir_info.st_dev && inode == dir_info.st_ino) {
- _statusline(
- "Source and destination are the same location - request ignored!");
- sleep(AlertSecs);
+ HTAlert("Source and destination are the same location - request ignored!");
FREE(savepath);
return 0;
}
@@ -477,17 +471,13 @@ PRIVATE BOOLEAN modify_tagged ARGS1(
clear_tags();
return count;
} else {
- _statusline(
- "Destination has different owner! Request denied.");
- sleep(AlertSecs);
+ HTAlert("Destination has different owner! Request denied.");
FREE(srcpath);
FREE(savepath);
return 0;
}
} else {
- _statusline(
- "Destination is not a valid directory! Request denied.");
- sleep(AlertSecs);
+ HTAlert("Destination is not a valid directory! Request denied.");
FREE(savepath);
return 0;
}
@@ -515,8 +505,7 @@ PRIVATE BOOLEAN modify_name ARGS1(
if (stat(testpath, &dir_info) == -1) {
sprintf(tmpbuf, "Unable to get status of '%s'.", testpath);
- _statusline(tmpbuf);
- sleep(AlertSecs);
+ HTAlert(tmpbuf);
} else {
/*
* Change the name of the file or directory.
@@ -526,9 +515,7 @@ PRIVATE BOOLEAN modify_name ARGS1(
} else if (S_ISREG(dir_info.st_mode)) {
cp = "Enter new name for file: ";
} else {
- _statusline(
- "The selected item is not a file or a directory! Request ignored.");
- sleep(AlertSecs);
+ HTAlert("The selected item is not a file or a directory! Request ignored.");
return 0;
}
if (filename(cp, tmpbuf, sizeof(tmpbuf)) == NULL)
@@ -538,8 +525,7 @@ PRIVATE BOOLEAN modify_name ARGS1(
* Do not allow the user to also change the location at this time.
*/
if (strchr(tmpbuf, '/') != NULL) {
- _statusline("Illegal character \"/\" found! Request ignored.");
- sleep(AlertSecs);
+ HTAlert("Illegal character \"/\" found! Request ignored.");
} else if (strlen(tmpbuf) &&
(cp = strrchr(testpath, '/')) != NULL) {
strcpy(savepath,testpath);
@@ -554,8 +540,7 @@ PRIVATE BOOLEAN modify_name ARGS1(
if (errno != ENOENT) {
sprintf(tmpbuf,
"Unable to determine status of '%s'.", newpath);
- _statusline(tmpbuf);
- sleep(AlertSecs);
+ HTAlert(tmpbuf);
} else {
sprintf(tmpbuf, "move %s to %s", savepath, newpath);
args[0] = "mv";
@@ -567,17 +552,11 @@ PRIVATE BOOLEAN modify_name ARGS1(
return 1;
}
} else if (S_ISDIR(dir_info.st_mode)) {
- _statusline(
- "There is already a directory with that name! Request ignored.");
- sleep(AlertSecs);
+ HTAlert("There is already a directory with that name! Request ignored.");
} else if (S_ISREG(dir_info.st_mode)) {
- _statusline(
- "There is already a file with that name! Request ignored.");
- sleep(AlertSecs);
+ HTAlert("There is already a file with that name! Request ignored.");
} else {
- _statusline(
- "The specified name is already in use! Request ignored.");
- sleep(AlertSecs);
+ HTAlert("The specified name is already in use! Request ignored.");
}
}
}
@@ -608,8 +587,7 @@ PRIVATE BOOLEAN modify_location ARGS1(
if (stat(testpath, &dir_info) == -1) {
sprintf(tmpbuf, "Unable to get status of '%s'.", testpath);
- _statusline(tmpbuf);
- sleep(AlertSecs);
+ HTAlert(tmpbuf);
return 0;
}
@@ -621,9 +599,7 @@ PRIVATE BOOLEAN modify_location ARGS1(
} else if (S_ISREG(dir_info.st_mode)) {
cp = "Enter new location for file: ";
} else {
- _statusline(
- "The specified item is not a file or a directory - request ignored.");
- sleep(AlertSecs);
+ HTAlert("The specified item is not a file or a directory - request ignored.");
return 0;
}
if (filename(cp, tmpbuf, sizeof(tmpbuf)) == NULL)
@@ -645,8 +621,7 @@ PRIVATE BOOLEAN modify_location ARGS1(
*++cp = '\0';
strcat(newpath,tmpbuf);
} else {
- _statusline("Unexpected failure - unable to find trailing \"/\"");
- sleep(AlertSecs);
+ HTAlert("Unexpected failure - unable to find trailing \"/\"");
return 0;
}
} else {
@@ -662,14 +637,11 @@ PRIVATE BOOLEAN modify_location ARGS1(
owner = dir_info.st_uid;
if (stat(newpath, &dir_info) == -1) {
sprintf(tmpbuf,"Unable to get status of '%s'.",newpath);
- _statusline(tmpbuf);
- sleep(AlertSecs);
+ HTAlert(tmpbuf);
return 0;
}
if (S_ISDIR(dir_info.st_mode)) {
- _statusline(
- "Destination is not a valid directory! Request denied.");
- sleep(AlertSecs);
+ HTAlert("Destination is not a valid directory! Request denied.");
return 0;
}
@@ -677,9 +649,7 @@ PRIVATE BOOLEAN modify_location ARGS1(
* Make sure the source and target are not the same location.
*/
if (dev == dir_info.st_dev && inode == dir_info.st_ino) {
- _statusline(
- "Source and destination are the same location! Request ignored!");
- sleep(AlertSecs);
+ HTAlert("Source and destination are the same location! Request ignored!");
return 0;
}
if (dir_info.st_uid == owner) {
@@ -692,8 +662,7 @@ PRIVATE BOOLEAN modify_location ARGS1(
return (-1);
return 1;
} else {
- _statusline("Destination has different owner! Request denied.");
- sleep(AlertSecs);
+ HTAlert("Destination has different owner! Request denied.");
return 0;
}
}
@@ -774,8 +743,7 @@ PUBLIC BOOLEAN local_modify ARGS2(
/*
* Code for changing ownership needed here.
*/
- _statusline("This feature not yet implemented!");
- sleep(AlertSecs);
+ HTAlert("This feature not yet implemented!");
}
}
return 0;
@@ -803,8 +771,7 @@ PRIVATE BOOLEAN create_file ARGS1(
}
if (strstr(tmpbuf, "//") != NULL) {
- _statusline("Illegal redirection \"//\" found! Request ignored.");
- sleep(AlertSecs);
+ HTAlert("Illegal redirection \"//\" found! Request ignored.");
} else if (strlen(tmpbuf) && strchr(bad_chars, tmpbuf[0]) == NULL) {
strcpy(testpath,current_location);
if (testpath[(strlen(testpath) - 1)] != '/') {
@@ -823,8 +790,7 @@ PRIVATE BOOLEAN create_file ARGS1(
if (errno != ENOENT) {
sprintf(tmpbuf,
"Unable to determine status of '%s'.", testpath);
- _statusline(tmpbuf);
- sleep(AlertSecs);
+ HTAlert(tmpbuf);
return 0;
}
sprintf(tmpbuf,"create %s",testpath);
@@ -835,17 +801,11 @@ PRIVATE BOOLEAN create_file ARGS1(
return (-1);
return 1;
} else if (S_ISDIR(dir_info.st_mode)) {
- _statusline(
- "There is already a directory with that name! Request ignored.");
- sleep(AlertSecs);
+ HTAlert("There is already a directory with that name! Request ignored.");
} else if (S_ISREG(dir_info.st_mode)) {
- _statusline(
- "There is already a file with that name! Request ignored.");
- sleep(AlertSecs);
+ HTAlert("There is already a file with that name! Request ignored.");
} else {
- _statusline(
- "The specified name is already in use! Request ignored.");
- sleep(AlertSecs);
+ HTAlert("The specified name is already in use! Request ignored.");
}
}
return 0;
@@ -873,8 +833,7 @@ PRIVATE BOOLEAN create_directory ARGS1(
}
if (strstr(tmpbuf, "//") != NULL) {
- _statusline("Illegal redirection \"//\" found! Request ignored.");
- sleep(AlertSecs);
+ HTAlert("Illegal redirection \"//\" found! Request ignored.");
} else if (strlen(tmpbuf) && strchr(bad_chars, tmpbuf[0]) == NULL) {
strcpy(testpath,current_location);
if (testpath[(strlen(testpath) - 1)] != '/') {
@@ -889,8 +848,7 @@ PRIVATE BOOLEAN create_directory ARGS1(
if (errno != ENOENT) {
sprintf(tmpbuf,
"Unable to determine status of '%s'.", testpath);
- _statusline(tmpbuf);
- sleep(AlertSecs);
+ HTAlert(tmpbuf);
return 0;
}
sprintf(tmpbuf,"make directory %s",testpath);
@@ -901,17 +859,11 @@ PRIVATE BOOLEAN create_directory ARGS1(
return (-1);
return 1;
} else if (S_ISDIR(dir_info.st_mode)) {
- _statusline(
- "There is already a directory with that name! Request ignored.");
- sleep(AlertSecs);
+ HTAlert("There is already a directory with that name! Request ignored.");
} else if (S_ISREG(dir_info.st_mode)) {
- _statusline(
- "There is already a file with that name! Request ignored.");
- sleep(AlertSecs);
+ HTAlert("There is already a file with that name! Request ignored.");
} else {
- _statusline(
- "The specified name is already in use! Request ignored.");
- sleep(AlertSecs);
+ HTAlert("The specified name is already in use! Request ignored.");
}
}
return 0;
@@ -968,8 +920,7 @@ PRIVATE BOOLEAN remove_single ARGS1(
stat(testpath, &dir_info) == -1) {
sprintf(tmpbuf,
"System error - failed to get status of '%s'.", testpath);
- _statusline(tmpbuf);
- sleep(AlertSecs);
+ HTAlert(tmpbuf);
return 0;
}
@@ -1005,8 +956,7 @@ PRIVATE BOOLEAN remove_single ARGS1(
#endif
} else {
sprintf(tmpbuf, "Unable to determine status of '%s'.", testpath);
- _statusline(tmpbuf);
- sleep(AlertSecs);
+ HTAlert(tmpbuf);
return 0;
}
_statusline(tmpbuf);
@@ -1109,8 +1059,7 @@ PRIVATE BOOLEAN permit_location ARGS3(
char **, newpath)
{
#ifndef UNIX
- _statusline("Sorry, don't know how to permit non-UNIX files yet.");
- sleep(AlertSecs);
+ HTAlert("Sorry, don't know how to permit non-UNIX files yet.");
return(0);
#else
static char tempfile[256] = "\0";
@@ -1135,14 +1084,11 @@ PRIVATE BOOLEAN permit_location ARGS3(
srcpath += 16;
if (lstat(srcpath, &dir_info) == -1) {
sprintf(tmpbuf, "Unable to get status of '%s'.", srcpath);
- _statusline(tmpbuf);
- sleep(AlertSecs);
+ HTAlert(tmpbuf);
return 0;
} else if (!S_ISDIR(dir_info.st_mode) &&
!S_ISREG(dir_info.st_mode)) {
- _statusline(
- "The specified item is not a file nor a directory - request ignored.");
- sleep(AlertSecs);
+ HTAlert("The specified item is not a file nor a directory - request ignored.");
return(0);
}
@@ -1154,8 +1100,7 @@ PRIVATE BOOLEAN permit_location ARGS3(
LYRemoveTemp(tempfile);
if ((fp0 = LYOpenTemp(tempfile, HTML_SUFFIX, "w")) == NULL) {
- _statusline("Unable to open permit options file");
- sleep(AlertSecs);
+ HTAlert("Unable to open permit options file");
return(0);
}
@@ -1301,14 +1246,11 @@ form to permit %s %s.\n</Ol>\n</Form>\n",
destpath = strip_trailing_slash(destpath);
if (stat(destpath, &dir_info) == -1) {
sprintf(tmpbuf, "Unable to get status of '%s'.", destpath);
- _statusline(tmpbuf);
- sleep(AlertSecs);
+ HTAlert(tmpbuf);
return 0;
} else if (!S_ISDIR(dir_info.st_mode) &&
!S_ISREG(dir_info.st_mode)) {
- _statusline(
- "The specified item is not a file nor a directory - request ignored.");
- sleep(AlertSecs);
+ HTAlert("The specified item is not a file nor a directory - request ignored.");
return 0;
}
@@ -1341,13 +1283,11 @@ form to permit %s %s.\n</Ol>\n</Form>\n",
}
}
if (permissions[i].string_mode == NULL) {
- _statusline("Invalid mode format.");
- sleep(AlertSecs);
+ HTAlert("Invalid mode format.");
return 0;
}
} else {
- _statusline("Invalid syntax format.");
- sleep(AlertSecs);
+ HTAlert("Invalid syntax format.");
return 0;
}
@@ -1531,9 +1471,7 @@ PUBLIC int local_dired ARGS1(
} else if (!strncmp(line, "LYNXDIRED://UUDECODE", 20)) {
tp = quote_pathname(line + 20);
sprintf(buffer,"%s %s", UUDECODE_PATH, tp);
- _statusline(
- "Warning! UUDecoded file will exist in the directory you started Lynx.");
- sleep(AlertSecs);
+ HTAlert("Warning! UUDecoded file will exist in the directory you started Lynx.");
FREE(tp);
#endif /* OK_UUDECODE && !ARCHIVE_ONLY */
@@ -1692,8 +1630,7 @@ PUBLIC int dired_options ARGS2(
LYRemoveTemp(tempfile);
if ((fp0 = LYOpenTemp(tempfile, HTML_SUFFIX, "w")) == NULL) {
- _statusline("Unable to open file management menu file.");
- sleep(AlertSecs);
+ HTAlert("Unable to open file management menu file.");
return(0);
}
@@ -1735,8 +1672,7 @@ PUBLIC int dired_options ARGS2(
if (lstat(path, &dir_info) == -1 && stat(path, &dir_info) == -1) {
sprintf(tmpbuf, "Unable to get status of '%s'.", path);
- _statusline(tmpbuf);
- sleep(AlertSecs);
+ HTAlert(tmpbuf);
LYCloseTempFP(fp0);
FREE(dir_url);
FREE(path_url);
@@ -1874,8 +1810,7 @@ PRIVATE char *filename ARGS3(
*buf = '\0';
LYgetstr(buf, VISIBLE, bufsize, NORECALL);
if (strstr(buf, "../") != NULL) {
- _statusline("Illegal filename; request ignored.");
- sleep(AlertSecs);
+ HTAlert("Illegal filename; request ignored.");
return NULL;
}
@@ -1886,8 +1821,7 @@ PRIVATE char *filename ARGS3(
else
cp = buf;
if (*cp == '.') {
- _statusline("Illegal filename; request ignored.");
- sleep(AlertSecs);
+ HTAlert("Illegal filename; request ignored.");
return NULL;
}
}
@@ -1920,14 +1854,11 @@ PUBLIC BOOLEAN local_install ARGS3(
srcpath += 16;
if (stat(srcpath, &dir_info) == -1) {
sprintf(tmpbuf, "Unable to get status of '%s'.", srcpath);
- _statusline(tmpbuf);
- sleep(AlertSecs);
+ HTAlert(tmpbuf);
return 0;
} else if (!S_ISDIR(dir_info.st_mode) &&
!S_ISREG(dir_info.st_mode)) {
- _statusline(
- "The selected item is not a file or a directory! Request ignored.");
- sleep(AlertSecs);
+ HTAlert("The selected item is not a file or a directory! Request ignored.");
return 0;
}
strcpy(savepath, srcpath);
@@ -1943,17 +1874,13 @@ PUBLIC BOOLEAN local_install ARGS3(
if (stat(destpath,&dir_info) == -1) {
sprintf(tmpbuf,"Unable to get status of '%s'.",destpath);
- _statusline(tmpbuf);
- sleep(AlertSecs);
+ HTAlert(tmpbuf);
return 0;
} else if (!S_ISDIR(dir_info.st_mode)) {
- _statusline(
- "The selected item is not a directory! Request ignored.");
- sleep(AlertSecs);
+ HTAlert("The selected item is not a directory! Request ignored.");
return 0;
} else if (0 /*directory not writable*/) {
- _statusline("Install in the selected directory not permitted.");
- sleep(AlertSecs);
+ HTAlert("Install in the selected directory not permitted.");
return 0;
}
@@ -1986,8 +1913,7 @@ PUBLIC BOOLEAN local_install ARGS3(
}
clear_tags();
}
- statusline("Installation complete");
- sleep(InfoSecs);
+ HTInfoMsg("Installation complete");
return count;
}
@@ -2169,8 +2095,7 @@ PRIVATE char * render_item ARGS6(
}
if (overrun & url_syntax) {
sprintf(buf,"Temporary URL or list would be too long.");
- _statusline(buf);
- sleep(AlertSecs);
+ HTAlert(buf);
bp = buf; /* set to start, will return empty string as URL */
}
*bp = '\0';
@@ -2245,8 +2170,7 @@ PRIVATE int LYExecv ARGS3(
}
start_curses();
if (tmpbuf[0]) {
- _statusline(tmpbuf);
- sleep(AlertSecs);
+ HTAlert(tmpbuf);
}
return(rc);
diff --git a/src/LYMail.c b/src/LYMail.c
index 3557907f..7c70f798 100644
--- a/src/LYMail.c
+++ b/src/LYMail.c
@@ -276,8 +276,7 @@ PUBLIC void mailform ARGS4(
/*
* User cancelled via ^G. - FM
*/
- _statusline(FORM_MAILTO_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(FORM_MAILTO_CANCELLED);
FREE(address);
FREE(ccaddr);
FREE(keywords);
@@ -297,8 +296,7 @@ PUBLIC void mailform ARGS4(
/*
* User cancelled via ^G. - FM
*/
- _statusline(FORM_MAILTO_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(FORM_MAILTO_CANCELLED);
FREE(address);
FREE(ccaddr);
FREE(keywords);
@@ -1334,8 +1332,7 @@ PUBLIC void reply_by_mail ARGS3(
if (LYgetstr(user_input, VISIBLE, sizeof(user_input), NORECALL) < 0 ||
term_letter) {
addstr("\n");
- _statusline(COMMENT_REQUEST_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(COMMENT_REQUEST_CANCELLED);
LYCloseTempFP(fd); /* Close the tmpfile. */
scrollok(stdscr,FALSE); /* Stop scrolling. */
goto cleanup;
@@ -1377,8 +1374,7 @@ PUBLIC void reply_by_mail ARGS3(
if (LYgetstr(user_input, VISIBLE, sizeof(user_input), NORECALL) < 0 ||
term_letter) {
addstr("\n");
- _statusline(COMMENT_REQUEST_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(COMMENT_REQUEST_CANCELLED);
LYCloseTempFP(fd); /* Close the tmpfile. */
scrollok(stdscr,FALSE); /* Stop scrolling. */
goto cleanup;
@@ -1424,8 +1420,7 @@ PUBLIC void reply_by_mail ARGS3(
if (LYgetstr(user_input, VISIBLE, 71, NORECALL) < 0 ||
term_letter) {
addstr("\n");
- _statusline(COMMENT_REQUEST_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(COMMENT_REQUEST_CANCELLED);
LYCloseTempFP(fd); /* Close the tmpfile. */
scrollok(stdscr,FALSE); /* Stop scrolling. */
goto cleanup;
@@ -1458,8 +1453,7 @@ PUBLIC void reply_by_mail ARGS3(
if (LYgetstr(user_input, VISIBLE, sizeof(user_input), NORECALL) < 0 ||
term_letter) {
addstr("\n");
- _statusline(COMMENT_REQUEST_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(COMMENT_REQUEST_CANCELLED);
LYCloseTempFP(fd); /* Close the tmpfile. */
scrollok(stdscr, FALSE); /* Stop scrolling. */
goto cleanup;
@@ -1571,8 +1565,7 @@ PUBLIC void reply_by_mail ARGS3(
stop_curses();
if (system(user_input)) {
start_curses();
- _statusline(ERROR_SPAWNING_EDITOR);
- sleep(AlertSecs);
+ HTAlert(ERROR_SPAWNING_EDITOR);
} else {
start_curses();
}
@@ -1629,8 +1622,7 @@ PUBLIC void reply_by_mail ARGS3(
*user_input = '\0';
if (LYgetstr(user_input, VISIBLE, sizeof(user_input), NORECALL) < 0 ||
term_letter || STREQ(user_input, ".")) {
- _statusline(COMMENT_REQUEST_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(COMMENT_REQUEST_CANCELLED);
LYCloseTempFP(fd); /* Close the tmpfile. */
scrollok(stdscr,FALSE); /* Stop scrolling. */
goto cleanup;
@@ -1643,8 +1635,7 @@ PUBLIC void reply_by_mail ARGS3(
*user_input = '\0';
if (LYgetstr(user_input, VISIBLE,
sizeof(user_input), NORECALL) < 0) {
- _statusline(COMMENT_REQUEST_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(COMMENT_REQUEST_CANCELLED);
LYCloseTempFP(fd); /* Close the tmpfile. */
scrollok(stdscr,FALSE); /* Stop scrolling. */
goto cleanup;
@@ -1831,15 +1822,13 @@ PUBLIC void reply_by_mail ARGS3(
signal(SIGINT, SIG_IGN);
fp = popen(cmd, "w");
if (fp == NULL) {
- _statusline(COMMENT_REQUEST_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(COMMENT_REQUEST_CANCELLED);
goto cleanup;
}
#endif /* DOSPATH */
fd = fopen(my_tmpfile, "r");
if (fd == NULL) {
- _statusline(COMMENT_REQUEST_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(COMMENT_REQUEST_CANCELLED);
pclose(fp);
goto cleanup;
}
diff --git a/src/LYMain.c b/src/LYMain.c
index ea5584d0..cb5b1310 100644
--- a/src/LYMain.c
+++ b/src/LYMain.c
@@ -301,6 +301,7 @@ PUBLIC BOOLEAN LYUseDefaultRawMode = TRUE;
PUBLIC char *UCAssume_MIMEcharset = NULL;
PUBLIC char *UCAssume_localMIMEcharset = NULL;
PUBLIC char *UCAssume_unrecMIMEcharset = NULL;
+PUBLIC BOOLEAN LYSaveBookmarksInUnicode = FALSE;
PUBLIC int LYlines = 24;
PUBLIC int LYcols = 80;
PUBLIC int dump_output_width = 0;
@@ -2432,8 +2433,10 @@ static int restrictions_fun ARGS3(
if (next_arg != 0) {
parse_restrictions(next_arg);
} else {
+ SetOutputMode( O_TEXT );
for (n = 0; n < sizeof(Usage)/sizeof(Usage[0]); n++)
printf("%s\n", Usage[n]);
+ SetOutputMode( O_BINARY );
exit(0);
}
return 0;
@@ -2494,6 +2497,8 @@ static int version_fun ARGS3(
char **, argv GCC_UNUSED,
char *, next_arg GCC_UNUSED)
{
+ SetOutputMode( O_TEXT );
+
printf("\n%s Version %s (1998)\n", LYNX_NAME, LYNX_VERSION);
printf(
"Copyrights held by the University of Kansas, CERN, and other contributors.\n"
@@ -2502,6 +2507,9 @@ static int version_fun ARGS3(
printf(
"See http://lynx.browser.org/ and the online help for more information.\n\n"
);
+
+ SetOutputMode( O_BINARY );
+
exit(0);
/* NOT REACHED */
return 0;
diff --git a/src/LYMainLoop.c b/src/LYMainLoop.c
index b00b039b..a310b5a4 100644
--- a/src/LYMainLoop.c
+++ b/src/LYMainLoop.c
@@ -142,8 +142,7 @@ PUBLIC FILE *TraceFP NOARGS
PRIVATE void TracelogOpenFailed NOARGS
{
WWW_TraceFlag = FALSE;
- _statusline(TRACELOG_OPEN_FAILED);
- sleep(MessageSecs);
+ HTUserMsg(TRACELOG_OPEN_FAILED);
}
PUBLIC void LYCloseTracelog NOARGS
@@ -304,13 +303,11 @@ initialize:
if (bookmark_start) {
if (LYValidate) {
- _statusline(BOOKMARKS_DISABLED);
- sleep(AlertSecs);
+ HTAlert(BOOKMARKS_DISABLED);
bookmark_start = FALSE;
goto initialize;
} else if (traversal) {
- _statusline(BOOKMARKS_NOT_TRAVERSED);
- sleep(AlertSecs);
+ HTAlert(BOOKMARKS_NOT_TRAVERSED);
traversal = FALSE;
crawl = FALSE;
bookmark_start = FALSE;
@@ -331,8 +328,7 @@ initialize:
newdoc.safe = FALSE;
CTRACE(tfp, "Using bookmarks=%s\n", newdoc.address);
} else {
- _statusline(BOOKMARKS_NOT_OPEN);
- sleep(MessageSecs);
+ HTUserMsg(BOOKMARKS_NOT_OPEN);
bookmark_start = FALSE;
goto initialize;
}
@@ -383,6 +379,9 @@ try_again:
#ifndef EXP_FORMS_OPTIONS
if (strncmp(newdoc.address, "LYNXDOWNLOAD:", 13))
#else /* EXP_FORMS_OPTIONS */
+ if (!strncmp(newdoc.address, "LYNXOPTIONS://MBM_MENU", 22))
+ LYpush(&curdoc, ForcePush);
+
if (strncmp(newdoc.address, "LYNXDOWNLOAD:", 13) &&
strncmp(newdoc.address, "LYNXOPTIONS:", 12))
#endif /* EXP_FORMS_OPTIONS */
@@ -508,7 +507,7 @@ try_again:
}
#ifdef DISP_PARTIAL
- display_partial = display_partial_flag; /* reset */
+ display_partial = display_partial_flag; /* restore */
Newline_partial = newdoc.line; /* initialize */
NumOfLines_partial = 0; /* initialize */
/*
@@ -518,7 +517,8 @@ try_again:
* only if user did not mess screen up by scrolling before...
* So fall down to old behavior here.
*/
- if (display_partial && (strchr(newdoc.address, '#')==NULL))
+ if (display_partial && LYCursesON &&
+ (strchr(newdoc.address, '#')==NULL))
display_partial = TRUE;
else
display_partial = FALSE;
@@ -692,7 +692,7 @@ try_again:
was_in_options =
(!strncmp(newdoc.address, "LYNXOPTIONS:", 12));
}
-#endif /* LD_OPTIONS */
+#endif /* EXP_FORMS_OPTIONS */
FREE(newdoc.address); /* to pop last doc */
FREE(newdoc.bookmark);
LYJumpFileURL = FALSE;
@@ -916,8 +916,7 @@ try_again:
if (i <= MBM_V_MAXFILES) {
FREE(temp);
if (LYValidate) {
- _statusline(BOOKMARKS_DISABLED);
- sleep(AlertSecs);
+ HTAlert(BOOKMARKS_DISABLED);
return(-1);
}
if ((temp = HTParse(newdoc.address, "",
@@ -1339,8 +1338,8 @@ try_again:
/*
* Report unread or new mail, if appropriate.
*/
- if (check_mail && !no_mail && LYCheckMail())
- sleep(MessageSecs);
+ if (check_mail && !no_mail)
+ LYCheckMail();
/*
* If help is not on the screen,
@@ -1458,7 +1457,7 @@ try_again:
* Let them know if it's an index -- very rare.
*/
if (is_www_index) {
- move(LYlines-1,LYcols-8);
+ move(LYlines-1, LYcols-8);
start_reverse();
addstr("-index-");
stop_reverse();
@@ -1852,8 +1851,7 @@ new_cmd: /*
StrAllocCopy(newdoc.address, curdoc.address);
StrAllocCopy(newdoc.title, curdoc.title);
newdoc.internal_link = curdoc.internal_link;
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
if (nlinks > 0)
HText_pageDisplay(curdoc.line, prev_target);
break;
@@ -1871,8 +1869,7 @@ new_cmd: /*
FREE(newdoc.post_data);
FREE(newdoc.post_content_type);
newdoc.internal_link = FALSE;
- _statusline(DISCARDING_POST_DATA);
- sleep(AlertSecs);
+ HTAlert(DISCARDING_POST_DATA);
}
}
}
@@ -1931,8 +1928,7 @@ new_cmd: /*
StrAllocCopy(temp, user_input_buffer);
sprintf(user_input_buffer,
LINK_ALREADY_CURRENT, number);
- _statusline(user_input_buffer);
- sleep(MessageSecs);
+ HTUserMsg(user_input_buffer);
strcpy(user_input_buffer, temp);
FREE(temp);
} else {
@@ -1964,26 +1960,23 @@ new_cmd: /*
* users (like me 8-). - FM
*/
if (Newline <= 1) {
- _statusline(ALREADY_AT_BEGIN);
+ HTUserMsg(ALREADY_AT_BEGIN);
} else if (!more) {
- _statusline(ALREADY_AT_END);
+ HTUserMsg(ALREADY_AT_END);
} else {
StrAllocCopy(temp, user_input_buffer);
sprintf(user_input_buffer,
ALREADY_AT_PAGE, number);
- _statusline(user_input_buffer);
- sleep(MessageSecs);
+ HTUserMsg(user_input_buffer);
strcpy(user_input_buffer, temp);
FREE(temp);
}
- sleep(MessageSecs);
}
break;
case PRINT_ERROR:
old_c = real_c;
- _statusline(BAD_LINK_NUM_ENTERED);
- sleep(MessageSecs);
+ HTUserMsg(BAD_LINK_NUM_ENTERED);
break;
}
break;
@@ -1998,8 +1991,7 @@ new_cmd: /*
curdoc.safe != TRUE) &&
confirm_post_resub(curdoc.address, curdoc.title,
1, 1) == FALSE) {
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
break;
}
@@ -2023,8 +2015,7 @@ new_cmd: /*
if ((curdoc.post_data != NULL &&
curdoc.safe != TRUE) &&
HTConfirm(CONFIRM_POST_RESUBMISSION) == FALSE) {
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
break;
}
@@ -2055,8 +2046,7 @@ new_cmd: /*
* page, lynx_mode won't have this setting and we won't
* know that this warning should be issued. - FM
*/
- _statusline(RELOADING_FORM);
- sleep(AlertSecs);
+ HTAlert(RELOADING_FORM);
}
newdoc.line = ((curdoc.line > 0) ?
curdoc.line : 1);
@@ -2089,8 +2079,7 @@ new_cmd: /*
curdoc.safe != TRUE) &&
confirm_post_resub(curdoc.address, NULL,
0, 0) == FALSE) {
- _statusline(WILL_NOT_RELOAD_DOC);
- sleep(InfoSecs);
+ HTInfoMsg(WILL_NOT_RELOAD_DOC);
} else {
HTuncache_current_document();
StrAllocCopy(newdoc.address, curdoc.address);
@@ -2101,13 +2090,12 @@ new_cmd: /*
else
historical_comments = TRUE;
if (minimal_comments) {
- _statusline(historical_comments ?
+ HTAlert(historical_comments ?
HISTORICAL_ON_MINIMAL_OFF : HISTORICAL_OFF_MINIMAL_ON);
} else {
- _statusline(historical_comments ?
+ HTAlert(historical_comments ?
HISTORICAL_ON_VALID_OFF : HISTORICAL_OFF_VALID_ON);
}
- sleep(AlertSecs);
break;
case LYK_MINIMAL:
@@ -2121,8 +2109,7 @@ new_cmd: /*
curdoc.safe != TRUE) &&
confirm_post_resub(curdoc.address, NULL,
0, 0) == FALSE) {
- _statusline(WILL_NOT_RELOAD_DOC);
- sleep(InfoSecs);
+ HTInfoMsg(WILL_NOT_RELOAD_DOC);
} else {
HTuncache_current_document();
StrAllocCopy(newdoc.address, curdoc.address);
@@ -2134,13 +2121,12 @@ new_cmd: /*
else
minimal_comments = TRUE;
if (!historical_comments) {
- _statusline(minimal_comments ?
+ HTAlert(minimal_comments ?
MINIMAL_ON_IN_EFFECT : MINIMAL_OFF_VALID_ON);
} else {
- _statusline(minimal_comments ?
+ HTAlert(minimal_comments ?
MINIMAL_ON_BUT_HISTORICAL : MINIMAL_OFF_HISTORICAL_ON);
}
- sleep(AlertSecs);
break;
case LYK_SOFT_DQUOTES:
@@ -2153,8 +2139,7 @@ new_cmd: /*
curdoc.safe != TRUE) &&
confirm_post_resub(curdoc.address, NULL,
1, 1) == FALSE) {
- _statusline(WILL_NOT_RELOAD_DOC);
- sleep(InfoSecs);
+ HTInfoMsg(WILL_NOT_RELOAD_DOC);
} else {
HTuncache_current_document();
StrAllocCopy(newdoc.address, curdoc.address);
@@ -2164,9 +2149,8 @@ new_cmd: /*
soft_dquotes = FALSE;
else
soft_dquotes = TRUE;
- _statusline(soft_dquotes ?
+ HTUserMsg(soft_dquotes ?
SOFT_DOUBLE_QUOTE_ON : SOFT_DOUBLE_QUOTE_OFF);
- sleep(MessageSecs);
break;
case LYK_SWITCH_DTD:
@@ -2179,8 +2163,7 @@ new_cmd: /*
curdoc.safe != TRUE) &&
confirm_post_resub(curdoc.address, NULL,
1, 1) == FALSE) {
- _statusline(WILL_NOT_RELOAD_DOC);
- sleep(InfoSecs);
+ HTInfoMsg(WILL_NOT_RELOAD_DOC);
} else {
/*
* If currently viewing preparsed source, switching
@@ -2206,8 +2189,7 @@ new_cmd: /*
else
New_DTD = YES;
HTSwitchDTD(New_DTD);
- _statusline(New_DTD ? USING_DTD_1 : USING_DTD_0);
- sleep(MessageSecs);
+ HTUserMsg(New_DTD ? USING_DTD_1 : USING_DTD_0);
break;
#ifdef NOT_DONE_YET
@@ -2228,14 +2210,12 @@ new_cmd: /*
c != 7) {
return(0);
} else {
- statusline(NO_CANCEL);
- sleep(InfoSecs);
+ HTInfoMsg(NO_CANCEL);
}
} else if (TOUPPER(c) == 'Y') {
return(0);
} else {
- statusline(NO_CANCEL);
- sleep(InfoSecs);
+ HTInfoMsg(NO_CANCEL);
}
break;
@@ -2250,8 +2230,7 @@ new_cmd: /*
curdoc.link = nlinks-1; /* put on last link */
} else if (old_c != real_c) {
old_c = real_c;
- _statusline(ALREADY_AT_END);
- sleep(MessageSecs);
+ HTUserMsg(ALREADY_AT_END);
}
break;
@@ -2263,8 +2242,7 @@ new_cmd: /*
curdoc.link = 0; /* put on first link */
} else if (old_c != real_c) {
old_c = real_c;
- _statusline(ALREADY_AT_BEGIN);
- sleep(MessageSecs);
+ HTUserMsg(ALREADY_AT_BEGIN);
}
break;
@@ -2283,8 +2261,7 @@ new_cmd: /*
}
} else if (old_c != real_c) {
old_c = real_c;
- _statusline(ALREADY_AT_BEGIN);
- sleep(MessageSecs);
+ HTUserMsg(ALREADY_AT_BEGIN);
}
break;
@@ -2299,8 +2276,7 @@ new_cmd: /*
}
} else if (old_c != real_c) {
old_c = real_c;
- _statusline(ALREADY_AT_END);
- sleep(MessageSecs);
+ HTUserMsg(ALREADY_AT_END);
}
break;
@@ -2322,8 +2298,7 @@ new_cmd: /*
}
} else if (old_c != real_c) {
old_c = real_c;
- _statusline(ALREADY_AT_BEGIN);
- sleep(MessageSecs);
+ HTUserMsg(ALREADY_AT_BEGIN);
}
break;
@@ -2338,8 +2313,7 @@ new_cmd: /*
}
} else if (old_c != real_c) {
old_c = real_c;
- _statusline(ALREADY_AT_END);
- sleep(MessageSecs);
+ HTUserMsg(ALREADY_AT_END);
}
break;
@@ -2405,8 +2379,7 @@ new_cmd: /*
} else if (old_c != real_c) {
old_c = real_c;
- _statusline(ALREADY_AT_BEGIN);
- sleep(MessageSecs);
+ HTUserMsg(ALREADY_AT_BEGIN);
}
break;
@@ -2448,8 +2421,7 @@ new_cmd: /*
} else if (old_c != real_c) {
old_c = real_c;
- _statusline(ALREADY_AT_END);
- sleep(MessageSecs);
+ HTUserMsg(ALREADY_AT_END);
}
break;
@@ -2478,8 +2450,7 @@ new_cmd: /*
#else
} else if (old_c != real_c) {
old_c = real_c;
- _statusline(NO_LINKS_ABOVE);
- sleep(MessageSecs);
+ HTUserMsg(NO_LINKS_ABOVE);
#endif /* NOTDEFINED */
}
@@ -2509,8 +2480,7 @@ new_cmd: /*
} else if (old_c != real_c) {
old_c = real_c;
- _statusline(ALREADY_AT_BEGIN);
- sleep(MessageSecs);
+ HTUserMsg(ALREADY_AT_BEGIN);
}
break;
@@ -2536,8 +2506,7 @@ new_cmd: /*
Newline += (display_lines);
} else if (old_c != real_c) {
old_c = real_c;
- _statusline(NO_LINKS_BELOW);
- sleep(MessageSecs);
+ HTUserMsg(NO_LINKS_BELOW);
break;
}
#ifdef NOTDEFINED
@@ -2554,8 +2523,7 @@ new_cmd: /*
} else if (old_c != real_c) {
old_c = real_c;
- _statusline(ALREADY_AT_END);
- sleep(MessageSecs);
+ HTUserMsg(ALREADY_AT_END);
}
break;
@@ -2705,14 +2673,12 @@ new_cmd: /*
goto new_cmd;
}
if (nhist == 1) {
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
old_c = 0;
cmd = LYK_DO_NOTHING;
goto new_cmd;
} else {
- _user_message(WWW_SKIP_MESSAGE, WWWDoc.address);
- sleep(MessageSecs);
+ HTUserMsg2(WWW_SKIP_MESSAGE, WWWDoc.address);
do {
LYpop(&curdoc);
} while (nhist > 1 && !are_different(
@@ -2750,8 +2716,7 @@ new_cmd: /*
} else if (old_c != real_c) {
old_c = real_c;
- _statusline(ALREADY_AT_FIRST);
- sleep(MessageSecs);
+ HTUserMsg(ALREADY_AT_FIRST);
}
break;
@@ -2763,8 +2728,7 @@ new_cmd: /*
if (old_c == real_c)
break;
old_c = real_c;
- _statusline(NOT_ON_SUBMIT_OR_LINK);
- sleep(MessageSecs);
+ HTUserMsg(NOT_ON_SUBMIT_OR_LINK);
break;
} else {
LYforce_no_cache = TRUE;
@@ -2803,8 +2767,7 @@ new_cmd: /*
if (!links[curdoc.link].form->submit_action ||
*links[curdoc.link].form->submit_action
== '\0') {
- _statusline(NO_FORM_ACTION);
- sleep(MessageSecs);
+ HTUserMsg(NO_FORM_ACTION);
HTOutputFormat = WWW_PRESENT;
LYforce_no_cache = FALSE;
reloading = FALSE;
@@ -2927,8 +2890,7 @@ new_cmd: /*
newdoc.safe == FALSE) {
if ((HText_POSTReplyLoaded(&newdoc) == TRUE) &&
HTConfirm(CONFIRM_POST_RESUBMISSION) == FALSE) {
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
HTOutputFormat = WWW_PRESENT;
LYforce_no_cache = FALSE;
StrAllocCopy(newdoc.address, curdoc.address);
@@ -3084,8 +3046,7 @@ new_cmd: /*
StrAllocCopy(newdoc.address, curdoc.address);
StrAllocCopy(newdoc.title, curdoc.title);
newdoc.internal_link = curdoc.internal_link;
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
break;
} else if (LYresubmit_posts &&
cmd != LYK_NOCACHE) {
@@ -3103,8 +3064,7 @@ new_cmd: /*
FREE(newdoc.post_data);
FREE(newdoc.post_content_type);
newdoc.internal_link = FALSE;
- _statusline(DISCARDING_POST_DATA);
- sleep(AlertSecs);
+ HTAlert(DISCARDING_POST_DATA);
}
}
}
@@ -3181,8 +3141,7 @@ new_cmd: /*
*/
if (old_c != real_c) {
old_c = real_c;
- _statusline(GOTO_DISALLOWED);
- sleep(MessageSecs);
+ HTUserMsg(GOTO_DISALLOWED);
}
break;
}
@@ -3197,8 +3156,7 @@ new_cmd: /*
*/
if (old_c != real_c) {
old_c = real_c;
- _statusline(NOT_ON_SUBMIT_OR_LINK);
- sleep(MessageSecs);
+ HTUserMsg(NOT_ON_SUBMIT_OR_LINK);
}
break;
}
@@ -3210,8 +3168,7 @@ new_cmd: /*
*/
if (old_c != real_c) {
old_c = real_c;
- _statusline(NO_FORM_ACTION);
- sleep(MessageSecs);
+ HTUserMsg(NO_FORM_ACTION);
}
break;
}
@@ -3232,8 +3189,7 @@ new_cmd: /*
*/
if (old_c != real_c) {
old_c = real_c;
- _statusline(EDIT_FM_MENU_URLS_DISALLOWED);
- sleep(MessageSecs);
+ HTUserMsg(EDIT_FM_MENU_URLS_DISALLOWED);
}
break;
}
@@ -3284,8 +3240,7 @@ new_cmd: /*
* User cancelled via ^G, a full deletion,
* or not modifying the URL. - FM
*/
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
strcpy(user_input_buffer, temp);
FREE(temp);
break;
@@ -3297,8 +3252,7 @@ new_cmd: /*
*/
if (old_c != real_c) {
old_c = real_c;
- _statusline(GOTO_DISALLOWED);
- sleep(MessageSecs);
+ HTUserMsg(GOTO_DISALLOWED);
}
break;
}
@@ -3317,8 +3271,7 @@ new_cmd: /*
*/
if (old_c != real_c) {
old_c = real_c;
- _statusline(EDIT_FM_MENU_URLS_DISALLOWED);
- sleep(MessageSecs);
+ HTUserMsg(EDIT_FM_MENU_URLS_DISALLOWED);
}
break;
}
@@ -3371,8 +3324,7 @@ new_cmd: /*
* User cancelled via ^G, a full deletion,
* or not modifying the URL. - FM
*/
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
strcpy(user_input_buffer, temp);
FREE(temp);
break;
@@ -3381,8 +3333,7 @@ new_cmd: /*
if (no_goto && !LYValidate) {
if (old_c != real_c) {
old_c = real_c;
- _statusline(GOTO_DISALLOWED);
- sleep(MessageSecs);
+ HTUserMsg(GOTO_DISALLOWED);
}
break;
}
@@ -3414,8 +3365,7 @@ new_cmd: /*
*/
strcpy(user_input_buffer, temp);
FREE(temp);
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
break;
}
@@ -3442,8 +3392,7 @@ check_recall:
!(recall && (ch == UPARROW || ch == DNARROW))) {
strcpy(user_input_buffer, temp);
FREE(temp);
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
break;
}
if (recall && ch == UPARROW) {
@@ -3485,8 +3434,7 @@ check_recall:
*/
strcpy(user_input_buffer, temp);
FREE(temp);
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
break;
}
goto check_recall;
@@ -3530,8 +3478,7 @@ check_recall:
*/
strcpy(user_input_buffer, temp);
FREE(temp);
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
break;
}
goto check_recall;
@@ -3550,8 +3497,7 @@ check_goto_URL:
FREE(temp);
if ((no_file_url || no_goto_file) &&
!strncmp(user_input_buffer,"file:",5)) {
- _statusline(GOTO_FILE_DISALLOWED);
- sleep(MessageSecs);
+ HTUserMsg(GOTO_FILE_DISALLOWED);
} else if ((no_shell || no_goto_lynxexec
#ifdef EXEC_LINKS
@@ -3559,8 +3505,7 @@ check_goto_URL:
#endif /* EXEC_LINKS */
) &&
!strncmp(user_input_buffer, "lynxexec:",9)) {
- _statusline(GOTO_EXEC_DISALLOWED);
- sleep(MessageSecs);
+ HTUserMsg(GOTO_EXEC_DISALLOWED);
} else if ((no_shell || no_goto_lynxprog
#ifdef EXEC_LINKS
@@ -3568,97 +3513,79 @@ check_goto_URL:
#endif /* EXEC_LINKS */
) &&
!strncmp(user_input_buffer, "lynxprog:",9)) {
- _statusline(GOTO_PROG_DISALLOWED);
- sleep(MessageSecs);
+ HTUserMsg(GOTO_PROG_DISALLOWED);
} else if ((no_shell || no_goto_lynxcgi) &&
!strncmp(user_input_buffer, "lynxcgi:", 8)) {
- _statusline(GOTO_CGI_DISALLOWED);
- sleep(MessageSecs);
+ HTUserMsg(GOTO_CGI_DISALLOWED);
} else if (LYValidate &&
strncmp(user_input_buffer, "http:", 5) &&
strncmp(user_input_buffer, "https:", 6)) {
- _statusline(GOTO_NON_HTTP_DISALLOWED);
- sleep(MessageSecs);
+ HTUserMsg(GOTO_NON_HTTP_DISALLOWED);
} else if (no_goto_cso &&
!strncmp(user_input_buffer, "cso:", 4)) {
- _statusline(GOTO_CSO_DISALLOWED);
- sleep(MessageSecs);
+ HTUserMsg(GOTO_CSO_DISALLOWED);
} else if (no_goto_finger &&
!strncmp(user_input_buffer, "finger:", 7)) {
- _statusline(GOTO_FINGER_DISALLOWED);
- sleep(MessageSecs);
+ HTUserMsg(GOTO_FINGER_DISALLOWED);
} else if (no_goto_ftp &&
!strncmp(user_input_buffer, "ftp:", 4)) {
- _statusline(GOTO_FTP_DISALLOWED);
- sleep(MessageSecs);
+ HTUserMsg(GOTO_FTP_DISALLOWED);
} else if (no_goto_gopher &&
!strncmp(user_input_buffer, "gopher:", 7)) {
- _statusline(GOTO_GOPHER_DISALLOWED);
- sleep(MessageSecs);
+ HTUserMsg(GOTO_GOPHER_DISALLOWED);
} else if (no_goto_http &&
!strncmp(user_input_buffer, "http:", 5)) {
- _statusline(GOTO_HTTP_DISALLOWED);
- sleep(MessageSecs);
+ HTUserMsg(GOTO_HTTP_DISALLOWED);
} else if (no_goto_https &&
!strncmp(user_input_buffer, "https:", 6)) {
- _statusline(GOTO_HTTPS_DISALLOWED);
- sleep(MessageSecs);
+ HTUserMsg(GOTO_HTTPS_DISALLOWED);
} else if (no_goto_mailto &&
!strncmp(user_input_buffer, "mailto:", 7)) {
- _statusline(GOTO_MAILTO_DISALLOWED);
- sleep(MessageSecs);
+ HTUserMsg(GOTO_MAILTO_DISALLOWED);
} else if (no_goto_news &&
!strncmp(user_input_buffer, "news:", 5)) {
- _statusline(GOTO_NEWS_DISALLOWED);
- sleep(MessageSecs);
+ HTUserMsg(GOTO_NEWS_DISALLOWED);
} else if (no_goto_nntp &&
!strncmp(user_input_buffer, "nntp:", 5)) {
- _statusline(GOTO_NNTP_DISALLOWED);
- sleep(MessageSecs);
+ HTUserMsg(GOTO_NNTP_DISALLOWED);
} else if (no_goto_rlogin &&
!strncmp(user_input_buffer, "rlogin:", 7)) {
- _statusline(GOTO_RLOGIN_DISALLOWED);
- sleep(MessageSecs);
+ HTUserMsg(GOTO_RLOGIN_DISALLOWED);
} else if (no_goto_snews &&
!strncmp(user_input_buffer, "snews:", 6)) {
- _statusline(GOTO_SNEWS_DISALLOWED);
- sleep(MessageSecs);
+ HTUserMsg(GOTO_SNEWS_DISALLOWED);
} else if (no_goto_telnet &&
!strncmp(user_input_buffer, "telnet:", 7)) {
- _statusline(GOTO_TELNET_DISALLOWED);
- sleep(MessageSecs);
+ HTUserMsg(GOTO_TELNET_DISALLOWED);
} else if (no_goto_tn3270 &&
!strncmp(user_input_buffer, "tn3270:", 7)) {
- _statusline(GOTO_TN3270_DISALLOWED);
- sleep(MessageSecs);
+ HTUserMsg(GOTO_TN3270_DISALLOWED);
} else if (no_goto_wais &&
!strncmp(user_input_buffer, "wais:", 5)) {
- _statusline(GOTO_WAIS_DISALLOWED);
- sleep(MessageSecs);
+ HTUserMsg(GOTO_WAIS_DISALLOWED);
} else if (!strncmp(user_input_buffer, "LYNXCOOKIE:", 11) ||
!strncmp(user_input_buffer, "LYNXDIRED:", 10) ||
!strncmp(user_input_buffer, "LYNXDOWNLOAD:", 13) ||
!strncmp(user_input_buffer, "LYNXOPTIONS:", 12) ||
!strncmp(user_input_buffer, "LYNXPRINT:", 10)) {
- _statusline(GOTO_SPECIAL_DISALLOWED);
- sleep(MessageSecs);
+ HTUserMsg(GOTO_SPECIAL_DISALLOWED);
} else {
StrAllocCopy(newdoc.address, user_input_buffer);
@@ -3716,8 +3643,7 @@ check_goto_URL:
if (indexfile[0]=='\0') { /* no defined index */
if (old_c != real_c) {
old_c = real_c;
- _statusline(NO_INDEX_FILE);
- sleep(MessageSecs);
+ HTUserMsg(NO_INDEX_FILE);
}
} else {
@@ -3807,8 +3733,7 @@ check_goto_URL:
} else {
if (old_c != real_c) {
old_c = real_c;
- _statusline(IN_MAIN_SCREEN);
- sleep(MessageSecs);
+ HTUserMsg(IN_MAIN_SCREEN);
}
}
break;
@@ -3853,9 +3778,7 @@ check_goto_URL:
curdoc.safe != TRUE) &&
confirm_post_resub(curdoc.address, curdoc.title,
2, 1) == FALSE) {
- _statusline(WILL_NOT_RELOAD_DOC);
- sleep(InfoSecs);
-
+ HTInfoMsg(WILL_NOT_RELOAD_DOC);
} else {
StrAllocCopy(newdoc.address, curdoc.address);
if (((strcmp(CurrentUserAgent, (LYUserAgent ?
@@ -3880,8 +3803,7 @@ check_goto_URL:
reloading = TRUE;
}
if (lynx_mode == FORMS_LYNX_MODE) {
- _statusline(RELOADING_FORM);
- sleep(AlertSecs);
+ HTAlert(RELOADING_FORM);
}
if (HTisDocumentSource()) {
HTOutputFormat = WWW_SOURCE;
@@ -3941,6 +3863,13 @@ check_goto_URL:
if (check_realm)
LYPermitURL = TRUE;
refresh_screen = TRUE; /* redisplay */
+
+ /*
+ * FIXME: this is a temporary solution until we find the
+ * correct place for this command to reload the document before
+ * 'options menu' only when necessary.
+ */
+ HTuncache_current_document();
}
#endif /* EXP_FORMS_OPTIONS */
break;
@@ -4017,8 +3946,7 @@ check_goto_URL:
}
} else if (old_c != real_c) {
old_c = real_c;
- _statusline(NOT_ISINDEX);
- sleep(MessageSecs);
+ HTUserMsg(NOT_ISINDEX);
}
break;
@@ -4095,14 +4023,12 @@ check_goto_URL:
strncasecomp(curdoc.address, "http", 4)) {
if (old_c != real_c) {
old_c = real_c;
- _statusline(NO_OWNER);
- sleep(MessageSecs);
+ HTUserMsg(NO_OWNER);
}
} else if (no_mail) {
if (old_c != real_c) {
old_c = real_c;
- _statusline(MAIL_DISALLOWED);
- sleep(MessageSecs);
+ HTUserMsg(MAIL_DISALLOWED);
}
} else {
_statusline(CONFIRM_COMMENT);
@@ -4271,8 +4197,7 @@ check_goto_URL:
if (no_editor) {
if (old_c != real_c) {
old_c = real_c;
- _statusline(EDIT_DISABLED);
- sleep(MessageSecs);
+ HTUserMsg(EDIT_DISABLED);
}
break;
}
@@ -4299,8 +4224,7 @@ check_goto_URL:
}
HTUnEscape(tp);
if (stat(tp, &dir_info) == -1) {
- _statusline(NO_STATUS);
- sleep(AlertSecs);
+ HTAlert(NO_STATUS);
} else {
if (S_ISREG(dir_info.st_mode)) {
StrAllocCopy(tp, cp);
@@ -4360,8 +4284,7 @@ check_goto_URL:
} else {
if (old_c != real_c) {
old_c = real_c;
- _statusline(NO_EDITOR);
- sleep(MessageSecs);
+ HTUserMsg(NO_EDITOR);
}
}
break;
@@ -4445,8 +4368,7 @@ check_goto_URL:
if (LYValidate) {
if (old_c != real_c) {
old_c = real_c;
- _statusline(PRINT_DISABLED);
- sleep(MessageSecs);
+ HTUserMsg(PRINT_DISABLED);
}
break;
}
@@ -4519,8 +4441,7 @@ check_goto_URL:
* Print visited links page to file.
*/
if (LYShowVisitedLinks(&newdoc.address) < 0) {
- _statusline(VISITED_LINKS_EMPTY);
- sleep(MessageSecs);
+ HTUserMsg(VISITED_LINKS_EMPTY);
break;
}
StrAllocCopy(newdoc.title, VISITED_LINKS_TITLE);
@@ -4541,8 +4462,7 @@ check_goto_URL:
if (!HText_hasToolbar(HTMainText)) {
if (old_c != real_c) {
old_c = real_c;
- _statusline(NO_TOOLBAR);
- sleep(MessageSecs);
+ HTUserMsg(NO_TOOLBAR);
}
} else if (old_c != real_c) {
old_c = real_c;
@@ -4579,8 +4499,7 @@ check_goto_URL:
HTDirAccess == HT_DIR_SELECTIVE) {
if (old_c != real_c) {
old_c = real_c;
- _statusline(DFM_NOT_AVAILABLE);
- sleep(MessageSecs);
+ HTUserMsg(DFM_NOT_AVAILABLE);
}
break;
}
@@ -4709,8 +4628,7 @@ check_goto_URL:
if (LYValidate) {
if (old_c != real_c) {
old_c = real_c;
- _statusline(BOOKMARKS_DISABLED);
- sleep(MessageSecs);
+ HTUserMsg(BOOKMARKS_DISABLED);
}
break;
}
@@ -4791,8 +4709,7 @@ check_goto_URL:
/*
* Internal link, and document has POST content.
*/
- _statusline(NOBOOK_POST_FORM);
- sleep(MessageSecs);
+ HTUserMsg(NOBOOK_POST_FORM);
break;
} else {
/*
@@ -4811,8 +4728,7 @@ check_goto_URL:
/*
* Internal link, and document has POST content.
*/
- _statusline(NOBOOK_POST_FORM);
- sleep(MessageSecs);
+ HTUserMsg(NOBOOK_POST_FORM);
break;
}
/*
@@ -4823,8 +4739,7 @@ check_goto_URL:
links[curdoc.link].hightext);
refresh_screen = TRUE; /* MultiBookmark support */
} else {
- _statusline(NOBOOK_FORM_FIELD);
- sleep(MessageSecs);
+ HTUserMsg(NOBOOK_FORM_FIELD);
break;
}
} else {
@@ -4834,16 +4749,14 @@ check_goto_URL:
/*
* No links, and document has POST content. - FM
*/
- _statusline(NOBOOK_POST_FORM);
- sleep(MessageSecs);
+ HTUserMsg(NOBOOK_POST_FORM);
break;
} else if (curdoc.bookmark != NULL) {
/*
* It's a bookmark file from which all
* of the links were deleted. - FM
*/
- _statusline(BOOKMARKS_NOLINKS);
- sleep(MessageSecs);
+ HTUserMsg(BOOKMARKS_NOLINKS);
break;
} else {
_statusline(BOOK_D_OR_CANCEL);
@@ -4870,8 +4783,7 @@ check_add_bookmark_to_self:
} else {
if (old_c != real_c) {
old_c = real_c;
- _statusline(NOBOOK_HSML);
- sleep(MessageSecs);
+ HTUserMsg(NOBOOK_HSML);
}
}
break;
@@ -4880,8 +4792,7 @@ check_add_bookmark_to_self:
if (LYValidate) {
if (old_c != real_c) {
old_c = real_c;
- _statusline(BOOKMARKS_DISABLED);
- sleep(MessageSecs);
+ HTUserMsg(BOOKMARKS_DISABLED);
}
break;
}
@@ -4957,8 +4868,7 @@ check_add_bookmark_to_self:
} else {
if (old_c != real_c) {
old_c = real_c;
- _statusline(SPAWNING_DISABLED);
- sleep(MessageSecs);
+ HTUserMsg(SPAWNING_DISABLED);
}
}
break;
@@ -4971,8 +4881,7 @@ check_add_bookmark_to_self:
(no_download && !override_no_download && no_disk_save)) {
if (old_c != real_c) {
old_c = real_c;
- _statusline(DOWNLOAD_DISABLED);
- sleep(MessageSecs);
+ HTUserMsg(DOWNLOAD_DISABLED);
}
break;
}
@@ -4992,8 +4901,7 @@ check_add_bookmark_to_self:
URL_MAIL_METHOD) {
if (old_c != real_c) {
old_c = real_c;
- _statusline(NO_DOWNLOAD_MAILTO_ACTION);
- sleep(MessageSecs);
+ HTUserMsg(NO_DOWNLOAD_MAILTO_ACTION);
}
break;
}
@@ -5004,24 +4912,21 @@ check_add_bookmark_to_self:
}
if (old_c != real_c) {
old_c = real_c;
- _statusline(NO_DOWNLOAD_INPUT);
- sleep(MessageSecs);
+ HTUserMsg(NO_DOWNLOAD_INPUT);
}
} else if (!strcmp((curdoc.title ? curdoc.title : ""),
COOKIE_JAR_TITLE)) {
if (old_c != real_c) {
old_c = real_c;
- _statusline(NO_DOWNLOAD_COOKIES);
- sleep(MessageSecs);
+ HTUserMsg(NO_DOWNLOAD_COOKIES);
}
} else if (!strcmp((curdoc.title ? curdoc.title : ""),
PRINT_OPTIONS_TITLE)) {
if (old_c != real_c) {
old_c = real_c;
- _statusline(NO_DOWNLOAD_PRINT_OP);
- sleep(MessageSecs);
+ HTUserMsg(NO_DOWNLOAD_PRINT_OP);
}
#ifdef DIRED_SUPPORT
@@ -5030,8 +4935,7 @@ check_add_bookmark_to_self:
UPLOAD_OPTIONS_TITLE)) {
if (old_c != real_c) {
old_c = real_c;
- _statusline(NO_DOWNLOAD_UPLOAD_OP);
- sleep(MessageSecs);
+ HTUserMsg(NO_DOWNLOAD_UPLOAD_OP);
}
} else if (!strcmp(curdoc.address, LYPermitFileURL) ||
@@ -5039,8 +4943,7 @@ check_add_bookmark_to_self:
PERMIT_OPTIONS_TITLE)) {
if (old_c != real_c) {
old_c = real_c;
- _statusline(NO_DOWNLOAD_PERMIT_OP);
- sleep(MessageSecs);
+ HTUserMsg(NO_DOWNLOAD_PERMIT_OP);
}
} else if (lynx_edit_mode && !no_dired_support) {
@@ -5064,8 +4967,7 @@ check_add_bookmark_to_self:
if ((history[number].post_data != NULL &&
history[number].safe != TRUE) &&
HTConfirm(CONFIRM_POST_RESUBMISSION) == FALSE) {
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
break;
}
StrAllocCopy(newdoc.address, history[number].address);
@@ -5110,8 +5012,7 @@ check_add_bookmark_to_self:
"lynxexec:", 9) ||
!strncmp(links[curdoc.link].lname,
"lynxprog:", 9)) {
- _statusline(NO_DOWNLOAD_SPECIAL);
- sleep(MessageSecs);
+ HTUserMsg(NO_DOWNLOAD_SPECIAL);
} else { /* Not a forms, options or history link */
/*
@@ -5152,8 +5053,7 @@ check_add_bookmark_to_self:
}
} else if (old_c != real_c) {
old_c = real_c;
- _statusline(NO_DOWNLOAD_CHOICE);
- sleep(MessageSecs);
+ HTUserMsg(NO_DOWNLOAD_CHOICE);
}
break;
@@ -5220,8 +5120,7 @@ check_add_bookmark_to_self:
#endif /* VMS */
fprintf(tfp, "\t\t%s\n\n", LYNX_TRACELOG_TITLE);
}
- _statusline(WWW_TraceFlag ? TRACE_ON : TRACE_OFF);
- sleep(MessageSecs);
+ HTUserMsg(WWW_TraceFlag ? TRACE_ON : TRACE_OFF);
break;
case LYK_TRACE_LOG: /* View TRACE log. */
@@ -5230,8 +5129,7 @@ check_add_bookmark_to_self:
* in this session. - FM
*/
if (LYTraceLogFP == NULL) {
- _statusline(NO_TRACELOG_STARTED);
- sleep(MessageSecs);
+ HTUserMsg(NO_TRACELOG_STARTED);
break;
}
@@ -5281,9 +5179,8 @@ check_add_bookmark_to_self:
else
clickable_images = TRUE;
- _statusline(clickable_images ?
+ HTUserMsg(clickable_images ?
CLICKABLE_IMAGES_ON : CLICKABLE_IMAGES_OFF);
- sleep(MessageSecs);
cmd = LYK_RELOAD;
goto new_cmd;
@@ -5293,9 +5190,8 @@ check_add_bookmark_to_self:
else
pseudo_inline_alts = TRUE;
- _statusline(pseudo_inline_alts ?
+ HTUserMsg(pseudo_inline_alts ?
PSEUDO_INLINE_ALTS_ON : PSEUDO_INLINE_ALTS_OFF);
- sleep(MessageSecs);
cmd = LYK_RELOAD;
goto new_cmd;
@@ -5304,10 +5200,9 @@ check_add_bookmark_to_self:
LYUseDefaultRawMode = FALSE;
else
LYUseDefaultRawMode = TRUE;
- _statusline(LYRawMode ? RAWMODE_OFF : RAWMODE_ON);
+ HTUserMsg(LYRawMode ? RAWMODE_OFF : RAWMODE_ON);
HTMLSetCharacterHandling(current_char_set);
LYRawMode_flag = LYRawMode;
- sleep(MessageSecs);
cmd = LYK_RELOAD;
goto new_cmd;
@@ -5326,8 +5221,7 @@ check_add_bookmark_to_self:
char *scheme = strncmp(curdoc.address, "LYNXIMGMAP:", 11) ?
curdoc.address : curdoc.address + 11;
if (LYCanDoHEAD(scheme) != TRUE) {
- _statusline(DOC_NOT_HTTP_URL);
- sleep(MessageSecs);
+ HTUserMsg(DOC_NOT_HTTP_URL);
} else {
/*
* Check if this is a reply from a POST,
@@ -5337,8 +5231,7 @@ check_add_bookmark_to_self:
if ((curdoc.post_data != NULL &&
curdoc.safe != TRUE) &&
HTConfirm(CONFIRM_POST_DOC_HEAD) == FALSE) {
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
break;
}
HEAD_request = TRUE;
@@ -5361,25 +5254,21 @@ check_add_bookmark_to_self:
(links[curdoc.link].type != WWW_INTERN_LINK_TYPE ||
!curdoc.address ||
strncmp(curdoc.address, "http", 4))) {
- _statusline(LINK_NOT_HTTP_URL);
- sleep(MessageSecs);
+ HTUserMsg(LINK_NOT_HTTP_URL);
} else if (links[curdoc.link].type == WWW_FORM_LINK_TYPE &&
links[curdoc.link].form->disabled) {
- _statusline(FORM_ACTION_DISABLED);
- sleep(MessageSecs);
+ HTUserMsg(FORM_ACTION_DISABLED);
} else if (links[curdoc.link].type == WWW_FORM_LINK_TYPE &&
strncmp(links[curdoc.link].form->submit_action,
"lynxcgi:", 8) &&
strncmp(links[curdoc.link].form->submit_action,
"http", 4)) {
- _statusline(FORM_ACTION_NOT_HTTP_URL);
- sleep(MessageSecs);
+ HTUserMsg(FORM_ACTION_NOT_HTTP_URL);
} else if (links[curdoc.link].type == WWW_FORM_LINK_TYPE &&
links[curdoc.link].form->submit_method ==
URL_POST_METHOD &&
HTConfirm(CONFIRM_POST_LINK_HEAD) == FALSE) {
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
} else {
HEAD_request = TRUE;
LYforce_no_cache = TRUE;
@@ -5398,8 +5287,7 @@ check_add_bookmark_to_self:
if ((curdoc.post_data != NULL &&
curdoc.safe != TRUE) &&
HTConfirm(CONFIRM_POST_DOC_HEAD) == FALSE) {
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
break;
} else if (nlinks > 0) {
/*
@@ -5427,8 +5315,7 @@ check_add_bookmark_to_self:
* current document. - FM
*/
if (LYCanDoHEAD(scheme) != TRUE) {
- _statusline(DOC_NOT_HTTP_URL);
- sleep(MessageSecs);
+ HTUserMsg(DOC_NOT_HTTP_URL);
} else {
HEAD_request = TRUE;
LYforce_no_cache = TRUE;
@@ -5493,10 +5380,9 @@ check_add_bookmark_to_self:
if (old_c != real_c) {
old_c = real_c;
if (no_jump)
- _statusline(JUMP_DISALLOWED);
+ HTUserMsg(JUMP_DISALLOWED);
else
- _statusline(NO_JUMPFILE);
- sleep(MessageSecs);
+ HTUserMsg(NO_JUMPFILE);
}
} else {
LYJumpFileURL = TRUE;
@@ -5516,8 +5402,7 @@ check_add_bookmark_to_self:
goto check_recall;
}
FREE(temp);
- statusline(NO_RANDOM_URLS_YET);
- sleep(MessageSecs);
+ HTUserMsg(NO_RANDOM_URLS_YET);
break;
}
ret = HTParse((ret+3), startfile, PARSE_ALL);
@@ -5571,11 +5456,10 @@ check_add_bookmark_to_self:
HTClearHTTPAuthInfo();
HTClearNNTPAuthInfo();
HTClearFTPPassword();
- _statusline(AUTH_INFO_CLEARED);
+ HTUserMsg(AUTH_INFO_CLEARED);
} else {
- _statusline(CANCELLED);
+ HTUserMsg(CANCELLED);
}
- sleep(MessageSecs);
}
break;
diff --git a/src/LYNews.c b/src/LYNews.c
index 91c6fc3d..b04e7a96 100644
--- a/src/LYNews.c
+++ b/src/LYNews.c
@@ -122,8 +122,7 @@ PUBLIC char *LYNewsPost ARGS2(
if (LYgetstr(user_input, VISIBLE,
sizeof(user_input), NORECALL) < 0 ||
term_message) {
- _statusline(NEWS_POST_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(NEWS_POST_CANCELLED);
LYCloseTempFP(fd); /* Close the temp file. */
scrollok(stdscr, FALSE); /* Stop scrolling. */
goto cleanup;
@@ -152,8 +151,7 @@ PUBLIC char *LYNewsPost ARGS2(
if (LYgetstr(user_input, VISIBLE,
sizeof(user_input), NORECALL) < 0 ||
term_message) {
- _statusline(NEWS_POST_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(NEWS_POST_CANCELLED);
LYCloseTempFP(fd); /* Close the temp file. */
scrollok(stdscr, FALSE); /* Stop scrolling. */
goto cleanup;
@@ -188,8 +186,7 @@ PUBLIC char *LYNewsPost ARGS2(
if (LYgetstr(user_input, VISIBLE,
sizeof(user_input), NORECALL) < 0 ||
term_message) {
- _statusline(NEWS_POST_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(NEWS_POST_CANCELLED);
LYCloseTempFP(fd); /* Close the temp file. */
scrollok(stdscr, FALSE); /* Stop scrolling. */
goto cleanup;
@@ -245,8 +242,7 @@ PUBLIC char *LYNewsPost ARGS2(
stop_curses();
if (system(user_input)) {
start_curses();
- _statusline(ERROR_SPAWNING_EDITOR);
- sleep(AlertSecs);
+ HTAlert(ERROR_SPAWNING_EDITOR);
} else {
start_curses();
}
@@ -263,8 +259,7 @@ PUBLIC char *LYNewsPost ARGS2(
if (LYgetstr(user_input, VISIBLE,
sizeof(user_input), NORECALL) < 0 ||
term_message) {
- _statusline(NEWS_POST_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(NEWS_POST_CANCELLED);
LYCloseTempFP(fd); /* Close the temp file. */
scrollok(stdscr, FALSE); /* Stop scrolling. */
goto cleanup;
@@ -275,8 +270,7 @@ PUBLIC char *LYNewsPost ARGS2(
*user_input = '\0';
if (LYgetstr(user_input, VISIBLE,
sizeof(user_input), NORECALL) < 0) {
- _statusline(NEWS_POST_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(NEWS_POST_CANCELLED);
LYCloseTempFP(fd); /* Close the temp file. */
scrollok(stdscr, FALSE); /* Stop scrolling. */
goto cleanup;
@@ -363,9 +357,8 @@ PUBLIC char *LYNewsPost ARGS2(
LYforce_no_cache = TRUE;
}
LYStatusLine = (LYlines - 1);
- statusline(POSTING_TO_NEWS);
+ HTUserMsg(POSTING_TO_NEWS);
LYStatusLine = -1;
- sleep(MessageSecs);
/*
* Come here to cleanup and exit.
diff --git a/src/LYOptions.c b/src/LYOptions.c
index 267d8770..38622372 100644
--- a/src/LYOptions.c
+++ b/src/LYOptions.c
@@ -44,7 +44,6 @@ PRIVATE int popup_choice PARAMS((
char ** choices,
int i_length,
int disabled));
-#endif /* EXP_FORMS_OPTIONS */
#define MAXCHOICES 10
@@ -61,55 +60,9 @@ PRIVATE int popup_choice PARAMS((
#define L_Dired (use_assume_charset ? L_DIRED + 1 : L_DIRED)
#define L_User_Mode (use_assume_charset ? L_USER_MODE + 1 : L_USER_MODE)
#define L_User_Agent (use_assume_charset ? L_USER_AGENT + 1 : L_USER_AGENT)
-
-PRIVATE void option_statusline ARGS1(
- CONST char *, text)
-{
- /*
- * Make sure we have a pointer to a string.
- */
- if (text == NULL)
- return;
-
- /*
- * Don't print statusline messages if dumping to stdout.
- */
- if (dump_output_immediately)
- return;
-
- /*
- * Use _statusline() set to output on the bottom line. - FM
- */
- LYStatusLine = (LYlines - 1);
- _statusline(text);
- LYStatusLine = -1;
-}
+#endif /* !EXP_FORMS_OPTIONS */
#ifndef EXP_FORMS_OPTIONS
-PRIVATE void option_user_message ARGS2(
- CONST char *, message,
- char *, argument)
-{
- /*
- * Make sure we have a pointer to a string.
- */
- if (message == NULL || argument == NULL)
- return;
-
- /*
- * Don't print statusline messages if dumping to stdout.
- */
- if (dump_output_immediately)
- return;
-
- /*
- * Use _user_message() set to output on the bottom line.
- */
- LYStatusLine = (LYlines - 1);
- _user_message(message, argument);
- LYStatusLine = -1;
-}
-
PUBLIC void LYoptions NOARGS
{
#ifdef ALLOW_USERS_TO_CHANGE_EXEC_WITHIN_OPTIONS
@@ -161,6 +114,7 @@ PUBLIC void LYoptions NOARGS
#endif /* DIRED_SUPPORT */
term_options = FALSE;
+ LYStatusLine = (LYlines - 1); /* screen is otherwise too crowded */
signal(SIGINT, terminate_options);
if (no_option_save) {
if (LYShowColor == SHOW_COLOR_NEVER) {
@@ -302,7 +256,7 @@ draw_options:
} else {
switch (LYChosenShowColor) {
case SHOW_COLOR_NEVER:
- addstr("NEVER ");
+ addstr("NEVER ");
break;
case SHOW_COLOR_OFF:
addstr("OFF");
@@ -411,7 +365,7 @@ draw_options:
response != '>' && !term_options &&
response != 7 && response != 3) {
if (AddValueAccepted == TRUE) {
- option_statusline(VALUE_ACCEPTED);
+ _statusline(VALUE_ACCEPTED);
AddValueAccepted = FALSE;
}
move((LYlines - 2), 0);
@@ -431,9 +385,9 @@ draw_options:
case 'e': /* Change the editor. */
case 'E':
if (no_editor) {
- option_statusline(EDIT_DISABLED);
+ _statusline(EDIT_DISABLED);
} else if (system_editor ) {
- option_statusline(EDITOR_LOCKED);
+ _statusline(EDITOR_LOCKED);
} else {
if (editor && *editor)
strcpy(display_option, editor);
@@ -442,7 +396,7 @@ draw_options:
addstr(" ");
*display_option = '\0';
}
- option_statusline(ACCEPT_DATA);
+ _statusline(ACCEPT_DATA);
move(L_EDITOR, COL_OPTION_VALUES);
start_bold();
ch = LYgetstr(display_option, VISIBLE,
@@ -461,11 +415,10 @@ draw_options:
}
clrtoeol();
if (ch == -1) {
- option_statusline(CANCELLED);
- sleep(InfoSecs);
- option_statusline("");
+ HTInfoMsg(CANCELLED);
+ HTInfoMsg("");
} else {
- option_statusline(VALUE_ACCEPTED);
+ _statusline(VALUE_ACCEPTED);
}
}
response = ' ';
@@ -480,7 +433,7 @@ draw_options:
addstr(" ");
*display_option = '\0';
}
- option_statusline(ACCEPT_DATA);
+ _statusline(ACCEPT_DATA);
move(L_DISPLAY, COL_OPTION_VALUES);
start_bold();
ch = LYgetstr(display_option, VISIBLE,
@@ -502,11 +455,10 @@ draw_options:
addstr((display && *display) ? display : "NONE");
clrtoeol();
if (ch == -1) {
- option_statusline(CANCELLED);
- sleep(InfoSecs);
- option_statusline("");
+ HTInfoMsg(CANCELLED);
+ HTInfoMsg("");
} else {
- option_statusline(VALUE_ACCEPTED);
+ _statusline(VALUE_ACCEPTED);
}
response = ' ';
break;
@@ -519,7 +471,7 @@ draw_options:
*/
addstr("NONE");
clrtoeol();
- option_statusline(VALUE_ACCEPTED);
+ _statusline(VALUE_ACCEPTED);
response = ' ';
break;
}
@@ -547,18 +499,18 @@ draw_options:
!strcmp(display, display_option))) {
if (display == NULL &&
LYisConfiguredForX == TRUE) {
- option_statusline(VALUE_ACCEPTED_WARNING_X);
+ _statusline(VALUE_ACCEPTED_WARNING_X);
} else if (display != NULL &&
LYisConfiguredForX == FALSE) {
- option_statusline(VALUE_ACCEPTED_WARNING_NONX);
+ _statusline(VALUE_ACCEPTED_WARNING_NONX);
} else {
- option_statusline(VALUE_ACCEPTED);
+ _statusline(VALUE_ACCEPTED);
}
} else {
if (*display_option) {
- option_statusline(FAILED_TO_SET_DISPLAY);
+ _statusline(FAILED_TO_SET_DISPLAY);
} else {
- option_statusline(FAILED_CLEAR_SET_DISPLAY);
+ _statusline(FAILED_CLEAR_SET_DISPLAY);
}
}
response = ' ';
@@ -567,7 +519,7 @@ draw_options:
case 'l': /* Change multibookmarks option. */
case 'L':
if (LYMBMBlocked) {
- option_statusline(MULTIBOOKMARKS_DISALLOWED);
+ _statusline(MULTIBOOKMARKS_DISALLOWED);
response = ' ';
break;
}
@@ -654,7 +606,7 @@ draw_options:
clrtoeol();
*display_option = '\0';
}
- option_statusline(ACCEPT_DATA);
+ _statusline(ACCEPT_DATA);
move(L_HOME, C_DEFAULT);
start_bold();
ch = LYgetstr(display_option, VISIBLE,
@@ -670,7 +622,7 @@ draw_options:
addstr((bookmark_page && *bookmark_page) ?
bookmark_page : "NONE");
clrtoeol();
- option_statusline(USE_PATH_OFF_HOME);
+ _statusline(USE_PATH_OFF_HOME);
response = ' ';
break;
} else {
@@ -681,14 +633,13 @@ draw_options:
}
clrtoeol();
if (ch == -1) {
- option_statusline(CANCELLED);
- sleep(InfoSecs);
- option_statusline("");
+ HTInfoMsg(CANCELLED);
+ HTInfoMsg("");
} else {
- option_statusline(VALUE_ACCEPTED);
+ _statusline(VALUE_ACCEPTED);
}
} else { /* anonymous */
- option_statusline(BOOKMARK_CHANGE_DISALLOWED);
+ _statusline(BOOKMARK_CHANGE_DISALLOWED);
}
response = ' ';
break;
@@ -750,7 +701,7 @@ draw_options:
addstr(" ");
*display_option = '\0';
}
- option_statusline(ACCEPT_DATA);
+ _statusline(ACCEPT_DATA);
move(L_MAIL_ADDRESS, COL_OPTION_VALUES);
start_bold();
ch = LYgetstr(display_option, VISIBLE,
@@ -770,16 +721,15 @@ draw_options:
}
clrtoeol();
if (ch == -1) {
- option_statusline(CANCELLED);
- sleep(InfoSecs);
- option_statusline("");
+ HTInfoMsg(CANCELLED);
+ HTInfoMsg("");
} else {
- option_statusline(VALUE_ACCEPTED);
+ _statusline(VALUE_ACCEPTED);
}
response = ' ';
break;
- case 's': /* Change case sentitivity for searches. */
+ case 's': /* Change case sensitivity for searches. */
case 'S':
/*
* Copy strings into choice array.
@@ -871,7 +821,7 @@ draw_options:
#endif /* !VMS || USE_SLANG */
}
} else {
- option_statusline(NEED_ADVANCED_USER_MODE);
+ _statusline(NEED_ADVANCED_USER_MODE);
AddValueAccepted = FALSE;
}
break;
@@ -961,7 +911,7 @@ draw_options:
addstr(" ");
*display_option = '\0';
}
- option_statusline(ACCEPT_DATA);
+ _statusline(ACCEPT_DATA);
move(L_LANGUAGE, COL_OPTION_VALUES);
start_bold();
ch = LYgetstr(display_option, VISIBLE,
@@ -980,11 +930,10 @@ draw_options:
}
clrtoeol();
if (ch == -1) {
- option_statusline(CANCELLED);
- sleep(InfoSecs);
- option_statusline("");
+ HTInfoMsg(CANCELLED);
+ HTInfoMsg("");
} else {
- option_statusline(VALUE_ACCEPTED);
+ _statusline(VALUE_ACCEPTED);
}
response = ' ';
break;
@@ -998,7 +947,7 @@ draw_options:
addstr(" ");
*display_option = '\0';
}
- option_statusline(ACCEPT_DATA);
+ _statusline(ACCEPT_DATA);
move(L_PREF_CHARSET, COL_OPTION_VALUES);
start_bold();
ch = LYgetstr(display_option, VISIBLE,
@@ -1017,11 +966,10 @@ draw_options:
}
clrtoeol();
if (ch == -1) {
- option_statusline(CANCELLED);
- sleep(InfoSecs);
- option_statusline("");
+ HTInfoMsg(CANCELLED);
+ HTInfoMsg("");
} else {
- option_statusline(VALUE_ACCEPTED);
+ _statusline(VALUE_ACCEPTED);
}
response = ' ';
break;
@@ -1075,7 +1023,7 @@ draw_options:
case 'W': /* Change show dotfiles setting. */
case 'w':
if (no_dotfiles) {
- option_statusline(DOTFILE_ACCESS_DISABLED);
+ _statusline(DOTFILE_ACCESS_DISABLED);
} else {
/*
* Copy strings into choice array.
@@ -1121,12 +1069,11 @@ draw_options:
if (!has_colors()) {
char * terminal = getenv("TERM");
if (terminal)
- option_user_message(
+ HTUserMsg2(
COLOR_TOGGLE_DISABLED_FOR_TERM,
terminal);
else
- option_statusline(COLOR_TOGGLE_DISABLED);
- sleep(AlertSecs);
+ HTUserMsg(COLOR_TOGGLE_DISABLED);
}
#endif
/*
@@ -1183,12 +1130,11 @@ draw_options:
if (again) {
char * terminal = getenv("TERM");
if (terminal)
- option_user_message(
+ HTUserMsg2(
COLOR_TOGGLE_DISABLED_FOR_TERM,
terminal);
else
- option_statusline(COLOR_TOGGLE_DISABLED);
- sleep(AlertSecs);
+ HTUserMsg(COLOR_TOGGLE_DISABLED);
}
#endif
} while (again);
@@ -1448,7 +1394,7 @@ draw_options:
addstr(" ");
*display_option = '\0';
}
- option_statusline(ACCEPT_DATA_OR_DEFAULT);
+ _statusline(ACCEPT_DATA_OR_DEFAULT);
move(L_User_Agent, COL_OPTION_VALUES);
start_bold();
ch = LYgetstr(display_option, VISIBLE,
@@ -1470,18 +1416,17 @@ draw_options:
}
clrtoeol();
if (ch == -1) {
- option_statusline(CANCELLED);
- sleep(InfoSecs);
- option_statusline("");
+ HTInfoMsg(CANCELLED);
+ HTInfoMsg("");
} else if (LYUserAgent && *LYUserAgent &&
!strstr(LYUserAgent, "Lynx") &&
!strstr(LYUserAgent, "lynx")) {
- option_statusline(UA_COPYRIGHT_WARNING);
+ _statusline(UA_COPYRIGHT_WARNING);
} else {
- option_statusline(VALUE_ACCEPTED);
+ _statusline(VALUE_ACCEPTED);
}
} else { /* disallowed */
- option_statusline(UA_COPYRIGHT_WARNING);
+ _statusline(UA_COPYRIGHT_WARNING);
}
response = ' ';
break;
@@ -1490,7 +1435,7 @@ draw_options:
case 'x': /* Change local exec restriction. */
case 'X':
if (exec_frozen && !LYSelectPopups) {
- option_statusline(CHANGE_OF_SETTING_DISALLOWED);
+ _statusline(CHANGE_OF_SETTING_DISALLOWED);
response = ' ';
break;
}
@@ -1574,15 +1519,15 @@ draw_options:
case '>': /* Save current options to RC file. */
if (!no_option_save) {
- option_statusline(SAVING_OPTIONS);
+ _statusline(SAVING_OPTIONS);
if (save_rc()) {
LYrcShowColor = LYChosenShowColor;
- option_statusline(OPTIONS_SAVED);
+ _statusline(OPTIONS_SAVED);
} else {
HTAlert(OPTIONS_NOT_SAVED);
}
} else {
- option_statusline(R_TO_RETURN_TO_LYNX);
+ _statusline(R_TO_RETURN_TO_LYNX);
/*
* Change response so that we don't exit
* the options menu.
@@ -1597,14 +1542,15 @@ draw_options:
default:
if (!no_option_save) {
- option_statusline(SAVE_OR_R_TO_RETURN_TO_LYNX);
+ _statusline(SAVE_OR_R_TO_RETURN_TO_LYNX);
} else {
- option_statusline(R_TO_RETURN_TO_LYNX);
+ _statusline(R_TO_RETURN_TO_LYNX);
}
} /* end switch */
} /* end while */
term_options = FALSE;
+ LYStatusLine = -1; /* let user_mode have some of the screen */
signal(SIGINT, cleanup_sig);
}
@@ -1638,7 +1584,7 @@ PRIVATE int boolean_choice ARGS4(
/*
* Update the statusline.
*/
- option_statusline(ANY_KEY_CHANGE_RET_ACCEPT);
+ _statusline(ANY_KEY_CHANGE_RET_ACCEPT);
/*
* Highlight the current choice.
@@ -1746,17 +1692,16 @@ PRIVATE int boolean_choice ARGS4(
if (term_options) {
term_options = FALSE;
- option_statusline(CANCELLED);
- sleep(InfoSecs);
- option_statusline("");
+ HTInfoMsg(CANCELLED);
+ HTInfoMsg("");
} else {
- option_statusline(VALUE_ACCEPTED);
+ _statusline(VALUE_ACCEPTED);
}
return(cur_choice);
}
}
}
-#endif /* EXP_FORMS_OPTIONS */
+#endif /* !EXP_FORMS_OPTIONS */
PRIVATE void terminate_options ARGS1(
int, sig GCC_UNUSED)
@@ -1915,13 +1860,13 @@ draw_bookmark_list:
*/
if (response == '>') {
if (!no_option_save) {
- option_statusline(SAVING_OPTIONS);
+ _statusline(SAVING_OPTIONS);
if (save_rc())
- option_statusline(OPTIONS_SAVED);
+ _statusline(OPTIONS_SAVED);
else
HTAlert(OPTIONS_NOT_SAVED);
} else {
- option_statusline(R_TO_RETURN_TO_LYNX);
+ _statusline(R_TO_RETURN_TO_LYNX);
/*
* Change response so that we don't exit
* the options menu.
@@ -1978,7 +1923,7 @@ draw_bookmark_list:
goto draw_bookmark_list;
}
}
- option_statusline(ACCEPT_DATA);
+ _statusline(ACCEPT_DATA);
if (a > 0) {
start_bold();
@@ -2079,15 +2024,14 @@ PRIVATE int get_popup_choice_number ARGS1(
*/
temp[0] = *c;
temp[1] = '\0';
- option_statusline(OPTION_CHOICE_NUMBER);
+ _statusline(OPTION_CHOICE_NUMBER);
/*
* Get the number, possibly with a suffix, from the user.
*/
if (LYgetstr(temp, VISIBLE, sizeof(temp), NORECALL) < 0 ||
*temp == 0 || term_options) {
- option_statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
*c = '\0';
term_options = FALSE;
return(0);
@@ -2264,7 +2208,7 @@ PRIVATE int popup_choice ARGS6(
if (!(form_window = newwin(bottom - top, (Lnum + width + 4),
top, (lx - 1))) &&
!(form_window = newwin(bottom - top, 0, top, 0))) {
- option_statusline(POPUP_FAILED);
+ _statusline(POPUP_FAILED);
return(orig_choice);
}
scrollok(form_window, TRUE);
@@ -2287,9 +2231,9 @@ PRIVATE int popup_choice ARGS6(
move((LYlines - 2), 0);
clrtoeol();
if (disabled) {
- option_statusline(CHOICE_LIST_UNM_MSG);
+ _statusline(CHOICE_LIST_UNM_MSG);
} else {
- option_statusline(CHOICE_LIST_MESSAGE);
+ _statusline(CHOICE_LIST_MESSAGE);
}
/*
@@ -2464,21 +2408,20 @@ redraw:
*/
if (number <= 1) {
if (window_offset == 0) {
- option_statusline(ALREADY_AT_CHOICE_BEGIN);
- sleep(MessageSecs);
+ HTUserMsg(ALREADY_AT_CHOICE_BEGIN);
if (disabled) {
- option_statusline(CHOICE_LIST_UNM_MSG);
+ _statusline(CHOICE_LIST_UNM_MSG);
} else {
- option_statusline(CHOICE_LIST_MESSAGE);
+ _statusline(CHOICE_LIST_MESSAGE);
}
break;
}
window_offset = 0;
cur_choice = 0;
if (disabled) {
- option_statusline(CHOICE_LIST_UNM_MSG);
+ _statusline(CHOICE_LIST_UNM_MSG);
} else {
- option_statusline(CHOICE_LIST_MESSAGE);
+ _statusline(CHOICE_LIST_MESSAGE);
}
goto redraw;
}
@@ -2489,12 +2432,11 @@ redraw:
*/
if (number >= npages) {
if (window_offset >= ((num_choices - length) + 1)) {
- option_statusline(ALREADY_AT_CHOICE_END);
- sleep(MessageSecs);
+ HTUserMsg(ALREADY_AT_CHOICE_END);
if (disabled) {
- option_statusline(CHOICE_LIST_UNM_MSG);
+ _statusline(CHOICE_LIST_UNM_MSG);
} else {
- option_statusline(CHOICE_LIST_MESSAGE);
+ _statusline(CHOICE_LIST_MESSAGE);
}
break;
}
@@ -2505,9 +2447,9 @@ redraw:
if (cur_choice < window_offset)
cur_choice = window_offset;
if (disabled) {
- option_statusline(CHOICE_LIST_UNM_MSG);
+ _statusline(CHOICE_LIST_UNM_MSG);
} else {
- option_statusline(CHOICE_LIST_MESSAGE);
+ _statusline(CHOICE_LIST_MESSAGE);
}
goto redraw;
}
@@ -2517,20 +2459,19 @@ redraw:
*/
if (((number - 1) * length) == window_offset) {
sprintf(buffer, ALREADY_AT_CHOICE_PAGE, number);
- option_statusline(buffer);
- sleep(MessageSecs);
+ HTUserMsg(buffer);
if (disabled) {
- option_statusline(CHOICE_LIST_UNM_MSG);
+ _statusline(CHOICE_LIST_UNM_MSG);
} else {
- option_statusline(CHOICE_LIST_MESSAGE);
+ _statusline(CHOICE_LIST_MESSAGE);
}
break;
}
cur_choice = window_offset = ((number - 1) * length);
if (disabled) {
- option_statusline(CHOICE_LIST_UNM_MSG);
+ _statusline(CHOICE_LIST_UNM_MSG);
} else {
- option_statusline(CHOICE_LIST_MESSAGE);
+ _statusline(CHOICE_LIST_MESSAGE);
}
goto redraw;
@@ -2568,12 +2509,11 @@ redraw:
*/
sprintf(buffer,
CHOICE_ALREADY_CURRENT, (number + 1));
- option_statusline(buffer);
- sleep(MessageSecs);
+ HTUserMsg(buffer);
if (disabled) {
- option_statusline(CHOICE_LIST_UNM_MSG);
+ _statusline(CHOICE_LIST_UNM_MSG);
} else {
- option_statusline(CHOICE_LIST_MESSAGE);
+ _statusline(CHOICE_LIST_MESSAGE);
}
break;
}
@@ -2597,9 +2537,9 @@ redraw:
window_offset = 0;
}
if (disabled) {
- option_statusline(CHOICE_LIST_UNM_MSG);
+ _statusline(CHOICE_LIST_UNM_MSG);
} else {
- option_statusline(CHOICE_LIST_MESSAGE);
+ _statusline(CHOICE_LIST_MESSAGE);
}
goto redraw;
}
@@ -2607,8 +2547,7 @@ redraw:
/*
* Not in range. - FM
*/
- option_statusline(BAD_CHOICE_NUM_ENTERED);
- sleep(MessageSecs);
+ HTUserMsg(BAD_CHOICE_NUM_ENTERED);
}
}
@@ -2616,9 +2555,9 @@ redraw:
* Restore the popup statusline. - FM
*/
if (disabled) {
- option_statusline(CHOICE_LIST_UNM_MSG);
+ _statusline(CHOICE_LIST_UNM_MSG);
} else {
- option_statusline(CHOICE_LIST_MESSAGE);
+ _statusline(CHOICE_LIST_MESSAGE);
}
break;
@@ -2836,15 +2775,14 @@ redraw:
strcpy(prev_target, prev_target_buffer);
case LYK_WHEREIS:
if (*prev_target == '\0' ) {
- option_statusline(ENTER_WHEREIS_QUERY);
+ _statusline(ENTER_WHEREIS_QUERY);
if ((ch = LYgetstr(prev_target, VISIBLE,
sizeof(prev_target_buffer),
recall)) < 0) {
/*
* User cancelled the search via ^G. - FM
*/
- option_statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
goto restore_popup_statusline;
}
}
@@ -2855,8 +2793,7 @@ check_recall:
/*
* No entry. Simply break. - FM
*/
- option_statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
goto restore_popup_statusline;
}
@@ -2896,21 +2833,20 @@ check_recall:
strcpy(prev_target, cp);
if (*prev_target_buffer &&
!strcmp(prev_target_buffer, prev_target)) {
- option_statusline(EDIT_CURRENT_QUERY);
+ _statusline(EDIT_CURRENT_QUERY);
} else if ((*prev_target_buffer && QueryTotal == 2) ||
(!(*prev_target_buffer) &&
QueryTotal == 1)) {
- option_statusline(EDIT_THE_PREV_QUERY);
+ _statusline(EDIT_THE_PREV_QUERY);
} else {
- option_statusline(EDIT_A_PREV_QUERY);
+ _statusline(EDIT_A_PREV_QUERY);
}
if ((ch = LYgetstr(prev_target, VISIBLE,
sizeof(prev_target_buffer), recall)) < 0) {
/*
* User cancelled the search via ^G. - FM
*/
- option_statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
goto restore_popup_statusline;
}
goto check_recall;
@@ -2951,14 +2887,14 @@ check_recall:
strcpy(prev_target, cp);
if (*prev_target_buffer &&
!strcmp(prev_target_buffer, prev_target)) {
- option_statusline(EDIT_CURRENT_QUERY);
+ _statusline(EDIT_CURRENT_QUERY);
} else if ((*prev_target_buffer &&
QueryTotal == 2) ||
(!(*prev_target_buffer) &&
QueryTotal == 1)) {
- option_statusline(EDIT_THE_PREV_QUERY);
+ _statusline(EDIT_THE_PREV_QUERY);
} else {
- option_statusline(EDIT_A_PREV_QUERY);
+ _statusline(EDIT_A_PREV_QUERY);
}
if ((ch = LYgetstr(prev_target, VISIBLE,
sizeof(prev_target_buffer),
@@ -2966,8 +2902,7 @@ check_recall:
/*
* User cancelled the search via ^G. - FM
*/
- option_statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
goto restore_popup_statusline;
}
goto check_recall;
@@ -3017,8 +2952,7 @@ check_recall:
* If we started at the beginning, it can't be present. - FM
*/
if (cur_choice == 0) {
- option_user_message(STRING_NOT_FOUND, prev_target_buffer);
- sleep(MessageSecs);
+ HTUserMsg2(STRING_NOT_FOUND, prev_target_buffer);
goto restore_popup_statusline;
}
@@ -3060,8 +2994,7 @@ check_recall:
/*
* Didn't find it in the preceding choices either. - FM
*/
- option_user_message(STRING_NOT_FOUND, prev_target_buffer);
- sleep(MessageSecs);
+ HTUserMsg2(STRING_NOT_FOUND, prev_target_buffer);
restore_popup_statusline:
/*
@@ -3069,9 +3002,9 @@ restore_popup_statusline:
* reset the search variables. - FM
*/
if (disabled)
- option_statusline(CHOICE_LIST_UNM_MSG);
+ _statusline(CHOICE_LIST_UNM_MSG);
else
- option_statusline(CHOICE_LIST_MESSAGE);
+ _statusline(CHOICE_LIST_MESSAGE);
*prev_target = '\0';
QueryTotal = (search_queries ? HTList_count(search_queries)
: 0);
@@ -3088,8 +3021,7 @@ restore_popup_statusline:
case LYK_PREV_DOC:
cur_choice = orig_choice;
term_options = TRUE;
- option_statusline(CANCELLED);
- sleep(MessageSecs);
+ HTUserMsg(CANCELLED);
cmd = LYK_ACTIVATE; /* to exit */
break;
}
@@ -3102,10 +3034,10 @@ restore_popup_statusline:
#endif /* !USE_SLANG */
if (disabled || term_options) {
- option_statusline("");
+ _statusline("");
return(orig_choice);
} else {
- option_statusline(VALUE_ACCEPTED);
+ _statusline(VALUE_ACCEPTED);
return(cur_choice);
}
}
@@ -3117,14 +3049,27 @@ restore_popup_statusline:
* so we don't have to worry about the intelligence of the compiler.
* We don't need to burn memory like it's cheap. We're better than that.
*/
-static char * selected_string = "selected";
-static char * disabled_string = "disabled";
-static char * label_string = "label";
-static char * on_string = "ON";
-static char * off_string = "OFF";
-static char * never_string = "NEVER";
-static char * always_string = "ALWAYS";
-static char * empty_string = "";
+#define SELECTED(flag) (flag) ? selected_string : ""
+#define DISABLED(flag) (flag) ? disabled_string : ""
+#define NOTEMPTY(text) (text && text[0]) ? text : ""
+
+typedef struct {
+ int value;
+ CONST char *LongName;
+ CONST char *HtmlName;
+} OptValues;
+
+typedef struct {
+ char * tag;
+ char * value;
+} PostPair;
+
+static CONST char selected_string[] = "selected";
+static CONST char disabled_string[] = "disabled";
+static CONST char on_string[] = "ON";
+static CONST char off_string[] = "OFF";
+static CONST char never_string[] = "NEVER";
+static CONST char always_string[] = "ALWAYS";
static char * secure_string = "secure";
static char * secure_value = NULL;
@@ -3133,20 +3078,16 @@ static char * editor_string = "editor";
static char * display_string = "display";
-static char * ftp_sort_string = "ftp_sort";
-static char * ftp_by_name_string = "ftp_by_name";
-static char * ftp_by_type_string = "ftp_by_type";
-static char * ftp_by_size_string = "ftp_by_size";
-static char * ftp_by_date_string = "ftp_by_date";
+static char * mbm_string = "multi_bookmarks_mode";
+static char * mbm_off_string = "OFF";
+static char * mbm_standard_string = "STANDARD";
+static char * mbm_advanced_string = "ADVANCED";
+static char * single_bookmark_string = "single_bookmark_name";
static char * mail_address_string = "mail_address";
static char * save_options_string = "save_options";
-static char * search_type_string = "search_type";
-static char * search_case_insensitive_string = "case_insensitive";
-static char * search_case_sensitive_string = "case_sensitive";
-
static char * preferred_doc_lang_string = "preferred_doc_lang";
static char * preferred_doc_char_string = "preferred_doc_char";
@@ -3169,25 +3110,98 @@ static char * select_popups_string = "select_popups";
static char * show_cursor_string = "show_cursor";
-static char * keypad_mode_string = "keypad_mode";
-static char * number_arrows_string = "number_arrows";
-static char * links_numbered_string = "links_numbered";
-static char * links_and_forms_string = "links_and_forms";
+static OptValues bool_values[] = {
+ { FALSE, "OFF", "OFF" },
+ { TRUE, "ON", "ON" },
+ { 0, 0, 0 }};
+static OptValues dired_values[] = {
+ { 0, "Directories first", "dired_dir" },
+ { FILES_FIRST, "Files first", "dired_files" },
+ { MIXED_STYLE, "Mixed style", "dired_mixed" },
+ { 0, 0, 0 }};
static char * dired_sort_string = "dired_sort";
-static char * dired_dir_string = "dired_dir";
-static char * dired_files_string = "dired_files";
-static char * dired_mixed_string = "dired_mixed";
+static OptValues ftp_sort_values[] = {
+ { FILE_BY_NAME, "By Name", "ftp_by_name" },
+ { FILE_BY_TYPE, "By Type", "ftp_by_type" },
+ { FILE_BY_SIZE, "By Size", "ftp_by_size" },
+ { FILE_BY_DATE, "By Date", "ftp_by_date" },
+ { 0, 0, 0 }};
+static char * ftp_sort_string = "ftp_sort";
+
+static OptValues keypad_mode_values[] = {
+ { NUMBERS_AS_ARROWS, "Numbers act as arrows", "number_arrows" },
+ { LINKS_ARE_NUMBERED,
+ "Links are numbered",
+ "links_numbered" },
+ { LINKS_AND_FORM_FIELDS_ARE_NUMBERED,
+ "Links and form fields are numbered",
+ "links_and_forms" },
+ { 0, 0, 0 }};
+static char * keypad_mode_string = "keypad_mode";
+
+static OptValues search_type_values[] = {
+ { FALSE, "Case insensitive", "case_insensitive" },
+ { TRUE, "Case sensitive", "case_sensitive" },
+ { 0, 0, 0 }};
+static char * search_type_string = "search_type";
+
+static OptValues show_color_values[] = {
+ { SHOW_COLOR_NEVER, never_string, never_string },
+ { SHOW_COLOR_OFF, off_string, off_string },
+ { SHOW_COLOR_ON, on_string, on_string },
+ { SHOW_COLOR_ALWAYS, always_string, always_string },
+ { 0, 0, 0 }};
+
+static OptValues user_mode_values[] = {
+ { NOVICE_MODE, "Novice", "Novice" },
+ { INTERMEDIATE_MODE, "Intermediate", "Intermediate" },
+ { ADVANCED_MODE, "Advanced", "Advanced" },
+ { 0, 0, 0 }};
static char * user_mode_string = "user_mode";
-static char * user_novice = "Novice";
-static char * user_intermediate = "Intermediate";
-static char * user_advanced = "Advanced";
-struct post_pair {
- char * tag;
- char * value;
-};
+#define PutLabel(fp, text) \
+ fprintf(fp,"<label>%s:</label> ", text)
+
+#define PutOption(fp, flag, html, name) \
+ fprintf(fp, "<option %s value=\"%s\">%s</option>\n", \
+ SELECTED(flag), html, name)
+
+#define BeginSelect(fp, text) \
+ fprintf(fp,"<select name=\"%s\">\n", text)
+
+#define MaybeSelect(fp, flag, text) \
+ fprintf(fp,"<select %s name=\"%s\">\n", DISABLED(flag), text)
+
+#define EndSelect(fp)\
+ fprintf(fp, "</select>\n")
+
+PRIVATE void PutOptValues ARGS3(
+ FILE *, fp,
+ int, value,
+ OptValues *, table)
+{
+ while (table->LongName != 0) {
+ PutOption(fp,
+ value == table->value,
+ table->HtmlName,
+ table->LongName);
+ table++;
+ }
+}
+
+PRIVATE int GetOptValues ARGS2(
+ OptValues *, table,
+ char *, value)
+{
+ while (table->LongName != 0) {
+ if (!strcmp(value, table->HtmlName))
+ return table->value;
+ table++;
+ }
+ return -1;
+}
/*
* Break cgi line into array of pairs of pointers. Don't bother trying to
@@ -3199,17 +3213,17 @@ struct post_pair {
* Not pretty, but works. Hey, if strings can be null terminate arrays...
*/
-PRIVATE struct post_pair * break_data ARGS1(
+PRIVATE PostPair * break_data ARGS1(
char *, data)
{
char * p = data;
- struct post_pair * q = NULL;
+ PostPair * q = NULL;
int count = 0;
if (p==NULL || p[0]=='\0')
return NULL;
- q = calloc(sizeof(struct post_pair), 1);
+ q = calloc(sizeof(PostPair), 1);
if (q==NULL)
outofmem(__FILE__, "break_data(calloc)");
@@ -3231,10 +3245,10 @@ PRIVATE struct post_pair * break_data ARGS1(
count++;
/*
- * Like I said, screw effeciency. Sides, realloc is fast on
+ * Like I said, screw efficiency. Sides, realloc is fast on
* Linux ;->
*/
- q = realloc(q, sizeof(struct post_pair)*(count+1));
+ q = realloc(q, sizeof(PostPair)*(count+1));
if (q==NULL)
outofmem(__FILE__, "break_data(realloc)");
q[count].tag=NULL;
@@ -3253,22 +3267,39 @@ PRIVATE struct post_pair * break_data ARGS1(
* Another values (like display_char_set or assume_char_set) used by lynx
* initial rendering stages and can be changed only after reloading :-(
* So we introduce boolean flag 'need_reload' (currently dummy).
+ *
+ * Options processed in order according to gen_options(),
+ * to avoid possible dependencies we add boolean flags
+ * where the order is essential (save, character sets...)
*/
PUBLIC int postoptions ARGS1(
document *, newdoc)
{
- struct post_pair *data;
+ PostPair *data = 0;
int i;
BOOLEAN save_all = FALSE;
+ BOOLEAN display_char_set_changed = FALSE;
+ BOOLEAN raw_mode_changed = FALSE;
+ BOOLEAN assume_char_set_changed = FALSE;
BOOLEAN need_reload = FALSE;
+ char *link_info = NULL;
+
+ /*-------------------------------------------------
+ * kludge a link from mbm_menu, the URL was:
+ * fprintf(fp0,"<a href=\"LYNXOPTIONS://MBM_MENU\">go mbm menu</a>\n");
+ *--------------------------------------------------*/
+
+ StrAllocCopy(link_info, newdoc->address);
+ if (strstr(link_info, "LYNXOPTIONS://MBM_MENU")) {
+ edit_bookmarks();
+ FREE(newdoc->post_data);
+ FREE(data);
+ return(NULLFILE);
+ }
data = break_data(newdoc->post_data);
- /*
- * This is just plain ugly. Perhaps someone will have the will power
- * to do this programmatically? MRC
- */
for (i = 0; data[i].tag != NULL; i++) {
/*
* Paranoid security.
@@ -3301,18 +3332,35 @@ PUBLIC int postoptions ARGS1(
}
/*
+ * multi-bookmarks mode
+ */
+ if (!strcmp(data[i].tag, mbm_string)) {
+ if (!strcmp(data[i].value, mbm_off_string)) {
+ LYMultiBookmarks = FALSE;
+ } else if (!strcmp(data[i].value, mbm_standard_string)) {
+ LYMultiBookmarks = TRUE;
+ LYMBMAdvanced = FALSE;
+ } else if (!strcmp(data[i].value, mbm_advanced_string)) {
+ LYMultiBookmarks = TRUE;
+ LYMBMAdvanced = TRUE;
+ }
+ }
+
+ /*
+ * single bookmarks file name
+ */
+ if (!strcmp(data[i].tag, single_bookmark_string)) {
+ if (strcmp(data[i].value, "")) {
+ FREE(bookmark_page);
+ StrAllocCopy(bookmark_page, data[i].value);
+ }
+ }
+
+ /*
* ftp sort
*/
if (!strcmp(data[i].tag, ftp_sort_string)) {
- if (!strcmp(data[i].value, ftp_by_name_string)) {
- HTfileSortMethod = FILE_BY_NAME;
- } else if (!strcmp(data[i].value, ftp_by_type_string)) {
- HTfileSortMethod = FILE_BY_TYPE;
- } else if (!strcmp(data[i].value, ftp_by_size_string)) {
- HTfileSortMethod = FILE_BY_SIZE;
- } else if (!strcmp(data[i].value, ftp_by_date_string)) {
- HTfileSortMethod = FILE_BY_DATE;
- }
+ HTfileSortMethod = GetOptValues(ftp_sort_values, data[i].value);
}
/*
@@ -3327,11 +3375,7 @@ PUBLIC int postoptions ARGS1(
* search_type
*/
if (!strcmp(data[i].tag, search_type_string)) {
- if (!strcmp(data[i].value, search_case_insensitive_string)) {
- case_sensitive = FALSE;
- } else if (!strcmp(data[i].value, search_case_sensitive_string)) {
- case_sensitive = TRUE;
- }
+ case_sensitive = GetOptValues(search_type_values, data[i].value);
}
/*
@@ -3351,16 +3395,27 @@ PUBLIC int postoptions ARGS1(
}
/*
+ * display_char_set
+ */
+ if (!strcmp(data[i].tag, display_char_set_string)) {
+ int newval;
+
+ newval = atoi(data[i].value);
+ if (newval != current_char_set) {
+ current_char_set = newval;
+ display_char_set_changed = TRUE;
+ }
+ }
+
+ /*
* raw_mode
*/
if (!strcmp(data[i].tag, raw_mode_string)) {
- BOOLEAN newmode;
- newmode = (!strcmp(data[i].value, on_string));
+ BOOLEAN newmode = GetOptValues(bool_values, data[i].value);
+
if (newmode != LYRawMode) {
LYRawMode = newmode;
- HTMLSetUseDefaultRawMode(current_char_set, LYRawMode);
- HTMLSetCharacterHandling(current_char_set);
- need_reload = TRUE;
+ raw_mode_changed = TRUE;
}
}
@@ -3371,44 +3426,10 @@ PUBLIC int postoptions ARGS1(
int newval;
newval = UCGetLYhndl_byMIME(data[i].value);
- /*
- * Set the raw 8-bit or CJK mode defaults and
- * character set if changed. - FM
- */
- /*
- * FIXME: I have no clue if I got this right. Since this is
- * forms based, we should probably flag that we may have
- * changed something here, then when we're done, check to see
- * if the user also changed RAW mode. If they did, take what
- * they set, even if it doesn't make sense. Otherwise, use
- * what we calculate here.
- */
if (newval != UCLYhndl_for_unspec) {
UCLYhndl_for_unspec = newval;
StrAllocCopy(UCAssume_MIMEcharset, data[i].value);
- LYRawMode = (UCLYhndl_for_unspec == current_char_set);
- HTMLSetUseDefaultRawMode(current_char_set, LYRawMode);
- HTMLSetCharacterHandling(current_char_set);
- }
- }
-
- /*
- * display_char_set
- */
- if (!strcmp(data[i].tag, display_char_set_string)) {
- int newval;
-
- newval = atoi(data[i].value);
- /*
- * Set the LYUseDefaultRawMode value and character
- * handling if LYRawMode was changed. - FM
- */
- if (newval != current_char_set) {
- current_char_set = newval;
- HTMLSetRawModeDefault(current_char_set);
- LYUseDefaultRawMode = TRUE;
- HTMLUseCharacterSet(current_char_set);
- need_reload = TRUE;
+ assume_char_set_changed = TRUE;
}
}
@@ -3416,15 +3437,7 @@ PUBLIC int postoptions ARGS1(
* show_color
*/
if (!strcmp(data[i].tag, show_color_string)) {
- if (!strcmp(data[i].value, never_string)) {
- LYShowColor = SHOW_COLOR_NEVER;
- } else if (!strcmp(data[i].value, off_string)) {
- LYShowColor = SHOW_COLOR_OFF;
- } else if (!strcmp(data[i].value, on_string)) {
- LYShowColor = SHOW_COLOR_ON;
- } else if (!strcmp(data[i].value, always_string)) {
- LYShowColor = SHOW_COLOR_ALWAYS;
- }
+ LYShowColor = GetOptValues(show_color_values, data[i].value);
LYChosenShowColor = LYShowColor;
}
@@ -3432,11 +3445,9 @@ PUBLIC int postoptions ARGS1(
* vi_keys
*/
if (!strcmp(data[i].tag, vi_keys_string)) {
- if (!strcmp(data[i].value, on_string)) {
- vi_keys = TRUE;
+ if ((vi_keys = GetOptValues(bool_values, data[i].value))) {
set_vi_keys();
} else if (!strcmp(data[i].value, off_string)) {
- vi_keys = FALSE;
reset_vi_keys();
}
}
@@ -3445,11 +3456,9 @@ PUBLIC int postoptions ARGS1(
* emacs_keys
*/
if (!strcmp(data[i].tag, emacs_keys_string)) {
- if (!strcmp(data[i].value, on_string)) {
- emacs_keys = TRUE;
+ if ((emacs_keys = GetOptValues(bool_values, data[i].value))) {
set_emacs_keys();
- } else if (!strcmp(data[i].value, off_string)) {
- emacs_keys = FALSE;
+ } else {
reset_emacs_keys();
}
}
@@ -3458,46 +3467,28 @@ PUBLIC int postoptions ARGS1(
* show_dotfiles
*/
if (!strcmp(data[i].tag, show_dotfiles_string)) {
- if (!strcmp(data[i].value, on_string)) {
- show_dotfiles = TRUE;
- } else if (!strcmp(data[i].value, off_string)) {
- show_dotfiles = FALSE;
- }
+ show_dotfiles = GetOptValues(bool_values, data[i].value);
}
/*
* select_popups
*/
if (!strcmp(data[i].tag, select_popups_string)) {
- if (!strcmp(data[i].value, on_string)) {
- LYSelectPopups = TRUE;
- } else if (!strcmp(data[i].value, off_string)) {
- LYSelectPopups = FALSE;
- }
+ LYSelectPopups = GetOptValues(bool_values, data[i].value);
}
/*
* show_cursor
*/
if (!strcmp(data[i].tag, show_cursor_string)) {
- if (!strcmp(data[i].value, on_string)) {
- LYShowCursor = TRUE;
- } else if (!strcmp(data[i].value, off_string)) {
- LYShowCursor = FALSE;
- }
+ LYShowCursor = GetOptValues(bool_values, data[i].value);
}
/*
* keypad_mode
*/
if (!strcmp(data[i].tag, keypad_mode_string)) {
- if (!strcmp(data[i].value, number_arrows_string)) {
- keypad_mode = NUMBERS_AS_ARROWS;
- } else if (!strcmp(data[i].value, links_numbered_string)) {
- keypad_mode = LINKS_ARE_NUMBERED;
- } else if (!strcmp(data[i].value, links_and_forms_string)) {
- keypad_mode = LINKS_AND_FORM_FIELDS_ARE_NUMBERED;
- }
+ keypad_mode = GetOptValues(keypad_mode_values, data[i].value);
}
#ifdef DIRED_SUPPORT
@@ -3505,13 +3496,7 @@ PUBLIC int postoptions ARGS1(
* dired_sort
*/
if (!strcmp(data[i].tag, dired_sort_string)) {
- if (!strcmp(data[i].value, dired_dir_string)) {
- dir_list_style = 0;
- } else if (!strcmp(data[i].value, dired_files_string)) {
- dir_list_style = FILES_FIRST;
- } else if (!strcmp(data[i].value, dired_mixed_string)) {
- dir_list_style = MIXED_STYLE;
- }
+ dir_list_style = GetOptValues(dired_values, data[i].value);
}
#endif /* DIRED_SUPPORT */
@@ -3519,13 +3504,7 @@ PUBLIC int postoptions ARGS1(
* user_mode
*/
if (!strcmp(data[i].tag, user_mode_string)) {
- if (!strcmp(data[i].value, user_novice)) {
- user_mode = NOVICE_MODE;
- } else if (!strcmp(data[i].value, user_intermediate)) {
- user_mode = INTERMEDIATE_MODE;
- } else if (!strcmp(data[i].value, user_advanced)) {
- user_mode = ADVANCED_MODE;
- }
+ user_mode = GetOptValues(user_mode_values, data[i].value);
}
/*
@@ -3534,16 +3513,48 @@ PUBLIC int postoptions ARGS1(
if (!strcmp(data[i].tag, save_options_string)) {
save_all = TRUE;
}
- }
+ } /* end of loop */
+
+ /*
+ * Process the flags:
+ */
+ if ( display_char_set_changed || raw_mode_changed || assume_char_set_changed ) {
+ /*
+ * charset settings: the order is essential here.
+ */
+ if (display_char_set_changed) {
+ /*
+ * Set the LYUseDefaultRawMode value and character
+ * handling if LYRawMode was changed. - FM
+ */
+ HTMLSetRawModeDefault(current_char_set);
+ LYUseDefaultRawMode = TRUE;
+ HTMLUseCharacterSet(current_char_set);
+ }
+ if (assume_char_set_changed) {
+ LYRawMode = (UCLYhndl_for_unspec == current_char_set);
+ }
+ if (raw_mode_changed || assume_char_set_changed) {
+ /*
+ * Set the raw 8-bit or CJK mode defaults and
+ * character set if changed. - FM
+ */
+ HTMLSetUseDefaultRawMode(current_char_set, LYRawMode);
+ HTMLSetCharacterHandling(current_char_set);
+ }
+ need_reload = TRUE;
+ } /* end of charset settings */
+
+
/*
* FIXME: Golly gee, we need to write all of this out now, don't we?
*/
FREE(newdoc->post_data);
FREE(data);
if (save_all) {
- option_statusline(SAVING_OPTIONS);
+ _statusline(SAVING_OPTIONS);
if (save_rc()) {
- option_statusline(OPTIONS_SAVED);
+ _statusline(OPTIONS_SAVED);
} else {
HTAlert(OPTIONS_NOT_SAVED);
}
@@ -3561,10 +3572,6 @@ PUBLIC int postoptions ARGS1(
* Basic Strategy: For each option, throw up the appropriate type of
* control, giving defaults as appropriate. If nothing else, we're
* probably going to test every control there is. MRC
- *
- * Each option from this form will be processed whether it was changed or not.
- * The order may be important for some fields (like RawMode)
- * unless we add a special flag in postoptions()
*/
PUBLIC int gen_options ARGS1(
char **, newfile)
@@ -3572,8 +3579,9 @@ PUBLIC int gen_options ARGS1(
int i;
BOOLEAN can_do_colors;
static char tempfile[256];
- static char print_filename[256];
+ char any_filename[256];
FILE *fp0;
+ char *leaf;
LYRemoveTemp(tempfile);
fp0 = LYOpenTemp(tempfile, HTML_SUFFIX, "w");
@@ -3582,12 +3590,12 @@ PUBLIC int gen_options ARGS1(
return(-1);
}
- LYLocalFileToURL(print_filename, tempfile);
+ LYLocalFileToURL(any_filename, tempfile);
- StrAllocCopy(*newfile, print_filename);
+ StrAllocCopy(*newfile, any_filename);
LYforce_no_cache = TRUE;
- fprintf(fp0, "<html><head>\n<title>%s</title>\n</head>\n<body>\n",
+ fprintf(fp0, "<html>\n<head>\n<title>%s</title>\n</head>\n<body>\n",
OPTIONS_TITLE);
fprintf(fp0,"<h1>Options Menu (%s Version %s)</h1>\n",
@@ -3608,7 +3616,7 @@ PUBLIC int gen_options ARGS1(
secure_string, secure_value);
/*
- * visible preformated text begins here
+ * visible preformatted text begins here
*/
fprintf(fp0,"<pre>\n\n");
@@ -3617,109 +3625,135 @@ PUBLIC int gen_options ARGS1(
*/
fprintf(fp0,"<input type=\"submit\" value=\"Accept Changes\">");
fprintf(fp0," <input type=\"reset\" value=\"Reset\">");
- fprintf(fp0," Use the back key to cancel changes.\n\n");
+ fprintf(fp0," Use the back key to cancel changes.");
+
+ strcpy(any_filename, helpfile);
+ if ((leaf = strrchr(any_filename, '/')) != 0)
+ leaf++;
+ else
+ leaf = any_filename;
+ strcpy(leaf, "keystrokes/option_help.html");
+
+ fprintf(fp0," <a href=\"%s\"> HELP available</a>\n\n", any_filename);
/*
* editor
*/
- fprintf(fp0,"<%s>Editor:</%s> ", label_string, label_string);
+ PutLabel(fp0, "Editor");
fprintf(fp0,"<input %s type=\"text\" name=\"%s\" value=\"%s\">\n",
- (no_editor || system_editor)?disabled_string:empty_string,
- editor_string, (editor && editor[0])?editor:empty_string);
+ DISABLED(no_editor || system_editor),
+ editor_string,
+ NOTEMPTY(editor));
/*
* display
*/
- fprintf(fp0,"<%s>Display:</%s> ", label_string, label_string);
+ PutLabel(fp0, "Display");
fprintf(fp0,"<input type=\"text\" name=\"%s\" value=\"%s\">\n",
- display_string, (display && display[0])?display:empty_string);
+ display_string,
+ NOTEMPTY(display));
+
+ /*
+ * multi-bookmarks mode
+ */
+ if (!LYMBMBlocked) {
+ PutLabel(fp0, "Multi-bookmarks");
+ BeginSelect(fp0, mbm_string);
+ PutOption(fp0, !LYMultiBookmarks,
+ mbm_off_string,
+ mbm_off_string);
+ PutOption(fp0, LYMultiBookmarks && !LYMBMAdvanced,
+ mbm_standard_string,
+ mbm_standard_string);
+ PutOption(fp0, LYMultiBookmarks && LYMBMAdvanced,
+ mbm_advanced_string,
+ mbm_advanced_string);
+ EndSelect(fp0);
+ }
+
+ /*
+ * bookmarks files menu
+ */
+ if (LYMultiBookmarks) {
+
+ PutLabel(fp0, "Review/edit Bookmarks files");
+ fprintf(fp0,"<a href=\"LYNXOPTIONS://MBM_MENU\">go mbm menu</a>\n");
+
+ } else {
+ PutLabel(fp0, "Bookmarks file");
+ fprintf(fp0,"<input type=\"text\" name=\"%s\" value=\"%s\">\n",
+ single_bookmark_string,
+ NOTEMPTY(bookmark_page));
+ }
/*
* ftp sort
*/
- fprintf(fp0,"<%s>Ftp sort criteria:</%s> ", label_string, label_string);
- fprintf(fp0,"<select name=\"%s\">\n", ftp_sort_string);
- fprintf(fp0,"<option %s value=\"%s\">By Name</option>\n",
- (HTfileSortMethod == FILE_BY_NAME)?selected_string:empty_string,
- ftp_by_name_string);
- fprintf(fp0,"<option %s value=\"%s\">By Type</option>\n",
- (HTfileSortMethod == FILE_BY_TYPE)?selected_string:empty_string,
- ftp_by_type_string);
- fprintf(fp0,"<option %s value=\"%s\">By Size</option>\n",
- (HTfileSortMethod == FILE_BY_SIZE)?selected_string:empty_string,
- ftp_by_size_string);
- fprintf(fp0,"<option %s value=\"%s\">By Date</option>\n",
- (HTfileSortMethod == FILE_BY_DATE)?selected_string:empty_string,
- ftp_by_date_string);
- fprintf(fp0,"</select>\n");
+ PutLabel(fp0, "Ftp sort criteria");
+ BeginSelect(fp0, ftp_sort_string);
+ PutOptValues(fp0, HTfileSortMethod, ftp_sort_values);
+ EndSelect(fp0);
/*
* mail_address
*/
- fprintf(fp0,"<%s>Personal mail address:</%s> ", label_string,
- label_string);
+ PutLabel(fp0, "Personal mail address");
fprintf(fp0,"<input type=\"text\" name=\"%s\" value=\"%s\">\n",
mail_address_string,
- (personal_mail_address && personal_mail_address[0])?
- personal_mail_address:empty_string);
+ NOTEMPTY(personal_mail_address));
/*
* search_type
*/
- fprintf(fp0,"<%s>Searching type:</%s> ", label_string, label_string);
- fprintf(fp0,"<select name=\"%s\">\n", search_type_string);
- fprintf(fp0,"<option %s value=\"%s\">Case insensitive</option>\n",
- case_sensitive?empty_string:selected_string,
- search_case_insensitive_string);
- fprintf(fp0,"<option %s value=\"%s\">Case sensitive</option>\n",
- case_sensitive?selected_string:empty_string,
- search_case_sensitive_string);
- fprintf(fp0,"</select>\n");
+ PutLabel(fp0, "Searching type");
+ BeginSelect(fp0, search_type_string);
+ PutOptValues(fp0, case_sensitive, search_type_values);
+ EndSelect(fp0);
/*
* preferred_doc_lang
*/
- fprintf(fp0,"<%s>Preferred document language</%s> ", label_string,
- label_string);
+ PutLabel(fp0, "Preferred document language");
fprintf(fp0,"<input type=\"text\" name=\"%s\" value=\"%s\">\n",
preferred_doc_lang_string,
- (language && language[0])?language:empty_string);
+ NOTEMPTY(language));
/*
* preferred_doc_char
*/
- fprintf(fp0,"<%s>Preferred document character set</%s> ", label_string,
- label_string);
+ PutLabel(fp0, "Preferred document character set");
fprintf(fp0,"<input type=\"text\" name=\"%s\" value=\"%s\">\n",
preferred_doc_char_string,
- (pref_charset && pref_charset[0])?pref_charset:empty_string);
+ NOTEMPTY(pref_charset));
/*
* display_char_set
*/
- fprintf(fp0,"<%s>Display character set:</%s> ", label_string,
- label_string);
- fprintf(fp0,"<select name=\"%s\">\n", display_char_set_string);
+ PutLabel(fp0, "Display character set");
+ BeginSelect(fp0, display_char_set_string);
for (i = 0; LYchar_set_names[i]; i++) {
- fprintf(fp0,"<option %s value=\"%d\">%s</options>\n",
- (i==current_char_set)?selected_string:empty_string,
- i, LYchar_set_names[i]);
+ char temp[10];
+ sprintf(temp, "%d", i);
+ PutOption(fp0, i==current_char_set, temp, LYchar_set_names[i]);
}
- fprintf(fp0,"</select>\n");
+ EndSelect(fp0);
/*
* raw_mode
*/
- fprintf(fp0,"<%s>Raw 8-bit or CJK mode:</%s> ", label_string,
- label_string);
- fprintf(fp0,"<select name=\"%s\">\n", raw_mode_string);
- fprintf(fp0,"<option %s value=\"%s\">%s</option>\n",
- (LYRawMode)?empty_string:selected_string,
- off_string, off_string);
- fprintf(fp0,"<option %s value=\"%s\">%s</option>\n",
- (LYRawMode)?selected_string:empty_string,
- on_string, on_string);
- fprintf(fp0,"</select>\n");
+ if (LYHaveCJKCharacterSet)
+ /*
+ * Since CJK people hardly mixed with other world
+ * we split the header to make it more readable:
+ * "CJK mode" for CJK display charsets, and "Raw 8-bit" for others.
+ */
+ PutLabel(fp0, "CJK mode");
+ else
+ PutLabel(fp0, "Raw 8-bit");
+
+ BeginSelect(fp0, raw_mode_string);
+ PutOptValues(fp0, LYRawMode, bool_values);
+ EndSelect(fp0);
/*
* assume_char_set
@@ -3729,7 +3763,7 @@ PUBLIC int gen_options ARGS1(
* string that was displayed. Now, user will never see that. Good
* or bad? I don't know. MRC
*/
- if (user_mode==ADVANCED_MODE) {
+ /* if (user_mode==ADVANCED_MODE) */ {
int curval;
curval = UCLYhndl_for_unspec;
@@ -3739,15 +3773,14 @@ PUBLIC int gen_options ARGS1(
if (curval < 0) {
curval = LYRawMode ? current_char_set : 0;
}
- fprintf(fp0,"<%s>Assume Character Set:</%s> ", label_string,
- label_string);
- fprintf(fp0,"<select name=\"%s\">\n", assume_char_set_string);
+ PutLabel(fp0, "Assumed document character set");
+ BeginSelect(fp0, assume_char_set_string);
for (i = 0; i < LYNumCharsets; i++) {
- fprintf(fp0,"<option %s value=\"%s\">%s</option>\n",
- (i==curval)?selected_string:empty_string,
- LYCharSet_UC[i].MIMEname, LYCharSet_UC[i].MIMEname);
+ PutOption(fp0, i==curval,
+ LYCharSet_UC[i].MIMEname,
+ LYCharSet_UC[i].MIMEname);
}
- fprintf(fp0,"</select>\n");
+ EndSelect(fp0);
}
/*
@@ -3758,21 +3791,15 @@ PUBLIC int gen_options ARGS1(
#if defined(COLOR_CURSES)
can_do_colors = has_colors();
#endif
- fprintf(fp0,"<%s>Show Color:</%s> ", label_string, label_string);
- fprintf(fp0,"<select %s name=\"%s\">\n",
- can_do_colors?empty_string:disabled_string, show_color_string);
+ PutLabel(fp0, "Show Color");
+ MaybeSelect(fp0, DISABLED(!can_do_colors), show_color_string);
if (no_option_save) {
if (LYShowColor == SHOW_COLOR_NEVER) {
LYShowColor = SHOW_COLOR_OFF;
} else if (LYShowColor == SHOW_COLOR_ALWAYS) {
LYShowColor = SHOW_COLOR_ON;
}
- fprintf(fp0,"<option %s value=\"%s\">%s</option>\n",
- (LYShowColor==SHOW_COLOR_OFF)?empty_string:selected_string,
- off_string, off_string);
- fprintf(fp0,"<option %s value=\"%s\">%s</option>\n",
- (LYShowColor==SHOW_COLOR_ON)?empty_string:selected_string,
- on_string, on_string);
+ PutOptValues(fp0, LYShowColor, bool_values);
} else {
if (LYChosenShowColor == SHOW_COLOR_UNKNOWN) {
switch (LYrcShowColor) {
@@ -3795,147 +3822,85 @@ PUBLIC int gen_options ARGS1(
SHOW_COLOR_ON : SHOW_COLOR_OFF;
}
}
- fprintf(fp0,"<option %s value=\"%s\">%s</option>\n",
- (LYChosenShowColor==SHOW_COLOR_NEVER)?selected_string:empty_string,
- never_string, never_string);
- fprintf(fp0,"<option %s value=\"%s\">%s</option>\n",
- (LYChosenShowColor==SHOW_COLOR_OFF)?selected_string:empty_string,
- off_string, off_string);
- fprintf(fp0,"<option %s value=\"%s\">%s</option>\n",
- (LYChosenShowColor==SHOW_COLOR_ON)?selected_string:empty_string,
- on_string, on_string);
- fprintf(fp0,"<option %s value=\"%s\">%s</option>\n",
- (LYChosenShowColor==SHOW_COLOR_ALWAYS)?selected_string:empty_string,
- always_string, (can_do_colors)?always_string:"Always try");
+ show_color_values[3].LongName = (can_do_colors)?always_string:"Always try";
+ PutOptValues(fp0, LYChosenShowColor, show_color_values);
}
- fprintf(fp0,"</select>\n");
+ EndSelect(fp0);
#endif /* USE_SLANG || COLOR_CURSES */
/*
* vi_keys
*/
- fprintf(fp0,"<%s>VI Keys:</%s> ", label_string, label_string);
- fprintf(fp0,"<select name=\"%s\">\n", vi_keys_string);
- fprintf(fp0,"<option %s value=\"%s\">%s</option>\n",
- (vi_keys)?empty_string:selected_string,
- off_string, off_string);
- fprintf(fp0,"<option %s value=\"%s\">%s</option>\n",
- (vi_keys)?selected_string:empty_string,
- on_string, on_string);
- fprintf(fp0,"</select>\n");
+ PutLabel(fp0, "VI Keys");
+ BeginSelect(fp0, vi_keys_string);
+ PutOptValues(fp0, vi_keys, bool_values);
+ EndSelect(fp0);
/*
* emacs_keys
*/
- fprintf(fp0,"<%s>Emacs Keys:</%s> ", label_string, label_string);
- fprintf(fp0,"<select name=\"%s\">\n", emacs_keys_string);
- fprintf(fp0,"<option %s value=\"%s\">%s</option>\n",
- (emacs_keys)?empty_string:selected_string,
- off_string, off_string);
- fprintf(fp0,"<option %s value=\"%s\">%s</option>\n",
- (emacs_keys)?selected_string:empty_string,
- on_string, on_string);
- fprintf(fp0,"</select>\n");
+ PutLabel(fp0, "Emacs Keys");
+ BeginSelect(fp0, emacs_keys_string);
+ PutOptValues(fp0, emacs_keys, bool_values);
+ EndSelect(fp0);
/*
* show_dotfiles
*/
if (!no_dotfiles) {
- fprintf(fp0,"<%s>Show dot files:</%s> ", label_string, label_string);
- fprintf(fp0,"<select name=\"%s\">\n", show_dotfiles_string);
- fprintf(fp0,"<option %s value=\"%s\">%s</option>\n",
- (show_dotfiles)?empty_string:selected_string,
- off_string, off_string);
- fprintf(fp0,"<option %s value=\"%s\">%s</option>\n",
- (show_dotfiles)?selected_string:empty_string,
- on_string, on_string);
- fprintf(fp0,"</select>\n");
+ PutLabel(fp0, "Show dot files");
+ BeginSelect(fp0, show_dotfiles_string);
+ PutOptValues(fp0, show_dotfiles, bool_values);
+ EndSelect(fp0);
}
/*
* select_popups
*/
- fprintf(fp0,"<%s>Popups for select fields:</%s> ", label_string,
- label_string);
- fprintf(fp0,"<select name=\"%s\">\n", select_popups_string);
- fprintf(fp0,"<option %s value=\"%s\">%s</option>\n",
- (LYSelectPopups)?empty_string:selected_string,
- off_string, off_string);
- fprintf(fp0,"<option %s value=\"%s\">%s</option>\n",
- (LYSelectPopups)?selected_string:empty_string,
- on_string, on_string);
- fprintf(fp0,"</select>\n");
+ PutLabel(fp0, "Popups for select fields");
+ BeginSelect(fp0, select_popups_string);
+ PutOptValues(fp0, LYSelectPopups, bool_values);
+ EndSelect(fp0);
/*
* show_cursor
*/
- fprintf(fp0,"<%s>Show cursor:</%s> ", label_string, label_string);
- fprintf(fp0,"<select name=\"%s\">\n", show_cursor_string);
- fprintf(fp0,"<option %s value=\"%s\">%s</option>\n",
- (LYShowCursor)?empty_string:selected_string,
- off_string, off_string);
- fprintf(fp0,"<option %s value=\"%s\">%s</option>\n",
- (LYShowCursor)?selected_string:empty_string,
- on_string, on_string);
- fprintf(fp0,"</select>\n");
+ PutLabel(fp0, "Show cursor");
+ BeginSelect(fp0, show_cursor_string);
+ PutOptValues(fp0, LYShowCursor, bool_values);
+ EndSelect(fp0);
/*
* keypad_mode
*/
- fprintf(fp0,"<%s>Keypad Mode:</%s> ", label_string, label_string);
- fprintf(fp0,"<select name=\"%s\">\n", keypad_mode_string);
- fprintf(fp0,"<option %s value=\"%s\">Numbers act as arrows</option>\n",
- (keypad_mode==NUMBERS_AS_ARROWS)?selected_string:empty_string,
- number_arrows_string);
- fprintf(fp0,"<option %s value=\"%s\">Links are numbered</option>\n",
- (keypad_mode==LINKS_ARE_NUMBERED)?selected_string:empty_string,
- links_numbered_string);
- fprintf(fp0,"<option %s value=\"%s\">\
- Links and form fields are numbered</option>\n",
- (keypad_mode==LINKS_AND_FORM_FIELDS_ARE_NUMBERED)?
- selected_string:empty_string, links_and_forms_string);
- fprintf(fp0,"</select>\n");
+ PutLabel(fp0, "Keypad Mode");
+ BeginSelect(fp0, keypad_mode_string);
+ PutOptValues(fp0, keypad_mode, keypad_mode_values);
+ EndSelect(fp0);
#ifdef DIRED_SUPPORT
/*
* dired_sort
*/
- fprintf(fp0,"<%s>Local directory sort criteria:</%s> ", label_string, label_string);
- fprintf(fp0,"<select name=\"%s\">\n", dired_sort_string);
- fprintf(fp0,"<option %s value=\"%s\">Directories first</option>\n",
- (dir_list_style==0)?selected_string:empty_string,
- dired_dir_string);
- fprintf(fp0,"<option %s value=\"%s\">Files first</option>\n",
- (dir_list_style==FILES_FIRST)?selected_string:empty_string,
- dired_files_string);
- fprintf(fp0,"<option %s value=\"%s\">Mixed style</option>\n",
- (dir_list_style==MIXED_STYLE)?selected_string:empty_string,
- dired_mixed_string);
- fprintf(fp0,"</select>\n");
+ PutLabel(fp0, "Local directory sort criteria");
+ BeginSelect(fp0, dired_sort_string);
+ PutOptValues(fp0, dir_list_style, dired_values);
+ EndSelect(fp0);
#endif /* DIRED_SUPPORT */
/*
* user_mode
*/
- fprintf(fp0,"<%s>User Mode:</%s> ", label_string, label_string);
- fprintf(fp0,"<select name=\"%s\">\n", user_mode_string);
- fprintf(fp0,"<option %s value=\"%s\">%s</option>\n",
- (user_mode==NOVICE_MODE)?selected_string:empty_string,
- user_novice, user_novice);
- fprintf(fp0,"<option %s value=\"%s\">%s</option>\n",
- (user_mode==INTERMEDIATE_MODE)?selected_string:empty_string,
- user_intermediate, user_intermediate);
- fprintf(fp0,"<option %s value=\"%s\">%s</option>\n",
- (user_mode==ADVANCED_MODE)?selected_string:empty_string,
- user_advanced, user_advanced);
- fprintf(fp0,"</select>\n");
+ PutLabel(fp0, "User Mode");
+ BeginSelect(fp0, user_mode_string);
+ PutOptValues(fp0, user_mode, user_mode_values);
+ EndSelect(fp0);
/*
* save options
*/
if (!no_option_save) {
- fprintf(fp0,"<%s>Save options to disk: </%s> ", label_string,
- label_string);
+ PutLabel(fp0, "Save options to disk");
fprintf(fp0,"<input type=\"checkbox\" name=\"%s\">\n",
save_options_string);
}
@@ -3943,16 +3908,17 @@ PUBLIC int gen_options ARGS1(
/*
* save/reset
*/
- fprintf(fp0,"\n");
+ fprintf(fp0,"\n");
fprintf(fp0,"<input type=\"submit\" value=\"Accept Changes\">");
- fprintf(fp0," <input type=\"reset\" value=\"Reset\">");
- fprintf(fp0," Use the back key to cancel changes.\n");
-
- /*
- * close HTML
- */
- fprintf(fp0,"</pre>\n");
+ fprintf(fp0," <input type=\"reset\" value=\"Reset\">");
+ fprintf(fp0," Use the back key to cancel changes.\n");
+
+ /*
+ * close HTML
+ */
+ fprintf(fp0,"</pre>\n");
fprintf(fp0,"</body>\n");
+ fprintf(fp0,"</html>\n");
fclose(fp0);
return(0);
diff --git a/src/LYPrint.c b/src/LYPrint.c
index 9a7bc90a..1b5bcb5d 100644
--- a/src/LYPrint.c
+++ b/src/LYPrint.c
@@ -27,7 +27,7 @@
/*
* printfile prints out the current file minus the links and targets
- * to a verity of places
+ * to a variety of places
*/
/* it parses an incoming link that looks like
@@ -342,8 +342,7 @@ PUBLIC int printfile ARGS1(
/*
* Save cancelled.
*/
- _statusline(SAVE_REQUEST_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(SAVE_REQUEST_CANCELLED);
break;
}
@@ -367,8 +366,7 @@ PUBLIC int printfile ARGS1(
if (!strcmp(filename, "/dev/null"))
#endif /* VMS */
{
- _statusline(SAVE_REQUEST_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(SAVE_REQUEST_CANCELLED);
break;
}
if ((cp = strchr(filename, '~'))) {
@@ -439,14 +437,12 @@ PUBLIC int printfile ARGS1(
#ifdef VMS
if (HadVMSInterrupt) {
HadVMSInterrupt = FALSE;
- _statusline(SAVE_REQUEST_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(SAVE_REQUEST_CANCELLED);
break;
}
#endif /* VMS */
if (c == 7 || c == 3) { /* Control-G or Control-C */
- _statusline(SAVE_REQUEST_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(SAVE_REQUEST_CANCELLED);
break;
}
if (TOUPPER(c) == 'N') {
@@ -473,10 +469,17 @@ PUBLIC int printfile ARGS1(
* get any partial or relative URLs resolved
* properly if no BASE tag is present to
* replace it. - FM
+ *
+ * Add timestamp (last reload).
*/
+
fprintf(outfile_fp,
- "<!-- X-URL: %s -->\n<BASE HREF=\"%s\">\n",
- newdoc->address, content_base);
+ "<!-- X-URL: %s -->\n", newdoc->address);
+ if (HText_getDate() != NULL)
+ fprintf(outfile_fp,
+ "<!-- Date: %s -->\n", HText_getDate());
+ fprintf(outfile_fp,
+ "<BASE HREF=\"%s\">\n", content_base);
}
if (LYPrependCharsetToSource && HTisDocumentSource()) {
@@ -543,8 +546,7 @@ PUBLIC int printfile ARGS1(
#ifdef VMS
if (HadVMSInterrupt) {
HadVMSInterrupt = FALSE;
- _statusline(MAIL_REQUEST_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(MAIL_REQUEST_CANCELLED);
break;
}
#endif /* VMS */
@@ -553,8 +555,7 @@ PUBLIC int printfile ARGS1(
addstr(" Ok...");
first_mail_preparsed = FALSE;
} else {
- _statusline(MAIL_REQUEST_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(MAIL_REQUEST_CANCELLED);
break;
}
}
@@ -565,8 +566,7 @@ PUBLIC int printfile ARGS1(
if (LYgetstr(user_response, VISIBLE,
sizeof(user_response), NORECALL) < 0 ||
*user_response == '\0') {
- _statusline(MAIL_REQUEST_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(MAIL_REQUEST_CANCELLED);
break;
}
@@ -733,8 +733,7 @@ PUBLIC int printfile ARGS1(
outfile_fp = popen(buffer, "w");
#endif
if (outfile_fp == NULL) {
- _statusline(MAIL_REQUEST_FAILED);
- sleep(AlertSecs);
+ HTAlert(MAIL_REQUEST_FAILED);
break;
}
@@ -867,8 +866,7 @@ PUBLIC int printfile ARGS1(
#ifdef VMS
if (HadVMSInterrupt) {
HadVMSInterrupt = FALSE;
- _statusline(PRINT_REQUEST_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(PRINT_REQUEST_CANCELLED);
break;
}
#endif /* VMS */
@@ -876,8 +874,7 @@ PUBLIC int printfile ARGS1(
|| c == '\n' || c == '\r') {
addstr(" Ok...");
} else {
- _statusline(PRINT_REQUEST_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(PRINT_REQUEST_CANCELLED);
break;
}
}
@@ -890,8 +887,7 @@ PUBLIC int printfile ARGS1(
*filename = '\0';
if (LYgetstr(filename, VISIBLE,
sizeof(filename), NORECALL) < 0) {
- _statusline(PRINT_REQUEST_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(PRINT_REQUEST_CANCELLED);
break;
}
@@ -955,8 +951,7 @@ PUBLIC int printfile ARGS1(
#ifdef VMS
if (HadVMSInterrupt) {
HadVMSInterrupt = FALSE;
- _statusline(PRINT_REQUEST_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(PRINT_REQUEST_CANCELLED);
break;
}
#endif /* VMS */
@@ -964,8 +959,7 @@ PUBLIC int printfile ARGS1(
|| c == '\n' || c == '\r') {
addstr(" Ok...");
} else {
- _statusline(PRINT_REQUEST_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(PRINT_REQUEST_CANCELLED);
break;
}
}
@@ -1111,8 +1105,7 @@ PUBLIC int printfile ARGS1(
/*
* Printer cancelled.
*/
- _statusline(PRINT_REQUEST_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(PRINT_REQUEST_CANCELLED);
break;
}
@@ -1136,8 +1129,7 @@ PUBLIC int printfile ARGS1(
if (!strcmp(filename, "/dev/null"))
#endif /* VMS */
{
- _statusline(PRINT_REQUEST_CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(PRINT_REQUEST_CANCELLED);
break;
}
HTAddSugFilename(filename);
@@ -1270,7 +1262,7 @@ PUBLIC int print_options ARGS2(
StrAllocCopy(*newfile, print_filename);
- fprintf(fp0, "<head>\n<title>%s</title>\n</head>\n<body>\n",
+ fprintf(fp0, "<html>\n<head>\n<title>%s</title>\n</head>\n<body>\n",
PRINT_OPTIONS_TITLE);
fprintf(fp0,"<h1>Printing Options (%s Version %s)</h1><pre>\n",
@@ -1294,16 +1286,19 @@ PUBLIC int print_options ARGS2(
lines_in_file);
else
fprintf(fp0," Save to disk disabled.\n");
- if (child_lynx == FALSE && no_mail == FALSE)
+ if (child_lynx == FALSE && no_mail == FALSE && local_host_only == FALSE)
fprintf(fp0,
" <a href=\"LYNXPRINT://MAIL_FILE/lines=%d\">Mail the file</a>\n",
lines_in_file);
+
+#ifndef DOSPATH
fprintf(fp0,
" <a href=\"LYNXPRINT://TO_SCREEN/lines=%d\">Print to the screen</a>\n",
lines_in_file);
fprintf(fp0,
" <a href=\"LYNXPRINT://LPANSI/lines=%d\">Print out on a printer attached to your vt100 terminal</a>\n",
lines_in_file);
+#endif
for (count = 0, cur_printer = printers; cur_printer != NULL;
cur_printer = cur_printer->next, count++)
@@ -1315,7 +1310,7 @@ PUBLIC int print_options ARGS2(
cur_printer->name : "No Name Given"));
fprintf(fp0, "</a>\n");
}
- fprintf(fp0, "</pre>\n</body>\n");
+ fprintf(fp0, "</pre>\n</body>\n</html>\n");
LYCloseTempFP(fp0);
LYforce_no_cache = TRUE;
diff --git a/src/LYReadCFG.c b/src/LYReadCFG.c
index 0e503e1d..69bb6a32 100644
--- a/src/LYReadCFG.c
+++ b/src/LYReadCFG.c
@@ -783,6 +783,7 @@ static int viewer_fun ARGS1(
return 0;
}
+/* This table should be sorted alphabetically */
static Config_Type Config_Table [] =
{
PARSE_SET("accept_all_cookies", CONF_BOOL, LYAcceptAllCookies),
@@ -874,6 +875,7 @@ static Config_Type Config_Table [] =
PARSE_INT("messagesecs", CONF_INT, MessageSecs),
PARSE_SET("minimal_comments", CONF_BOOL, minimal_comments),
PARSE_INT("multi_bookmark_support", CONF_BOOL, LYMultiBookmarks),
+ PARSE_SET("ncr_in_bookmarks", CONF_BOOL, LYSaveBookmarksInUnicode),
PARSE_FUN("news_chunk_size", CONF_FUN, news_chunk_size_fun),
PARSE_FUN("news_max_chunk", CONF_FUN, news_max_chunk_fun),
PARSE_FUN("news_posting", CONF_FUN, news_posting_fun),
diff --git a/src/LYSearch.c b/src/LYSearch.c
index 6fcfa362..dfd359c3 100644
--- a/src/LYSearch.c
+++ b/src/LYSearch.c
@@ -1,4 +1,5 @@
#include <HTUtils.h>
+#include <HTAlert.h>
#include <LYUtils.h>
#include <LYStrings.h>
#include <LYSearch.h>
@@ -214,8 +215,7 @@ PUBLIC BOOL textsearch ARGS3(
* Restore prev_target and return. - FM
*/
strcpy(prev_target, prev_target_buffer);
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
return(FALSE);
}
}
@@ -229,8 +229,7 @@ check_recall:
* previous search string will no longer occur, but it can
* be used again via LYK_NEXT. - FM
*/
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
return(FALSE);
}
@@ -281,8 +280,7 @@ check_recall:
* Restore prev_target and return. - FM
*/
strcpy(prev_target, prev_target_buffer);
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
return(FALSE);
}
goto check_recall;
@@ -334,8 +332,7 @@ check_recall:
* Restore prev_target and return. - FM
*/
strcpy(prev_target, prev_target_buffer);
- _statusline(CANCELLED);
- sleep(InfoSecs);
+ HTInfoMsg(CANCELLED);
return(FALSE);
}
goto check_recall;
diff --git a/src/LYShowInfo.c b/src/LYShowInfo.c
index 54be1077..7afe1670 100644
--- a/src/LYShowInfo.c
+++ b/src/LYShowInfo.c
@@ -102,8 +102,7 @@ PUBLIC int showinfo ARGS4(
strcpy(temp, cp);
HTUnEscape(temp);
if (lstat(temp, &dir_info) == -1) {
- _statusline(CURRENT_LINK_STATUS_FAILED);
- sleep(AlertSecs);
+ HTAlert(CURRENT_LINK_STATUS_FAILED);
} else {
char modes[80];
if (S_ISDIR(dir_info.st_mode)) {
diff --git a/src/LYStrings.c b/src/LYStrings.c
index 73a04f8b..4a251812 100644
--- a/src/LYStrings.c
+++ b/src/LYStrings.c
@@ -743,12 +743,9 @@ re_read:
break;
}
default:
- if (TRACE) {
- fprintf(tfp,"Unknown key sequence: %d:%d:%d\n",c,b,a);
- if (!LYTraceLogFP) {
- sleep(MessageSecs);
- }
- }
+ CTRACE(tfp,"Unknown key sequence: %d:%d:%d\n",c,b,a);
+ CTRACE_SLEEP(MessageSecs);
+ break;
}
if (isdigit(a) && (b == '[' || c == 155) && d != -1 && d != '~')
d = GetChar();
@@ -896,6 +893,78 @@ re_read:
}
}
#endif /* HAVE_KEYPAD */
+#ifdef DJGPP_KEYHANDLER
+ else {
+ switch(c) {
+ case K_Down: /* The four arrow keys ... */
+ case K_EDown:
+ c = DNARROW;
+ break;
+ case K_Up:
+ case K_EUp:
+ c = UPARROW;
+ break;
+ case K_Left:
+ case K_ELeft:
+ c = LTARROW;
+ break;
+ case K_Right: /* ... */
+ case K_ERight:
+ c = RTARROW;
+ break;
+ case K_Home: /* Home key (upward+left arrow) */
+ case K_EHome:
+ c = HOME;
+ break;
+ case K_PageDown: /* Next page */
+ case K_EPageDown:
+ c = PGDOWN;
+ break;
+ case K_PageUp: /* Previous page */
+ case K_EPageUp:
+ c = PGUP;
+ break;
+ case K_End: /* home down or bottom (lower left) */
+ case K_EEnd:
+ c = END_KEY;
+ break;
+ }
+ }
+#endif /* DGJPP_KEYHANDLER */
+#if defined(USE_SLANG) && defined(__DJGPP__) && !defined(DJGPP_KEYHANDLER) && !defined(USE_SLANG_KEYMAPS)
+ else {
+ switch(c) {
+ case SL_KEY_DOWN: /* The four arrow keys ... */
+ c = DNARROW;
+ break;
+ case SL_KEY_UP:
+ c = UPARROW;
+ break;
+ case SL_KEY_LEFT:
+ c = LTARROW;
+ break;
+ case SL_KEY_RIGHT: /* ... */
+ c = RTARROW;
+ break;
+ case SL_KEY_HOME: /* Home key (upward+left arrow) */
+ case SL_KEY_A1: /* upper left of keypad */
+ c = HOME;
+ break;
+ case SL_KEY_NPAGE: /* Next page */
+ case SL_KEY_C3: /* lower right of keypad */
+ c = PGDOWN;
+ break;
+ case SL_KEY_PPAGE: /* Previous page */
+ case SL_KEY_A3: /* upper right of keypad */
+ c = PGUP;
+ break;
+ case SL_KEY_END: /* home down or bottom (lower left) */
+ case SL_KEY_C1: /* lower left of keypad */
+ c = END_KEY;
+ break;
+ }
+ }
+#endif /* USE_SLANG && __DJGPP__ && !DJGPP_KEYHANDLER && !USE_SLANG_KEYMAPS */
#if (defined(__DJGPP__) || defined(_WINDOWS))
if (c > 659)
diff --git a/src/LYUpload.c b/src/LYUpload.c
index 125e5dca..fd3b4616 100644
--- a/src/LYUpload.c
+++ b/src/LYUpload.c
@@ -81,8 +81,7 @@ PUBLIC int LYUpload ARGS1(
* Parsed out the Method and the Location?
*/
if (upload_command->command == NULL) {
- _statusline("ERROR! - upload command is misconfigured");
- sleep(AlertSecs);
+ HTAlert("ERROR! - upload command is misconfigured");
goto failed;
}
@@ -104,18 +103,13 @@ retry:
goto cancelled;
if (strstr(tmpbuf, "../") != NULL) {
- _statusline(
- "Illegal redirection \"../\" found! Request ignored.");
- sleep(AlertSecs);
+ HTAlert("Illegal redirection \"../\" found! Request ignored.");
goto cancelled;
} else if (strchr(tmpbuf, '/') != NULL) {
- _statusline("Illegal character \"/\" found! Request ignored.");
- sleep(AlertSecs);
+ HTAlert("Illegal character \"/\" found! Request ignored.");
goto cancelled;
} else if (tmpbuf[0] == '~') {
- _statusline(
- "Illegal redirection using \"~\" found! Request ignored.");
- sleep(AlertSecs);
+ HTAlert("Illegal redirection using \"~\" found! Request ignored.");
goto cancelled;
}
sprintf(buffer, "%s/%s", directory, tmpbuf);
@@ -197,13 +191,11 @@ retry:
return 1;
failed:
- _statusline("Unable to upload file.");
- sleep(AlertSecs);
+ HTAlert("Unable to upload file.");
return 0;
cancelled:
- _statusline("Cancelling.");
- sleep(InfoSecs);
+ HTInfoMsg("Cancelling.");
return 0;
}
diff --git a/src/LYUtils.c b/src/LYUtils.c
index 9a2432a2..bcbd3cf7 100644
--- a/src/LYUtils.c
+++ b/src/LYUtils.c
@@ -2041,9 +2041,8 @@ PUBLIC int HTCheckForInterrupt NOARGS
if (TRACE) {
fprintf(tfp, "\r *** Got simulated 'Z' ***\n");
fflush(tfp);
- if (!LYTraceLogFP)
- sleep(AlertSecs);
}
+ CTRACE_SLEEP(AlertSecs);
return((int)TRUE);
}
@@ -2159,9 +2158,8 @@ PUBLIC int HTCheckForInterrupt NOARGS
if (TRACE) {
fprintf(tfp, "\r *** Got simulated 'Z' ***\n");
fflush(tfp);
- if (!LYTraceLogFP)
- sleep(AlertSecs);
}
+ CTRACE_SLEEP(AlertSecs);
return((int)TRUE);
}
@@ -3499,7 +3497,7 @@ typedef struct _VMSMailItemList
long *return_length_address;
} VMSMailItemList;
-PUBLIC int LYCheckMail NOARGS
+PUBLIC void LYCheckMail NOARGS
{
static BOOL firsttime = TRUE, failure = FALSE;
static char user[13], dir[252];
@@ -3523,7 +3521,7 @@ PUBLIC int LYCheckMail NOARGS
extern long mail$user_end();
if (failure)
- return 0;
+ return;
if (firsttime) {
firsttime = FALSE;
@@ -3531,7 +3529,7 @@ PUBLIC int LYCheckMail NOARGS
status = sys$getjpiw(0,0,0,jpi_list,0,0,0);
if (!(status & 1)) {
failure = TRUE;
- return 0;
+ return;
}
user[userlen] = '\0';
LYTrimTrailing(user);
@@ -3540,42 +3538,42 @@ PUBLIC int LYCheckMail NOARGS
/* Minimum report interval is 60 sec. */
time(&now);
if (now - lastcheck < 60)
- return 0;
+ return;
lastcheck = now;
/* Get the current newmail count. */
status = mail$user_begin(&ucontext,null_list,null_list);
if (!(status & 1)) {
failure = TRUE;
- return 0;
+ return;
}
uilist[0].buffer_length = strlen(user);
uilist[0].buffer_address = user;
status = mail$user_get_info(&ucontext,uilist,uolist);
if (!(status & 1)) {
failure = TRUE;
- return 0;
+ return;
}
/* Should we report anything to the user? */
if (new > 0) {
if (lastcount == 0)
/* Have newmail at startup of Lynx. */
- _statusline(HAVE_UNREAD_MAIL_MSG);
+ HTUserMsg(HAVE_UNREAD_MAIL_MSG);
else if (new > lastcount)
/* Have additional mail since last report. */
- _statusline(HAVE_NEW_MAIL_MSG);
+ HTUserMsg(HAVE_NEW_MAIL_MSG);
lastcount = new;
- return 1;
+ return;
}
lastcount = new;
/* Clear the context */
mail$user_end((long *)&ucontext,null_list,null_list);
- return 0;
+ return;
}
#else
-PUBLIC int LYCheckMail NOARGS
+PUBLIC void LYCheckMail NOARGS
{
static BOOL firsttime = TRUE;
static char *mf;
@@ -3590,29 +3588,29 @@ PUBLIC int LYCheckMail NOARGS
}
if (mf == NULL)
- return 0;
+ return;
time(&now);
if (now - lastcheck < 60)
- return 0;
+ return;
lastcheck = now;
if (stat(mf,&st) < 0) {
mf = NULL;
- return 0;
+ return;
}
if (st.st_size > 0) {
if (st.st_mtime > st.st_atime ||
(lastsize && st.st_size > lastsize))
- _statusline(HAVE_NEW_MAIL_MSG);
+ HTUserMsg(HAVE_NEW_MAIL_MSG);
else if (lastsize == 0)
- _statusline(HAVE_MAIL_MSG);
+ HTUserMsg(HAVE_MAIL_MSG);
lastsize = st.st_size;
- return 1;
+ return;
}
lastsize = st.st_size;
- return 0;
+ return;
}
#endif /* VMS */
@@ -4113,11 +4111,8 @@ have_VMS_URL:
old_string, *AllocatedString);
}
FREE(old_string);
- if (TRACE) {
- /* Pause so we can read the messages before invoking curses */
- if (!LYTraceLogFP)
- sleep(AlertSecs);
- }
+ /* Pause so we can read the messages before invoking curses */
+ CTRACE_SLEEP(AlertSecs);
}
/*
diff --git a/src/LYUtils.h b/src/LYUtils.h
index 67ff15cc..5fd0868b 100644
--- a/src/LYUtils.h
+++ b/src/LYUtils.h
@@ -32,7 +32,7 @@ extern void change_sug_filename PARAMS((char *fname));
extern int number2arrows PARAMS((int number));
extern void parse_restrictions PARAMS((CONST char *s));
extern void checkmail NOPARAMS;
-extern int LYCheckMail NOPARAMS;
+extern void LYCheckMail NOPARAMS;
extern void LYEnsureAbsoluteURL PARAMS((char **href, CONST char *name));
extern void LYConvertToURL PARAMS((char **AllocatedString));
extern BOOLEAN LYExpandHostForURL PARAMS((
diff --git a/src/makefile.wsl b/src/makefile.wsl
index 8a5504d9..af721f2f 100644
--- a/src/makefile.wsl
+++ b/src/makefile.wsl
@@ -12,7 +12,7 @@ LYStyle.o LYHash.o
CFLAGS= $(MCFLAGS) -I. -I.. $(SLANGINC)
CC = gcc
-MCFLAGS = -O3 -DUSE_ZLIB -DUSE_EXTERNALS \
+MCFLAGS = -O3 -DDISP_PARTIAL -DUSE_ZLIB -DUSE_EXTERNALS \
-DUSE_SLANG -DACCESS_AUTH -DNO_CUSERID \
-DNOUSERS -DDOSPATH -DNO_TTYTYPE -DNO_UTMP -I../WWW/library/implement -I../djgpp/tcplib/include \
-I./chrtrans -I../djgpp/tcplib/include/tcp