Commit 7f78908e authored by Axel Beckert's avatar Axel Beckert

Imported Upstream version 2.8.7dev10

parent e039600f
-- $LynxId: CHANGES,v 1.271 2008/04/27 23:03:14 tom Exp $
-- $LynxId: CHANGES,v 1.308 2008/09/21 21:12:42 tom Exp $
===============================================================================
Changes since Lynx 2.8 release
===============================================================================
2008-09-21 (2.8.7dev.10)
* remove rw.po, since the translation project no longer supplies it -TD
* implement "readonly" attribute for TEXTAREA and TEXT fields -TD
* update Lynx's tables of HTML attributes to cover (except for events) the
keywords from HTML 4.01 -TD
* modify initial active link in download-page to be the first download
action rather than the "help" link which is provided in Novice mode
(Debian #376259) -PBM, TD
* implement "chunked" transfer-encoding to work with servers that ignore the
version number in HTTP get's -TD
* change initialization of trace file, handing this during the first part of
argument parsing along with -help and -version, to show steps done for
initialization of presentors, etc -TD
* minor fix to LYstartPopup() to handle a case where the popup menu was too
large for the screen -TD
* fixes for srcdir!=objdir (report by FLWM) -TD
* modify man2hlp.sh to work from subdirectory, e.g., its parameter would be
"../lynx.man" -TD
* set POSIX locale for install-cfg.sh and man2hlp.sh since they use character
ranges -TD
* add switch -xhtml-parsing and lynx.cfg XHTML_PARSING setting to control
whether the extensions for XHTML 1.0 are used (prompted by bug report by
FLWM, as well as discussion on lynx-dev) -TD
* modify external editing of TEXTAREA to not do tab-conversion -TD
* modify LYhighlight() to limit display of multicolumn characters -TD
* rewrite LYRefreshEdit(), to display multibyte/multicolumn characters properly
when using wide-character curses -TD
* revise introductory comment written to ".lynxrc" (Debian #461158) -TD
* discard anchor's post_data field in HTLoadDocument() if Lynx is about to
reload a document. That would happen if the result of the form includes a
link back to the form. Removing the data causes Lynx to prompt the user,
e.g.,
Resubmit POST content to http://localhost/cgi-bin/lynxtest.pl ? (y/n)
to offer the user the choice between revisiting form or re-POST'ing the
data that was on the form (report by Andreas K Foerster) -TD
* fixes for LYHighlight() when the highlighted text is empty -TD
* translate named entities, etc., for "content" field of refresh-URL, cf:
2.8.5dev.13 (report by Ivan Shmakov) -TD
* suppress computation in TrimmedLength() for source-view, which is not needed
for Debian #204515 (patch by Mike Knight)
* add check-po rule to po/makefile -TD
* modify top-level makefile to work with configure --srcdir -TD
* add update-po rule to top-level makefile -TD
* update fr.po, nl.po, tr.po, vi.po, zh_TW.po,sv.po from
http://translationproject.org/latest/lynx/
* parse doctype for xhtml, to tell when empty tags such as "<textarea />" can
be discarded (report by Nils Dagsson Moskopp) -TD
* parse xml processing-instruction to turn on UTF-8 decoding, as well as
disable upper/lower case transforming in source view (discussion on
lynx-dev) -TD
* fix typo in Lynx_users_guide.html (report by Kristof Zelechovski)
* minor fix to documentation in lynx.cfg -PW
* use off_t rather than long for representing file sizes, e.g., when used to
print progress messages (reports by LP, Tomas Liska, TG, PG) -TD
* use dtd_util to replace most of HTMLDTD.h and HTMLDTD.c with source generated
from the existing tables in those files -TD
* add program dtd_util which can be used to dump the SGML tables in readable
form -TD
* change calls to LYhandlePopupList() to turn on (or off) numbering when
keypad_mode is not NUMBERS_AS_ARROWS -PBM
* move close of session-file outside ifdef for VLINK_IN_SESSION, closing
session file properly if that ifdef is disabled. Add a null-pointer check
for visited links that are saved -PBM
* make auto_session and session_file configurable with ENABLE_LYNXRC -PBM
* separate configure "--enable-sessions" option from "--enable-session-cache"
option -PBM
* add ncurses scroll-wheel support, which requires the extended-mouse configure
option of ncurses (Debian #476394) -TD
Caveat: if running on a local terminal, setting the ESCDELAY environment
variable to 0 (zero) helps, since the event rate is rather high. That would
not help on a network with delays (this is true of all text applications that
use xterm's mouse protocol, such as gpm and ncurses).
* adapt/extend parsdate.y from tin to improve parsing of cookie expiration
times (Debian #480144) -TD
* update de.po (patch by Fabian Fingerle)
2008-04-27 (2.8.7dev.9)
* update nl.po, vi.po from
http://translationproject.org/latest/lynx/
......
/* Access Manager HTAccess.c
/*
* $LynxId: HTAccess.c,v 1.67 2008/09/06 14:44:37 tom Exp $
*
* Access Manager HTAccess.c
* ==============
*
* Authors
......@@ -61,6 +64,7 @@
#include <LYGlobalDefs.h>
#include <LYexit.h>
#include <LYStrings.h>
#include <LYUtils.h>
#include <LYLeaks.h>
......@@ -681,13 +685,10 @@ static int HTLoad(const char *addr,
if (status == HT_FORBIDDEN) {
/* prevent crash if telnet or similar was forbidden by rule. - kw */
LYFixCursesOn("show alert:");
return HTLoadError(sink, 500, gettext("Access forbidden by rule"));
status = HTLoadError(sink, 500, gettext("Access forbidden by rule"));
} else if (status == HT_REDIRECTING) {
return status; /* fake redirection by rule, to redirecting_url */
}
if (status < 0)
return status; /* Can't resolve or forbidden */
; /* fake redirection by rule, to redirecting_url */
} else if (status >= 0) {
/* prevent crash if telnet or similar mapped or proxied by rule. - kw */
LYFixCursesOnForAccess(addr, HTAnchor_physical(anchor));
p = (HTProtocol *) HTAnchor_protocol(anchor);
......@@ -696,6 +697,7 @@ static int HTLoad(const char *addr,
anchor, format_out, sink);
anchor->parent->underway = FALSE;
LYUCPopAssumed();
}
return status;
}
......@@ -903,11 +905,12 @@ static BOOL HTLoadDocument(const char *full_address, /* may include #fragment */
return YES;
} else {
ForcingNoCache = YES;
BStrFree(anchor->post_data);
CTRACE((tfp, "HTAccess: Auto-reloading document.\n"));
}
}
if (text && HText_HaveUserChangedForms(text)) {
if (HText_HaveUserChangedForms(text)) {
/*
* Issue a warning. User forms content will be lost.
* Will not restore changed forms, currently.
......@@ -1285,7 +1288,7 @@ BOOL HTSearch(const char *keywords,
if (WHITE(*p)) {
*q++ = '+';
} else if (HTCJK != NOCJK) {
} else if (IS_CJK_TTY) {
*q++ = *p;
} else if (c >= 32 && c <= UCH(127) && isAcceptable[c - 32]) {
*q++ = *p; /* 930706 TBL for MVS bug */
......
/*
* $LynxId: HTAnchor.c,v 1.59 2007/07/02 23:42:54 tom Exp $
* $LynxId: HTAnchor.c,v 1.60 2008/09/18 21:35:24 tom Exp $
*
* Hypertext "Anchor" Object HTAnchor.c
* ==========================
......@@ -362,11 +362,11 @@ HTChildAnchor *HTAnchor_findChildAndLink(HTParentAnchor *parent, /* May not be 0
if (child->dest) { /* DUPLICATE_ANCHOR_NAME_WORKAROUND - kw */
CTRACE((tfp,
"*** Duplicate ChildAnchor %p named `%s'",
child, tag));
(void *) child, tag));
if ((HTAnchor *) dest != child->dest || ltype != child->type) {
CTRACE((tfp,
", different dest %p or type, creating unnamed child\n",
child->dest));
(void *) child->dest));
child = HTAnchor_addChild(parent);
}
}
......@@ -515,7 +515,7 @@ static BOOL HTAnchor_link(HTChildAnchor *child,
if (!(child && destination))
return (NO); /* Can't link to/from non-existing anchor */
CTRACE((tfp, "Linking child %p to anchor %p\n", child, destination));
CTRACE((tfp, "Linking child %p to anchor %p\n", (void *) child, (void *) destination));
if (child->dest) {
CTRACE((tfp, "*** child anchor already has destination, exiting!\n"));
return (NO);
......
/*
* $LynxId: HTFTP.c,v 1.80 2007/08/02 19:55:46 tom Exp $
* $LynxId: HTFTP.c,v 1.81 2008/09/18 21:34:25 tom Exp $
*
* File Transfer Protocol (FTP) Client
* for a WorldWideWeb browser
......@@ -882,7 +882,7 @@ static int get_connection(const char *arg,
}
CTRACE((tfp, "FTP connected, socket %d control %p\n",
con->socket, con));
con->socket, (void *) con));
control = con; /* Current control connection */
/* Initialise buffering for control connection */
......
/*
* $LynxId: HTFile.c,v 1.104 2007/08/02 19:46:01 tom Exp $
* $LynxId: HTFile.c,v 1.105 2008/09/18 21:34:25 tom Exp $
*
* File Access HTFile.c
* ===========
......@@ -2234,7 +2234,7 @@ static int decompressAndParse(HTParentAnchor *anchor,
FREE(ultrixname);
}
#endif /* VMS */
CTRACE((tfp, "HTLoadFile: Opening `%s' gives %p\n", localname, fp));
CTRACE((tfp, "HTLoadFile: Opening `%s' gives %p\n", localname, (void *) fp));
if (fp) { /* Good! */
if (HTEditable(localname)) {
HTAtom *put = HTAtom_for("PUT");
......@@ -2271,7 +2271,7 @@ static int decompressAndParse(HTParentAnchor *anchor,
fp = 0;
CTRACE((tfp, "HTLoadFile: zzopen of `%s' gives %p\n",
localname, zzfp));
localname, (void *) zzfp));
internal_decompress = cftDeflate;
} else
#endif /* USE_ZLIB */
......@@ -2318,7 +2318,7 @@ static int decompressAndParse(HTParentAnchor *anchor,
fp = 0;
CTRACE((tfp, "HTLoadFile: zzopen of `%s' gives %p\n",
localname, zzfp));
localname, (void *) zzfp));
internal_decompress = cftDeflate;
}
#else /* USE_ZLIB */
......
/*
* $LynxId: HTFormat.c,v 1.62 2007/08/02 20:12:22 tom Exp $
* $LynxId: HTFormat.c,v 1.63 2008/09/10 23:22:59 tom Exp $
*
* Manage different file formats HTFormat.c
* =============================
......@@ -101,6 +101,14 @@ void HTSetPresentation(const char *representation,
if (pres == NULL)
outofmem(__FILE__, "HTSetPresentation");
CTRACE2(TRACE_CFG,
(tfp,
"HTSetPresentation rep=%s, command=%s, test=%s, qual=%f\n",
NonNull(representation),
NonNull(command),
NonNull(testcommand),
quality));
pres->rep = HTAtom_for(representation);
pres->rep_out = WWW_PRESENT; /* Fixed for now ... :-) */
pres->converter = HTSaveAndExecute; /* Fixed for now ... */
......@@ -153,6 +161,13 @@ void HTSetConversion(const char *representation_in,
if (pres == NULL)
outofmem(__FILE__, "HTSetConversion");
CTRACE2(TRACE_CFG,
(tfp,
"HTSetConversion rep_in=%s, rep_out=%s, qual=%f\n",
NonNull(representation_in),
NonNull(representation_out),
quality));
pres->rep = HTAtom_for(representation_in);
pres->rep_out = HTAtom_for(representation_out);
pres->converter = converter;
......
......@@ -163,7 +163,7 @@ The HTPresentation and HTConverter types
float quality; /* Between 0 (bad) and 1 (good) */
float secs;
float secs_per_byte;
long int maxbytes;
off_t maxbytes;
BOOL get_accept; /* list in "Accept:" for GET */
int accept_opt; /* matches against LYAcceptMedia */
};
......
/* A small List class HTList.c
/*
* $LynxId: HTList.c,v 1.17 2008/09/18 21:36:59 tom Exp $
*
* A small List class HTList.c
* ==================
*
* A list is represented as a sequence of linked nodes of type HTList.
......@@ -70,7 +73,7 @@ HTList *HTList_appendList(HTList *start,
if (!start) {
CTRACE((tfp,
"HTList: Trying to append list %p to a nonexisting list\n",
tail));
(void *) tail));
return NULL;
}
if (!(tail && tail->next))
......@@ -107,7 +110,7 @@ void HTList_linkObject(HTList *me, void *newObject,
*/
CTRACE((tfp, "*** HTList: Refuse linking already linked obj "));
CTRACE((tfp, "%p, node %p, list %p\n",
newObject, newNode, me));
(void *) newObject, (void *) newNode, (void *) me));
}
} else {
......
/*
* $LynxId: HTMIME.c,v 1.62 2007/07/03 00:16:30 tom Exp $
* $LynxId: HTMIME.c,v 1.64 2008/09/17 00:04:44 tom Exp $
*
* MIME Message Parse HTMIME.c
* ==================
......@@ -37,6 +37,16 @@
typedef enum {
MIME_TRANSPARENT, /* put straight through to target ASAP! */
/* states for "Transfer-Encoding: chunked" */
MIME_CHUNKED,
mcCHUNKED_COUNT_DIGIT,
mcCHUNKED_COUNT_CR,
mcCHUNKED_COUNT_LF,
mcCHUNKED_EXTENSION,
mcCHUNKED_DATA,
mcCHUNKED_DATA_CR,
mcCHUNKED_DATA_LF,
/* character state-machine */
miBEGINNING_OF_LINE, /* first character and not a continuation */
miA,
miACCEPT_RANGES,
......@@ -138,8 +148,12 @@ struct _HTStream {
char *refresh_url; /* "Refresh:" URL */
HTFormat encoding; /* Content-Transfer-Encoding */
HTFormat c_t_encoding; /* Content-Transfer-Encoding */
char *compression_encoding;
BOOL chunked_encoding; /* Transfer-Encoding: chunked */
long chunked_size; /* ...counter for "chunked" */
HTFormat format; /* Content-Type */
HTStream *target; /* While writing out */
HTStreamClass targetClass;
......@@ -471,10 +485,11 @@ static int pumpData(HTStream *me)
if (me->target) {
me->targetClass = *me->target->isa;
/*
* Check for encoding and select state from there, someday, but until
* we have the relevant code, from now push straight through. - FM
* Pump rest of data right through, according to the transfer encoding.
*/
me->state = MIME_TRANSPARENT; /* Pump rest of data right through */
me->state = (me->chunked_encoding
? MIME_CHUNKED
: MIME_TRANSPARENT);
} else {
me->state = MIME_IGNORE; /* What else to do? */
}
......@@ -754,7 +769,7 @@ static int dispatchField(HTStream *me)
* Force the Content-Transfer-Encoding value to all lower case. - FM
*/
LYLowerCase(me->value);
me->encoding = HTAtom_for(me->value);
me->c_t_encoding = HTAtom_for(me->value);
break;
case miCONTENT_TYPE:
HTMIME_TrimDoubleQuotes(me->value);
......@@ -937,6 +952,8 @@ static int dispatchField(HTStream *me)
HTMIME_TrimDoubleQuotes(me->value);
CTRACE((tfp, "HTMIME: PICKED UP Transfer-Encoding: '%s'\n",
me->value));
if (!strcmp(me->value, "chunked"))
me->chunked_encoding = YES;
break;
case miUPGRADE:
HTMIME_TrimDoubleQuotes(me->value);
......@@ -990,11 +1007,84 @@ static int dispatchField(HTStream *me)
static void HTMIME_put_character(HTStream *me,
char c)
{
if (me->state == MIME_TRANSPARENT) {
(*me->targetClass.put_character) (me->target, c); /* MUST BE FAST */
/* MUST BE FAST */
switch (me->state) {
begin_transparent:
case MIME_TRANSPARENT:
(*me->targetClass.put_character) (me->target, c);
return;
/* RFC-2616 describes chunked transfer coding */
case mcCHUNKED_DATA:
(*me->targetClass.put_character) (me->target, c);
me->chunked_size--;
if (me->chunked_size <= 0)
me->state = mcCHUNKED_DATA_CR;
return;
case mcCHUNKED_DATA_CR:
me->state = mcCHUNKED_DATA_LF;
if (c == CR) {
return;
}
case mcCHUNKED_DATA_LF:
me->state = MIME_CHUNKED;
if (c == LF) {
return;
}
CTRACE((tfp, "HTIME_put_character expected LF in chunked data\n"));
me->state = MIME_TRANSPARENT;
goto begin_transparent;
/* FALLTHRU */
begin_chunked:
case MIME_CHUNKED:
me->chunked_size = 0;
me->state = mcCHUNKED_COUNT_DIGIT;
/* FALLTHRU */
case mcCHUNKED_COUNT_DIGIT:
if (isxdigit(UCH(c))) {
me->chunked_size <<= 4;
if (isdigit(UCH(c)))
me->chunked_size += UCH(c) - '0';
else
me->chunked_size += TOUPPER(UCH(c)) - 'A' + 10;
return;
}
if (c == ';')
me->state = mcCHUNKED_EXTENSION;
/* FALLTHRU */
case mcCHUNKED_EXTENSION:
if (c != CR && c != LF) {
return;
}
me->state = mcCHUNKED_COUNT_CR;
/* FALLTHRU */
case mcCHUNKED_COUNT_CR:
me->state = mcCHUNKED_COUNT_LF;
if (c == CR) {
return;
}
/* FALLTHRU */
case mcCHUNKED_COUNT_LF:
me->state = ((me->chunked_size != 0)
? mcCHUNKED_DATA
: MIME_CHUNKED);
if (c == LF) {
return;
}
goto begin_chunked;
default:
break;
}
/*
* This slightly simple conversion just strips CR and turns LF to newline.
* On unix LF is \n but on Mac \n is CR for example. See NetToText for an
......@@ -1025,7 +1115,14 @@ static void HTMIME_put_character(HTStream *me,
return;
case MIME_TRANSPARENT: /* Not reached see above */
(*me->targetClass.put_character) (me->target, c);
case MIME_CHUNKED:
case mcCHUNKED_COUNT_DIGIT:
case mcCHUNKED_COUNT_CR:
case mcCHUNKED_COUNT_LF:
case mcCHUNKED_EXTENSION:
case mcCHUNKED_DATA:
case mcCHUNKED_DATA_CR:
case mcCHUNKED_DATA_LF:
return;
case MIME_NET_ASCII:
......@@ -2049,7 +2146,7 @@ HTStream *HTMIMEConvert(HTPresentation *pres,
me->set_cookie = NULL; /* Not set yet */
me->set_cookie2 = NULL; /* Not set yet */
me->refresh_url = NULL; /* Not set yet */
me->encoding = 0; /* Not set yet */
me->c_t_encoding = 0; /* Not set yet */
me->compression_encoding = NULL; /* Not set yet */
me->net_ascii = NO; /* Local character set */
HTAnchor_setUCInfoStage(me->anchor, current_char_set,
......
This diff is collapsed.
This diff is collapsed.
/* Plain text object HTWrite.c
/*
* $LynxId: HTPlain.c,v 1.42 2008/09/06 14:45:09 tom Exp $
*
* Plain text object HTWrite.c
* =================
*
* This version of the stream object just writes to a socket.
......@@ -28,6 +31,7 @@
#include <UCAux.h>
#include <LYCharSets.h>
#include <LYStrings.h>
#include <LYLeaks.h>
static int HTPlain_lastraw = -1;
......@@ -134,7 +138,7 @@ static void HTPlain_put_character(HTStream *me, char c)
* For now, don't repeat everything here that has been done below - KW
*/
HTPlain_write(me, &c, 1);
} else if (HTCJK != NOCJK) {
} else if (IS_CJK_TTY) {
HText_appendCharacter(me->text, c);
} else if (TOASCII(UCH(c)) >= 127 && TOASCII(UCH(c)) < 161 &&
HTPassHighCtrlRaw) {
......@@ -470,7 +474,7 @@ static void HTPlain_write(HTStream *me, const char *s, int l)
* display character set, and if not, the user should toggle off
* raw/CJK mode to reload. - FM
*/
if (HTCJK != NOCJK) {
if (IS_CJK_TTY) {
HText_appendCharacter(me->text, c);
#define PASSHICTRL (me->T.transp || \
......@@ -616,12 +620,12 @@ static void HTPlain_write(HTStream *me, const char *s, int l)
/*
* Ignore 8204 (zwnj) or 8205 (zwj), if we get to here. - FM
*/
CTRACE((tfp, "HTPlain_write: Ignoring '%ld'.\n", code));
CTRACE((tfp, "HTPlain_write: Ignoring '%" PRI_UCode_t "'.\n", code));
} else if (code == 8206 || code == 8207) {
/*
* Ignore 8206 (lrm) or 8207 (rlm), if we get to here. - FM
*/
CTRACE((tfp, "HTPlain_write: Ignoring '%ld'.\n", code));
CTRACE((tfp, "HTPlain_write: Ignoring '%" PRI_UCode_t "'.\n", code));
} else {
/*
* Out of luck, so use the UHHH notation (ugh). - FM
......
/*
* $LynxId: HTRules.c,v 1.30 2007/08/02 20:12:40 tom Exp $
* $LynxId: HTRules.c,v 1.34 2008/07/06 12:53:43 tom Exp $
*
* Configuration manager for Hypertext Daemon HTRules.c
* ==========================================
......@@ -456,7 +456,7 @@ int HTSetConfiguration(char *config)
const char *cond_op = NULL;
const char *cond = NULL;
float quality, secs, secs_per_byte;
int maxbytes;
off_t maxbytes;
int status;
StrAllocCopy(line, config);
......@@ -500,7 +500,7 @@ int HTSetConfiguration(char *config)
} else if (0 == strcasecomp(word1, "presentation")) {
if (pointer)
status = sscanf(pointer, "%f%f%f%d",
status = sscanf(pointer, "%f%f%f%" SCN_off_t "",
&quality, &secs, &secs_per_byte, &maxbytes);
else
status = 0;
......
/*
* $LynxId: HTString.c,v 1.52 2008/02/18 00:04:16 tom Exp $
* $LynxId: HTString.c,v 1.54 2008/09/20 14:32:29 tom Exp $
*
* Case-independent string comparison HTString.c
*
......@@ -1165,7 +1165,9 @@ void HTSABCopy(bstring **dest, const char *src,
bstring *t;
unsigned need = len + 1;
CTRACE2(TRACE_BSTRING, (tfp, "HTSABCopy(%p, %p, %d)\n", dest, src, len));
CTRACE2(TRACE_BSTRING,
(tfp, "HTSABCopy(%p, %p, %d)\n",
(void *) dest, (const void *) src, len));
HTSABFree(dest);
if (src) {
if (TRACE_BSTRING) {
......@@ -1206,7 +1208,9 @@ void HTSABCat(bstring **dest, const char *src,
{
bstring *t = *dest;
CTRACE2(TRACE_BSTRING, (tfp, "HTSABCat(%p, %p, %d)\n", dest, src, len));
CTRACE2(TRACE_BSTRING,
(tfp, "HTSABCat(%p, %p, %d)\n",
(void *) dest, (const void *) src, len));
if (src) {
unsigned need = len + 1;
......
/*
* $LynxId: HTTCP.c,v 1.93 2007/05/22 23:54:43 tom Exp $
* $LynxId: HTTCP.c,v 1.97 2008/09/20 14:32:29 tom Exp $
*
* Generic Communication Code HTTCP.c
* ==========================
......@@ -380,7 +380,7 @@ static void dump_hostent(const char *msgprefix,
int i;
char **pcnt;
CTRACE((tfp, "%s: %p ", msgprefix, phost));
CTRACE((tfp, "%s: %p ", msgprefix, (const void *) phost));
if (phost) {
CTRACE((tfp, "{ h_name = %p", phost->h_name));
if (phost->h_name) {
......@@ -388,7 +388,7 @@ static void dump_hostent(const char *msgprefix,
} else {
CTRACE((tfp, ","));
}
CTRACE((tfp, "\n\t h_aliases = %p", phost->h_aliases));
CTRACE((tfp, "\n\t h_aliases = %p", (void *) phost->h_aliases));
if (phost->h_aliases) {
CTRACE((tfp, " {"));
for (pcnt = phost->h_aliases; *pcnt; pcnt++) {
......@@ -403,7 +403,7 @@ static void dump_hostent(const char *msgprefix,
}
CTRACE((tfp, " h_addrtype = %d,", phost->h_addrtype));
CTRACE((tfp, " h_length = %d,\n\t", phost->h_length));
CTRACE((tfp, " h_addr_list = %p", phost->h_addr_list));
CTRACE((tfp, " h_addr_list = %p", (void *) phost->h_addr_list));
if (phost->h_addr_list) {
CTRACE((tfp, " {"));
for (pcnt = phost->h_addr_list; *pcnt; pcnt++) {
......@@ -2091,8 +2091,9 @@ int HTDoRead(int fildes,
#endif /* UCX && VAXC */
}
#ifdef USE_READPROGRESS
CTRACE2(TRACE_TIMING, (tfp, "...HTDoRead returns %d (%ld seconds)\n",
result, (long) (time((time_t *) 0) - start)));
CTRACE2(TRACE_TIMING, (tfp, "...HTDoRead returns %d (%" PRI_time_t
" seconds)\n",
result, CAST_time_t(time((time_t *) 0) - start)));
#endif
return result;
}
......
/*
* $LynxId: HTTP.c,v 1.94 2008/04/27 17:05:55 tom Exp $
* $LynxId: HTTP.c,v 1.96 2008/07/06 12:55:40 tom Exp $
*
* HyperText Tranfer Protocol - Client implementation HTTP.c
* ==========================
......@@ -1034,13 +1034,13 @@ static int HTLoadHTTP(const char *arg,
if (pres->get_accept) {
if (pres->quality < 1.0) {
if (pres->maxbytes > 0) {
sprintf(temp, ";q=%4.3f;mxb=%ld",
sprintf(temp, ";q=%4.3f;mxb=%" PRI_off_t "",
pres->quality, pres->maxbytes);
} else {
sprintf(temp, ";q=%4.3f", pres->quality);
}
} else if (pres->maxbytes > 0) {
sprintf(temp, ";mxb=%ld", pres->maxbytes);
sprintf(temp, ";mxb=%" PRI_off_t "", pres->maxbytes);
} else {
temp[0] = '\0';
}
......
/*
* $LynxId: HTUtils.h,v 1.79 2008/04/13 14:43:32 tom Exp $
* $LynxId: HTUtils.h,v 1.87 2008/09/17 16:31:34 tom Exp $
*
* Utility macros for the W3 code library
* MACROS FOR GENERAL USE
......@@ -535,6 +535,75 @@ extern int WWW_TraceMask;
#define TRACE_GRIDTEXT (TRACE_bit(7))
#define TRACE_TIMING (TRACE_bit(8))
/*
* Get printing/scanning formats.
*/
#if defined(HAVE_INTTYPES_H)
#include <inttypes.h>
#endif
/*
* Printing/scanning-formats for "off_t", as well as cast needed to fit.
*/
#if defined(HAVE_INTTYPES_H) && defined(SIZEOF_OFF_T)
#if (SIZEOF_OFF_T == 8) && defined(PRId64)
#define PRI_off_t PRId64
#define SCN_off_t SCNd64
#define CAST_off_t(n) (int64_t)(n)
#elif defined(PRId32)
#define PRI_off_t PRId32
#define SCN_off_t SCNd32
#define CAST_off_t(n) (int32_t)(n)
#endif
#endif
#ifndef PRI_off_t
#if (SIZEOF_OFF_T == 8)
#define PRI_off_t "lld"
#define SCN_off_t "lld"
#define CAST_off_t(n) (long long)(n)
#else
#define PRI_off_t "ld"
#define SCN_off_t "ld"
#define CAST_off_t(n) (long)(n)
#endif
#endif
/*
* Printing-format for "time_t", as well as cast needed to fit.
*/
#if defined(HAVE_INTTYPES_H) && defined(SIZEOF_TIME_T)
#if (SIZEOF_TIME_T == 8) && defined(PRId64)
#define PRI_time_t PRId64
#define SCN_time_t SCNd64
#define CAST_time_t(n) (int64_t)(n)
#elif defined(PRId32)
#define PRI_time_t PRId32