1
/* Displaying messages and getting input for Lynx Browser
2
** ==========================================================
4
** REPLACE THIS MODULE with a GUI version in a GUI environment!
7
** Jun 92 Created May 1992 By C.T. Barker
8
** Feb 93 Simplified, portablised TBL
14
#include <LYGlobalDefs.h>
16
#include <LYStrings.h>
21
#include <LYHistory.h> /* store statusline messages */
27
#undef timezone /* U/Win defines this in time.h, hides implementation detail */
29
#if defined(HAVE_FTIME) && defined(HAVE_SYS_TIMEB_H)
30
#include <sys/timeb.h>
34
* 'napms()' is preferable to 'sleep()' in any case because it does not
35
* interfere with output, but also because it can be less than a second.
38
#define LYSleep(n) napms(n)
40
#define LYSleep(n) sleep(n)
43
/* Issue a message about a problem. HTAlert()
44
** --------------------------------
46
PUBLIC void HTAlert ARGS1(
49
CTRACE((tfp, "\nAlert!: %s\n\n", Msg));
51
_user_message(ALERT_FORMAT, Msg);
52
LYstore_message2(ALERT_FORMAT, Msg);
57
PUBLIC void HTAlwaysAlert ARGS2(
58
CONST char *, extra_prefix,
61
if (!dump_output_immediately && LYCursesON) {
65
fprintf(((TRACE) ? stdout : stderr),
69
LYstore_message2(ALERT_FORMAT, Msg);
72
fprintf(((TRACE) ? stdout : stderr), ALERT_FORMAT, NonNull(Msg));
74
LYstore_message2(ALERT_FORMAT, Msg);
76
fprintf(((TRACE) ? stdout : stderr), "\n");
78
CTRACE((tfp, "\nAlert!: %s\n\n", Msg));
83
/* Issue an informational message. HTInfoMsg()
84
** --------------------------------
86
PUBLIC void HTInfoMsg ARGS1(
91
CTRACE((tfp, "Info message: %s\n", Msg));
97
/* Issue an important message. HTUserMsg()
98
** --------------------------------
100
PUBLIC void HTUserMsg ARGS1(
105
CTRACE((tfp, "User message: %s\n", Msg));
106
LYstore_message(Msg);
107
#if !(defined(USE_SLANG) || defined(WIDEC_CURSES))
108
if (HTCJK != NOCJK) {
109
clearok(curscr, TRUE);
117
PUBLIC void HTUserMsg2 ARGS2(
121
_user_message(Msg2, Arg);
123
CTRACE((tfp, "User message: "));
124
CTRACE((tfp, Msg2, Arg));
126
LYstore_message2(Msg2, Arg);
131
/* Issue a progress message. HTProgress()
132
** -------------------------
134
PUBLIC void HTProgress ARGS1(
138
LYstore_message(Msg);
139
CTRACE((tfp, "%s\n", Msg));
143
PUBLIC CONST char *HTProgressUnits ARGS1(
146
static CONST char *bunits = 0;
147
static CONST char *kbunits = 0;
150
bunits = gettext("bytes");
151
kbunits = gettext(LYTransferName);
153
return ((rate == rateKB)
154
#ifdef USE_READPROGRESS
155
|| (rate == rateEtaKB)
157
) ? kbunits : bunits;
160
PRIVATE CONST char *sprint_bytes ARGS3(
163
CONST char *, was_units)
165
static long kb_units = 1024;
166
CONST char *u = HTProgressUnits(LYTransferRate);
168
if ( (LYTransferRate == rateKB || LYTransferRate == rateEtaKB_maybe)
169
&& (n >= 10 * kb_units) )
170
sprintf(s, "%ld", n/kb_units);
171
else if ((LYTransferRate == rateKB || LYTransferRate == rateEtaKB_maybe)
172
&& (n > 999)) /* Avoid switching between 1016b/s and 1K/s */
173
sprintf(s, "%.2g", ((double)n)/kb_units);
175
sprintf(s, "%ld", n);
178
if (!was_units || was_units != u)
179
sprintf(s + strlen(s), " %s", u);
183
#ifdef USE_READPROGRESS
184
#define TIME_HMS_LENGTH (16)
185
PRIVATE char *sprint_tbuf ARGS2(
190
sprintf (s, "%ldh%ldm%lds", t / 3600, (t / 60) % 60, t % 60);
192
sprintf (s, "%ldm%lds", t / 60, t % 60);
194
sprintf (s, "%ld sec", t);
197
#endif /* USE_READPROGRESS */
199
/* Issue a read-progress message. HTReadProgress()
200
** ------------------------------
202
PUBLIC void HTReadProgress ARGS2(
206
static long bytes_last, total_last;
207
static long transfer_rate = 0;
208
static char *line = NULL;
209
char bytesp[80], totalp[80], transferp[80];
211
CONST char *was_units;
213
#ifdef HAVE_GETTIMEOFDAY
216
static double first, last, last_active;
217
gettimeofday(&tv, (struct timezone *)0);
218
now = tv.tv_sec + tv.tv_usec/1000000. ;
220
#if defined(HAVE_FTIME) && defined(HAVE_SYS_TIMEB_H)
221
static double now, first, last, last_active;
225
now = tb.time + (double)tb.millitm / 1000;
227
time_t now = time((time_t *)0); /* once per second */
228
static time_t first, last, last_active;
232
if (!LYShowTransferRate)
233
LYTransferRate = rateOFF;
236
first = last = last_active = now;
238
} else if (bytes < 0) { /* stalled */
244
/* 1 sec delay for transfer_rate calculation without g-t-o-d */ {
245
if (transfer_rate <= 0) /* the very first time */
246
transfer_rate = (long)((bytes) / (now - first)); /* bytes/sec */
250
* Optimal refresh time: every 0.2 sec
252
#if defined(HAVE_GETTIMEOFDAY) || (defined(HAVE_FTIME) && defined(HAVE_SYS_TIMEB_H))
253
if (now >= last + 0.2)
257
* Use interpolation. (The transfer rate may be not constant
258
* when we have partial content in a proxy. We adjust transfer_rate
259
* once a second to minimize interpolation error below.)
261
if ((now != last) || ((bytes - bytes_last) > (transfer_rate / 5))) {
263
bytes_last += (transfer_rate / 5); /* until we got next second */
269
if (bytes_last != bytes)
272
transfer_rate = (long)(bytes / (now - first)); /* more accurate value */
276
was_units = sprint_bytes(totalp, total, 0);
279
sprint_bytes(bytesp, bytes, was_units);
282
HTSprintf0 (&line, gettext("Read %s of %s of data"), bytesp, totalp);
284
HTSprintf0 (&line, gettext("Read %s of data"), bytesp);
286
if (LYTransferRate != rateOFF
287
&& transfer_rate > 0) {
288
sprint_bytes(transferp, transfer_rate, 0);
289
HTSprintf (&line, gettext(", %s/sec"), transferp);
292
#ifdef USE_READPROGRESS
293
if (LYTransferRate == rateEtaBYTES
294
|| LYTransferRate == rateEtaKB) {
295
char tbuf[TIME_HMS_LENGTH];
296
if (now - last_active >= 5)
298
gettext(" (stalled for %s)"),
299
sprint_tbuf (tbuf, (long)(now - last_active)));
300
if (total > 0 && transfer_rate)
303
sprint_tbuf (tbuf, (long)((total - bytes)/transfer_rate)));
307
StrAllocCat (line, ".");
309
StrAllocCat(line, gettext(" (Press 'z' to abort)"));
311
/* do not store the message for history page. */
313
CTRACE((tfp, "%s\n", line));
321
PRIVATE BOOL conf_cancelled = NO; /* used by HTConfirm only - kw */
323
PUBLIC BOOL HTLastConfirmCancelled NOARGS
325
if (conf_cancelled) {
326
conf_cancelled = NO; /* reset */
334
* Prompt for yes/no response, but let a configuration variable override
335
* the prompt entirely.
337
PUBLIC int HTForcedPrompt ARGS3(
346
if (option == FORCE_PROMPT_DFT) {
347
result = HTConfirmDefault(msg, dft);
349
if (option == FORCE_PROMPT_YES) {
350
show = gettext("yes");
352
} else if (option == FORCE_PROMPT_NO) {
353
show = gettext("no");
356
return HTConfirmDefault(msg, dft); /* bug... */
358
HTSprintf(&msg2, "%s %s", msg, show);
365
#define DFT_CONFIRM ~(YES|NO)
367
/* Seek confirmation with default answer. HTConfirmDefault()
368
** --------------------------------------
370
PUBLIC int HTConfirmDefault ARGS2(CONST char *, Msg, int, Dft)
372
/* Meta-note: don't move the following note from its place right
373
in front of the first gettext(). As it is now, it should
374
automatically appear in generated lynx.pot files. - kw
377
/* NOTE TO TRANSLATORS: If you provide a translation for "yes", lynx
378
* will take the first byte of the translation as a positive response
379
* to Yes/No questions. If you provide a translation for "no", lynx
380
* will take the first byte of the translation as a negative response
381
* to Yes/No questions. For both, lynx will also try to show the
382
* first byte in the prompt as a character, instead of (y) or (n),
383
* respectively. This will not work right for multibyte charsets!
384
* Don't translate "yes" and "no" for CJK character sets (or translate
385
* them to "yes" and "no"). For a translation using UTF-8, don't
386
* translate if the translation would begin with anything but a 7-bit
387
* (US_ASCII) character. That also means do not translate if the
388
* translation would begin with anything but a 7-bit character, if
389
* you use a single-byte character encoding (a charset like ISO-8859-n)
390
* but anticipate that the message catalog may be used re-encoded in
392
* For translations using other character sets, you may also wish to
393
* leave "yes" and "no" untranslated, if using (y) and (n) is the
394
* preferred behavior.
395
* Lynx will also accept y Y n N as responses unless there is a conflict
396
* with the first letter of the "yes" or "no" translation.
398
char *msg_yes = gettext("yes");
399
char *msg_no = gettext("no");
402
/* If they're not really distinct in the first letter, revert to English */
403
if (TOUPPER(*msg_yes) == TOUPPER(*msg_no)) {
409
if (dump_output_immediately) { /* Non-interactive, can't respond */
410
if (Dft == DFT_CONFIRM) {
411
CTRACE((tfp, "Confirm: %s (%c/%c) ", Msg, *msg_yes, *msg_no));
413
CTRACE((tfp, "Confirm: %s (%c) ", Msg, (Dft == YES) ? *msg_yes : *msg_no));
415
CTRACE((tfp, "- NO, not interactive.\n"));
419
char fallback_y = 'y'; /* English letter response as fallback */
420
char fallback_n = 'n'; /* English letter response as fallback */
422
if (fallback_y == *msg_yes || fallback_y == *msg_no)
423
fallback_y = '\0'; /* conflict or duplication, don't use */
424
if (fallback_n == *msg_yes || fallback_n == *msg_no)
425
fallback_n = '\0'; /* conflict or duplication, don't use */
427
if (Dft == DFT_CONFIRM)
428
HTSprintf0(&msg, "%s (%c/%c) ", Msg, *msg_yes, *msg_no);
430
HTSprintf0(&msg, "%s (%c) ", Msg, (Dft == YES) ? *msg_yes : *msg_no);
432
CTRACE((tfp, "Confirm: %s", msg));
438
int c = LYgetch_single();
440
if (HadVMSInterrupt) {
441
HadVMSInterrupt = FALSE;
442
c = TOUPPER(*msg_no);
445
if (c == TOUPPER(*msg_yes)) {
447
} else if (c == TOUPPER(*msg_no)) {
449
} else if (fallback_y && c == fallback_y) {
451
} else if (fallback_n && c == fallback_n) {
453
} else if (LYCharIsINTERRUPT(c)) { /* remember we had ^G or ^C */
454
conf_cancelled = YES;
456
} else if (Dft != DFT_CONFIRM) {
461
CTRACE((tfp, "- %s%s.\n",
462
(result != NO) ? "YES" : "NO",
463
conf_cancelled ? ", cancelled" : ""));
468
/* Seek confirmation. HTConfirm()
469
** ------------------
471
PUBLIC BOOL HTConfirm ARGS1(CONST char *, Msg)
473
return (BOOL) HTConfirmDefault(Msg, DFT_CONFIRM);
477
* Ask a post resubmission prompt with some indication of what would
478
* be resubmitted, useful especially for going backward in history.
479
* Try to use parts of the address or, if given, the title, depending
480
* on how much fits on the statusline.
481
* if_imgmap and if_file indicate how to handle an address that is
482
* a "LYNXIMGMAP:", or a "file:" URL (presumably the List Page file),
483
* respectively: 0: auto-deny, 1: auto-confirm, 2: prompt.
487
PUBLIC BOOL confirm_post_resub ARGS4(
488
CONST char*, address,
494
CONST char *msg = CONFIRM_POST_RESUBMISSION_TO;
498
size_t maxlen = LYcols - 6;
501
} else if (isLYNXIMGMAP(address)) {
504
else if (if_imgmap == 1)
507
msg = CONFIRM_POST_LIST_RELOAD;
508
} else if (isFILE_URL(address)) {
511
else if (if_file == 1)
514
msg = CONFIRM_POST_LIST_RELOAD;
515
} else if (dump_output_immediately) {
518
if (maxlen >= sizeof(buf))
519
maxlen = sizeof(buf) - 1;
520
if ((len1 = strlen(msg)) +
521
strlen(address) <= maxlen) {
522
sprintf(buf, msg, address);
523
return HTConfirm(buf);
525
if (len1 + strlen(temp = HTParse(address, "",
526
PARSE_ACCESS+PARSE_HOST+PARSE_PATH
527
+PARSE_PUNCTUATION)) <= maxlen) {
528
sprintf(buf, msg, temp);
529
res = HTConfirm(buf);
534
if (title && (len1 + strlen(title) <= maxlen)) {
535
sprintf(buf, msg, title);
536
return HTConfirm(buf);
538
if (len1 + strlen(temp = HTParse(address, "",
539
PARSE_ACCESS+PARSE_HOST
540
+PARSE_PUNCTUATION)) <= maxlen) {
541
sprintf(buf, msg, temp);
542
res = HTConfirm(buf);
547
if ((temp = HTParse(address, "", PARSE_HOST)) && *temp &&
548
len1 + strlen(temp) <= maxlen) {
549
sprintf(buf, msg, temp);
550
res = HTConfirm(buf);
555
return HTConfirm(CONFIRM_POST_RESUBMISSION);
558
/* Prompt for answer and get text back. HTPrompt()
559
** ------------------------------------
561
PUBLIC char * HTPrompt ARGS2(
569
Tmp[sizeof(Tmp)-1] = '\0';
573
strncpy(Tmp, deflt, sizeof(Tmp)-1);
575
if (!dump_output_immediately)
576
LYgetstr(Tmp, VISIBLE, sizeof(Tmp), NORECALL);
578
StrAllocCopy(rep, Tmp);
584
** Prompt for password without echoing the reply. HTPromptPassword()
585
** ----------------------------------------------
587
PUBLIC char * HTPromptPassword ARGS1(
595
if (!dump_output_immediately) {
596
_statusline(Msg ? Msg : PASSWORD_PROMPT);
597
LYgetstr(pw, HIDDEN, sizeof(pw), NORECALL); /* hidden */
598
StrAllocCopy(result, pw);
600
printf("\n%s\n", PASSWORD_REQUIRED);
601
StrAllocCopy(result, "");
606
/* Prompt both username and password. HTPromptUsernameAndPassword()
607
** ----------------------------------
610
** Msg is the prompting message.
612
** *password are char pointers which contain default
613
** or zero-length strings; they are changed
614
** to point to result strings.
615
** IsProxy should be TRUE if this is for
616
** proxy authentication.
618
** If *username is not NULL, it is taken
619
** to point to a default value.
620
** Initial value of *password is
621
** completely discarded.
624
** *username and *password point to newly allocated
625
** strings -- original strings pointed to by them
629
PUBLIC void HTPromptUsernameAndPassword ARGS4(
635
if ((IsProxy == FALSE &&
636
authentication_info[0] && authentication_info[1]) ||
638
proxyauth_info[0] && proxyauth_info[1])) {
640
** The -auth or -pauth parameter gave us both the username
641
** and password to use for the first realm or proxy server,
642
** respectively, so just use them without any prompting. - FM
644
StrAllocCopy(*username, (IsProxy ?
645
proxyauth_info[0] : authentication_info[0]));
647
FREE(proxyauth_info[0]);
649
FREE(authentication_info[0]);
651
StrAllocCopy(*password, (IsProxy ?
652
proxyauth_info[1] : authentication_info[1]));
654
FREE(proxyauth_info[1]);
656
FREE(authentication_info[1]);
658
} else if (dump_output_immediately) {
660
* We are not interactive and don't have both the
661
* username and password from the command line,
662
* but might have one or the other. - FM
664
if ((IsProxy == FALSE && authentication_info[0]) ||
665
(IsProxy == TRUE && proxyauth_info[0])) {
667
** Use the command line username. - FM
669
StrAllocCopy(*username, (IsProxy ?
670
proxyauth_info[0] : authentication_info[0]));
672
FREE(proxyauth_info[0]);
674
FREE(authentication_info[0]);
678
** Default to "WWWuser". - FM
680
StrAllocCopy(*username, "WWWuser");
682
if ((IsProxy == FALSE && authentication_info[1]) ||
683
(IsProxy == TRUE && proxyauth_info[1])) {
685
** Use the command line password. - FM
687
StrAllocCopy(*password, (IsProxy ?
688
proxyauth_info[1] : authentication_info[1]));
690
FREE(proxyauth_info[1]);
692
FREE(authentication_info[1]);
696
** Default to a zero-length string. - FM
698
StrAllocCopy(*password, "");
700
printf("\n%s\n", USERNAME_PASSWORD_REQUIRED);
704
* We are interactive and don't have both the
705
* username and password from the command line,
706
* but might have one or the other. - FM
708
if ((IsProxy == FALSE && authentication_info[0]) ||
709
(IsProxy == TRUE && proxyauth_info[0])) {
711
** Offer the command line username in the
712
** prompt for the first realm. - FM
714
StrAllocCopy(*username, (IsProxy ?
715
proxyauth_info[0] : authentication_info[0]));
717
FREE(proxyauth_info[0]);
719
FREE(authentication_info[0]);
723
* Prompt for confirmation or entry of the username. - FM
726
*username = HTPrompt(Msg, *username);
728
*username = HTPrompt(USERNAME_PROMPT, *username);
730
if ((IsProxy == FALSE && authentication_info[1]) ||
731
(IsProxy == TRUE && proxyauth_info[1])) {
733
** Use the command line password for the first realm. - FM
735
StrAllocCopy(*password, (IsProxy ?
736
proxyauth_info[1] : authentication_info[1]));
738
FREE(proxyauth_info[1]);
740
FREE(authentication_info[1]);
742
} else if (*username != NULL && *username[0] != '\0') {
744
** We have a non-zero length username,
745
** so prompt for the password. - FM
747
*password = HTPromptPassword(PASSWORD_PROMPT);
750
** Return a zero-length password. - FM
752
StrAllocCopy(*password, "");
757
/* Confirm a cookie operation. HTConfirmCookie()
758
** ---------------------------
761
** server is the server sending the Set-Cookie.
762
** domain is the domain of the cookie.
763
** path is the path of the cookie.
764
** name is the name of the cookie.
765
** value is the value of the cookie.
768
** Returns FALSE on cancel,
769
** TRUE if the cookie should be set.
771
PUBLIC BOOL HTConfirmCookie ARGS4(
773
CONST char *, server,
778
char *prompt = ADVANCED_COOKIE_CONFIRMATION;
783
/* If the user has specified a list of domains to allow or deny
784
** from the config file, then they'll already have de->bv set to
785
** ACCEPT_ALWAYS or REJECT_ALWAYS so we can relax and let the
786
** default cookie handling code cope with this fine.
790
** If the user has specified a constant action, don't prompt at all.
792
if (de->bv == ACCEPT_ALWAYS)
794
if (de->bv == REJECT_ALWAYS)
797
if (dump_output_immediately) {
799
** Non-interactive, can't respond. Use the LYSetCookies value
800
* based on its compilation or configuration setting, or on the
801
** command line toggle. - FM
807
** Estimate how much of the cookie we can show.
809
if(!LYAcceptAllCookies) {
810
int namelen, valuelen, space_free, percentage;
813
space_free = ((LYcols - 1)
815
- 10) /* %s and %.*s and %.*s chars */
819
namelen = strlen(name);
820
valuelen = strlen(value);
821
if ((namelen + valuelen) > space_free) {
823
** Argh... there isn't enough space on our single line for
824
** the whole cookie. Reduce them both by a percentage.
825
** This should be smarter.
827
percentage = (100 * space_free) / (namelen + valuelen);
828
namelen = (percentage * namelen) / 100;
829
valuelen = (percentage * valuelen) / 100;
831
HTSprintf(&message, prompt, server, namelen, name, valuelen, value);
832
_statusline(message);
836
if(LYAcceptAllCookies) {
839
ch = LYgetch_single();
840
#if defined(LOCALE) && defined(HAVE_GETTEXT) && !defined(gettext)
842
* Special-purpose workaround for gettext support (we should do
843
* this in a more general way -- after 2.8.3).
845
* NOTE TO TRANSLATORS: If the prompt has been rendered into
846
* another language, and if yes/no are distinct, assume the
847
* translator can make an ordered list in parentheses with one
848
* capital letter for each as we assumed in HTConfirmDefault().
849
* The list has to be in the same order as in the original message,
850
* and the four capital letters chosen to not match those in the
851
* original unless they have the same position.
854
* (Y/N/Always/neVer) - English (original)
855
* (O/N/Toujours/Jamais) - French
861
char *s = "YNAV\007\003"; /* see ADVANCED_COOKIE_CONFIRMATION */
863
if (strchr(s, ch) == 0
865
&& (p = strrchr(prompt, L_PAREN)) != 0) {
867
CTRACE((tfp, "Looking for %c in %s\n", ch, p));
868
while (*p != R_PAREN && *p != 0 && isalpha(UCH(*s))) {
869
if (isalpha(UCH(*p)) && (*p == TOUPPER(*p))) {
870
CTRACE((tfp, "...testing %c/%c\n", *p, *s));
884
if (HadVMSInterrupt) {
885
HadVMSInterrupt = FALSE;
892
** Set to accept all cookies for this domain.
894
de->bv = ACCEPT_ALWAYS;
895
HTUserMsg2(ALWAYS_ALLOWING_COOKIES, de->domain);
900
** Reject the cookie.
903
HTUserMsg(REJECTING_COOKIE);
908
** Set to reject all cookies from this domain.
910
de->bv = REJECT_ALWAYS;
911
HTUserMsg2(NEVER_ALLOWING_COOKIES, de->domain);
916
** Accept the cookie.
918
HTInfoMsg(ALLOWING_COOKIE);
922
if (LYCharIsINTERRUPT(ch))
929
/* Confirm redirection of POST. HTConfirmPostRedirect()
930
** ----------------------------
933
** Redirecting_url is the Location.
934
** server_status is the server status code.
937
** Returns 0 on cancel,
938
** 1 for redirect of POST with content,
939
** 303 for redirect as GET without content
941
PUBLIC int HTConfirmPostRedirect ARGS2(
942
CONST char *, Redirecting_url,
946
char *show_POST_url = NULL;
947
char *StatusInfo = 0;
949
int on_screen = 0; /* 0 - show menu
951
* 2 - menu is already on screen */
953
if (server_status == 303 ||
954
server_status == 302) {
956
* HTTP.c should not have called us for either of
957
* these because we're treating 302 as historical,
958
* so just return 303. - FM
963
if (dump_output_immediately) {
964
if (server_status == 301) {
966
** Treat 301 as historical, i.e., like 303 (GET
967
** without content), when not interactive. - FM
972
** Treat anything else (e.g., 305, 306 or 307) as too
973
** dangerous to redirect without confirmation, and thus
974
** cancel when not interactive. - FM
980
if (user_mode == NOVICE_MODE) {
982
LYmove(LYlines-2, 0);
983
HTSprintf0(&StatusInfo, SERVER_ASKED_FOR_REDIRECTION, server_status);
984
LYaddstr(StatusInfo);
986
LYmove(LYlines-1, 0);
987
HTSprintf0(&url, "URL: %.*s",
988
(LYcols < 250 ? LYcols-6 : 250), Redirecting_url);
991
if (server_status == 301) {
992
_statusline(PROCEED_GET_CANCEL);
994
_statusline(PROCEED_OR_CANCEL);
997
HTSprintf0(&StatusInfo, "%d %.*s",
1000
((server_status == 301) ?
1001
ADVANCED_POST_GET_REDIRECT :
1002
ADVANCED_POST_REDIRECT));
1003
StrAllocCopy(show_POST_url, LOCATION_HEADER);
1004
StrAllocCat(show_POST_url, Redirecting_url);
1006
while (result < 0) {
1009
switch (on_screen) {
1011
_statusline(StatusInfo);
1014
_statusline(show_POST_url);
1016
c = LYgetch_single();
1020
** Proceed with 301 or 307 redirect of POST
1021
** with same method and POST content. - FM
1023
FREE(show_POST_url);
1032
FREE(show_POST_url);
1038
** Show URL for intermediate or advanced mode.
1040
if (user_mode != NOVICE_MODE) {
1041
if (on_screen == 1) {
1050
if (server_status == 301) {
1052
** Treat as 303 (GET without content).
1054
FREE(show_POST_url);
1058
/* fall through to default */
1062
** Get another character.
1064
if (on_screen == 1) {
1076
#define okToSleep() (!crawl && !traversal && LYCursesON)
1079
* Sleep for the given message class's time.
1081
PUBLIC void LYSleepAlert NOARGS
1087
PUBLIC void LYSleepDebug NOARGS
1093
PUBLIC void LYSleepInfo NOARGS
1099
PUBLIC void LYSleepMsg NOARGS
1102
LYSleep(MessageSecs);
1105
#ifdef EXP_CMD_LOGGING
1106
PUBLIC void LYSleepReplay NOARGS
1109
LYSleep(ReplaySecs);
1111
#endif /* EXP_CMD_LOGGING */
1114
* LYstrerror emulates the ANSI strerror() function.
1117
/* defined as macro in .h file. */
1119
PUBLIC char *LYStrerror ARGS1(int, code)
1121
static char temp[80];
1122
sprintf(temp, "System errno is %d.\r\n", code);
1125
#endif /* HAVE_STRERROR */