diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 1998-06-25 20:46:00 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 1998-06-25 20:46:00 -0400 |
commit | 5488a2e17cfeff78f8927f652ecb9750d7a28c29 (patch) | |
tree | 061d9ca743d7c0a2fed37bd1e22cb1f83dd7d051 /WWW | |
parent | 159955668b23e32fb7cefa1638bb40b8b3a58fa9 (diff) | |
download | lynx-snapshots-5488a2e17cfeff78f8927f652ecb9750d7a28c29.tar.gz |
snapshot of project "lynx", label v2-8-1dev_17
Diffstat (limited to 'WWW')
25 files changed, 41 insertions, 132 deletions
diff --git a/WWW/Library/Implementation/HTAAFile.c b/WWW/Library/Implementation/HTAAFile.c index 96b07faa..53dde21a 100644 --- a/WWW/Library/Implementation/HTAAFile.c +++ b/WWW/Library/Implementation/HTAAFile.c @@ -20,7 +20,6 @@ #endif /* HTUTILS_H */ #include <tcp.h> /* Macro FROMASCII() */ -/*#include <stdio.h> included by HTUtils.h -- FM *//* FILE */ #include <string.h> #include <HTAAUtil.h> /* Common utilities used in AA */ #include <HTAAFile.h> /* Implemented here */ diff --git a/WWW/Library/Implementation/HTAAFile.h b/WWW/Library/Implementation/HTAAFile.h index e20735c7..8549f89f 100644 --- a/WWW/Library/Implementation/HTAAFile.h +++ b/WWW/Library/Implementation/HTAAFile.h @@ -18,7 +18,6 @@ #ifndef HTUTILS_H #include <HTUtils.h> /* BOOL, PARAMS, ARGS */ #endif /* HTUTILS_H */ -/*#include <stdio.h> included by HTUtils.h -- FM *//* FILE */ #include <HTList.h> /* HTList */ #ifdef SHORT_NAMES diff --git a/WWW/Library/Implementation/HTAAServ.c b/WWW/Library/Implementation/HTAAServ.c index 10f0a6f6..674c6dc3 100644 --- a/WWW/Library/Implementation/HTAAServ.c +++ b/WWW/Library/Implementation/HTAAServ.c @@ -43,7 +43,6 @@ #include <HTUtils.h> -/*#include <stdio.h> included by HTUtils.h -- FM *//* FILE */ #include <string.h> /* strchr() */ #include <HTString.h> diff --git a/WWW/Library/Implementation/HTAAServ.h b/WWW/Library/Implementation/HTAAServ.h index fdee1c2b..6e300032 100644 --- a/WWW/Library/Implementation/HTAAServ.h +++ b/WWW/Library/Implementation/HTAAServ.h @@ -34,7 +34,6 @@ #ifndef HTUTILS_H #include <HTUtils.h> /* BOOL, PARAMS, ARGS */ #endif /* HTUTILS_H */ -/*#include <stdio.h> included by HTUtils.h -- FM *//* FILE */ #include <HTRules.h> /* This module interacts with rule system */ #include <HTAAUtil.h> /* Common parts of AA */ #include <HTAuth.h> /* Authentication */ diff --git a/WWW/Library/Implementation/HTACL.c b/WWW/Library/Implementation/HTACL.c index 2dbc79d6..20087841 100644 --- a/WWW/Library/Implementation/HTACL.c +++ b/WWW/Library/Implementation/HTACL.c @@ -18,7 +18,6 @@ #include <HTUtils.h> -/*#include <stdio.h> included by HTUtils.h -- FM *//* FILE */ #include <string.h> #include <HTAAFile.h> /* File routines */ diff --git a/WWW/Library/Implementation/HTAtom.c b/WWW/Library/Implementation/HTAtom.c index 1fd6d9c1..48823651 100644 --- a/WWW/Library/Implementation/HTAtom.c +++ b/WWW/Library/Implementation/HTAtom.c @@ -17,7 +17,6 @@ #define HASH_SIZE 101 /* Tunable */ #include <HTAtom.h> -/*#include <stdio.h> included by HTUtils.h -- FM *//* joe@athena, TBL 921019 */ #include <string.h> #include <HTList.h> diff --git a/WWW/Library/Implementation/HTChunk.c b/WWW/Library/Implementation/HTChunk.c index db06f64e..5a741a54 100644 --- a/WWW/Library/Implementation/HTChunk.c +++ b/WWW/Library/Implementation/HTChunk.c @@ -5,7 +5,6 @@ #include <HTUtils.h> #include <HTChunk.h> -/*#include <stdio.h> included by HTUtils.h -- FM */ #include <LYLeaks.h> diff --git a/WWW/Library/Implementation/HTFTP.c b/WWW/Library/Implementation/HTFTP.c index aa03f47f..aeba7dae 100644 --- a/WWW/Library/Implementation/HTFTP.c +++ b/WWW/Library/Implementation/HTFTP.c @@ -141,9 +141,6 @@ struct _HTStructured { #define FREE(x) if (x) {free(x); x = NULL;} -extern int HTCheckForInterrupt NOPARAMS; - - /* Global Variables ** --------------------- */ diff --git a/WWW/Library/Implementation/HTFWriter.h b/WWW/Library/Implementation/HTFWriter.h index 334169e7..4dd9bb0a 100644 --- a/WWW/Library/Implementation/HTFWriter.h +++ b/WWW/Library/Implementation/HTFWriter.h @@ -12,7 +12,6 @@ #include <HTUtils.h> #endif /* HTUTILS_H */ #include <HTStream.h> -/*#include <stdio.h> included by HTUtils.h -- FM */ #include <HTFormat.h> #ifdef SHORT_NAMES diff --git a/WWW/Library/Implementation/HTFormat.c b/WWW/Library/Implementation/HTFormat.c index fb7705e3..e92848dc 100644 --- a/WWW/Library/Implementation/HTFormat.c +++ b/WWW/Library/Implementation/HTFormat.c @@ -54,8 +54,6 @@ PUBLIC long int HTMaxBytes = 0; /* No effective limit */ #define FREE(x) if (x) {free(x); x = NULL;} -extern int HTCheckForInterrupt NOPARAMS; - PUBLIC BOOL HTOutputSource = NO; /* Flag: shortcut parser to stdout */ /* extern BOOL interactive; LJM */ @@ -495,8 +493,7 @@ PUBLIC int HTCopy ARGS4( HTStream*, sink) { HTStreamClass targetClass; - char line[256]; - int bytes = 0; + int bytes; int rv = 0; /* Push the data down the stream @@ -507,6 +504,7 @@ PUBLIC int HTCopy ARGS4( ** ** This operation could be put into a main event loop */ + HTReadProgress(bytes = 0, 0); for (;;) { int status; @@ -587,12 +585,7 @@ PUBLIC int HTCopy ARGS4( #endif /* DISP_PARTIAL */ bytes += status; - if (anchor && anchor->content_length > 0) - sprintf(line, "Read %d of %d bytes of data.", - bytes, anchor->content_length); - else - sprintf(line, "Read %d bytes of data.", bytes); - HTProgress(line); + HTReadProgress(bytes, anchor ? anchor->content_length : 0); } /* next bufferload */ @@ -617,8 +610,7 @@ PUBLIC int HTFileCopy ARGS2( HTStream*, sink) { HTStreamClass targetClass; - char line[256]; - int status, bytes = 0, nreads = 0, nprogr = 0; + int status, bytes; int rv = HT_OK; /* Push the data down the stream @@ -627,9 +619,9 @@ PUBLIC int HTFileCopy ARGS2( /* Push binary from socket down sink */ + HTReadProgress(bytes = 0, 0); for (;;) { status = fread(input_buffer, 1, INPUT_BUFFER_SIZE, fp); - nreads++; if (status == 0) { /* EOF or error */ if (ferror(fp) == 0) { rv = HT_LOADED; @@ -655,38 +647,15 @@ PUBLIC int HTFileCopy ARGS2( #endif /* DISP_PARTIAL */ bytes += status; - if (nreads >= 100) { - /* - ** Show progress messages for local files, and check for - ** user interruption. Start doing so only after a certain - ** number of reads have been done, and don't update it on - ** every read (normally reading in a local file should be - ** speedy). - KW - */ - if (nprogr == 0) { - if (bytes < 1024000) { - sprintf(line, "Read %d bytes of data.", bytes); - } else { - sprintf(line, "Read %d KB of data. %s", - bytes/1024, - "(Press 'z' if you want to abort loading.)"); - } - HTProgress(line); - if (HTCheckForInterrupt()) { - _HTProgress ("Data transfer interrupted."); - if (bytes) { - rv = HT_INTERRUPTED; - } else { - rv = -1; - } - break; - } - nprogr++; - } else if (nprogr == 25) { - nprogr = 0; + HTReadProgress(bytes, -2); + if (HTCheckForInterrupt()) { + _HTProgress ("Data transfer interrupted."); + if (bytes) { + rv = HT_INTERRUPTED; } else { - nprogr++; + rv = -1; } + break; } } /* next bufferload */ @@ -707,8 +676,7 @@ PRIVATE int HTGzFileCopy ARGS2( HTStream*, sink) { HTStreamClass targetClass; - char line[256]; - int status, bytes = 0, nreads = 0, nprogr = 0; + int status, bytes; int gzerrnum; int rv = HT_OK; @@ -718,9 +686,9 @@ PRIVATE int HTGzFileCopy ARGS2( /* read and inflate gzipped file, and push binary down sink */ + HTReadProgress(bytes = 0, 0); for (;;) { status = gzread(gzfp, input_buffer, INPUT_BUFFER_SIZE); - nreads++; if (status <= 0) { /* EOF or error */ if (status == 0) { rv = HT_LOADED; @@ -752,39 +720,15 @@ PRIVATE int HTGzFileCopy ARGS2( #endif /* DISP_PARTIAL */ bytes += status; - if (nreads >= 100) { - /* - ** Show progress messages for local files, and check for - ** user interruption. Start doing so only after a certain - ** number of reads have been done, and don't update it on - ** every read (normally reading in a local file should be - ** speedy). - KW - */ - if (nprogr == 0) { - if (bytes < 1024000) { - sprintf(line, - "Read %d uncompressed bytes of data.", bytes); - } else { - sprintf(line, "Read %d uncompressed KB of data. %s", - bytes/1024, - "(Press 'z' to abort.)"); - } - HTProgress(line); - if (HTCheckForInterrupt()) { - _HTProgress ("Data transfer interrupted."); - if (bytes) { - rv = HT_INTERRUPTED; - } else { - rv = -1; - } - break; - } - nprogr++; - } else if (nprogr == 25) { - nprogr = 0; + HTReadProgress(bytes, -2); + if (HTCheckForInterrupt()) { + _HTProgress ("Data transfer interrupted."); + if (bytes) { + rv = HT_INTERRUPTED; } else { - nprogr++; + rv = -1; } + break; } } /* next bufferload */ diff --git a/WWW/Library/Implementation/HTList.c b/WWW/Library/Implementation/HTList.c index 90b2769c..2cb89389 100644 --- a/WWW/Library/Implementation/HTList.c +++ b/WWW/Library/Implementation/HTList.c @@ -9,8 +9,6 @@ #include <HTUtils.h> #include <HTList.h> -/*#include <stdio.h> included by HTUtils.h -- FM *//* joe@athena, TBL 921019 */ - #include <LYLeaks.h> #define FREE(x) if (x) {free(x); x = NULL;} diff --git a/WWW/Library/Implementation/HTMIME.c b/WWW/Library/Implementation/HTMIME.c index ed731263..21b865ec 100644 --- a/WWW/Library/Implementation/HTMIME.c +++ b/WWW/Library/Implementation/HTMIME.c @@ -1862,9 +1862,6 @@ PUBLIC HTStream* HTNetMIME ARGS3( ** Software Foundation Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* #include <stdio.h> */ /* Included via previous headers. - FM */ -/* #include <string.h> */ /* Included via previous headers. - FM */ - /* ** MIME decoding routines ** diff --git a/WWW/Library/Implementation/HTMLGen.c b/WWW/Library/Implementation/HTMLGen.c index da2b63e5..f1f89173 100644 --- a/WWW/Library/Implementation/HTMLGen.c +++ b/WWW/Library/Implementation/HTMLGen.c @@ -22,7 +22,6 @@ */ #include <HTMLGen.h> -#include <stdio.h> #include <HTMLDTD.h> #include <HTStream.h> #include <SGML.h> diff --git a/WWW/Library/Implementation/HTRules.c b/WWW/Library/Implementation/HTRules.c index b6abe661..91596190 100644 --- a/WWW/Library/Implementation/HTRules.c +++ b/WWW/Library/Implementation/HTRules.c @@ -23,7 +23,6 @@ #include <HTUtils.h> #include <tcp.h> -/*#include <stdio.h> included by HTUtils.h -- FM */ #include <HTFile.h> #include <HTAAServ.h> /* Access Authorization */ diff --git a/WWW/Library/Implementation/HTTCP.c b/WWW/Library/Implementation/HTTCP.c index c7baf292..2a181624 100644 --- a/WWW/Library/Implementation/HTTCP.c +++ b/WWW/Library/Implementation/HTTCP.c @@ -22,6 +22,7 @@ #include <HTParse.h> #include <HTAlert.h> #include <HTTCP.h> +#include <LYUtils.h> #ifdef NSL_FORK #include <signal.h> @@ -32,8 +33,6 @@ #define OK_HOST(p) ((p) != 0 && (p->h_length) != 0) -extern int HTCheckForInterrupt NOPARAMS; - #ifdef SVR4_BSDSELECT PUBLIC int BSDselect PARAMS(( int nfds, diff --git a/WWW/Library/Implementation/HTTP.c b/WWW/Library/Implementation/HTTP.c index 8ad25eba..a8448c19 100644 --- a/WWW/Library/Implementation/HTTP.c +++ b/WWW/Library/Implementation/HTTP.c @@ -66,7 +66,6 @@ extern BOOL traversal; /* TRUE if we are doing a traversal */ extern BOOL dump_output_immediately; /* TRUE if no interactive user */ extern char * HTLoadedDocumentURL NOPARAMS; -extern int HTCheckForInterrupt NOPARAMS; extern void LYSetCookie PARAMS(( CONST char * SetCookie, CONST char * SetCookie2, @@ -165,7 +164,6 @@ try_again: ** so we can start over here... */ eol = 0; - bytes_already_read = 0; had_header = NO; length = 0; doing_redirect = FALSE; @@ -640,6 +638,7 @@ try_again: line_buffer = (char *)calloc(1, (buffer_length * sizeof(char))); + HTReadProgress (bytes_already_read = 0, 0); do {/* Loop to read in the first line */ /* ** Extend line buffer if necessary for those crazy WAIS URLs ;-) @@ -700,8 +699,7 @@ try_again: #endif /* DISP_PARTIAL */ bytes_already_read += status; - sprintf (line, "Read %d bytes of data.", bytes_already_read); - HTProgress (line); + HTReadProgress (bytes_already_read, 0); #ifdef UCX /* UCX returns -1 on EOF */ if (status == 0 || status == -1) diff --git a/WWW/Library/Implementation/HTTelnet.c b/WWW/Library/Implementation/HTTelnet.c index d842f230..2ee009b9 100644 --- a/WWW/Library/Implementation/HTTelnet.c +++ b/WWW/Library/Implementation/HTTelnet.c @@ -24,8 +24,6 @@ #include <HTAnchor.h> #include <HTTP.h> #include <HTFile.h> -/*#include <errno.h> included by tcp.h -- FM */ -/*#include <stdio.h> included by HTUtils.h -- FM */ #include <HText.h> diff --git a/WWW/Library/Implementation/HTUtils.h b/WWW/Library/Implementation/HTUtils.h index 68032dab..60dbdac0 100644 --- a/WWW/Library/Implementation/HTUtils.h +++ b/WWW/Library/Implementation/HTUtils.h @@ -17,8 +17,25 @@ #ifdef HAVE_CONFIG_H #include <lynx_cfg.h> /* generated by autoconf 'configure' script */ #include <sys/types.h> +#include <stdio.h> + +/* + * We force this include-ordering since socks.h contains redefinitions of + * functions that probably are prototyped via other includes. The socks.h + * definitions have to be included everywhere, since they're making wrappers + * for the stdio functions as well as the network functions. + */ +#if defined(USE_SOCKS5) && !defined(DONT_USE_SOCKS5) +#define SOCKS4TO5 +#define SHORTENED_RBIND +#define SOCKS +#include <socks.h> +#endif /* USE_SOCKS5 */ + #else +#include <stdio.h> + #define DONT_TRACK_INTERNAL_LINKS 1 /* Explicit system-configure */ @@ -107,10 +124,6 @@ Debug message control. */ -#ifndef STDIO_H -#include <stdio.h> -#define STDIO_H -#endif #ifdef DEBUG #define TRACE (WWW_TraceFlag) @@ -163,7 +176,6 @@ Standard C library for malloc() etc #include <malloc.h> #include <memory.h> -#include <stdio.h> #include <stdlib.h> /* ANSI */ /* BSN */ #endif /* !ultrix */ diff --git a/WWW/Library/Implementation/HTVMSUtils.c b/WWW/Library/Implementation/HTVMSUtils.c index 21283c9b..502f8c3a 100644 --- a/WWW/Library/Implementation/HTVMSUtils.c +++ b/WWW/Library/Implementation/HTVMSUtils.c @@ -21,8 +21,6 @@ #include <UCMap.h> #include <UCAux.h> #include <HTVMSUtils.h> -/*#include <stdio.h> included by HTUtils.h -- FM */ -/*#include <unixlib.h> included by HTUtils.h -- FM */ #include <ssdef.h> #include <jpidef.h> #include <prvdef.h> diff --git a/WWW/Library/Implementation/HTWAIS.c b/WWW/Library/Implementation/HTWAIS.c index 11bc6bad..a817f1b7 100644 --- a/WWW/Library/Implementation/HTWAIS.c +++ b/WWW/Library/Implementation/HTWAIS.c @@ -80,8 +80,6 @@ #define FREE(x) if (x) {free(x); x = NULL;} -extern int HTCheckForInterrupt NOPARAMS; - #define DIRECTORY "/cnidr.org:210/directory-of-servers" /* #define DIRECTORY "/quake.think.com:210/directory-of-servers" */ diff --git a/WWW/Library/Implementation/HTWriter.c b/WWW/Library/Implementation/HTWriter.c index 1e405cbb..c6c88638 100644 --- a/WWW/Library/Implementation/HTWriter.c +++ b/WWW/Library/Implementation/HTWriter.c @@ -9,8 +9,6 @@ #define BUFFER_SIZE 4096 /* Tradeoff */ -/*#include <stdio.h> included by HTUtils.h -- FM */ - #include <LYLeaks.h> #define FREE(x) if (x) {free(x); x = NULL;} diff --git a/WWW/Library/Implementation/SGML.c b/WWW/Library/Implementation/SGML.c index d2a84397..1c711740 100644 --- a/WWW/Library/Implementation/SGML.c +++ b/WWW/Library/Implementation/SGML.c @@ -27,7 +27,6 @@ #include <UCAux.h> #include <ctype.h> -/*#include <stdio.h> included in HTUtils.h -- FM */ #include <HTChunk.h> #include <LYCharSets.h> diff --git a/WWW/Library/Implementation/crypt_util.c b/WWW/Library/Implementation/crypt_util.c index bdec6f7b..5d8c710a 100644 --- a/WWW/Library/Implementation/crypt_util.c +++ b/WWW/Library/Implementation/crypt_util.c @@ -27,10 +27,6 @@ #include <HTUtils.h> #endif -#ifdef DEBUG -/*#include <stdio.h> included by HTUTils.h - FM */ -#endif - #ifndef STATIC #define STATIC static #endif diff --git a/WWW/Library/Implementation/getpass.c b/WWW/Library/Implementation/getpass.c index 0e8ffdfa..f209da77 100644 --- a/WWW/Library/Implementation/getpass.c +++ b/WWW/Library/Implementation/getpass.c @@ -23,7 +23,6 @@ Cambridge, MA 02139, USA. */ */ #include <HTUtils.h> -/*#include <stdio.h> included by HTUtils.h -- FM */ #include <descrip.h> #include <psldef.h> #include <iodef.h> diff --git a/WWW/Library/Implementation/tcp.h b/WWW/Library/Implementation/tcp.h index e6f8e2de..6d4eae6f 100644 --- a/WWW/Library/Implementation/tcp.h +++ b/WWW/Library/Implementation/tcp.h @@ -59,12 +59,6 @@ Default values typedef struct sockaddr_in SockA; /* See netinet/in.h */ - -#ifndef STDIO_H -#include <stdio.h> -#define STDIO_H -#endif /* !STDIO_H */ - #ifndef VMS #include <sys/types.h> @@ -158,7 +152,6 @@ IBM-PC running Windows NT #include <time.h> #include <errno.h> #include <direct.h> -#include <stdio.h> #include <winsock.h> typedef struct sockaddr_in SockA; /* See netinet/in.h */ #define EINPROGRESS (WSABASEERR+36) @@ -271,11 +264,6 @@ extern int socket_ioctl(); #include <string.h> -#ifndef STDIO_H -#include <stdio.h> -#define STDIO_H -#endif /* !STDIO_H */ - #include <file.h> #include <stat.h> #include <unixio.h> |