From 18024037b515bfff83e0230b35151babe6005e18 Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Fri, 6 Nov 1998 16:18:09 -0500 Subject: snapshot of project "lynx", label v2-8-1dev_4 --- WWW/Library/Implementation/HTUtils.h | 82 +++++++++--------------------------- 1 file changed, 21 insertions(+), 61 deletions(-) (limited to 'WWW/Library/Implementation/HTUtils.h') diff --git a/WWW/Library/Implementation/HTUtils.h b/WWW/Library/Implementation/HTUtils.h index 16fc0eb2..d96a6cb7 100644 --- a/WWW/Library/Implementation/HTUtils.h +++ b/WWW/Library/Implementation/HTUtils.h @@ -1,7 +1,9 @@ -/* Utility macros for the W3 code library +/* Utitlity macros for the W3 code library MACROS FOR GENERAL USE - See also: the system dependent file "tcp.h", which is included here. + Generates: HTUtils.h + + See also: the system dependent file "tcp.h" */ @@ -15,12 +17,8 @@ #ifdef HAVE_CONFIG_H #include /* generated by autoconf 'configure' script */ #include -#include - #else -#include - #define DONT_TRACK_INTERNAL_LINKS 1 /* Explicit system-configure */ @@ -29,7 +27,6 @@ #define NO_UNISTD_H #define NO_KEYPAD #define NO_UTMP -#define NO_FILIO_H #endif /* FIXME: these will be removed after completing auto-configure script */ @@ -77,10 +74,6 @@ #define HAVE_UTMP 1 #endif -#endif /* HAVE_CONFIG_H */ - -#ifndef LY_MAXPATH -#define LY_MAXPATH 256 #endif #ifndef GCC_UNUSED @@ -95,15 +88,6 @@ #define popen _popen #define pclose _pclose #endif /* _WINDOWS */ - -#ifdef __EMX__ -#include /* should be re-include protected under EMX */ -#include /* should be re-include protected under EMX */ -#define getcwd _getcwd2 -#define chdir _chdir2 - -#endif - #ifdef SHORT_NAMES #define WWW_TraceFlag HTTrFlag @@ -114,6 +98,10 @@ Debug message control. */ +#ifndef STDIO_H +#include +#define STDIO_H +#endif #ifdef DEBUG #define TRACE (WWW_TraceFlag) @@ -124,6 +112,9 @@ Debug message control. #define PROGRESS(str) /* nothing for now */ #endif +#define CTRACE if(TRACE)fprintf +#define tfp stderr + /* ERROR TYPE @@ -166,6 +157,7 @@ Standard C library for malloc() etc #include #include +#include #include /* ANSI */ /* BSN */ #endif /* !ultrix */ @@ -173,6 +165,7 @@ Standard C library for malloc() etc #include #include +#include #if defined(VAXC) && !defined(__DECC) #define malloc VAXC$MALLOC_OPT #define calloc VAXC$CALLOC_OPT @@ -311,7 +304,6 @@ Sucess (>=0) and failure (<0) codes #define HT_ERROR -1 /* Generic failure */ -#define HT_CANNOT_TRANSLATE -4 #define HT_NO_ACCESS -10 /* Access not available */ #define HT_FORBIDDEN -11 /* Access forbidden */ #define HT_INTERNAL -12 /* Weird -- should never happen. */ @@ -321,12 +313,10 @@ Sucess (>=0) and failure (<0) codes #include /* String utilities */ #ifndef va_arg -#if defined(__STDC__) || defined(VMS) +#ifdef __STDC__ #include -#define LYva_start(ap,format) va_start(ap,format) #else #include -#define LYva_start(ap,format) va_start(ap) #endif #endif @@ -342,7 +332,11 @@ Out Of Memory checking for malloc() return: #include -extern void outofmem PARAMS((CONST char *fname, CONST char *func)); +#define outofmem(file, func)\ + { fprintf(stderr,\ + "\r\n\r\n\r\n%s %s: out of memory. Aborting...\r\n", file, func);\ + LYOutOfMemory = TRUE; exit(-1);} +/* extern void outofmem PARAMS((const char *fname, const char *func)); */ /* @@ -362,8 +356,6 @@ Upper- and Lowercase macros #define TOUPPER(c) (islower((unsigned char)c) ? toupper((unsigned char)c) : ((unsigned char)c)) #endif /* TOLOWER */ -#define FREE(x) if (x) {free(x); x = NULL;} - /* The local equivalents of CR and LF @@ -376,40 +368,8 @@ The local equivalents of CR and LF #define LF FROMASCII('\012') /* ASCII line feed LOCAL EQUIVALENT */ #define CR FROMASCII('\015') /* Will be converted to ^M for transmission */ -#define CTRACE if(TRACE)fprintf -#define tfp TraceFP() -#define CTRACE_SLEEP(secs) if (TRACE && LYTraceLogFP == 0) sleep(secs) -#define CTRACE_FLUSH(fp) if(TRACE) fflush(fp) - -extern FILE *TraceFP NOPARAMS; - -#include - -/* - * 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 /* turn on the Rxxxx definitions used in Lynx */ -#include +#endif /* HTUTILS_H */ /* - * The AIX- and SOCKS4-specific definitions in socks.h are inconsistent. - * Repair them so they're consistent (and usable). - */ -#if defined(_AIX) && !defined(USE_SOCKS4_PREFIX) -#undef Raccept -#define Raccept accept -#undef Rgetsockname -#define Rgetsockname getsockname -#undef Rgetpeername -#define Rgetpeername getpeername -#endif -#endif /* USE_SOCKS5 */ - -#define SHORTENED_RBIND /* FIXME: do this in configure-script */ - -#endif /* HTUTILS_H */ + end of utilities */ -- cgit 1.4.1-2-gfad0