diff options
Diffstat (limited to 'WWW/Library')
33 files changed, 1186 insertions, 780 deletions
diff --git a/WWW/Library/Implementation/HTAccess.c b/WWW/Library/Implementation/HTAccess.c index 1ea1d7fd..eda37d8f 100644 --- a/WWW/Library/Implementation/HTAccess.c +++ b/WWW/Library/Implementation/HTAccess.c @@ -22,7 +22,7 @@ ** 27 Jan 95 Ensured that proxy service will be overridden for files ** on the local host (because HTLoadFile() doesn't try ftp ** for those) and will substitute ftp for remote files. FM -** 28 Jan 95 Tweeked PDM's proxy override mods to handle port info +** 28 Jan 95 Tweaked PDM's proxy override mods to handle port info ** for news and wais URL's. FM ** ** Bugs @@ -713,7 +713,7 @@ PUBLIC int redirection_attempts = 0; /* counter in HTLoadDocument */ ** - Checks or documents already loaded ** - Logs the access ** - Allows stdin filter option -** - Trace ouput and error messages +** - Trace output and error messages ** ** On Entry, ** anchor is the node_anchor for the document @@ -726,13 +726,13 @@ PUBLIC int redirection_attempts = 0; /* counter in HTLoadDocument */ */ PRIVATE BOOL HTLoadDocument ARGS4( - CONST char *, full_address, + CONST char *, full_address, /* may include #fragment */ HTParentAnchor *, anchor, HTFormat, format_out, HTStream*, sink) { - int status; - HText * text; + int status; + HText * text; CONST char * address_to_load = full_address; char *cp; BOOL ForcingNoCache = LYforce_no_cache; @@ -772,9 +772,9 @@ PRIVATE BOOL HTLoadDocument ARGS4( * are LYNXIMGMAP documents, for which we defer to LYLoadIMGmap * for prompting if necessary. - kw */ - if (LYinternal_flag && !LYforce_no_cache && + text = (HText *)HTAnchor_document(anchor); + if (LYinternal_flag && !text && !LYforce_no_cache && anchor->post_data && !anchor->safe && - (text = (HText *)HTAnchor_document(anchor)) == NULL && !isLYNXIMGMAP(full_address) && HTConfirm(gettext("Document with POST content not found in cache. Resubmit?")) != TRUE) { @@ -832,7 +832,8 @@ PRIVATE BOOL HTLoadDocument ARGS4( /* ** See if we can use an already loaded document. */ - if (!LYforce_no_cache && (text = (HText *)HTAnchor_document(anchor))) { + text = (HText *)HTAnchor_document(anchor); + if (text && !LYforce_no_cache) { /* ** We have a cached rendition of the target document. ** Check if it's OK to re-use it. We consider it OK if: @@ -884,15 +885,15 @@ PRIVATE BOOL HTLoadDocument ARGS4( ** etc.) but the code for doing those other things isn't ** available yet. */ + if (LYoverride_no_cache || #ifdef DONT_TRACK_INTERNAL_LINKS - if (LYoverride_no_cache || !HText_hasNoCacheSet(text) || - !HText_AreDifferent(anchor, full_address)) + !HText_hasNoCacheSet(text) || + !HText_AreDifferent(anchor, full_address) #else - if (LYoverride_no_cache || ((LYinternal_flag || !HText_hasNoCacheSet(text)) && - !isLYNXIMGMAP(full_address))) + !isLYNXIMGMAP(full_address)) #endif /* TRACK_INTERNAL_LINKS */ - { + ) { CTRACE((tfp, "HTAccess: Document already in memory.\n")); HText_select(text); @@ -908,6 +909,14 @@ PRIVATE BOOL HTLoadDocument ARGS4( } } + if (text && HText_HaveUserChangedForms(text)) { + /* + * Issue a warning. User forms content will be lost. + * Will not restore changed forms, currently. + */ + HTAlert(RELOADING_FORM); + } + /* ** Get the document from the net. If we are auto-reloading, ** the mutable anchor elements from the previous rendition @@ -916,12 +925,30 @@ PRIVATE BOOL HTLoadDocument ARGS4( */ LYforce_no_cache = NO; /* reset after each time through */ if (ForcingNoCache) { - FREE(anchor->title); + FREE(anchor->title); /* ??? */ } status = HTLoad(address_to_load, anchor, format_out, sink); CTRACE((tfp, "HTAccess: status=%d\n", status)); /* + * RECOVERY: + * if the loading failed, and we had a cached HText copy, + * and no new HText created - use a previous copy, issue a warning. + */ + if (text && status < 0 && (HText *)HTAnchor_document(anchor) == text) { + HTAlert(gettext("Loading failed, use a previous copy.")); + CTRACE((tfp, "HTAccess: Loading failed, use a previous copy.\n")); + HText_select(text); + +#ifdef DIRED_SUPPORT + if (HTAnchor_format(anchor) == WWW_DIRED) + lynx_edit_mode = TRUE; +#endif + redirection_attempts = 0; + return YES; + } + + /* ** Log the access if necessary. */ if (HTlogfile) { @@ -1106,7 +1133,7 @@ PUBLIC BOOL HTLoadToStream ARGS3( HTStream *, sink) { return HTLoadDocument(addr, - HTAnchor_findAddress(addr), + HTAnchor_findSimpleAddress(addr), (HTOutputFormat ? HTOutputFormat : WWW_PRESENT), sink); } @@ -1145,7 +1172,7 @@ PUBLIC BOOL HTLoadRelative ARGS2( full_address.address = HTParse(stripped, here->address, - PARSE_ACCESS|PARSE_HOST|PARSE_PATH|PARSE_PUNCTUATION); + PARSE_ALL_WITHOUT_ANCHOR); result = HTLoadAbsolute(&full_address); /* ** If we got redirection, result will be NO, but use_this_url_instead diff --git a/WWW/Library/Implementation/HTAccess.h b/WWW/Library/Implementation/HTAccess.h index 8d6e40e1..dbe36fa2 100644 --- a/WWW/Library/Implementation/HTAccess.h +++ b/WWW/Library/Implementation/HTAccess.h @@ -114,8 +114,8 @@ Load a document from relative name */ extern BOOL HTLoadRelative PARAMS(( - CONST char * relative_name, - HTParentAnchor * here)); + CONST char * relative_name, + HTParentAnchor * here)); /* @@ -150,7 +150,7 @@ Load a document from absolute name to a stream */ extern BOOL HTLoadToStream PARAMS((CONST char * addr, BOOL filter_it, - HTStream * sink)); + HTStream * sink)); /* @@ -210,8 +210,8 @@ Search Given Indexname */ extern BOOL HTSearchAbsolute PARAMS(( - CONST char * keywords, - char * indexname)); + CONST char * keywords, + char * indexname)); /* @@ -221,15 +221,15 @@ Register an access method */ typedef struct _HTProtocol { - char * name; + char * name; - int (*load)PARAMS(( - CONST char * full_address, - HTParentAnchor * anchor, - HTFormat format_out, - HTStream* sink)); + int (*load)PARAMS(( + CONST char * full_address, + HTParentAnchor * anchor, + HTFormat format_out, + HTStream* sink)); - HTStream* (*saveStream)PARAMS((HTParentAnchor * anchor)); + HTStream* (*saveStream)PARAMS((HTParentAnchor * anchor)); } HTProtocol; diff --git a/WWW/Library/Implementation/HTAnchor.c b/WWW/Library/Implementation/HTAnchor.c index e463c408..e83a0fa8 100644 --- a/WWW/Library/Implementation/HTAnchor.c +++ b/WWW/Library/Implementation/HTAnchor.c @@ -769,7 +769,7 @@ PRIVATE void HTParentAnchor_free ARGS1( FREE(me->owner); FREE(me->RevTitle); FREE(me->citehost); -#ifdef SOURCE_CACHE +#ifdef USE_SOURCE_CACHE HTAnchor_clearSourceCache(me); #endif if (me->FileCache) { @@ -812,7 +812,7 @@ PRIVATE void HTParentAnchor_free ARGS1( ImageMapList_free(me->imaps); } -#ifdef SOURCE_CACHE +#ifdef USE_SOURCE_CACHE PUBLIC void HTAnchor_clearSourceCache ARGS1( HTParentAnchor *, me) { @@ -832,7 +832,7 @@ PUBLIC void HTAnchor_clearSourceCache ARGS1( me->source_cache_chunk = NULL; } } -#endif /* SOURCE_CACHE */ +#endif /* USE_SOURCE_CACHE */ /* Data access functions ** --------------------- diff --git a/WWW/Library/Implementation/HTAnchor.h b/WWW/Library/Implementation/HTAnchor.h index 2083f862..3467f612 100644 --- a/WWW/Library/Implementation/HTAnchor.h +++ b/WWW/Library/Implementation/HTAnchor.h @@ -92,7 +92,7 @@ struct _HTParentAnchor { BOOL isISMAPScript; /* Script for clickable image map */ BOOL isHEAD; /* Document is headers from a HEAD request */ BOOL safe; /* Safe */ -#ifdef SOURCE_CACHE +#ifdef USE_SOURCE_CACHE char * source_cache_file; HTChunk * source_cache_chunk; #endif @@ -205,7 +205,7 @@ extern BOOL HTAnchor_delete PARAMS(( extern void HTAnchor_delete_links PARAMS(( HTParentAnchor * me)); -#ifdef SOURCE_CACHE +#ifdef USE_SOURCE_CACHE extern void HTAnchor_clearSourceCache PARAMS(( HTParentAnchor * me)); #endif diff --git a/WWW/Library/Implementation/HTAtom.c b/WWW/Library/Implementation/HTAtom.c index cb5fc7c4..b0b9273b 100644 --- a/WWW/Library/Implementation/HTAtom.c +++ b/WWW/Library/Implementation/HTAtom.c @@ -50,7 +50,7 @@ PUBLIC HTAtom * HTAtom_for ARGS1(CONST char *, string) * 05-29-94 Lynx 2-3-1 Garrett Arch Blythe */ if (!initialised) { - int i; + int i; for (i = 0; i < HASH_SIZE; i++) hash_table[i] = (HTAtom *) 0; initialised = YES; @@ -67,7 +67,7 @@ PUBLIC HTAtom * HTAtom_for ARGS1(CONST char *, string) */ for (a = hash_table[hash]; a; a = a->next) { if (0 == strcasecomp(a->name, string)) { - /* CTRACE((tfp, "HTAtom: Old atom %p for `%s'\n", a, string)); */ + /* CTRACE((tfp, "HTAtom: Old atom %p for `%s'\n", a, string)); */ return a; /* Found: return it */ } } @@ -76,10 +76,10 @@ PUBLIC HTAtom * HTAtom_for ARGS1(CONST char *, string) */ a = (HTAtom *)malloc(sizeof(*a)); if (a == NULL) - outofmem(__FILE__, "HTAtom_for"); + outofmem(__FILE__, "HTAtom_for"); a->name = (char *)malloc(strlen(string)+1); if (a->name == NULL) - outofmem(__FILE__, "HTAtom_for"); + outofmem(__FILE__, "HTAtom_for"); strcpy(a->name, string); a->next = hash_table[hash]; /* Put onto the head of list */ hash_table[hash] = a; @@ -112,7 +112,7 @@ PRIVATE void free_atoms NOARGS */ while (hash_table[i_counter] != NULL) { /* - * Free off atoms and any members. + * Free off atoms and any members. */ HTAp_freeme = hash_table[i_counter]; hash_table[i_counter] = HTAp_freeme->next; diff --git a/WWW/Library/Implementation/HTChunk.h b/WWW/Library/Implementation/HTChunk.h index 2c393261..4150c1e7 100644 --- a/WWW/Library/Implementation/HTChunk.h +++ b/WWW/Library/Implementation/HTChunk.h @@ -18,7 +18,7 @@ typedef struct { int size; /* In bytes */ - int growby; /* Allocation unit in bytes */ + int growby; /* Allocation unit in bytes */ int allocated; /* Current size of *data */ char * data; /* Pointer to malloced area or 0 */ int failok; /* allowed to fail without exiting program? */ @@ -70,11 +70,11 @@ extern HTChunk * HTChunkCreate2 PARAMS((int growby, size_t needed)); * * ON ENTRY, * - * ch A valid chunk pointer made by HTChunkCreate() + * ch A valid chunk pointer made by HTChunkCreate() * * ON EXIT, * - * ch is invalid and may not be used. + * ch is invalid and may not be used. * */ @@ -87,7 +87,7 @@ extern void HTChunkFree PARAMS((HTChunk * ch)); * * ON ENTRY, * - * ch A valid chunk pointer made by HTChunkCreate() + * ch A valid chunk pointer made by HTChunkCreate() * * ON EXIT, * @@ -104,7 +104,7 @@ extern void HTChunkClear PARAMS((HTChunk * ch)); * * ON ENTRY, * - * ch A valid chunk pointer made by HTChunkCreate() + * ch A valid chunk pointer made by HTChunkCreate() * * growby growby * @@ -123,7 +123,7 @@ extern BOOL HTChunkRealloc PARAMS((HTChunk * ch, int growby)); * * ON ENTRY, * - * ch A valid chunk pointer made by HTChunkCreate() + * ch A valid chunk pointer made by HTChunkCreate() * * s The size required * @@ -142,7 +142,7 @@ extern void HTChunkEnsure PARAMS((HTChunk * ch, int s)); * * ON ENTRY, * - * ch A valid chunk pointer made by HTChunkCreate() + * ch A valid chunk pointer made by HTChunkCreate() * * c The character to be appended * @@ -162,7 +162,7 @@ extern void HTChunkPutUtf8Char PARAMS((HTChunk * ch, UCode_t code)); * * ON ENTRY, * - * ch A valid chunk pointer made by HTChunkCreate() + * ch A valid chunk pointer made by HTChunkCreate() * * str Points to a zero-terminated string to be appended * @@ -186,7 +186,7 @@ extern void HTChunkPuts PARAMS((HTChunk * ch, CONST char *str)); * * ON ENTRY, * - * ch A valid chunk pointer made by HTChunkCreate() + * ch A valid chunk pointer made by HTChunkCreate() * * ON EXIT, * diff --git a/WWW/Library/Implementation/HTDOS.c b/WWW/Library/Implementation/HTDOS.c index 58241d08..df667bef 100644 --- a/WWW/Library/Implementation/HTDOS.c +++ b/WWW/Library/Implementation/HTDOS.c @@ -24,10 +24,10 @@ PRIVATE char * copy_plus ARGS2(char **, result, CONST char *, source) /* PUBLIC HTDOS_wwwName() ** CONVERTS DOS Name into WWW Name ** ON ENTRY: -** dosname DOS file specification (NO NODE) +** dosname DOS file specification (NO NODE) ** ** ON EXIT: -** returns WWW file specification +** returns WWW file specification ** */ char * HTDOS_wwwName ARGS1(CONST char *, dosname) @@ -93,10 +93,10 @@ char * HTDOS_slashes ARGS1(char *, path) /* PUBLIC HTDOS_name() ** CONVERTS WWW name into a DOS name ** ON ENTRY: -** wwwname WWW file name +** wwwname WWW file name ** ** ON EXIT: -** returns DOS file specification +** returns DOS file specification */ char * HTDOS_name ARGS1(char *, wwwname) { diff --git a/WWW/Library/Implementation/HTFTP.c b/WWW/Library/Implementation/HTFTP.c index d88bcf01..4c90ac0e 100644 --- a/WWW/Library/Implementation/HTFTP.c +++ b/WWW/Library/Implementation/HTFTP.c @@ -93,7 +93,7 @@ BUGS: @@@ Limit connection cache size! typedef struct _connection { struct _connection * next; /* Link on list */ - u_long addr; /* IP address */ + unsigned long addr; /* IP address */ int socket; /* Socket number for communication */ BOOL binary; /* Binary mode? */ } connection; @@ -102,12 +102,13 @@ typedef struct _connection { */ #include <HTML.h> -#define PUTC(c) (*targetClass.put_character)(target, c) -#define PUTS(s) (*targetClass.put_string)(target, s) -#define START(e) (*targetClass.start_element)(target, e, 0, 0, -1, 0) -#define END(e) (*targetClass.end_element)(target, e, 0) -#define FREE_TARGET (*targetClass._free)(target) -#define ABORT_TARGET (*targetClass._free)(target) +#define PUTC(c) (*targetClass.put_character) (target, c) +#define PUTS(s) (*targetClass.put_string) (target, s) +#define START(e) (*targetClass.start_element) (target, e, 0, 0, -1, 0) +#define END(e) (*targetClass.end_element) (target, e, 0) +#define FREE_TARGET (*targetClass._free) (target) +#define ABORT_TARGET (*targetClass._free) (target) + struct _HTStructured { CONST HTStructuredClass * isa; /* ... */ @@ -117,6 +118,7 @@ struct _HTStructured { ** --------------------- */ PUBLIC int HTfileSortMethod = FILE_BY_NAME; + #ifndef DISABLE_FTP /*This disables everything to end-of-file */ PRIVATE char ThisYear[8]; PRIVATE char LastYear[8]; @@ -133,6 +135,15 @@ PRIVATE int data_soc = -1; /* Socket for data transfer =invalid */ PRIVATE char *user_entered_password = NULL; PRIVATE char *last_username_and_host = NULL; +/* + * ProFTPD 1.2.5rc1 is known to have a broken implementation of RETR. If asked + * to retrieve a directory, it gets confused and fails subsequent commands such + * as CWD and LIST. Since this is an unusual bug, we should remove this ifdef + * at some point - TD 2004/1/1. + */ +#define BROKEN_PROFTPD 1 +PRIVATE int ProFTPD_bugs = FALSE; + typedef enum { GENERIC_SERVER , MACHTEN_SERVER @@ -474,6 +485,12 @@ PRIVATE int response ARGS1( continuation == ' ') continuation_response = -1; /* ended */ } +#ifdef BROKEN_PROFTPD + if (result == 220 && LYstrstr(response_text, "ProFTPD 1.2.5")) { + ProFTPD_bugs = TRUE; + CTRACE((tfp, "This server is broken (RETR)\n")); + } +#endif break; } /* if end of line */ @@ -2902,45 +2919,29 @@ unload_btree: return HT_LOADED; } -/* Retrieve File from Server -** ------------------------- -** -** On entry, -** name WWW address of a file: document, including hostname -** On exit, -** returns Socket number for file if good. -** <0 if bad. -*/ -PUBLIC int HTFTPLoad ARGS4( +/* + * Setup an FTP connection. + */ +PRIVATE int setup_connection ARGS2( CONST char *, name, - HTParentAnchor *, anchor, - HTFormat, format_out, - HTStream *, sink) + HTParentAnchor *, anchor) { - BOOL isDirectory = NO; - HTAtom * encoding = NULL; - int status, final_status; int retry; /* How many times tried? */ - int outstanding = 1; /* outstanding control connection responses - that we are willing to wait for, if we - get to the point of reading data - kw */ - HTFormat format; - - CTRACE((tfp, "HTFTPLoad(%s) %s connection\n", name, ftp_passive ? "passive" : "normal")); + int status; /* set use_list to NOT since we don't know what kind of server * this is yet. And set the type to GENERIC */ use_list = FALSE; server_type = GENERIC_SERVER; - HTReadProgress(0,0); + ProFTPD_bugs = FALSE; for (retry = 0; retry < 2; retry++) { /* For timed out/broken connections */ status = get_connection(name, anchor); if (status < 0) return status; - if (!ftp_passive) { + if (!ftp_local_passive) { status = get_listen_socket(); if (status < 0) { NETCLOSE (control->socket); @@ -3090,6 +3091,37 @@ PUBLIC int HTFTPLoad ARGS4( break; /* No more retries */ } /* for retries */ + return status; +} + +/* Retrieve File from Server +** ------------------------- +** +** On entry, +** name WWW address of a file: document, including hostname +** On exit, +** returns Socket number for file if good. +** <0 if bad. +*/ +PUBLIC int HTFTPLoad ARGS4( + CONST char *, name, + HTParentAnchor *, anchor, + HTFormat, format_out, + HTStream *, sink) +{ + BOOL isDirectory = NO; + HTAtom * encoding = NULL; + int status, final_status; + int outstanding = 1; /* outstanding control connection responses + that we are willing to wait for, if we + get to the point of reading data - kw */ + HTFormat format; + + CTRACE((tfp, "HTFTPLoad(%s) %s connection\n", name, ftp_local_passive ? "passive" : "normal")); + + HTReadProgress(0,0); + + status = setup_connection(name, anchor); if (status < 0) return status; /* Failed with this code */ @@ -3540,6 +3572,23 @@ PUBLIC int HTFTPLoad ARGS4( */ if (!(type) || (type && *type != 'D')) { status = send_cmd_2("RETR", filename); +#ifdef BROKEN_PROFTPD + /* + * ProFTPD 1.2.5rc1 gets confused when asked to RETR a directory. + */ + if (status >= 5) { + int check; + + if (ProFTPD_bugs) { + CTRACE((tfp, "{{reconnecting...\n")); + close_connection(control); + check = setup_connection(name, anchor); + CTRACE((tfp, "...done }}reconnecting\n")); + if (check < 0) + return check; + } + } +#endif } else { status = 5; /* Failed status set as flag. - FM */ } @@ -3571,7 +3620,7 @@ PUBLIC int HTFTPLoad ARGS4( } listen: - if(!ftp_passive) { + if(!ftp_local_passive) { /* Wait for the connection */ #ifdef INET6 struct sockaddr_storage soc_address; @@ -3595,7 +3644,7 @@ listen: } CTRACE((tfp, "TCP: Accepted new socket %d\n", status)); data_soc = status; - } /* !ftp_passive */ + } /* !ftp_local_passive */ #if 0 /* no - this makes the data connection go away too soon (2.8.3dev.22) */ if ((status = send_cmd_nowait("QUIT")) == 1) diff --git a/WWW/Library/Implementation/HTFTP.h b/WWW/Library/Implementation/HTFTP.h index 4189a4b9..cda35834 100644 --- a/WWW/Library/Implementation/HTFTP.h +++ b/WWW/Library/Implementation/HTFTP.h @@ -28,7 +28,7 @@ extern int HTfileSortMethod; /* specifies the method of sorting */ ** fn WWW file name ** ** ON EXIT: -** returns vms file specification +** returns vms file specification ** ** Bug: Returns pointer to static -- non-reentrant */ diff --git a/WWW/Library/Implementation/HTFWriter.c b/WWW/Library/Implementation/HTFWriter.c index b8b0c5d9..b7b8ac17 100644 --- a/WWW/Library/Implementation/HTFWriter.c +++ b/WWW/Library/Implementation/HTFWriter.c @@ -27,8 +27,8 @@ struct _HTStream { CONST HTStreamClass * isa; FILE * fp; - char * end_command; - char * remove_command; + char * end_command; + char * remove_command; BOOL announce; }; @@ -61,7 +61,7 @@ PRIVATE CONST HTStreamClass HTBlackHoleClass = "BlackHole", HTBlackHole_free, HTBlackHole_abort, - HTBlackHole_put_character, HTBlackHole_put_string, + HTBlackHole_put_character, HTBlackHole_put_string, HTBlackHole_write }; @@ -133,7 +133,7 @@ PRIVATE void HTFWriter_free ARGS1(HTStream *, me) { fclose(me->fp); if (me->end_command) { /* Temp file */ - _HTProgress(me->end_command); /* Tell user what's happening */ + _HTProgress(me->end_command); /* Tell user what's happening */ system(me->end_command); FREE(me->end_command); if (me->remove_command) { @@ -173,7 +173,7 @@ PRIVATE CONST HTStreamClass HTFWriter = /* As opposed to print etc */ "FileWriter", HTFWriter_free, HTFWriter_abort, - HTFWriter_put_character, HTFWriter_put_string, + HTFWriter_put_character, HTFWriter_put_string, HTFWriter_write }; @@ -238,7 +238,7 @@ PUBLIC HTStream* HTSaveAndExecute ARGS3( HTStream* me; if (HTClientHost) { - HTAlert(CANNOT_SAVE_REMOTE); + HTAlert(CANNOT_SAVE_REMOTE); return HTBlackHole(); } @@ -259,7 +259,7 @@ PUBLIC HTStream* HTSaveAndExecute ARGS3( me->fp = fopen (fnam, BIN_W); if (!me->fp) { HTAlert(CANNOT_OPEN_TEMP); - FREE(fnam); + FREE(fnam); FREE(me); return NULL; } @@ -307,7 +307,7 @@ PUBLIC HTStream* HTSaveLocally ARGS3( HTStream* me; if (HTClientHost) { - HTAlert(CANNOT_SAVE_REMOTE); + HTAlert(CANNOT_SAVE_REMOTE); return HTBlackHole(); } @@ -336,7 +336,7 @@ PUBLIC HTStream* HTSaveLocally ARGS3( me->fp = fopen (answer, BIN_W); if (!me->fp) { HTAlert(CANNOT_OPEN_OUTPUT); - FREE(answer); + FREE(answer); FREE(me); return NULL; } diff --git a/WWW/Library/Implementation/HTFile.c b/WWW/Library/Implementation/HTFile.c index 34a01106..ea60145d 100644 --- a/WWW/Library/Implementation/HTFile.c +++ b/WWW/Library/Implementation/HTFile.c @@ -46,7 +46,7 @@ #include <stat.h> #endif /* VMS */ -#ifdef USE_ZLIB +#if defined (USE_ZLIB) || defined (USE_BZLIB) #include <GridText.h> #endif @@ -279,7 +279,7 @@ PRIVATE void LYListFmtParse ARGS5( *buf = '\0'; #ifdef S_IFLNK if (c != 'A' && S_ISLNK(data->file_info.st_mode) && - (len = readlink(file, tmp, sizeof(tmp))) >= 0) { + (len = readlink(file, tmp, sizeof(tmp) - 1)) >= 0) { PUTS(" -> "); tmp[len] = '\0'; PUTS(tmp); @@ -2070,20 +2070,27 @@ PUBLIC int HTLoadFile ARGS4( { char * filename = NULL; char * acc_method = NULL; + char * ftp_newhost; HTFormat format; char * nodename = NULL; char * newname = NULL; /* Simplified name of file */ HTAtom * encoding; /* @@ not used yet */ HTAtom * myEncoding = NULL; /* enc of this file, may be gzip etc. */ - int status; + int status = -1; char *dot; #ifdef VMS struct stat stat_info; #endif /* VMS */ #ifdef USE_ZLIB gzFile gzfp = 0; - BOOL use_gzread = NO; #endif /* USE_ZLIB */ +#ifdef USE_BZLIB + BZFILE *bzfp = 0; +#endif /* USE_ZLIB */ +#if defined(USE_ZLIB) || defined(USE_BZLIB) + CompressFileType internal_decompress = cftNone; + BOOL failed_decompress = NO; +#endif /* ** Reduce the filename to a basic form (hopefully unique!). @@ -2105,7 +2112,21 @@ PUBLIC int HTLoadFile ARGS4( FREE(nodename); FREE(acc_method); #ifndef DISABLE_FTP + ftp_newhost = HTParse(addr, "", PARSE_HOST); + if (strcmp(ftp_lasthost, ftp_newhost)) + ftp_local_passive = ftp_passive; + status = HTFTPLoad(addr, anchor, format_out, sink); + + if ( ftp_passive == ftp_local_passive ) { + if (( status >= 400 ) || ( status < 0 )) { + ftp_local_passive = !ftp_passive; + status = HTFTPLoad(addr, anchor, format_out, sink); + } + } + + free(ftp_lasthost); + ftp_lasthost = ftp_newhost; #endif /* DISABLE_FTP */ return status; } else { @@ -2242,9 +2263,23 @@ PUBLIC int HTLoadFile ARGS4( CTRACE((tfp, "HTLoadFile: gzopen of `%s' gives %p\n", vmsname, (void*)gzfp)); - use_gzread = YES; + internal_decompress = cftGzip; } else #endif /* USE_ZLIB */ +#ifdef USE_BZLIB + if (strcmp(format_out->name, "www/download") != 0 && + (!strcmp(HTAtom_name(myEncoding), "bzip2") || + !strcmp(HTAtom_name(myEncoding), "x-bzip2"))) { + fclose(fp); + if (semicolon != NULL) + *semicolon = ';'; + bzfp = BZ2_bzopen(vmsname, BIN_R); + + CTRACE((tfp, "HTLoadFile: bzopen of `%s' gives %p\n", + vmsname, (void*)bzfp)); + use_zread = YES; + } else +#endif /* USE_BZLIB */ { StrAllocCopy(anchor->content_type, format->name); StrAllocCopy(anchor->content_encoding, HTAtom_name(myEncoding)); @@ -2282,7 +2317,7 @@ PUBLIC int HTLoadFile ARGS4( CTRACE((tfp, "HTLoadFile: gzopen of `%s' gives %p\n", vmsname, (void*)gzfp)); - use_gzread = YES; + internal_decompress = cftGzip; } #else /* USE_ZLIB */ format = HTAtom_for("www/compressed"); @@ -2290,7 +2325,20 @@ PUBLIC int HTLoadFile ARGS4( break; case cftBzip2: StrAllocCopy(anchor->content_encoding, "x-bzip2"); +#ifdef USE_BZLIB + if (strcmp(format_out->name, "www/download") != 0) { + fclose(fp); + if (semicolon != NULL) + *semicolon = ';'; + bzfp = BZ2_bzopen(vmsname, BIN_R); + + CTRACE((tfp, "HTLoadFile: bzopen of `%s' gives %p\n", + vmsname, (void*)bzfp)); + internal_decompress = cfgBzip2; + } +#else /* USE_BZLIB */ format = HTAtom_for("www/compressed"); +#endif /* USE_BZLIB */ break; case cftNone: break; @@ -2300,9 +2348,29 @@ PUBLIC int HTLoadFile ARGS4( *semicolon = ';'; FREE(filename); FREE(nodename); +#if defined(USE_ZLIB) || defined(USE_BZLIB) + if (internal_decompress != cftNone) { + switch (internal_decompress) { #ifdef USE_ZLIB - if (use_gzread) { - if (gzfp) { + case cftCompress: + case cftGzip: + failed_decompress = (gzfp == 0); + break; +#endif +#ifdef USE_BZLIB + case cftBzip2: + failed_decompress = (bzfp == 0); + break; +#endif + default: + failed_decompress = YES; + break; + } + if (failed_decompress) { + status = HTLoadError(NULL, + -(HT_ERROR), + FAILED_OPEN_COMPRESSED_FILE); + } else { char * sugfname = NULL; if (anchor->SugFname) { StrAllocCopy(sugfname, anchor->SugFname); @@ -2323,16 +2391,21 @@ PUBLIC int HTLoadFile ARGS4( if (sugfname && *sugfname) StrAllocCopy(anchor->SugFname, sugfname); FREE(sugfname); - status = HTParseGzFile(format, format_out, - anchor, - gzfp, sink); - } else { - status = HTLoadError(NULL, - -(HT_ERROR), - FAILED_OPEN_COMPRESSED_FILE); +#ifdef USE_BZLIB + if (bzfp) + status = HTParseBzFile(format, format_out, + anchor, + bzfp, sink); +#endif +#ifdef USE_ZLIB + if (gzfp) + status = HTParseGzFile(format, format_out, + anchor, + gzfp, sink); +#endif } } else -#endif /* USE_ZLIB */ +#endif /* USE_ZLIB || USE_BZLIB */ { status = HTParseFile(format, format_out, anchor, fp, sink); fclose(fp); @@ -2350,7 +2423,7 @@ PUBLIC int HTLoadFile ARGS4( ** For unix, we try to translate the name into the name of a ** transparently mounted file. ** - ** Not allowed in secure (HTClienntHost) situations. TBL 921019 + ** Not allowed in secure (HTClientHost) situations. TBL 921019 */ #ifndef NO_UNIX_IO /* Need protection here for telnet server but not httpd server. */ @@ -2602,9 +2675,21 @@ PUBLIC int HTLoadFile ARGS4( CTRACE((tfp, "HTLoadFile: gzopen of `%s' gives %p\n", localname, (void*)gzfp)); - use_gzread = YES; + internal_decompress = cftGzip; } else #endif /* USE_ZLIB */ +#ifdef USE_BZLIB + if (strcmp(format_out->name, "www/download") != 0 && + (!strcmp(HTAtom_name(myEncoding), "bzip2") || + !strcmp(HTAtom_name(myEncoding), "x-bzip2"))) { + fclose(fp); + bzfp = BZ2_bzopen(localname, BIN_R); + + CTRACE((tfp, "HTLoadFile: bzopen of `%s' gives %p\n", + localname, (void*)bzfp)); + internal_decompress = cftBzip2; + } else +#endif /* USE_BZLIB */ { StrAllocCopy(anchor->content_type, format->name); StrAllocCopy(anchor->content_encoding, HTAtom_name(myEncoding)); @@ -2639,7 +2724,7 @@ PUBLIC int HTLoadFile ARGS4( CTRACE((tfp, "HTLoadFile: gzopen of `%s' gives %p\n", localname, (void*)gzfp)); - use_gzread = YES; + internal_decompress = cftGzip; } #else /* USE_ZLIB */ format = HTAtom_for("www/compressed"); @@ -2647,7 +2732,18 @@ PUBLIC int HTLoadFile ARGS4( break; case cftBzip2: StrAllocCopy(anchor->content_encoding, "x-bzip2"); +#ifdef USE_BZLIB + if (strcmp(format_out->name, "www/download") != 0) { + fclose(fp); + bzfp = BZ2_bzopen(localname, BIN_R); + + CTRACE((tfp, "HTLoadFile: bzopen of `%s' gives %p\n", + localname, (void*)bzfp)); + internal_decompress = cftBzip2; + } +#else /* USE_BZLIB */ format = HTAtom_for("www/compressed"); +#endif /* USE_BZLIB */ break; case cftNone: break; @@ -2655,9 +2751,28 @@ PUBLIC int HTLoadFile ARGS4( } FREE(localname); FREE(nodename); +#if defined(USE_ZLIB) || defined(USE_BZLIB) + if (internal_decompress != cftNone) { + switch (internal_decompress) { #ifdef USE_ZLIB - if (use_gzread) { - if (gzfp) { + case cftGzip: + failed_decompress = (gzfp == 0); + break; +#endif +#ifdef USE_BZLIB + case cftBzip2: + failed_decompress = (bzfp == 0); + break; +#endif + default: + failed_decompress = YES; + break; + } + if (failed_decompress) { + status = HTLoadError(NULL, + -(HT_ERROR), + FAILED_OPEN_COMPRESSED_FILE); + } else { char * sugfname = NULL; if (anchor->SugFname) { StrAllocCopy(sugfname, anchor->SugFname); @@ -2678,13 +2793,18 @@ PUBLIC int HTLoadFile ARGS4( if (sugfname && *sugfname) StrAllocCopy(anchor->SugFname, sugfname); FREE(sugfname); - status = HTParseGzFile(format, format_out, - anchor, - gzfp, sink); - } else { - status = HTLoadError(NULL, - -(HT_ERROR), - FAILED_OPEN_COMPRESSED_FILE); +#ifdef USE_BZLIB + if (bzfp) + status = HTParseBzFile(format, format_out, + anchor, + bzfp, sink); +#endif +#ifdef USE_ZLIB + if (gzfp) + status = HTParseGzFile(format, format_out, + anchor, + gzfp, sink); +#endif } } else #endif /* USE_ZLIB */ diff --git a/WWW/Library/Implementation/HTFormat.c b/WWW/Library/Implementation/HTFormat.c index 4a8e1778..d93f59cc 100644 --- a/WWW/Library/Implementation/HTFormat.c +++ b/WWW/Library/Implementation/HTFormat.c @@ -917,7 +917,7 @@ PUBLIC int HTFileCopy ARGS2( return rv; } -#ifdef SOURCE_CACHE +#ifdef USE_SOURCE_CACHE /* Push data from an HTChunk down a stream ** --------------------------------------- ** @@ -1057,6 +1057,83 @@ PRIVATE int HTGzFileCopy ARGS2( } #endif /* USE_ZLIB */ +#ifdef USE_BZLIB +/* Push data from a bzip file pointer down a stream +** ------------------------------------- +** +** This routine is responsible for creating and PRESENTING any +** graphic (or other) objects described by the file. +** +** +** State of file and target stream on entry: +** BZFILE (bzfp) assumed open (should have bzipped content), +** target (sink) assumed valid. +** +** Return values: +** HT_INTERRUPTED Interruption after some data read. +** HT_PARTIAL_CONTENT Error after some data read. +** -1 Error before any data read. +** HT_LOADED Normal end of file indication on reading. +** +** State of file and target stream on return: +** always bzfp still open, target stream still valid. +*/ +PRIVATE int HTBzFileCopy ARGS2( + BZFILE *, bzfp, + HTStream*, sink) +{ + HTStreamClass targetClass; + int status, bytes; + int bzerrnum; + int rv = HT_OK; + + /* Push the data down the stream + */ + targetClass = *(sink->isa); /* Copy pointers to procedures */ + + /* read and inflate bzip'd file, and push binary down sink + */ + HTReadProgress(bytes = 0, 0); + for (;;) { + status = BZ2_bzread(bzfp, input_buffer, INPUT_BUFFER_SIZE); + if (status <= 0) { /* EOF or error */ + if (status == 0) { + rv = HT_LOADED; + break; + } + CTRACE((tfp, "HTBzFileCopy: Read error, bzread returns %d\n", + status)); + CTRACE((tfp, "bzerror : %s\n", + BZ2_bzerror(bzfp, &bzerrnum))); + if (bytes) { + rv = HT_PARTIAL_CONTENT; + } else { + rv = -1; + } + break; + } + + (*targetClass.put_block)(sink, input_buffer, status); + bytes += status; + HTReadProgress(bytes, -1); + HTDisplayPartial(); + + if (HTCheckForInterrupt()) { + _HTProgress (TRANSFER_INTERRUPTED); + if (bytes) { + rv = HT_INTERRUPTED; + } else { + rv = -1; + } + break; + } + } /* next bufferload */ + + HTFinishDisplayPartial(); + return rv; +} +#endif /* USE_BZLIB */ + /* Push data from a socket down a stream STRIPPING CR ** -------------------------------------------------- ** @@ -1242,7 +1319,7 @@ PUBLIC int HTParseFile ARGS5( return HT_LOADED; } -#ifdef SOURCE_CACHE +#ifdef USE_SOURCE_CACHE /* Parse a document in memory given format and memory block pointer ** ** This routine is responsible for creating and PRESENTING any @@ -1376,6 +1453,82 @@ PUBLIC int HTParseGzFile ARGS5( } #endif /* USE_ZLIB */ +#ifdef USE_BZLIB +PRIVATE void HTCloseBzFile ARGS1( + BZFILE *, bzfp) +{ + if (bzfp) + BZ2_bzclose(bzfp); +} + +/* HTParseBzFile +** +** State of file and target stream on entry: +** bzFile (bzfp) assumed open, +** target (sink) usually NULL (will call stream stack). +** +** Return values: +** -501 Stream stack failed (cannot present or convert). +** -1 Download cancelled. +** HT_NO_DATA Error before any data read. +** HT_PARTIAL_CONTENT Interruption or error after some data read. +** HT_LOADED Normal end of file indication on reading. +** +** State of file and target stream on return: +** always bzfp closed; target freed, aborted, or NULL. +*/ +PUBLIC int HTParseBzFile ARGS5( + HTFormat, rep_in, + HTFormat, format_out, + HTParentAnchor *, anchor, + BZFILE*, bzfp, + HTStream*, sink) +{ + HTStream * stream; + HTStreamClass targetClass; + int rv; + + stream = HTStreamStack(rep_in, format_out, sink, anchor); + + if (!stream) { + char *buffer = 0; + HTCloseBzFile(bzfp); + if (LYCancelDownload) { + LYCancelDownload = FALSE; + return -1; + } + HTSprintf0(&buffer, CANNOT_CONVERT_I_TO_O, + HTAtom_name(rep_in), HTAtom_name(format_out)); + CTRACE((tfp, "HTFormat(in HTParseBzFile): %s\n", buffer)); + rv = HTLoadError(sink, 501, buffer); + FREE(buffer); + return rv; + } + + /* Push the data down the stream + ** + ** @@ Bug: This decision ought to be made based on "encoding" + ** rather than on content-type. @@@ When we handle encoding. + ** The current method smells anyway. + */ + targetClass = *(stream->isa); /* Copy pointers to procedures */ + rv = HTBzFileCopy(bzfp, stream); + if (rv == -1 || rv == HT_INTERRUPTED) { + (*targetClass._abort)(stream, NULL); + } else { + (*targetClass._free)(stream); + } + + HTCloseBzFile(bzfp); + if (rv == -1) + return HT_NO_DATA; + else if (rv == HT_INTERRUPTED || (rv > 0 && rv != HT_LOADED)) + return HT_PARTIAL_CONTENT; + else + return HT_LOADED; +} +#endif /* USE_BZLIB */ + /* Converter stream: Network Telnet to internal character text ** ----------------------------------------------------------- ** diff --git a/WWW/Library/Implementation/HTFormat.h b/WWW/Library/Implementation/HTFormat.h index 3b7403f5..4ee14688 100644 --- a/WWW/Library/Implementation/HTFormat.h +++ b/WWW/Library/Implementation/HTFormat.h @@ -344,7 +344,7 @@ extern int HTFileCopy PARAMS(( HTStream* sink)); -#ifdef SOURCE_CACHE +#ifdef USE_SOURCE_CACHE #include <HTChunk.h> /* @@ -425,7 +425,7 @@ extern int HTParseFile PARAMS(( FILE *fp, HTStream* sink)); -#ifdef SOURCE_CACHE +#ifdef USE_SOURCE_CACHE /* HTParseMem: Parse a document in memory @@ -444,12 +444,9 @@ extern int HTParseMem PARAMS(( #endif #ifdef USE_ZLIB - -#ifdef USE_ZLIB #include <zlib.h> -#endif /* USE_ZLIB */ /* -HTParseGzFile: Parse a gzipped File through a file pointer +HTParseGzFile: Parse a gzip'ed File through a file pointer This routine is called by protocols modules to load an object. uses HTStreamStack and HTGzFileCopy. Returns HT_LOADED if successful, can also @@ -464,6 +461,24 @@ extern int HTParseGzFile PARAMS(( #endif /* USE_ZLIB */ +#ifdef USE_BZLIB +#include <bzlib.h> +/* +HTParseBzFile: Parse a bzip2'ed File through a file pointer + + This routine is called by protocols modules to load an object. uses + HTStreamStack and HTGzFileCopy. Returns HT_LOADED if successful, can also + return HT_PARTIAL_CONTENT, HT_NO_DATA, or other <0 for failure. + */ +extern int HTParseBzFile PARAMS(( + HTFormat format_in, + HTFormat format_out, + HTParentAnchor *anchor, + BZFILE *bzfp, + HTStream* sink)); + +#endif /* USE_BZLIB */ + /* HTNetToText: Convert Net ASCII to local representation diff --git a/WWW/Library/Implementation/HTMIME.c b/WWW/Library/Implementation/HTMIME.c index 05c3a26f..aaba3d0e 100644 --- a/WWW/Library/Implementation/HTMIME.c +++ b/WWW/Library/Implementation/HTMIME.c @@ -180,15 +180,12 @@ PRIVATE BOOL content_is_compressed ARGS1(HTStream *, me) } /* - * Strip parameters and quotes from a URL. + * Strip quotes from a refresh-URL. */ PRIVATE void dequote ARGS1(char *, url) { - char *p; int len; - if ((p = strchr(url, '?')) != NULL) - *p = '\0'; len = strlen(url); if (*url == '\'' && len > 1 && url[len-1] == url[0]) { url[len-1] = '\0'; @@ -472,7 +469,7 @@ PRIVATE int pumpData ARGS1(HTStream *, me) char *base = ""; /* FIXME: refresh_url may be relative to doc */ LYParseRefreshURL(me->refresh_url, &num, &url); - if (url != NULL) { + if (url != NULL && me->format == WWW_HTML) { CTRACE((tfp, "Formatting refresh-url as first line of result\n")); HTSprintf0(&txt, gettext("Refresh: ")); HTSprintf(&txt, gettext("%s seconds "), num); diff --git a/WWW/Library/Implementation/HTMLDTD.c b/WWW/Library/Implementation/HTMLDTD.c index ec8aa5e3..8264f7d8 100644 --- a/WWW/Library/Implementation/HTMLDTD.c +++ b/WWW/Library/Implementation/HTMLDTD.c @@ -791,7 +791,7 @@ static attr object_attr[] = { /* OBJECT attributes */ { "USEMAP" T(h) }, { "VSPACE" T(N) }, { "WIDTH" T(N) }, - { 0 T(N) } /* Terminate list */ + { 0 T(N) } /* Terminate list */ }; static attr olist_attr[] = { /* OL attributes */ diff --git a/WWW/Library/Implementation/HTNews.c b/WWW/Library/Implementation/HTNews.c index 09b221d5..651e66ad 100644 --- a/WWW/Library/Implementation/HTNews.c +++ b/WWW/Library/Implementation/HTNews.c @@ -205,10 +205,13 @@ PRIVATE BOOL initialize NOARGS CTRACE((tfp, "HTNews: NNTPSERVER defined as `%s'\n", HTNewsHost)); } else { - char server_name[256]; FILE* fp = fopen(SERVER_FILE, TXT_R); if (fp) { - if (fscanf(fp, "%s", server_name)==1) { + char server_name[MAXHOSTNAMELEN+1]; + if (fgets(server_name, sizeof server_name, fp) != NULL) { + char *p = strchr(server_name, '\n'); + if (p != NULL) + *p = '\0'; StrAllocCopy(HTNewsHost, server_name); CTRACE((tfp, "HTNews: File %s defines news host as `%s'\n", SERVER_FILE, HTNewsHost)); diff --git a/WWW/Library/Implementation/HTParse.c b/WWW/Library/Implementation/HTParse.c index 0157a3b5..56cc0c0a 100644 --- a/WWW/Library/Implementation/HTParse.c +++ b/WWW/Library/Implementation/HTParse.c @@ -324,7 +324,7 @@ PUBLIC char * HTParse ARGS3( { char *p2, *h; if ((p2 = strchr(result, '@')) != NULL) - tail = (p2 + 1); + tail = (p2 + 1); p2 = strchr(tail, ':'); if (p2 != NULL && !isdigit(UCH(p2[1]))) /* @@ -515,7 +515,6 @@ PUBLIC char * HTParse ARGS3( */ if ((p = strchr(result, ' ')) != 0) { switch (is_url(result)) { - case NOT_A_URL_TYPE: case UNKNOWN_URL_TYPE: CTRACE((tfp, "HTParse: ignore:`%s'\n", result)); break; @@ -535,6 +534,7 @@ PUBLIC char * HTParse ARGS3( case LYNXMESSAGES_URL_TYPE: CTRACE((tfp, "HTParse: spaces:`%s'\n", result)); break; + case NOT_A_URL_TYPE: default: CTRACE((tfp, "HTParse: encode:`%s'\n", result)); do { @@ -817,8 +817,8 @@ PUBLIC char * HTRelative ARGS2( strcat(result, last_slash+1); } CTRACE((tfp, - "HTparse: `%s' expressed relative to\n `%s' is\n `%s'.\n", - aName, relatedName, result)); + "HTparse: `%s' expressed relative to\n `%s' is\n `%s'.\n", + aName, relatedName, result)); return result; } diff --git a/WWW/Library/Implementation/HTParse.h b/WWW/Library/Implementation/HTParse.h index 8d3fae74..4131e0fc 100644 --- a/WWW/Library/Implementation/HTParse.h +++ b/WWW/Library/Implementation/HTParse.h @@ -89,7 +89,7 @@ extern CONST char * HTParseAnchor PARAMS(( ** be replaced by "" , and the seqeunce "/./" which may be replaced by "/". ** Simplification helps us recognize duplicate filenames. ** -** Thus, /etc/junk/../fred becomes /etc/fred +** Thus, /etc/junk/../fred becomes /etc/fred ** /etc/junk/./fred becomes /etc/junk/fred ** ** but we should NOT change diff --git a/WWW/Library/Implementation/HTPlain.c b/WWW/Library/Implementation/HTPlain.c index 74c50f48..333697e3 100644 --- a/WWW/Library/Implementation/HTPlain.c +++ b/WWW/Library/Implementation/HTPlain.c @@ -430,7 +430,7 @@ PRIVATE void HTPlain_write ARGS3(HTStream *, me, CONST char*, s, int, l) me->T.trans_C0_to_uni) { /* ** Quote from SGML.c: - ** "This else if may be too ugly to keep. - KW" + ** "This else if may be too ugly to keep. - KW" */ if (me->T.trans_from_uni && (((code = UCTransToUni(c, me->inUCLYhndl)) >= 32) || diff --git a/WWW/Library/Implementation/HTTCP.c b/WWW/Library/Implementation/HTTCP.c index 993750c3..6591f3cb 100644 --- a/WWW/Library/Implementation/HTTCP.c +++ b/WWW/Library/Implementation/HTTCP.c @@ -1917,7 +1917,7 @@ PUBLIC int HTDoRead ARGS3( fd_set readfds; struct timeval select_timeout; int tries=0; -#ifdef EXP_READPROGRESS +#ifdef USE_READPROGRESS int otries = 0; time_t otime = time((time_t *)0); #endif @@ -1968,7 +1968,7 @@ PUBLIC int HTDoRead ARGS3( return HT_INTERRUPTED; } -#ifdef EXP_READPROGRESS +#ifdef USE_READPROGRESS if (tries - otries > 10) { time_t t = time((time_t *)0); diff --git a/WWW/Library/Implementation/HTTCP.h b/WWW/Library/Implementation/HTTCP.h index 91835980..363ab15d 100644 --- a/WWW/Library/Implementation/HTTCP.h +++ b/WWW/Library/Implementation/HTTCP.h @@ -103,8 +103,8 @@ extern int HTDoConnect PARAMS(( int * s)); extern int HTDoRead PARAMS(( - int fildes, + int fildes, void * buf, - unsigned nbyte)); + unsigned nbyte)); #endif /* HTTCP_H */ diff --git a/WWW/Library/Implementation/HTTP.c b/WWW/Library/Implementation/HTTP.c index 0ade2219..93fe4bb4 100644 --- a/WWW/Library/Implementation/HTTP.c +++ b/WWW/Library/Implementation/HTTP.c @@ -71,13 +71,14 @@ PRIVATE int HTSSLCallback(int preverify_ok, X509_STORE_CTX *x509_ctx) int result = 1; if (!(preverify_ok || ssl_okay || ssl_noprompt)) { - +#ifdef USE_X509_SUPPORT HTSprintf0(&msg, "SSL error:%s-Continue?", X509_verify_cert_error_string(X509_STORE_CTX_get_error(x509_ctx))); if (HTForcedPrompt(ssl_noprompt, msg, YES)) ssl_okay = 1; else result = 0; +#endif FREE(msg); } @@ -604,8 +605,12 @@ use_tunnel: cert_host += 4; if ((p = strchr(cert_host, '/')) != NULL) *p = '\0'; + if ((p = strchr(cert_host, ':')) != NULL) + *p = '\0'; ssl_host = HTParse(url, "", PARSE_HOST); - if (strcmp(ssl_host, cert_host)) { + if ((p = strchr(ssl_host, ':')) != NULL) + *p = '\0'; + if (strcasecomp(ssl_host, cert_host)) { HTSprintf0(&msg, gettext("SSL error:host(%s)!=cert(%s)-Continue?"), ssl_host, diff --git a/WWW/Library/Implementation/HTUtils.h b/WWW/Library/Implementation/HTUtils.h index 71a3f373..49c8d6f6 100644 --- a/WWW/Library/Implementation/HTUtils.h +++ b/WWW/Library/Implementation/HTUtils.h @@ -14,6 +14,29 @@ #ifdef HAVE_CONFIG_H #include <lynx_cfg.h> /* generated by autoconf 'configure' script */ + +/* see AC_FUNC_ALLOCA macro */ +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# ifdef _MSC_VER +# include <malloc.h> +# define alloca _alloca +# else +# if HAVE_ALLOCA_H +# include <alloca.h> +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +char *alloca (); +# endif +# endif +# endif +# endif +#endif + #include <sys/types.h> #include <stdio.h> @@ -144,6 +167,8 @@ #include <windows.h> /* #include "windef.h" */ #define BOOLEAN_DEFINED #undef HAVE_POPEN /* FIXME: does this not work, or is it missing */ +#undef small /* see <w32api/rpcndr.h> */ +#undef FILE_DOES_NOT_EXIST /* see <w32api/winnt.h> */ #endif #if defined(_WINDOWS) && !defined(__CYGWIN__) /* SCW */ @@ -423,9 +448,9 @@ are generally not the response status from any specific protocol. #define HT_FORBIDDEN -403 /* Access forbidden */ #define HT_NOT_ACCEPTABLE -406 /* Not Acceptable */ -#define HT_PARSER_REOPEN_ELT 700 /* tells SGML parser to keep tag open */ -#define HT_PARSER_OTHER_CONTENT 701 /* tells SGML to change content model */ -#define HT_H_ERRNO_VALID -800 /* see h_errno for resolver error */ +#define HT_PARSER_REOPEN_ELT 700 /* tells SGML parser to keep tag open */ +#define HT_PARSER_OTHER_CONTENT 701 /* tells SGML to change content model */ +#define HT_H_ERRNO_VALID -800 /* see h_errno for resolver error */ #define HT_INTERNAL -900 /* Weird -- should never happen. */ #define HT_BAD_EOF -12 /* Premature EOF */ @@ -475,21 +500,37 @@ Out Of Memory checking for malloc() return: extern void outofmem PARAMS((CONST char *fname, CONST char *func)); /* - -Upper- and Lowercase macros - - The problem here is that toupper(x) is not defined officially unless isupper(x) is. - These macros are CERTAINLY needed on #if defined(pyr) || define(mips) or BDSI - platforms. For safefy, we make them mandatory. - + * Upper- and Lowercase macros + * + * The problem here is that toupper(x) is not defined officially unless + * isupper(x) is. These macros are CERTAINLY needed on #if defined(pyr) || + * define(mips) or BDSI platforms. For safefy, we make them mandatory. + * + * Note: Pyramid and Mips can't uppercase non-alpha. */ #include <ctype.h> #include <string.h> #ifndef TOLOWER - /* Pyramid and Mips can't uppercase non-alpha */ + +#ifdef EXP_ASCII_CTYPES + +#define TOLOWER(c) ascii_tolower(UCH(c)) +#define TOUPPER(c) ascii_toupper(UCH(c)) +#define ISUPPER(c) ascii_isupper(UCH(c)) + +extern int ascii_toupper PARAMS((int)); +extern int ascii_tolower PARAMS((int)); +extern int ascii_isupper PARAMS((int)); + +#else + #define TOLOWER(c) (isupper(UCH(c)) ? tolower(UCH(c)) : UCH(c)) #define TOUPPER(c) (islower(UCH(c)) ? toupper(UCH(c)) : UCH(c)) +#define ISUPPER(c) (isupper(UCH(c))) + +#endif + #endif /* TOLOWER */ #define FREE(x) {if (x != 0) {free((char *)x); x = NULL;}} diff --git a/WWW/Library/Implementation/HTVMSUtils.h b/WWW/Library/Implementation/HTVMSUtils.h index 2720125e..18bdb3b7 100644 --- a/WWW/Library/Implementation/HTVMSUtils.h +++ b/WWW/Library/Implementation/HTVMSUtils.h @@ -1,5 +1,5 @@ /* VMS specific routines - + */ #ifndef HTVMSUTIL_H @@ -8,7 +8,7 @@ #ifndef HTUTILS_H #include <HTUtils.h> #endif - + #include <HTAnchor.h> extern BOOL HTVMSFileVersions; /* Include version numbers in listing? */ @@ -30,7 +30,7 @@ PUBLIC BOOL HTVMS_authSysPrv NOPARAMS; ** No arguments. ** ** ON EXIT: -** +** */ PUBLIC void HTVMS_enableSysPrv NOPARAMS; @@ -41,7 +41,7 @@ PUBLIC void HTVMS_enableSysPrv NOPARAMS; ** No arguments. ** ** ON EXIT: -** +** */ PUBLIC void HTVMS_disableSysPrv NOPARAMS; @@ -53,7 +53,7 @@ PUBLIC void HTVMS_disableSysPrv NOPARAMS; ** ** ON EXIT: ** returns YES if access is allowed -** +** */ PUBLIC BOOL HTVMS_checkAccess PARAMS(( CONST char * FileName, @@ -62,29 +62,29 @@ PUBLIC BOOL HTVMS_checkAccess PARAMS(( /* PUBLIC HTVMS_wwwName() -** CONVERTS VMS Name into WWW Name +** CONVERTS VMS Name into WWW Name ** ON ENTRY: ** vmsname VMS file specification (NO NODE) ** ** ON EXIT: -** returns www file specification +** returns www file specification ** ** EXAMPLES: ** vmsname wwwname -** DISK$USER disk$user -** DISK$USER: /disk$user/ -** DISK$USER:[DUNS] /disk$user/duns -** DISK$USER:[DUNS.ECHO] /disk$user/duns/echo -** [DUNS] duns -** [DUNS.ECHO] duns/echo -** [DUNS.ECHO.-.TRANS] duns/echo/../trans -** [DUNS.ECHO.--.TRANS] duns/echo/../../trans -** [.DUNS] duns -** [.DUNS.ECHO] duns/echo -** [.DUNS.ECHO]TEST.COM duns/echo/test.com -** TEST.COM test.com +** DISK$USER disk$user +** DISK$USER: /disk$user/ +** DISK$USER:[DUNS] /disk$user/duns +** DISK$USER:[DUNS.ECHO] /disk$user/duns/echo +** [DUNS] duns +** [DUNS.ECHO] duns/echo +** [DUNS.ECHO.-.TRANS] duns/echo/../trans +** [DUNS.ECHO.--.TRANS] duns/echo/../../trans +** [.DUNS] duns +** [.DUNS.ECHO] duns/echo +** [.DUNS.ECHO]TEST.COM duns/echo/test.com +** TEST.COM test.com +** ** -** */ PUBLIC char * HTVMS_wwwName PARAMS(( CONST char * vmsname)); diff --git a/WWW/Library/Implementation/HTVMS_WaisProt.c b/WWW/Library/Implementation/HTVMS_WaisProt.c index 9fddc10b..7ebe55a3 100644 --- a/WWW/Library/Implementation/HTVMS_WaisProt.c +++ b/WWW/Library/Implementation/HTVMS_WaisProt.c @@ -12,10 +12,10 @@ **----------------------------------------------------------------------*/ /* WIDE AREA INFORMATION SERVER SOFTWARE: No guarantees or restrictions. See the readme file for the full standard - disclaimer. - + disclaimer. + 3.26.90 Harry Morris, morris@think.com - 3.30.90 Harry Morris + 3.30.90 Harry Morris - removed chunk code from WAISSearchAPDU, - added makeWAISQueryType1Query() and readWAISType1Query() which replace makeWAISQueryTerms() and makeWAISQueryDocs(). @@ -28,7 +28,7 @@ #define _C_WAIS_protocol_ -/* This file implements the Z39.50 extensions required for WAIS +/* This file implements the Z39.50 extensions required for WAIS */ #include <HTUtils.h> @@ -53,7 +53,7 @@ #define RESERVE_SPACE_FOR_WAIS_HEADER(len) \ if (*len > 0) \ - *len -= header_len; + *len -= header_len; /*----------------------------------------------------------------------*/ @@ -65,7 +65,7 @@ userInfoTagSize(tag,length) data_tag tag; unsigned long length; /* return the number of bytes required to write the user info tag and - length + length */ { unsigned long size; @@ -73,13 +73,13 @@ unsigned long length; /* calculate bytes required to represent tag. max tag is 16K */ size = writtenCompressedIntSize(tag); size += writtenCompressedIntSize(length); - + return(size); -} +} /*----------------------------------------------------------------------*/ -static char* writeUserInfoHeader PARAMS((data_tag tag,long infoSize, +static char* writeUserInfoHeader PARAMS((data_tag tag,long infoSize, long estHeaderSize,char* buffer, long* len)); @@ -95,7 +95,7 @@ long* len; estHeaderSize. Note that the argument len is the number of bytes remaining in the buffer. Since we write the tag and size at the begining of the buffer (in space that we reserved) we don't want to pass len the calls which - do that writing. + do that writing. */ { long dummyLen = 100; /* plenty of space for a tag and size */ @@ -105,10 +105,10 @@ long* len; if (buffer == NULL || *len == 0) return(NULL); - + /* write the tag */ buf = writeTag(tag,buf,&dummyLen); - + /* see if the if the header size was correct. if not, we have to shift the info to fit the real header size */ if (estHeaderSize != realHeaderSize) @@ -116,10 +116,10 @@ long* len; CHECK_FOR_SPACE_LEFT(realHeaderSize - estHeaderSize,len); memmove(buffer + realHeaderSize,buffer + estHeaderSize,(size_t)(realSize)); } - + /* write the size */ writeCompressedInteger(realSize,buf,&dummyLen); - + /* return the true end of buffer */ return(buffer + realHeaderSize + realSize); } @@ -139,12 +139,12 @@ char* buffer; char* buf = buffer; buf = readTag(tag,buf); buf = readCompressedInteger(num,buf); - return(buf); + return(buf); } /*----------------------------------------------------------------------*/ -WAISInitResponse* +WAISInitResponse* makeWAISInitResponse(chunkCode, chunkIDLen, chunkMarker, @@ -167,13 +167,13 @@ char* newLineChars; init->HighlightMarker = highlightMarker; init->DeHighlightMarker = deHighlightMarker; init->NewlineCharacters = newLineChars; - + return(init); } /*----------------------------------------------------------------------*/ -void +void freeWAISInitResponse(init) WAISInitResponse* init; /* free an object made with makeWAISInitResponse */ @@ -199,20 +199,20 @@ long* len; char* buf = buffer + header_len; WAISInitResponse* info = (WAISInitResponse*)init->UserInformationField; unsigned long size; - + RESERVE_SPACE_FOR_WAIS_HEADER(len); - + buf = writeNum(info->ChunkCode,DT_ChunkCode,buf,len); buf = writeNum(info->ChunkIDLength,DT_ChunkIDLength,buf,len); buf = writeString(info->ChunkMarker,DT_ChunkMarker,buf,len); buf = writeString(info->HighlightMarker,DT_HighlightMarker,buf,len); buf = writeString(info->DeHighlightMarker,DT_DeHighlightMarker,buf,len); buf = writeString(info->NewlineCharacters,DT_NewlineCharacters,buf,len); - + /* now write the header and size */ - size = buf - buffer; + size = buf - buffer; buf = writeUserInfoHeader(DT_UserInformationLength,size,header_len,buffer,len); - + return(buf); } @@ -225,7 +225,7 @@ char* buffer; /* read an init response object */ { char* buf = buffer; - unsigned long size; + unsigned long size; unsigned long headerSize; long chunkCode,chunkIDLen; data_tag tag1; @@ -233,12 +233,12 @@ char* buffer; char* highlightMarker = NULL; char* deHighlightMarker = NULL; char* newLineChars = NULL; - + chunkCode = chunkIDLen = UNUSED; - + buf = readUserInfoHeader(&tag1,&size,buf); headerSize = buf - buffer; - + while (buf < (buffer + size + headerSize)) { data_tag tag = peekTag(buf); switch (tag) @@ -268,7 +268,7 @@ char* buffer; break; } } - + *info = (void *)makeWAISInitResponse(chunkCode,chunkIDLen,chunkMarker, highlightMarker,deHighlightMarker, newLineChars); @@ -277,7 +277,7 @@ char* buffer; /*----------------------------------------------------------------------*/ -WAISSearch* +WAISSearch* makeWAISSearch(seedWords, docs, textList, @@ -294,7 +294,7 @@ char* endDateRange; long maxDocsRetrieved; /* create a type 3 query object */ -{ +{ WAISSearch* query = (WAISSearch*)s_malloc((size_t)sizeof(WAISSearch)); query->SeedWords = seedWords; /* not copied! */ @@ -304,13 +304,13 @@ long maxDocsRetrieved; query->BeginDateRange = beginDateRange; query->EndDateRange = endDateRange; query->MaxDocumentsRetrieved = maxDocsRetrieved; - + return(query); } /*----------------------------------------------------------------------*/ -void +void freeWAISSearch(query) WAISSearch* query; @@ -318,14 +318,14 @@ WAISSearch* query; { void* ptr = NULL; long i; - + s_free(query->SeedWords); - + if (query->Docs != NULL) for (i = 0,ptr = (void *)query->Docs[i]; ptr != NULL; ptr = (void *)query->Docs[++i]) freeDocObj((DocObj*)ptr); s_free(query->Docs); - + if (query->TextList != NULL) /* XXX revisit when textlist is fully defined */ for (i = 0,ptr = (void *)query->TextList[i]; ptr != NULL; ptr = (void *)query->TextList[++i]) s_free(ptr); @@ -338,7 +338,7 @@ WAISSearch* query; /*----------------------------------------------------------------------*/ -DocObj* +DocObj* makeDocObjUsingWholeDocument(docID,type) any* docID; char* type; @@ -355,7 +355,7 @@ char* type; /*----------------------------------------------------------------------*/ -DocObj* +DocObj* makeDocObjUsingLines(docID,type,start,end) any* docID; char* type; @@ -376,7 +376,7 @@ long end; /*----------------------------------------------------------------------*/ -DocObj* +DocObj* makeDocObjUsingBytes(docID,type,start,end) any* docID; char* type; @@ -397,7 +397,7 @@ long end; /*----------------------------------------------------------------------*/ -DocObj* +DocObj* makeDocObjUsingParagraphs(docID,type,start,end) any* docID; char* type; @@ -411,8 +411,8 @@ any* end; doc->ChunkCode = CT_paragraph; doc->DocumentID = docID; /* not copied */ doc->Type = type; - doc->ChunkStart.ID = start; - doc->ChunkEnd.ID = end; + doc->ChunkStart.ID = start; + doc->ChunkEnd.ID = end; return(doc); } @@ -446,16 +446,16 @@ long* len; /* write as little as we can about the doc obj */ { char* buf = buffer; - + /* we alwasy have to write the id, but its tag depends on if its a chunk */ if (doc->ChunkCode == CT_document) buf = writeAny(doc->DocumentID,DT_DocumentID,buf,len); else buf = writeAny(doc->DocumentID,DT_DocumentIDChunk,buf,len); - + if (doc->Type != NULL) buf = writeString(doc->Type,DT_TYPE,buf,len); - + switch (doc->ChunkCode) { case CT_document: /* do nothing - there is no chunk data */ @@ -476,7 +476,7 @@ long* len; doc->ChunkCode); break; } - + return(buf); } @@ -493,12 +493,12 @@ char* buffer; { char* buf = buffer; data_tag tag; - + *doc = (DocObj*)s_malloc((size_t)sizeof(DocObj)); - + tag = peekTag(buf); buf = readAny(&((*doc)->DocumentID),buf); - + if (tag == DT_DocumentID) { (*doc)->ChunkCode = CT_document; tag = peekTag(buf); @@ -539,12 +539,12 @@ char* buffer; s_free(*doc); REPORT_READ_ERROR(buf); } - return(buf); + return(buf); } /*----------------------------------------------------------------------*/ -char* +char* writeSearchInfo(query,buffer,len) SearchAPDU* query; char* buffer; @@ -557,14 +557,14 @@ long* len; } else { unsigned long header_len = userInfoTagSize(DT_UserInformationLength, - DefWAISSearchSize); + DefWAISSearchSize); char* buf = buffer + header_len; WAISSearch* info = (WAISSearch*)query->Query; unsigned long size; long i; - + RESERVE_SPACE_FOR_WAIS_HEADER(len); - + buf = writeString(info->SeedWords,DT_SeedWords,buf,len); if (info->Docs != NULL) @@ -572,25 +572,25 @@ long* len; { buf = writeDocObj(info->Docs[i],buf,len); } } - + /* XXX text list */ - + buf = writeNum(info->DateFactor,DT_DateFactor,buf,len); buf = writeString(info->BeginDateRange,DT_BeginDateRange,buf,len); buf = writeString(info->EndDateRange,DT_EndDateRange,buf,len); buf = writeNum(info->MaxDocumentsRetrieved,DT_MaxDocumentsRetrieved,buf,len); - + /* now write the header and size */ - size = buf - buffer; + size = buf - buffer; buf = writeUserInfoHeader(DT_UserInformationLength,size,header_len,buffer,len); - + return(buf); } } /*----------------------------------------------------------------------*/ -char* +char* readSearchInfo(info,buffer) void** info; char* buffer; @@ -607,14 +607,14 @@ char* buffer; } else /* a type 3 query */ { char* buf = buffer; - unsigned long size; + unsigned long size; unsigned long headerSize; data_tag tag1; char* seedWords = NULL; char* beginDateRange = NULL; char* endDateRange = NULL; long dateFactor,maxDocsRetrieved; - char** textList = NULL; + char** textList = NULL; DocObj** docIDs = NULL; DocObj* doc = NULL; long docs = 0; @@ -622,10 +622,10 @@ char* buffer; void* ptr = NULL; dateFactor = maxDocsRetrieved = UNUSED; - + buf = readUserInfoHeader(&tag1,&size,buf); headerSize = buf - buffer; - + while (buf < (buffer + size + headerSize)) { data_tag tag = peekTag(buf); switch (tag) @@ -641,7 +641,7 @@ char* buffer; { docIDs = (DocObj**)s_realloc((char*)docIDs,(size_t)(sizeof(DocObj*) * (docs + 2))); } buf = readDocObj(&doc,buf); - if (buf == NULL) + if (buf == NULL) { s_free(seedWords); s_free(beginDateRange); s_free(endDateRange); @@ -683,7 +683,7 @@ char* buffer; break; } } - + *info = (void *)makeWAISSearch(seedWords,docIDs,textList, dateFactor,beginDateRange,endDateRange, maxDocsRetrieved); @@ -722,7 +722,7 @@ char* originCity; or set the field in this object to NULL before freeing it. */ { - WAISDocumentHeader* header = + WAISDocumentHeader* header = (WAISDocumentHeader*)s_malloc((size_t)sizeof(WAISDocumentHeader)); header->DocumentID = docID; @@ -736,7 +736,7 @@ char* originCity; header->Date = date; header->Headline = headline; header->OriginCity = originCity; - + return(header); } @@ -769,9 +769,9 @@ long* len; DefWAISDocHeaderSize); char* buf = buffer + header_len; unsigned long size1; - + RESERVE_SPACE_FOR_WAIS_HEADER(len); - + buf = writeAny(header->DocumentID,DT_DocumentID,buf,len); buf = writeNum(header->VersionNumber,DT_VersionNumber,buf,len); buf = writeNum(header->Score,DT_Score,buf,len); @@ -787,7 +787,7 @@ long* len; { long typeSize = strlen(ptr); size += writtenTagSize(DT_TYPE); size += writtenCompressedIntSize(typeSize); - size += typeSize; + size += typeSize; } buf = writeCompressedInteger((unsigned long)size,buf,len); for (i = 0,ptr = header->Types[i]; ptr != NULL; ptr = header->Types[++i]) @@ -797,9 +797,9 @@ long* len; buf = writeString(header->Date,DT_Date,buf,len); buf = writeString(header->Headline,DT_Headline,buf,len); buf = writeString(header->OriginCity,DT_OriginCity,buf,len); - + /* now write the header and size */ - size1 = buf - buffer; + size1 = buf - buffer; buf = writeUserInfoHeader(DT_DocumentHeaderGroup,size1,header_len,buffer,len); return(buf); @@ -813,7 +813,7 @@ WAISDocumentHeader** header; char* buffer; { char* buf = buffer; - unsigned long size1; + unsigned long size1; unsigned long headerSize; data_tag tag1; any* docID = NULL; @@ -823,12 +823,12 @@ char* buffer; char *date = NULL; char *headline = NULL; char *originCity = NULL; - + versionNumber = score = bestMatch = docLength = lines = UNUSED; - + buf = readUserInfoHeader(&tag1,&size1,buf); headerSize = buf - buffer; - + while (buf < (buffer + size1 + headerSize)) { data_tag tag = peekTag(buf); switch (tag) @@ -888,7 +888,7 @@ char* buffer; break; } } - + *header = makeWAISDocumentHeader(docID,versionNumber,score,bestMatch, docLength,lines,types,source,date,headline, originCity); @@ -915,7 +915,7 @@ long lines; or set the field in this object to NULL before freeing it. */ { - WAISDocumentShortHeader* header = + WAISDocumentShortHeader* header = (WAISDocumentShortHeader*)s_malloc((size_t)sizeof(WAISDocumentShortHeader)); header->DocumentID = docID; @@ -924,7 +924,7 @@ long lines; header->BestMatch = bestMatch; header->DocumentLength = docLen; header->Lines = lines; - + return(header); } @@ -950,18 +950,18 @@ long* len; DefWAISShortHeaderSize); char* buf = buffer + header_len; unsigned long size; - + RESERVE_SPACE_FOR_WAIS_HEADER(len); - + buf = writeAny(header->DocumentID,DT_DocumentID,buf,len); buf = writeNum(header->VersionNumber,DT_VersionNumber,buf,len); buf = writeNum(header->Score,DT_Score,buf,len); buf = writeNum(header->BestMatch,DT_BestMatch,buf,len); buf = writeNum(header->DocumentLength,DT_DocumentLength,buf,len); buf = writeNum(header->Lines,DT_Lines,buf,len); - + /* now write the header and size */ - size = buf - buffer; + size = buf - buffer; buf = writeUserInfoHeader(DT_DocumentShortHeaderGroup,size,header_len,buffer,len); return(buf); @@ -975,17 +975,17 @@ WAISDocumentShortHeader** header; char* buffer; { char* buf = buffer; - unsigned long size; + unsigned long size; unsigned long headerSize; data_tag tag1; any* docID = NULL; long versionNumber,score,bestMatch,docLength,lines; - + versionNumber = score = bestMatch = docLength = lines = UNUSED; - + buf = readUserInfoHeader(&tag1,&size,buf); headerSize = buf - buffer; - + while (buf < (buffer + size + headerSize)) { data_tag tag = peekTag(buf); switch (tag) @@ -1013,7 +1013,7 @@ char* buffer; break; } } - + *header = makeWAISDocumentShortHeader(docID,versionNumber,score,bestMatch, docLength,lines); return(buf); @@ -1055,7 +1055,7 @@ char* industryCodes; or set the field in this object to NULL before freeing it. */ { - WAISDocumentLongHeader* header = + WAISDocumentLongHeader* header = (WAISDocumentLongHeader*)s_malloc((size_t)sizeof(WAISDocumentLongHeader)); header->DocumentID = docID; @@ -1072,7 +1072,7 @@ char* industryCodes; header->StockCodes = stockCodes; header->CompanyCodes = companyCodes; header->IndustryCodes = industryCodes; - + return(header); } @@ -1106,9 +1106,9 @@ long* len; DefWAISLongHeaderSize); char* buf = buffer + header_len; unsigned long size1; - + RESERVE_SPACE_FOR_WAIS_HEADER(len); - + buf = writeAny(header->DocumentID,DT_DocumentID,buf,len); buf = writeNum(header->VersionNumber,DT_VersionNumber,buf,len); buf = writeNum(header->Score,DT_Score,buf,len); @@ -1124,7 +1124,7 @@ long* len; { long typeSize = strlen(ptr); size += writtenTagSize(DT_TYPE); size += writtenCompressedIntSize(typeSize); - size += typeSize; + size += typeSize; } buf = writeCompressedInteger((unsigned long)size,buf,len); for (i = 0,ptr = header->Types[i]; ptr != NULL; ptr = header->Types[++i]) @@ -1137,9 +1137,9 @@ long* len; buf = writeString(header->StockCodes,DT_StockCodes,buf,len); buf = writeString(header->CompanyCodes,DT_CompanyCodes,buf,len); buf = writeString(header->IndustryCodes,DT_IndustryCodes,buf,len); - + /* now write the header and size */ - size1 = buf - buffer; + size1 = buf - buffer; buf = writeUserInfoHeader(DT_DocumentLongHeaderGroup,size1,header_len,buffer,len); return(buf); @@ -1153,22 +1153,22 @@ WAISDocumentLongHeader** header; char* buffer; { char* buf = buffer; - unsigned long size1; + unsigned long size1; unsigned long headerSize; data_tag tag1; any* docID; long versionNumber,score,bestMatch,docLength,lines; char **types; char *source,*date,*headline,*originCity,*stockCodes,*companyCodes,*industryCodes; - + docID = NULL; versionNumber = score = bestMatch = docLength = lines = UNUSED; types = NULL; source = date = headline = originCity = stockCodes = companyCodes = industryCodes = NULL; - + buf = readUserInfoHeader(&tag1,&size1,buf); headerSize = buf - buffer; - + while (buf < (buffer + size1 + headerSize)) { data_tag tag = peekTag(buf); switch (tag) @@ -1240,7 +1240,7 @@ char* buffer; break; } } - + *header = makeWAISDocumentLongHeader(docID,versionNumber,score,bestMatch, docLength,lines,types,source,date,headline, originCity,stockCodes,companyCodes, @@ -1269,7 +1269,7 @@ WAISDocumentCodes** codes; diagnosticRecord** diagnostics; { WAISSearchResponse* response = (WAISSearchResponse*)s_malloc((size_t)sizeof(WAISSearchResponse)); - + response->SeedWordsUsed = seedWordsUsed; response->DocHeaders = docHeaders; response->ShortHeaders = shortHeaders; @@ -1278,7 +1278,7 @@ diagnosticRecord** diagnostics; response->Headlines = headlines; response->Codes = codes; response->Diagnostics = diagnostics; - + return(response); } @@ -1297,43 +1297,43 @@ WAISSearchResponse* response; for (i = 0,ptr = (void *)response->DocHeaders[i]; ptr != NULL; ptr = (void *)response->DocHeaders[++i]) freeWAISDocumentHeader((WAISDocumentHeader*)ptr); s_free(response->DocHeaders); - + if (response->ShortHeaders != NULL) for (i = 0,ptr = (void *)response->ShortHeaders[i]; ptr != NULL; ptr = (void *)response->ShortHeaders[++i]) freeWAISDocumentShortHeader((WAISDocumentShortHeader*)ptr); s_free(response->ShortHeaders); - + if (response->LongHeaders != NULL) for (i = 0,ptr = (void *)response->LongHeaders[i]; ptr != NULL; ptr = (void *)response->LongHeaders[++i]) freeWAISDocumentLongHeader((WAISDocumentLongHeader*)ptr); s_free(response->LongHeaders); - + if (response->Text != NULL) for (i = 0,ptr = (void *)response->Text[i]; ptr != NULL; ptr = (void *)response->Text[++i]) freeWAISDocumentText((WAISDocumentText*)ptr); s_free(response->Text); - + if (response->Headlines != NULL) for (i = 0,ptr = (void *)response->Headlines[i]; ptr != NULL; ptr = (void *)response->Headlines[++i]) freeWAISDocumentHeadlines((WAISDocumentHeadlines*)ptr); s_free(response->Headlines); - + if (response->Codes != NULL) for (i = 0,ptr = (void *)response->Codes[i]; ptr != NULL; ptr = (void *)response->Codes[++i]) freeWAISDocumentCodes((WAISDocumentCodes*)ptr); s_free(response->Codes); - + if (response->Diagnostics != NULL) for (i = 0,ptr = (void *)response->Diagnostics[i]; ptr != NULL; ptr = (void *)response->Diagnostics[++i]) freeDiag((diagnosticRecord*)ptr); s_free(response->Diagnostics); - + s_free(response); } /*----------------------------------------------------------------------*/ -char* +char* writeSearchResponseInfo(query,buffer,len) SearchResponseAPDU* query; char* buffer; @@ -1346,17 +1346,17 @@ long* len; unsigned long size; void* header = NULL; long i; - + RESERVE_SPACE_FOR_WAIS_HEADER(len); - + buf = writeString(info->SeedWordsUsed,DT_SeedWordsUsed,buf,len); - + /* write out all the headers */ if (info->DocHeaders != NULL) { for (i = 0,header = (void *)info->DocHeaders[i]; header != NULL; header = (void *)info->DocHeaders[++i]) buf = writeWAISDocumentHeader((WAISDocumentHeader*)header,buf,len); } - + if (info->ShortHeaders != NULL) { for (i = 0,header = (void *)info->ShortHeaders[i]; header != NULL; header = (void *)info->ShortHeaders[++i]) buf = writeWAISDocumentShortHeader((WAISDocumentShortHeader*)header,buf,len); @@ -1386,11 +1386,11 @@ long* len; { for (i = 0, header = (void *)info->Diagnostics[i]; header != NULL; header = (void *)info->Diagnostics[++i]) buf = writeDiag((diagnosticRecord*)header,buf,len); } - + /* now write the header and size */ - size = buf - buffer; + size = buf - buffer; buf = writeUserInfoHeader(DT_UserInformationLength,size,header_len,buffer,len); - + return(buf); } @@ -1418,7 +1418,7 @@ WAISDocumentText** text; WAISDocumentHeadlines** headlines; WAISDocumentCodes** codes; diagnosticRecord** diags; -/* if buf is NULL, we have just gotten a read error, and need to clean up +/* if buf is NULL, we have just gotten a read error, and need to clean up any state we have built. If not, then everything is going fine, and we should just hang loose */ @@ -1426,41 +1426,41 @@ diagnosticRecord** diags; void* ptr = NULL; long i; - if (buf == NULL) - { s_free(seedWordsUsed); - if (docHeaders != NULL) - for (i = 0,ptr = (void *)docHeaders[i]; ptr != NULL; - ptr = (void *)docHeaders[++i]) - freeWAISDocumentHeader((WAISDocumentHeader*)ptr); - s_free(docHeaders); - if (shortHeaders != NULL) + if (buf == NULL) + { s_free(seedWordsUsed); + if (docHeaders != NULL) + for (i = 0,ptr = (void *)docHeaders[i]; ptr != NULL; + ptr = (void *)docHeaders[++i]) + freeWAISDocumentHeader((WAISDocumentHeader*)ptr); + s_free(docHeaders); + if (shortHeaders != NULL) for (i = 0,ptr = (void *)shortHeaders[i]; ptr != NULL; - ptr = (void *)shortHeaders[++i]) + ptr = (void *)shortHeaders[++i]) freeWAISDocumentShortHeader((WAISDocumentShortHeader*)ptr); - s_free(shortHeaders); - if (longHeaders != NULL) - for (i = 0,ptr = (void *)longHeaders[i]; ptr != NULL; - ptr = (void *)longHeaders[++i]) + s_free(shortHeaders); + if (longHeaders != NULL) + for (i = 0,ptr = (void *)longHeaders[i]; ptr != NULL; + ptr = (void *)longHeaders[++i]) freeWAISDocumentLongHeader((WAISDocumentLongHeader*)ptr); - s_free(longHeaders); - if (text != NULL) + s_free(longHeaders); + if (text != NULL) for (i = 0,ptr = (void *)text[i]; ptr != NULL; ptr = (void *)text[++i]) - freeWAISDocumentText((WAISDocumentText*)ptr); - s_free(text); - if (headlines != NULL) + freeWAISDocumentText((WAISDocumentText*)ptr); + s_free(text); + if (headlines != NULL) for (i = 0,ptr = (void *)headlines[i]; ptr != NULL; - ptr = (void *)headlines[++i]) - freeWAISDocumentHeadlines((WAISDocumentHeadlines*)ptr); - s_free(headlines); - if (codes != NULL) - for (i = 0,ptr = (void *)codes[i]; ptr != NULL; - ptr = (void *)codes[++i]) - freeWAISDocumentCodes((WAISDocumentCodes*)ptr); - s_free(codes); - if (diags != NULL) - for (i = 0,ptr = (void *)diags[i]; ptr != NULL; - ptr = (void *)diags[++i]) - freeDiag((diagnosticRecord*)ptr); + ptr = (void *)headlines[++i]) + freeWAISDocumentHeadlines((WAISDocumentHeadlines*)ptr); + s_free(headlines); + if (codes != NULL) + for (i = 0,ptr = (void *)codes[i]; ptr != NULL; + ptr = (void *)codes[++i]) + freeWAISDocumentCodes((WAISDocumentCodes*)ptr); + s_free(codes); + if (diags != NULL) + for (i = 0,ptr = (void *)diags[i]; ptr != NULL; + ptr = (void *)diags[++i]) + freeDiag((diagnosticRecord*)ptr); s_free(diags); } } @@ -1473,7 +1473,7 @@ void** info; char* buffer; { char* buf = buffer; - unsigned long size; + unsigned long size; unsigned long headerSize; data_tag tag1; void* header = NULL; @@ -1489,123 +1489,123 @@ char* buffer; diagnosticRecord** diags = NULL; diagnosticRecord* diag = NULL; long numDiags = 0; - + numDocHeaders = numLongHeaders = numShortHeaders = numText = numHeadlines = numCodes = 0; - + buf = readUserInfoHeader(&tag1,&size,buf); headerSize = buf - buffer; - + while (buf < (buffer + size + headerSize)) { data_tag tag = peekTag(buf); switch (tag) { case DT_SeedWordsUsed: - buf = readString(&seedWordsUsed,buf); - break; - case DT_DatabaseDiagnosticRecords: - if (diags == NULL) /* create a new diag list */ - { diags = (diagnosticRecord**)s_malloc((size_t)sizeof(diagnosticRecord*) * 2); - } - else /* grow the diag list */ - { diags = (diagnosticRecord**)s_realloc((char*)diags,(size_t)(sizeof(diagnosticRecord*) * (numDiags + 2))); - } - buf = readDiag(&diag,buf); - diags[numDiags++] = diag; /* put it in the list */ - diags[numDiags] = NULL; - break; - case DT_DocumentHeaderGroup: - if (docHeaders == NULL) /* create a new header list */ - { docHeaders = (WAISDocumentHeader**)s_malloc((size_t)sizeof(WAISDocumentHeader*) * 2); - } - else /* grow the doc list */ - { docHeaders = (WAISDocumentHeader**)s_realloc((char*)docHeaders,(size_t)(sizeof(WAISDocumentHeader*) * (numDocHeaders + 2))); - } - buf = readWAISDocumentHeader((WAISDocumentHeader**)&header,buf); + buf = readString(&seedWordsUsed,buf); + break; + case DT_DatabaseDiagnosticRecords: + if (diags == NULL) /* create a new diag list */ + { diags = (diagnosticRecord**)s_malloc((size_t)sizeof(diagnosticRecord*) * 2); + } + else /* grow the diag list */ + { diags = (diagnosticRecord**)s_realloc((char*)diags,(size_t)(sizeof(diagnosticRecord*) * (numDiags + 2))); + } + buf = readDiag(&diag,buf); + diags[numDiags++] = diag; /* put it in the list */ + diags[numDiags] = NULL; + break; + case DT_DocumentHeaderGroup: + if (docHeaders == NULL) /* create a new header list */ + { docHeaders = (WAISDocumentHeader**)s_malloc((size_t)sizeof(WAISDocumentHeader*) * 2); + } + else /* grow the doc list */ + { docHeaders = (WAISDocumentHeader**)s_realloc((char*)docHeaders,(size_t)(sizeof(WAISDocumentHeader*) * (numDocHeaders + 2))); + } + buf = readWAISDocumentHeader((WAISDocumentHeader**)&header,buf); cleanUpWaisSearchResponse(buf,seedWordsUsed,docHeaders,shortHeaders,longHeaders,text,headlines,codes,diags); - RETURN_ON_NULL(buf); - docHeaders[numDocHeaders++] = + RETURN_ON_NULL(buf); + docHeaders[numDocHeaders++] = (WAISDocumentHeader*)header; /* put it in the list */ - docHeaders[numDocHeaders] = NULL; - break; - case DT_DocumentShortHeaderGroup: - if (shortHeaders == NULL) /* create a new header list */ - { shortHeaders = (WAISDocumentShortHeader**)s_malloc((size_t)sizeof(WAISDocumentShortHeader*) * 2); - } - else /* grow the doc list */ - { shortHeaders = (WAISDocumentShortHeader**)s_realloc((char*)shortHeaders,(size_t)(sizeof(WAISDocumentShortHeader*) * (numShortHeaders + 2))); - } - buf = readWAISDocumentShortHeader((WAISDocumentShortHeader**)&header,buf); + docHeaders[numDocHeaders] = NULL; + break; + case DT_DocumentShortHeaderGroup: + if (shortHeaders == NULL) /* create a new header list */ + { shortHeaders = (WAISDocumentShortHeader**)s_malloc((size_t)sizeof(WAISDocumentShortHeader*) * 2); + } + else /* grow the doc list */ + { shortHeaders = (WAISDocumentShortHeader**)s_realloc((char*)shortHeaders,(size_t)(sizeof(WAISDocumentShortHeader*) * (numShortHeaders + 2))); + } + buf = readWAISDocumentShortHeader((WAISDocumentShortHeader**)&header,buf); cleanUpWaisSearchResponse(buf,seedWordsUsed,docHeaders,shortHeaders,longHeaders,text,headlines,codes,diags); - RETURN_ON_NULL(buf); - shortHeaders[numShortHeaders++] = + RETURN_ON_NULL(buf); + shortHeaders[numShortHeaders++] = (WAISDocumentShortHeader*)header; /* put it in the list */ - shortHeaders[numShortHeaders] = NULL; - break; - case DT_DocumentLongHeaderGroup: - if (longHeaders == NULL) /* create a new header list */ - { longHeaders = (WAISDocumentLongHeader**)s_malloc((size_t)sizeof(WAISDocumentLongHeader*) * 2); - } - else /* grow the doc list */ - { longHeaders = (WAISDocumentLongHeader**)s_realloc((char*)longHeaders,(size_t)(sizeof(WAISDocumentLongHeader*) * (numLongHeaders + 2))); - } - buf = readWAISDocumentLongHeader((WAISDocumentLongHeader**)&header,buf); + shortHeaders[numShortHeaders] = NULL; + break; + case DT_DocumentLongHeaderGroup: + if (longHeaders == NULL) /* create a new header list */ + { longHeaders = (WAISDocumentLongHeader**)s_malloc((size_t)sizeof(WAISDocumentLongHeader*) * 2); + } + else /* grow the doc list */ + { longHeaders = (WAISDocumentLongHeader**)s_realloc((char*)longHeaders,(size_t)(sizeof(WAISDocumentLongHeader*) * (numLongHeaders + 2))); + } + buf = readWAISDocumentLongHeader((WAISDocumentLongHeader**)&header,buf); cleanUpWaisSearchResponse(buf,seedWordsUsed,docHeaders,shortHeaders,longHeaders,text,headlines,codes,diags); - RETURN_ON_NULL(buf); - longHeaders[numLongHeaders++] = + RETURN_ON_NULL(buf); + longHeaders[numLongHeaders++] = (WAISDocumentLongHeader*)header; /* put it in the list */ - longHeaders[numLongHeaders] = NULL; - break; - case DT_DocumentTextGroup: - if (text == NULL) /* create a new list */ - { text = (WAISDocumentText**)s_malloc((size_t)sizeof(WAISDocumentText*) * 2); - } - else /* grow the list */ - { text = (WAISDocumentText**)s_realloc((char*)text,(size_t)(sizeof(WAISDocumentText*) * (numText + 2))); - } - buf = readWAISDocumentText((WAISDocumentText**)&header,buf); + longHeaders[numLongHeaders] = NULL; + break; + case DT_DocumentTextGroup: + if (text == NULL) /* create a new list */ + { text = (WAISDocumentText**)s_malloc((size_t)sizeof(WAISDocumentText*) * 2); + } + else /* grow the list */ + { text = (WAISDocumentText**)s_realloc((char*)text,(size_t)(sizeof(WAISDocumentText*) * (numText + 2))); + } + buf = readWAISDocumentText((WAISDocumentText**)&header,buf); cleanUpWaisSearchResponse(buf,seedWordsUsed,docHeaders,shortHeaders,longHeaders,text,headlines,codes,diags); - RETURN_ON_NULL(buf); - text[numText++] = + RETURN_ON_NULL(buf); + text[numText++] = (WAISDocumentText*)header; /* put it in the list */ - text[numText] = NULL; - break; - case DT_DocumentHeadlineGroup: - if (headlines == NULL) /* create a new list */ - { headlines = (WAISDocumentHeadlines**)s_malloc((size_t)sizeof(WAISDocumentHeadlines*) * 2); - } - else /* grow the list */ - { headlines = (WAISDocumentHeadlines**)s_realloc((char*)headlines,(size_t)(sizeof(WAISDocumentHeadlines*) * (numHeadlines + 2))); - } - buf = readWAISDocumentHeadlines((WAISDocumentHeadlines**)&header,buf); + text[numText] = NULL; + break; + case DT_DocumentHeadlineGroup: + if (headlines == NULL) /* create a new list */ + { headlines = (WAISDocumentHeadlines**)s_malloc((size_t)sizeof(WAISDocumentHeadlines*) * 2); + } + else /* grow the list */ + { headlines = (WAISDocumentHeadlines**)s_realloc((char*)headlines,(size_t)(sizeof(WAISDocumentHeadlines*) * (numHeadlines + 2))); + } + buf = readWAISDocumentHeadlines((WAISDocumentHeadlines**)&header,buf); cleanUpWaisSearchResponse(buf,seedWordsUsed,docHeaders,shortHeaders,longHeaders,text,headlines,codes,diags); - RETURN_ON_NULL(buf); - headlines[numHeadlines++] = + RETURN_ON_NULL(buf); + headlines[numHeadlines++] = (WAISDocumentHeadlines*)header; /* put it in the list */ - headlines[numHeadlines] = NULL; - break; - case DT_DocumentCodeGroup: - if (codes == NULL) /* create a new list */ - { codes = (WAISDocumentCodes**)s_malloc((size_t)sizeof(WAISDocumentCodes*) * 2); - } - else /* grow the list */ - { codes = (WAISDocumentCodes**)s_realloc((char*)codes,(size_t)(sizeof(WAISDocumentCodes*) * (numCodes + 2))); - } - buf = readWAISDocumentCodes((WAISDocumentCodes**)&header,buf); + headlines[numHeadlines] = NULL; + break; + case DT_DocumentCodeGroup: + if (codes == NULL) /* create a new list */ + { codes = (WAISDocumentCodes**)s_malloc((size_t)sizeof(WAISDocumentCodes*) * 2); + } + else /* grow the list */ + { codes = (WAISDocumentCodes**)s_realloc((char*)codes,(size_t)(sizeof(WAISDocumentCodes*) * (numCodes + 2))); + } + buf = readWAISDocumentCodes((WAISDocumentCodes**)&header,buf); cleanUpWaisSearchResponse(buf,seedWordsUsed,docHeaders,shortHeaders,longHeaders,text,headlines,codes,diags); - RETURN_ON_NULL(buf); - codes[numCodes++] = + RETURN_ON_NULL(buf); + codes[numCodes++] = (WAISDocumentCodes*)header; /* put it in the list */ - codes[numCodes] = NULL; - break; - default: - cleanUpWaisSearchResponse(buf,seedWordsUsed,docHeaders,shortHeaders,longHeaders,text,headlines,codes,diags); - REPORT_READ_ERROR(buf); - break; + codes[numCodes] = NULL; + break; + default: + cleanUpWaisSearchResponse(buf,seedWordsUsed,docHeaders,shortHeaders,longHeaders,text,headlines,codes,diags); + REPORT_READ_ERROR(buf); + break; } } - + *info = (void *)makeWAISSearchResponse(seedWordsUsed,docHeaders,shortHeaders, longHeaders,text,headlines,codes,diags); - + return(buf); } @@ -1622,13 +1622,13 @@ any* documentText; docText->DocumentID = docID; docText->VersionNumber = versionNumber; docText->DocumentText = documentText; - + return(docText); } /*----------------------------------------------------------------------*/ -void +void freeWAISDocumentText(docText) WAISDocumentText* docText; { @@ -1639,7 +1639,7 @@ WAISDocumentText* docText; /*----------------------------------------------------------------------*/ -char* +char* writeWAISDocumentText(docText,buffer,len) WAISDocumentText* docText; char* buffer; @@ -1649,15 +1649,15 @@ long* len; DefWAISDocTextSize); char* buf = buffer + header_len; unsigned long size; - + RESERVE_SPACE_FOR_WAIS_HEADER(len); buf = writeAny(docText->DocumentID,DT_DocumentID,buf,len); buf = writeNum(docText->VersionNumber,DT_VersionNumber,buf,len); buf = writeAny(docText->DocumentText,DT_DocumentText,buf,len); - + /* now write the header and size */ - size = buf - buffer; + size = buf - buffer; buf = writeUserInfoHeader(DT_DocumentTextGroup,size,header_len,buffer,len); return(buf); @@ -1665,44 +1665,44 @@ long* len; /*----------------------------------------------------------------------*/ -char* +char* readWAISDocumentText(docText,buffer) WAISDocumentText** docText; char* buffer; { char* buf = buffer; - unsigned long size; + unsigned long size; unsigned long headerSize; data_tag tag1; any *docID,*documentText; long versionNumber; - + docID = documentText = NULL; versionNumber = UNUSED; - + buf = readUserInfoHeader(&tag1,&size,buf); headerSize = buf - buffer; - + while (buf < (buffer + size + headerSize)) { data_tag tag = peekTag(buf); switch (tag) { case DT_DocumentID: - buf = readAny(&docID,buf); - break; - case DT_VersionNumber: - buf = readNum(&versionNumber,buf); - break; - case DT_DocumentText: - buf = readAny(&documentText,buf); - break; - default: - freeAny(docID); - freeAny(documentText); - REPORT_READ_ERROR(buf); - break; + buf = readAny(&docID,buf); + break; + case DT_VersionNumber: + buf = readNum(&versionNumber,buf); + break; + case DT_DocumentText: + buf = readAny(&documentText,buf); + break; + default: + freeAny(docID); + freeAny(documentText); + REPORT_READ_ERROR(buf); + break; } } - + *docText = makeWAISDocumentText(docID,versionNumber,documentText); return(buf); } @@ -1732,13 +1732,13 @@ char* originCity; docHeadline->Date = date; docHeadline->Headline = headline; docHeadline->OriginCity = originCity; - + return(docHeadline); } /*----------------------------------------------------------------------*/ -void +void freeWAISDocumentHeadlines(docHeadline) WAISDocumentHeadlines* docHeadline; { @@ -1752,7 +1752,7 @@ WAISDocumentHeadlines* docHeadline; /*----------------------------------------------------------------------*/ -char* +char* writeWAISDocumentHeadlines(docHeadline,buffer,len) WAISDocumentHeadlines* docHeadline; char* buffer; @@ -1762,7 +1762,7 @@ long* len; DefWAISDocHeadlineSize); char* buf = buffer + header_len; unsigned long size; - + RESERVE_SPACE_FOR_WAIS_HEADER(len); buf = writeAny(docHeadline->DocumentID,DT_DocumentID,buf,len); @@ -1771,9 +1771,9 @@ long* len; buf = writeString(docHeadline->Date,DT_Date,buf,len); buf = writeString(docHeadline->Headline,DT_Headline,buf,len); buf = writeString(docHeadline->OriginCity,DT_OriginCity,buf,len); - + /* now write the header and size */ - size = buf - buffer; + size = buf - buffer; buf = writeUserInfoHeader(DT_DocumentHeadlineGroup,size,header_len,buffer,len); return(buf); @@ -1781,60 +1781,60 @@ long* len; /*----------------------------------------------------------------------*/ -char* +char* readWAISDocumentHeadlines(docHeadline,buffer) WAISDocumentHeadlines** docHeadline; char* buffer; { char* buf = buffer; - unsigned long size; + unsigned long size; unsigned long headerSize; data_tag tag1; any* docID; long versionNumber; char *source,*date,*headline,*originCity; - + docID = NULL; versionNumber = UNUSED; source = date = headline = originCity = NULL; - + buf = readUserInfoHeader(&tag1,&size,buf); headerSize = buf - buffer; - + while (buf < (buffer + size + headerSize)) { data_tag tag = peekTag(buf); switch (tag) { case DT_DocumentID: - buf = readAny(&docID,buf); - break; - case DT_VersionNumber: - buf = readNum(&versionNumber,buf); - break; - case DT_Source: - buf = readString(&source,buf); - break; - case DT_Date: - buf = readString(&date,buf); - break; - case DT_Headline: - buf = readString(&headline,buf); - break; - case DT_OriginCity: - buf = readString(&originCity,buf); - break; - default: - freeAny(docID); - s_free(source); - s_free(date); - s_free(headline); - s_free(originCity); - REPORT_READ_ERROR(buf); - break; + buf = readAny(&docID,buf); + break; + case DT_VersionNumber: + buf = readNum(&versionNumber,buf); + break; + case DT_Source: + buf = readString(&source,buf); + break; + case DT_Date: + buf = readString(&date,buf); + break; + case DT_Headline: + buf = readString(&headline,buf); + break; + case DT_OriginCity: + buf = readString(&originCity,buf); + break; + default: + freeAny(docID); + s_free(source); + s_free(date); + s_free(headline); + s_free(originCity); + REPORT_READ_ERROR(buf); + break; } } - + *docHeadline = makeWAISDocumentHeadlines(docID,versionNumber,source,date, - headline,originCity); + headline,originCity); return(buf); } @@ -1859,13 +1859,13 @@ char* industryCodes; docCodes->StockCodes = stockCodes; docCodes->CompanyCodes = companyCodes; docCodes->IndustryCodes = industryCodes; - + return(docCodes); } /*----------------------------------------------------------------------*/ -void +void freeWAISDocumentCodes(docCodes) WAISDocumentCodes* docCodes; { @@ -1878,7 +1878,7 @@ WAISDocumentCodes* docCodes; /*----------------------------------------------------------------------*/ -char* +char* writeWAISDocumentCodes(docCodes,buffer,len) WAISDocumentCodes* docCodes; char* buffer; @@ -1888,7 +1888,7 @@ long* len; DefWAISDocCodeSize); char* buf = buffer + header_len; unsigned long size; - + RESERVE_SPACE_FOR_WAIS_HEADER(len); buf = writeAny(docCodes->DocumentID,DT_DocumentID,buf,len); @@ -1896,9 +1896,9 @@ long* len; buf = writeString(docCodes->StockCodes,DT_StockCodes,buf,len); buf = writeString(docCodes->CompanyCodes,DT_CompanyCodes,buf,len); buf = writeString(docCodes->IndustryCodes,DT_IndustryCodes,buf,len); - + /* now write the header and size */ - size = buf - buffer; + size = buf - buffer; buf = writeUserInfoHeader(DT_DocumentCodeGroup,size,header_len,buffer,len); return(buf); @@ -1906,62 +1906,62 @@ long* len; /*----------------------------------------------------------------------*/ -char* +char* readWAISDocumentCodes(docCodes,buffer) WAISDocumentCodes** docCodes; char* buffer; { char* buf = buffer; - unsigned long size; + unsigned long size; unsigned long headerSize; data_tag tag1; any* docID; long versionNumber; char *stockCodes,*companyCodes,*industryCodes; - + docID = NULL; versionNumber = UNUSED; stockCodes = companyCodes = industryCodes = NULL; - + buf = readUserInfoHeader(&tag1,&size,buf); headerSize = buf - buffer; - + while (buf < (buffer + size + headerSize)) { data_tag tag = peekTag(buf); switch (tag) { case DT_DocumentID: - buf = readAny(&docID,buf); - break; - case DT_VersionNumber: - buf = readNum(&versionNumber,buf); - break; - case DT_StockCodes: - buf = readString(&stockCodes,buf); - break; - case DT_CompanyCodes: - buf = readString(&companyCodes,buf); - break; - case DT_IndustryCodes: - buf = readString(&industryCodes,buf); - break; - default: - freeAny(docID); - s_free(stockCodes); - s_free(companyCodes); - s_free(industryCodes); - REPORT_READ_ERROR(buf); - break; + buf = readAny(&docID,buf); + break; + case DT_VersionNumber: + buf = readNum(&versionNumber,buf); + break; + case DT_StockCodes: + buf = readString(&stockCodes,buf); + break; + case DT_CompanyCodes: + buf = readString(&companyCodes,buf); + break; + case DT_IndustryCodes: + buf = readString(&industryCodes,buf); + break; + default: + freeAny(docID); + s_free(stockCodes); + s_free(companyCodes); + s_free(industryCodes); + REPORT_READ_ERROR(buf); + break; } } - + *docCodes = makeWAISDocumentCodes(docID,versionNumber,stockCodes, - companyCodes,industryCodes); + companyCodes,industryCodes); return(buf); } /*----------------------------------------------------------------------*/ -char* +char* writePresentInfo(present,buffer,len) PresentAPDU* present GCC_UNUSED; char* buffer; @@ -1973,7 +1973,7 @@ long* len GCC_UNUSED; /*----------------------------------------------------------------------*/ -char* +char* readPresentInfo(info,buffer) void** info; char* buffer; @@ -1985,7 +1985,7 @@ char* buffer; /*----------------------------------------------------------------------*/ -char* +char* writePresentResponseInfo(response,buffer,len) PresentResponseAPDU* response GCC_UNUSED; char* buffer; @@ -1997,7 +1997,7 @@ long* len GCC_UNUSED; /*----------------------------------------------------------------------*/ -char* +char* readPresentResponseInfo(info,buffer) void** info; char* buffer; @@ -2018,36 +2018,36 @@ char* buffer; #define DATA_TYPE "wt" /* WAIS supports the following semantics for type 1 queries: - + 1. retrieve the header/codes from a document: - System_Control_Number = docID - Data Type = type (optional) - And + System_Control_Number = docID + Data Type = type (optional) + And 2. retrieve a fragment of the text of a document: - System_Control_Number = docID - Data Type = type (optional) - And - Chunk >= start - And - Chunk < end - And + System_Control_Number = docID + Data Type = type (optional) + And + Chunk >= start + And + Chunk < end + And - Information from multiple documents may be requested by using - groups of the above joined by: + Information from multiple documents may be requested by using + groups of the above joined by: - OR + OR - ( XXX does an OR come after every group but the first, or do they - all come at the end? ) - - ( XXX return type could be in the element set) + ( XXX does an OR come after every group but the first, or do they + all come at the end? ) + + ( XXX return type could be in the element set) */ static query_term** makeWAISQueryTerms PARAMS((DocObj** docs)); - + static query_term** makeWAISQueryTerms(docs) DocObj** docs; @@ -2075,7 +2075,7 @@ DocObj** docs; if (doc->ChunkCode == CT_document) /* a whole document */ { terms = (query_term**)s_realloc((char*)terms, - (size_t)(sizeof(query_term*) * + (size_t)(sizeof(query_term*) * (numTerms + 3 + 1))); terms[numTerms++] = makeAttributeTerm(SYSTEM_CONTROL_NUMBER, EQUAL,IGNORE,IGNORE, @@ -2085,16 +2085,16 @@ DocObj** docs; IGNORE,IGNORE,IGNORE, IGNORE,type); terms[numTerms++] = makeOperatorTerm(AND); - } + } terms[numTerms] = NULL; } else /* a document fragment */ { char chunk_att[ATTRIBUTE_SIZE]; any* startChunk = NULL; any* endChunk = NULL; - + terms = (query_term**)s_realloc((char*)terms, - (size_t)(sizeof(query_term*) * + (size_t)(sizeof(query_term*) * (numTerms + 7 + 1))); switch (doc->ChunkCode) @@ -2103,7 +2103,7 @@ DocObj** docs; { char start[20],end[20]; (doc->ChunkCode == CT_byte) ? strncpy(chunk_att,BYTE,ATTRIBUTE_SIZE) : - strncpy(chunk_att,LINE,ATTRIBUTE_SIZE); + strncpy(chunk_att,LINE,ATTRIBUTE_SIZE); sprintf(start,"%ld",doc->ChunkStart.Pos); startChunk = stringToAny(start); sprintf(end,"%ld",doc->ChunkEnd.Pos); @@ -2132,7 +2132,7 @@ DocObj** docs; } terms[numTerms++] = makeAttributeTerm(chunk_att, GREATER_THAN_OR_EQUAL, - IGNORE,IGNORE,IGNORE, + IGNORE,IGNORE,IGNORE, IGNORE, startChunk); terms[numTerms++] = makeOperatorTerm(AND); @@ -2148,12 +2148,12 @@ DocObj** docs; freeAny(endChunk); } } - + freeAny(type); - + if (i != 0) /* multiple independent queries, need a disjunction */ { terms = (query_term**)s_realloc((char*)terms, - (size_t)(sizeof(query_term*) * + (size_t)(sizeof(query_term*) * (numTerms + 1 + 1))); terms[numTerms++] = makeOperatorTerm(OR); terms[numTerms] = NULL; @@ -2167,10 +2167,10 @@ DocObj** docs; static DocObj** makeWAISQueryDocs PARAMS((query_term** terms)); -static DocObj** +static DocObj** makeWAISQueryDocs(terms) query_term** terms; -/* given a list of terms in the form given above, convert them to +/* given a list of terms in the form given above, convert them to DocObjs. */ { @@ -2181,36 +2181,36 @@ query_term** terms; long docNum,termNum; docNum = termNum = 0; - + docs = (DocObj**)s_malloc((size_t)(sizeof(DocObj*) * 1)); docs[docNum] = NULL; /* translate the terms into DocObjs */ while (true) - { + { query_term* typeTerm = NULL; char* type = NULL; long startTermOffset; docTerm = terms[termNum]; - + if (docTerm == NULL) break; /* we're done converting */ typeTerm = terms[termNum + 1]; /* get the lead Term if it exists */ if (strcmp(typeTerm->Use,DATA_TYPE) == 0) /* we do have a type */ - { startTermOffset = 3; + { startTermOffset = 3; type = anyToString(typeTerm->Term); } - else /* no type */ + else /* no type */ { startTermOffset = 1; typeTerm = NULL; type = NULL; } /* grow the doc list */ - docs = (DocObj**)s_realloc((char*)docs,(size_t)(sizeof(DocObj*) * + docs = (DocObj**)s_realloc((char*)docs,(size_t)(sizeof(DocObj*) * (docNum + 1 + 1))); /* figure out what kind of docObj to build - and build it */ @@ -2218,20 +2218,20 @@ query_term** terms; if (fragmentTerm != NULL && fragmentTerm->TermType == TT_Attribute) { /* build a document fragment */ query_term* startTerm = fragmentTerm; - query_term* endTerm = terms[termNum + startTermOffset + 2]; + query_term* endTerm = terms[termNum + startTermOffset + 2]; if (strcmp(startTerm->Use,BYTE) == 0){ /* a byte chunk */ doc = makeDocObjUsingBytes(duplicateAny(docTerm->Term), type, anyToLong(startTerm->Term), anyToLong(endTerm->Term)); - log_write("byte"); + log_write("byte"); }else if (strcmp(startTerm->Use,LINE) == 0){ /* a line chunk */ doc = makeDocObjUsingLines(duplicateAny(docTerm->Term), type, anyToLong(startTerm->Term), anyToLong(endTerm->Term)); - log_write("line"); + log_write("line"); }else{ log_write("chunk"); /* a paragraph chunk */ doc = makeDocObjUsingParagraphs(duplicateAny(docTerm->Term), @@ -2242,18 +2242,18 @@ query_term** terms; termNum += (startTermOffset + 4); /* point to next term */ } else /* build a full document */ - { + { doc = makeDocObjUsingWholeDocument(duplicateAny(docTerm->Term), type); log_write("whole doc"); termNum += startTermOffset; /* point to next term */ } - + docs[docNum++] = doc; /* insert the new document */ - + docs[docNum] = NULL; /* keep the doc list terminated */ - + if (terms[termNum] != NULL) termNum++; /* skip the OR operator it necessary */ else @@ -2265,7 +2265,7 @@ log_write("whole doc"); /*----------------------------------------------------------------------*/ -any* +any* makeWAISTextQuery(docs) DocObj** docs; /* given a list of DocObjs, return an any whose contents is the corresponding @@ -2274,34 +2274,34 @@ DocObj** docs; { any *buf = NULL; query_term** terms = NULL; - + terms = makeWAISQueryTerms(docs); buf = writeQuery(terms); - + doList((void**)terms,freeTerm); s_free(terms); - + return(buf); } /*----------------------------------------------------------------------*/ -DocObj** +DocObj** readWAISTextQuery(buf) any* buf; -/* given an any whose contents are type 1 queries of the WAIS sort, +/* given an any whose contents are type 1 queries of the WAIS sort, construct a list of the corresponding DocObjs */ { query_term** terms = NULL; DocObj** docs = NULL; - + terms = readQuery(buf); docs = makeWAISQueryDocs(terms); - + doList((void**)terms,freeTerm); s_free(terms); - + return(docs); } @@ -2315,7 +2315,7 @@ any* buf; /* caller to assign nulls to the pointer fields of the WAIS object. */ /*----------------------------------------------------------------------*/ -void +void CSTFreeWAISInitResponse(init) WAISInitResponse* init; /* free an object made with makeWAISInitResponse */ @@ -2325,11 +2325,11 @@ WAISInitResponse* init; /*----------------------------------------------------------------------*/ -void +void CSTFreeWAISSearch(query) WAISSearch* query; /* destroy an object made with makeWAISSearch() */ -{ +{ s_free(query); } @@ -2339,7 +2339,7 @@ void CSTFreeDocObj(doc) DocObj* doc; /* free a docObj */ -{ +{ s_free(doc); } @@ -2348,7 +2348,7 @@ DocObj* doc; void CSTFreeWAISDocumentHeader(header) WAISDocumentHeader* header; -{ +{ s_free(header); } @@ -2357,7 +2357,7 @@ WAISDocumentHeader* header; void CSTFreeWAISDocumentShortHeader(header) WAISDocumentShortHeader* header; -{ +{ s_free(header); } /*----------------------------------------------------------------------*/ @@ -2374,31 +2374,31 @@ WAISDocumentLongHeader* header; void CSTFreeWAISSearchResponse(response) WAISSearchResponse* response; -{ +{ s_free(response); } /*----------------------------------------------------------------------*/ -void +void CSTFreeWAISDocumentText(docText) WAISDocumentText* docText; -{ +{ s_free(docText); } /*----------------------------------------------------------------------*/ -void +void CSTFreeWAISDocHeadlines(docHeadline) WAISDocumentHeadlines* docHeadline; -{ +{ s_free(docHeadline); } /*----------------------------------------------------------------------*/ -void +void CSTFreeWAISDocumentCodes(docCodes) WAISDocumentCodes* docCodes; { @@ -2407,7 +2407,7 @@ WAISDocumentCodes* docCodes; /*----------------------------------------------------------------------*/ -void +void CSTFreeWAISTextQuery(query) any* query; { @@ -2423,7 +2423,7 @@ any* query; **----------------------------------------------------------------------*/ /* WIDE AREA INFORMATION SERVER SOFTWARE No guarantees or restrictions. See the readme file for the full standard - disclaimer. + disclaimer. 3.26.90 */ @@ -2438,14 +2438,14 @@ any* query; /*---------------------------------------------------------------------*/ -void +void readWAISPacketHeader(msgBuffer,header_struct) char* msgBuffer; WAISMessage *header_struct; { /* msgBuffer is a string containing at least HEADER_LENGTH bytes. */ - - memmove(header_struct->msg_len,msgBuffer,(size_t)10); + + memmove(header_struct->msg_len,msgBuffer,(size_t)10); header_struct->msg_type = char_downcase((unsigned long)msgBuffer[10]); header_struct->hdr_vers = char_downcase((unsigned long)msgBuffer[11]); memmove(header_struct->server,(void*)(msgBuffer + 12),(size_t)10); @@ -2453,13 +2453,13 @@ WAISMessage *header_struct; header_struct->encoding = char_downcase((unsigned long)msgBuffer[23]); header_struct->msg_checksum = char_downcase((unsigned long)msgBuffer[24]); } - + /*---------------------------------------------------------------------*/ /* this modifies the header argument. See wais-message.h for the different * options for the arguments. */ - + void writeWAISPacketHeader(header, dataLen, @@ -2484,19 +2484,19 @@ long version; if (serverLen > 10) serverLen = 10; - sprintf(lengthBuf, "%010ld", dataLen); + sprintf(lengthBuf, "%010ld", dataLen); strncpy(header,lengthBuf,10); - header[10] = type & 0xFF; + header[10] = type & 0xFF; header[11] = version & 0xFF; - strncpy(serverBuf,server,serverLen); + strncpy(serverBuf,server,serverLen); strncpy((char*)(header + 12),serverBuf,serverLen); - header[22] = compression & 0xFF; - header[23] = encoding & 0xFF; - header[24] = '0'; /* checkSum(header + HEADER_LENGTH,dataLen); XXX the result must be ascii */ -} - + header[22] = compression & 0xFF; + header[23] = encoding & 0xFF; + header[24] = '0'; /* checkSum(header + HEADER_LENGTH,dataLen); XXX the result must be ascii */ +} + /*---------------------------------------------------------------------*/ diff --git a/WWW/Library/Implementation/HTVMS_WaisProt.h b/WWW/Library/Implementation/HTVMS_WaisProt.h index feea3264..4ff76cef 100644 --- a/WWW/Library/Implementation/HTVMS_WaisProt.h +++ b/WWW/Library/Implementation/HTVMS_WaisProt.h @@ -12,17 +12,17 @@ **----------------------------------------------------------------------*/ /* WIDE AREA INFORMATION SERVER SOFTWARE: No guarantees or restrictions. See the readme file for the full standard - disclaimer. - + disclaimer. + 3.26.90 Harry Morris, morris@think.com - 3.30.90 Harry Morris - - removed chunk code from WAISSearchAPDU, - - added makeWAISQueryType1Query() and readWAISType1Query() which - replace makeWAISQueryTerms() and makeWAISQueryDocs(). + 3.30.90 Harry Morris + - removed chunk code from WAISSearchAPDU, + - added makeWAISQueryType1Query() and readWAISType1Query() which + replace makeWAISQueryTerms() and makeWAISQueryDocs(). 4.11.90 HWM - added definitions of wais element set names - 4.14.90 HWM - changed symbol for relevance feedback query from QT_3 to - QT_RelevanceFeedbackQuery added QT_TextRetrievalQuery as a - synonym for QT_BooleanQuery + 4.14.90 HWM - changed symbol for relevance feedback query from QT_3 to + QT_RelevanceFeedbackQuery added QT_TextRetrievalQuery as a + synonym for QT_BooleanQuery - renamed makeWAISType1Query() to makeWAISTextQuery() renamed readWAISType1Query() to readWAISTextQuery() 5.29.90 TS - added CSTFreeWAISFoo functions @@ -95,16 +95,16 @@ #define DT_DocumentShortHeaderGroup (data_tag)151 #define DT_DocumentLongHeaderGroup (data_tag)152 #define DT_DocumentTextGroup (data_tag)153 -#define DT_DocumentHeadlineGroup (data_tag)154 +#define DT_DocumentHeadlineGroup (data_tag)154 #define DT_DocumentCodeGroup (data_tag)155 -#define DT_Lines (data_tag)131 -#define DT_TYPE_BLOCK (data_tag)132 -#define DT_TYPE (data_tag)133 +#define DT_Lines (data_tag)131 +#define DT_TYPE_BLOCK (data_tag)132 +#define DT_TYPE (data_tag)133 /* wais element sets */ #define ES_DocumentHeader "Document Header" -#define ES_DocumentShortHeader "Document Short Header" -#define ES_DocumentLongHeader "Document Long Header" +#define ES_DocumentShortHeader "Document Short Header" +#define ES_DocumentLongHeader "Document Long Header" #define ES_DocumentText "Document Text" #define ES_DocumentHeadline "Document Headline" #define ES_DocumentCodes "Document Codes" @@ -122,7 +122,7 @@ typedef struct DocObj { /* specifies a section of a document */ any* ID; } ChunkEnd; } DocObj; - + /*----------------------------------------------------------------------*/ /* WAIS APDU extensions */ @@ -131,7 +131,7 @@ typedef struct WAISInitResponse { long ChunkIDLength; char* ChunkMarker; char* HighlightMarker; - char* DeHighlightMarker; + char* DeHighlightMarker; char* NewlineCharacters; /* XXX need to add UpdateFrequency and Update Time */ } WAISInitResponse; @@ -149,10 +149,10 @@ typedef struct WAISSearch { typedef struct WAISDocumentHeader { any* DocumentID; long VersionNumber; - long Score; - long BestMatch; + long Score; + long BestMatch; long DocumentLength; - long Lines; + long Lines; char** Types; char* Source; char* Date; @@ -163,35 +163,35 @@ typedef struct WAISDocumentHeader { typedef struct WAISDocumentShortHeader { any* DocumentID; long VersionNumber; - long Score; - long BestMatch; + long Score; + long BestMatch; long DocumentLength; - long Lines; - } WAISDocumentShortHeader; - + long Lines; + } WAISDocumentShortHeader; + typedef struct WAISDocumentLongHeader { any* DocumentID; long VersionNumber; - long Score; - long BestMatch; + long Score; + long BestMatch; long DocumentLength; - long Lines; + long Lines; char** Types; char* Source; char* Date; char* Headline; char* OriginCity; char* StockCodes; - char* CompanyCodes; + char* CompanyCodes; char* IndustryCodes; - } WAISDocumentLongHeader; + } WAISDocumentLongHeader; typedef struct WAISDocumentText { any* DocumentID; long VersionNumber; any* DocumentText; } WAISDocumentText; - + typedef struct WAISDocumentHeadlines { any* DocumentID; long VersionNumber; @@ -200,7 +200,7 @@ typedef struct WAISDocumentHeadlines { char* Headline; char* OriginCity; } WAISDocumentHeadlines; - + typedef struct WAISDocumentCodes { any* DocumentID; long VersionNumber; @@ -208,12 +208,12 @@ typedef struct WAISDocumentCodes { char* CompanyCodes; char* IndustryCodes; } WAISDocumentCodes; - + typedef struct WAISSearchResponse { - char* SeedWordsUsed; - WAISDocumentHeader** DocHeaders; - WAISDocumentShortHeader** ShortHeaders; - WAISDocumentLongHeader** LongHeaders; + char* SeedWordsUsed; + WAISDocumentHeader** DocHeaders; + WAISDocumentShortHeader** ShortHeaders; + WAISDocumentLongHeader** LongHeaders; WAISDocumentText** Text; WAISDocumentHeadlines** Headlines; WAISDocumentCodes** Codes; @@ -326,7 +326,7 @@ void CSTFreeWAISTextQuery PARAMS(( any* query)); **----------------------------------------------------------------------*/ /* WIDE AREA INFORMATION SERVER SOFTWARE No guarantees or restrictions. See the readme file for the full standard - disclaimer. + disclaimer. 3.26.90 */ @@ -351,7 +351,7 @@ void CSTFreeWAISTextQuery PARAMS(( any* query)); #ifndef HTUTILS_H #include <HTUtils.h> #endif - + #include <HTVMS_WaisUI.h> typedef struct wais_header { @@ -361,36 +361,36 @@ typedef struct wais_header { char hdr_vers; /* version of this header, currently = '2' */ char server[10]; /* name or address of server */ char compression; /* <sp>=no compression, 'u'=unix compress */ - char encoding; /* <sp>=no encoding, 'h'=hexize, + char encoding; /* <sp>=no encoding, 'h'=hexize, 'u'=uuencode */ char msg_checksum; /* XOR of every byte of message */ } WAISMessage; -#define HEADER_LENGTH 25 /* number of bytes needed to write a +#define HEADER_LENGTH 25 /* number of bytes needed to write a wais-header (not sizeof(wais_header)) */ -#define HEADER_VERSION (long)'2' +#define HEADER_VERSION (long)'2' /* message type */ -#define Z3950 'z' -#define ACK 'a' -#define NAK 'n' +#define Z3950 'z' +#define ACK 'a' +#define NAK 'n' /* compression */ -#define NO_COMPRESSION ' ' -#define UNIX_COMPRESSION 'u' +#define NO_COMPRESSION ' ' +#define UNIX_COMPRESSION 'u' /* encoding */ -#define NO_ENCODING ' ' -#define HEX_ENCODING 'h' /* Swartz 4/3 encoding */ -#define IBM_HEXCODING 'i' /* same as h but uses characters acceptable for IBM mainframes */ -#define UUENCODE 'u' +#define NO_ENCODING ' ' +#define HEX_ENCODING 'h' /* Swartz 4/3 encoding */ +#define IBM_HEXCODING 'i' /* same as h but uses characters acceptable for IBM mainframes */ +#define UUENCODE 'u' void readWAISPacketHeader PARAMS((char* msgBuffer,WAISMessage *header_struct)); long getWAISPacketLength PARAMS((WAISMessage* header)); void writeWAISPacketHeader PARAMS((char* header,long dataLen,long type, - char* server,long compression, + char* server,long compression, long encoding,long version)); #endif /* ndef WMESSAGE_H */ diff --git a/WWW/Library/Implementation/HTVMS_WaisUI.c b/WWW/Library/Implementation/HTVMS_WaisUI.c index 6f0811c0..5aaa9e69 100644 --- a/WWW/Library/Implementation/HTVMS_WaisUI.c +++ b/WWW/Library/Implementation/HTVMS_WaisUI.c @@ -696,9 +696,9 @@ freeSearchAPDU(SearchAPDU* query) /*----------------------------------------------------------------------*/ -#define DB_DELIMITER "\037" /* hex 1F occurs between each database name */ -#define ES_DELIMITER_1 "\037" /* separates database name from element name */ -#define ES_DELIMITER_2 "\036" /* hex 1E separates <db,es> groups from one another */ +#define DB_DELIMITER "\037" /* hex 1F occurs between each database name */ +#define ES_DELIMITER_1 "\037" /* separates database name from element name */ +#define ES_DELIMITER_2 "\036" /* hex 1E separates <db,es> groups from one another */ char* writeSearchAPDU(SearchAPDU* query, char* buffer, long* len) @@ -911,9 +911,9 @@ readSearchResponseAPDU(SearchResponseAPDU** queryResponse, char* buffer) 3.26.90 Harry Morris, morris@think.com 3.30.90 Harry Morris - Changed any->bits to any->bytes 4.11.90 HWM - fixed include file names, changed - - writeCompressedIntegerWithPadding() to - writeCompressedIntWithPadding() - - generalized conditional includes (see c-dialect.h) + - writeCompressedIntegerWithPadding() to + writeCompressedIntWithPadding() + - generalized conditional includes (see c-dialect.h) 3.7.91 Jonny Goldman. Replaced "short" in makeBitMap with "int" line 632. */ @@ -1907,7 +1907,7 @@ readQueryTerm(query_term** qt, char* buffer) char* buf = buffer; char *attributeList = NULL; char* operator = NULL; - any* term; + any* term; char* use = NULL; char* relation = NULL; char* position = NULL; diff --git a/WWW/Library/Implementation/HTVMS_WaisUI.h b/WWW/Library/Implementation/HTVMS_WaisUI.h index 474b943d..6bb2539e 100644 --- a/WWW/Library/Implementation/HTVMS_WaisUI.h +++ b/WWW/Library/Implementation/HTVMS_WaisUI.h @@ -19,7 +19,7 @@ void log_write PARAMS((char *)); ** **----------------------------------------------------------------------*/ -void panic (char* format,...); +void panic (char* format,...); /*----------------------------------------------------------------------*/ @@ -36,11 +36,11 @@ void panic (char* format,...); #endif /* boolean */ #ifndef true -#define true (boolean)1L +#define true (boolean)1L #endif /* true */ #ifndef false -#define false (boolean)0L /* used to be (!true), but broke +#define false (boolean)0L /* used to be (!true), but broke some compilers */ #endif /* false */ @@ -61,16 +61,16 @@ void fs_checkPtr PARAMS((void* ptr)); void* fs_malloc PARAMS((size_t size)); void* fs_realloc PARAMS((void* ptr,size_t size)); void fs_free PARAMS((void* ptr)); -char* fs_strncat PARAMS((char* dst,char* src,size_t maxToAdd,size_t maxTotal)); +char* fs_strncat PARAMS((char* dst,char* src,size_t maxToAdd,size_t maxTotal)); /* macros for memory functions. call these in your program. */ -#define s_checkPtr(ptr) fs_checkPtr(ptr) -#define s_malloc(size) fs_malloc(size) +#define s_checkPtr(ptr) fs_checkPtr(ptr) +#define s_malloc(size) fs_malloc(size) #define s_realloc(ptr,size) fs_realloc((ptr),(size)) #define s_free(ptr) { fs_free((char*)ptr); ptr = NULL; } #define s_strncat(dst,src,maxToAdd,maxTotal) fs_strncat((dst),(src),(maxToAdd),(maxTotal)) -char* s_strdup PARAMS((char* s)); +char* s_strdup PARAMS((char* s)); #define IS_DELIMITER 1 #define NOT_DELIMITER !IS_DELIMITER @@ -90,7 +90,7 @@ char *string_downcase PARAMS((char* word)); /* Data types / constants */ /* bytes to leave for the header size info */ -#define HEADER_LEN (size_t)2 +#define HEADER_LEN (size_t)2 typedef long pdu_type; @@ -108,15 +108,15 @@ typedef long pdu_type; #define resourceControlResponseAPDU (pdu_type)31 typedef struct any { /* an any is a non-ascii string of characters */ - unsigned long size; + unsigned long size; char* bytes; } any; - -typedef any bit_map; /* a bit_map is a group of packed bits */ + +typedef any bit_map; /* a bit_map is a group of packed bits */ typedef unsigned long data_tag; -#define DT_PDUType (data_tag)1 +#define DT_PDUType (data_tag)1 #define DT_ReferenceID (data_tag)2 #define DT_ProtocolVersion (data_tag)3 #define DT_Options (data_tag)4 @@ -134,7 +134,7 @@ typedef unsigned long data_tag; #define DT_ReplaceIndicator (data_tag)16 #define DT_ResultSetName (data_tag)17 #define DT_DatabaseNames (data_tag)18 -#define DT_ElementSetNames (data_tag)19 +#define DT_ElementSetNames (data_tag)19 #define DT_QueryType (data_tag)20 #define DT_Query (data_tag)21 #define DT_SearchStatus (data_tag)22 @@ -162,12 +162,12 @@ typedef unsigned long data_tag; #define UNUSED -1 -/* number of bytes required to represent the following sizes in compressed +/* number of bytes required to represent the following sizes in compressed integer format */ -#define CompressedInt1Byte 128 /* 2 ^ 7 */ -#define CompressedInt2Byte 16384 /* 2 ^ 14 */ -#define CompressedInt3Byte 2097152 /* 2 ^ 21 */ +#define CompressedInt1Byte 128 /* 2 ^ 7 */ +#define CompressedInt2Byte 16384 /* 2 ^ 14 */ +#define CompressedInt3Byte 2097152 /* 2 ^ 21 */ /* others may follow ... */ /* types of query */ @@ -198,24 +198,24 @@ typedef unsigned long data_tag; #define PARTIAL_2 2 #define PARTIAL_3 3 #define PARTIAL_4 4 -#define PS_NONE 5 /* can't use NONE since it was used by result +#define PS_NONE 5 /* can't use NONE since it was used by result set status */ #define DIAGNOSTIC_CODE_SIZE (size_t)3 -typedef struct diagnosticRecord +typedef struct diagnosticRecord { boolean SURROGATE; char DIAG[DIAGNOSTIC_CODE_SIZE]; - char* ADDINFO; + char* ADDINFO; } diagnosticRecord; #define D_PermanentSystemError "S1" -#define D_TemporarySystemError "S2" -#define D_UnsupportedSearch "S3" -#define D_TermsOnlyStopWords "S5" -#define D_TooManyArgumentWords "S6" +#define D_TemporarySystemError "S2" +#define D_UnsupportedSearch "S3" +#define D_TermsOnlyStopWords "S5" +#define D_TooManyArgumentWords "S6" #define D_TooManyBooleanOperators "S7" -#define D_TooManyTruncatedWords "S8" +#define D_TooManyTruncatedWords "S8" #define D_TooMany IncompleteSubfields "S9" #define D_TruncatedWordsTooShort "SA" #define D_InvalidFormatForRecordNumber "SB" @@ -251,17 +251,17 @@ typedef struct diagnosticRecord /* for internal error handling */ -extern char* readErrorPosition; /* pos where buf stoped making sense */ +extern char* readErrorPosition; /* pos where buf stoped making sense */ /* the following are macros so that they can return OUT of the function which calls them */ - -#define RETURN_ON_NULL(var) \ - if (var == NULL) \ + +#define RETURN_ON_NULL(var) \ + if (var == NULL) \ return(NULL); /* jump out of caller */ -#define REPORT_READ_ERROR(pos) \ +#define REPORT_READ_ERROR(pos) \ { readErrorPosition = (pos); \ return(NULL); /* jump out of caller */ \ } @@ -270,8 +270,8 @@ extern char* readErrorPosition; /* pos where buf stoped making sense */ { if (*spaceLeft >= spaceNeeded) \ (*spaceLeft) -= spaceNeeded; \ else \ - { *spaceLeft = 0; \ - return(NULL); /* jump out of the caller */ \ + { *spaceLeft = 0; \ + return(NULL); /* jump out of the caller */ \ } \ } @@ -476,8 +476,8 @@ query_term** readQuery PARAMS((any* info)); **----------------------------------------------------------------------*/ char * -generate_retrieval_apdu PARAMS((char *buff, - long *buff_len, +generate_retrieval_apdu PARAMS((char *buff, + long *buff_len, any *docID, long chunk_type, long start_line, long end_line, @@ -512,7 +512,7 @@ typedef struct InitAPDU { long MaximumRecordSize; char* IDAuthentication; char* ImplementationID; - char* ImplementationName; + char* ImplementationName; char* ImplementationVersion; any* ReferenceID; void* UserInformationField; @@ -524,10 +524,10 @@ typedef struct InitResponseAPDU { boolean willSearch,willPresent,willDelete; boolean supportAccessControl,supportResourceControl; long PreferredMessageSize; - long MaximumRecordSize; + long MaximumRecordSize; char* IDAuthentication; char* ImplementationID; - char* ImplementationName; + char* ImplementationName; char* ImplementationVersion; any* ReferenceID; void* UserInformationField; @@ -535,14 +535,14 @@ typedef struct InitResponseAPDU { typedef struct SearchAPDU { pdu_type PDUType; - long SmallSetUpperBound; + long SmallSetUpperBound; long LargeSetLowerBound; - long MediumSetPresentNumber; - boolean ReplaceIndicator; + long MediumSetPresentNumber; + boolean ReplaceIndicator; char* ResultSetName; - char** DatabaseNames; + char** DatabaseNames; char* QueryType; - char** ElementSetNames; + char** ElementSetNames; any* ReferenceID; void* Query; } SearchAPDU; @@ -552,9 +552,9 @@ typedef struct SearchResponseAPDU { long SearchStatus; long ResultCount; long NumberOfRecordsReturned; - long NextResultSetPosition; + long NextResultSetPosition; long ResultSetStatus; - long PresentStatus; + long PresentStatus; any* ReferenceID; void* DatabaseDiagnosticRecords; } SearchResponseAPDU; @@ -563,7 +563,7 @@ typedef struct PresentAPDU { pdu_type PDUType; long NumberOfRecordsRequested; long ResultSetStartPosition; - char* ResultSetID; + char* ResultSetID; char* ElementSetNames; any* ReferenceID; void* PresentInfo; diff --git a/WWW/Library/Implementation/HTWSRC.c b/WWW/Library/Implementation/HTWSRC.c index 9071baac..75e3934b 100644 --- a/WWW/Library/Implementation/HTWSRC.c +++ b/WWW/Library/Implementation/HTWSRC.c @@ -92,7 +92,7 @@ struct _HTStream { CONST HTStreamClass * isa; HTStructured * target; char * par_value[PAR_COUNT]; - enum tokenstate state; + enum tokenstate state; char param[BIG+1]; int param_number; int param_count; @@ -431,7 +431,7 @@ PRIVATE void WSRCParser_abort ARGS2(HTStream *, me, HTError, e GCC_UNUSED) } -/* Stream subclass -- method routines +/* Stream subclass -- method routines ** --------------- */ diff --git a/WWW/Library/Implementation/SGML.c b/WWW/Library/Implementation/SGML.c index 81304445..e31bcc45 100644 --- a/WWW/Library/Implementation/SGML.c +++ b/WWW/Library/Implementation/SGML.c @@ -2254,16 +2254,15 @@ top1: PSRCSTOP(abracket); context->current_tag = NULL; - string->size = 0; - context->current_attribute_number = INVALID; - context->state = S_text; - break; - } + } else #endif - end_element(context, context->element_stack->tag); + end_element(context, context->element_stack->tag); + string->size = 0; context->current_attribute_number = INVALID; context->state = S_text; + context->leading_spaces = 0; + context->trailing_spaces = 0; break; } @@ -4342,7 +4341,7 @@ after_switch: FREE(context->active_include); context->include_index = 0; } else { - if (context->current_tag_charset == UTF8 || + if (context->current_tag_charset == UTF8_handle || context->T.trans_from_uni) { /* * If it looks like we would have fed UTF-8 to the @@ -4454,7 +4453,6 @@ PUBLIC HTStream* SGML_new ARGS3( context->actions = (CONST HTStructuredClass*)(((HTStream*)target)->isa); /* Ugh: no OO */ context->unknown_tag = &HTTag_unrecognized; -/* context->extra_tags = dtd->tags + dtd->number_of_tags; */ context->current_tag = context->slashedtag = NULL; context->state = S_text; context->kanji_buf = '\0'; diff --git a/WWW/Library/Implementation/UCDefs.h b/WWW/Library/Implementation/UCDefs.h index 19007f75..b548d337 100644 --- a/WWW/Library/Implementation/UCDefs.h +++ b/WWW/Library/Implementation/UCDefs.h @@ -8,7 +8,7 @@ #endif typedef struct _LYUCcharset { - int UChndl; /* -1 for "old" charsets, >= 0 for chartrans tables */ + int UChndl; /* -1 for "old" charsets, >= 0 for chartrans tables */ CONST char * MIMEname; int enc; diff --git a/WWW/Library/Implementation/UCMap.h b/WWW/Library/Implementation/UCMap.h index cc9a487d..5472ad41 100644 --- a/WWW/Library/Implementation/UCMap.h +++ b/WWW/Library/Implementation/UCMap.h @@ -46,12 +46,10 @@ extern int UCLYhndl_for_unrec; extern int UCLYhndl_HTFile_for_unspec; extern int UCLYhndl_HTFile_for_unrec; -#undef UTF8 /* defined in some broken header files */ - /* easy to type: */ extern int LATIN1; /* UCGetLYhndl_byMIME("iso-8859-1") */ extern int US_ASCII; /* UCGetLYhndl_byMIME("us-ascii") */ -extern int UTF8; /* UCGetLYhndl_byMIME("utf-8") */ +extern int UTF8_handle; /* UCGetLYhndl_byMIME("utf-8") */ #undef TRANSPARENT /* defined on Solaris in <sys/stream.h> */ extern int TRANSPARENT; /* UCGetLYhndl_byMIME("x-transparent") */ diff --git a/WWW/Library/Implementation/makefile.in b/WWW/Library/Implementation/makefile.in index a2cc7424..c6af29c1 100644 --- a/WWW/Library/Implementation/makefile.in +++ b/WWW/Library/Implementation/makefile.in @@ -19,10 +19,12 @@ LYFLAGS = # FIXME: set in parent makefile CC = @CC@ DEFS = @DEFS@ CPPFLAGS = @CPPFLAGS@ -_O = .o + +o = .@OBJEXT@ INTLDIR_CPPFLAGS= @INTLDIR_CPPFLAGS@ -I$(top_srcdir)/intl +CPP = @CPP@ CPPOPTS = $(DEFS) $(CPPFLAGS) $(LYFLAGS) \ -I../../.. \ -I../../../src \ @@ -79,34 +81,32 @@ LOB = . # uncomment these and fill in WAISINC for adding direct wais access # to Lynx. #HTWAIS_c = $(CMN)/HTWAIS.c -#HTWAIS_o = $(LOB)/HTWAIS$(_O) +#HTWAIS_o = $(LOB)/HTWAIS$o #WAIS = YES #WAISINC = -I../../../../freeWAIS-0.202/ir #WAISCFLAGS = -DDIRECT_WAIS # -# XMOsAIC hack is only for server to cope with xmosaic kludge for mmedia -# # add -DNEW_GATEWAY here for the new gateway config stuff -CFLAGS2 = $(CFLAGS) $(LYFLAGS) $(WAISCFLAGS) -I$(CMN) -DXMOSAIC_HACK -DACCESS_AUTH +CFLAGS2 = $(CFLAGS) $(LYFLAGS) $(WAISCFLAGS) -I$(CMN) -DACCESS_AUTH COMPILE = $(ECHO) $(CC) $(CFLAGS2) -c -COMMON = $(LOB)/HTParse$(_O) $(LOB)/HTAccess$(_O) $(LOB)/HTTP$(_O) \ - $(LOB)/HTFile$(_O) $(LOB)/HTBTree$(_O) $(LOB)/HTFTP$(_O) $(LOB)/HTTCP$(_O) \ - $(LOB)/SGML$(_O) $(LOB)/HTMLDTD$(_O) $(LOB)/HTChunk$(_O) \ - $(LOB)/HTPlain$(_O) \ - $(LOB)/HTMLGen$(_O) \ - $(LOB)/HTAtom$(_O) $(LOB)/HTAnchor$(_O) $(LOB)/HTStyle$(_O) \ - $(LOB)/HTList$(_O) $(LOB)/HTString$(_O) \ - $(LOB)/HTRules$(_O) $(LOB)/HTFormat$(_O) $(LOB)/HTMIME$(_O) \ - $(LOB)/HTNews$(_O) $(LOB)/HTGopher$(_O) \ - $(LOB)/HTTelnet$(_O) $(LOB)/HTFinger$(_O) $(LOB)/HTWSRC$(_O) $(HTWAIS_o) \ - $(LOB)/HTAAUtil$(_O) $(LOB)/HTAABrow$(_O) \ - $(LOB)/HTGroup$(_O) \ - $(LOB)/HTAAProt$(_O) \ - $(LOB)/HTAssoc$(_O) $(LOB)/HTLex$(_O) $(LOB)/HTUU$(_O) \ - $(LOB)/HTDOS$(_O) +COMMON = $(LOB)/HTParse$o $(LOB)/HTAccess$o $(LOB)/HTTP$o \ + $(LOB)/HTFile$o $(LOB)/HTBTree$o $(LOB)/HTFTP$o $(LOB)/HTTCP$o \ + $(LOB)/SGML$o $(LOB)/HTMLDTD$o $(LOB)/HTChunk$o \ + $(LOB)/HTPlain$o \ + $(LOB)/HTMLGen$o \ + $(LOB)/HTAtom$o $(LOB)/HTAnchor$o $(LOB)/HTStyle$o \ + $(LOB)/HTList$o $(LOB)/HTString$o \ + $(LOB)/HTRules$o $(LOB)/HTFormat$o $(LOB)/HTMIME$o \ + $(LOB)/HTNews$o $(LOB)/HTGopher$o \ + $(LOB)/HTTelnet$o $(LOB)/HTFinger$o $(LOB)/HTWSRC$o $(HTWAIS_o) \ + $(LOB)/HTAAUtil$o $(LOB)/HTAABrow$o \ + $(LOB)/HTGroup$o \ + $(LOB)/HTAAProt$o \ + $(LOB)/HTAssoc$o $(LOB)/HTLex$o $(LOB)/HTUU$o \ + $(LOB)/HTDOS$o CFILES = $(CMN)HTParse.c $(CMN)HTAccess.c $(CMN)HTTP.c $(CMN)HTFile.c \ $(CMN)HTBTree.c \ @@ -149,9 +149,9 @@ all : $(LOB)/libwww.a lint: $(LINT) $(LINTOPTS) $(CPPOPTS) $(srcdir)/../Implementation/*.c > ../../../lint.libwww -.SUFFIXES: $(_O) .i .h .html +.SUFFIXES: $o .i .h .html -.c$(_O): +.c$o: @RULE_CC@ @ECHO_CC@$(CC) $(CPPOPTS) $(CFLAGS) -c $(srcdir)/$*.c @@ -173,135 +173,135 @@ $(LOB)/libwww.a : $(COMMON) # Clean up everything generatable except final products clean : rm -f core *.core *.leaks *.[oi] *.bak tags TAGS - rm -f $(LOB)/*$(_O) + rm -f $(LOB)/*$o # Common code # ----------- -$(LOB)/HTList$(_O) : $(OE) $(CMN)HTList.c $(CMN)HTUtils.h $(CMN)HTList.h +$(LOB)/HTList$o : $(OE) $(CMN)HTList.c $(CMN)HTUtils.h $(CMN)HTList.h $(COMPILE) $(CMN)HTList.c -$(LOB)/HTAnchor$(_O) : $(OE) $(CMN)HTAnchor.c $(CMN)HTUtils.h $(CMN)HTList.h +$(LOB)/HTAnchor$o : $(OE) $(CMN)HTAnchor.c $(CMN)HTUtils.h $(CMN)HTList.h $(COMPILE) $(CMN)HTAnchor.c -$(LOB)/HTFormat$(_O) : $(OE) $(CMN)HTFormat.c $(CMN)HTUtils.h $(CMN)HTList.h +$(LOB)/HTFormat$o : $(OE) $(CMN)HTFormat.c $(CMN)HTUtils.h $(CMN)HTList.h $(COMPILE) $(CMN)HTFormat.c -$(LOB)/HTMIME$(_O) : $(OE) $(CMN)HTMIME.c $(CMN)HTUtils.h $(CMN)HTList.h +$(LOB)/HTMIME$o : $(OE) $(CMN)HTMIME.c $(CMN)HTUtils.h $(CMN)HTList.h $(COMPILE) $(CMN)HTMIME.c -$(LOB)/HTNews$(_O) : $(OE) $(CMN)HTNews.c $(CMN)HTUtils.h $(CMN)HTList.h\ +$(LOB)/HTNews$o : $(OE) $(CMN)HTNews.c $(CMN)HTUtils.h $(CMN)HTList.h\ $(CMN)HTMLDTD.h $(COMPILE) $(CMN)HTNews.c -$(LOB)/HTGopher$(_O) : $(OE) $(CMN)HTGopher.c $(CMN)HTUtils.h $(CMN)HTList.h \ +$(LOB)/HTGopher$o : $(OE) $(CMN)HTGopher.c $(CMN)HTUtils.h $(CMN)HTList.h \ $(CMN)HTMLDTD.h $(COMPILE) $(CMN)HTGopher.c -$(LOB)/HTTelnet$(_O) : $(OE) $(CMN)HTTelnet.c $(CMN)HTUtils.h $(CMN)HTTelnet.h $(CMN)../../../userdefs.h +$(LOB)/HTTelnet$o : $(OE) $(CMN)HTTelnet.c $(CMN)HTUtils.h $(CMN)HTTelnet.h $(CMN)../../../userdefs.h $(COMPILE) $(CMN)HTTelnet.c -$(LOB)/HTFinger$(_O) : $(OE) $(CMN)HTFinger.c $(CMN)HTUtils.h $(CMN)HTList.h \ +$(LOB)/HTFinger$o : $(OE) $(CMN)HTFinger.c $(CMN)HTUtils.h $(CMN)HTList.h \ $(CMN)HTMLDTD.h $(COMPILE) $(CMN)HTFinger.c -$(LOB)/HTStyle$(_O) : $(OE) $(CMN)HTStyle.c $(CMN)HTUtils.h +$(LOB)/HTStyle$o : $(OE) $(CMN)HTStyle.c $(CMN)HTUtils.h $(COMPILE) $(CMN)HTStyle.c -$(LOB)/HTAtom$(_O) : $(OE) $(CMN)HTAtom.c $(CMN)HTUtils.h $(CMN)HTList.h +$(LOB)/HTAtom$o : $(OE) $(CMN)HTAtom.c $(CMN)HTUtils.h $(CMN)HTList.h $(COMPILE) $(CMN)HTAtom.c -$(LOB)/HTChunk$(_O) : $(OE) $(CMN)HTChunk.c $(CMN)HTUtils.h +$(LOB)/HTChunk$o : $(OE) $(CMN)HTChunk.c $(CMN)HTUtils.h $(COMPILE) $(CMN)HTChunk.c -$(LOB)/HTString$(_O) : $(OE) $(CMN)HTString.c $(CMN)HTUtils.h $(CMN)Version.make +$(LOB)/HTString$o : $(OE) $(CMN)HTString.c $(CMN)HTUtils.h $(CMN)Version.make $(COMPILE) -DVC=\"$(VC)\" $(CMN)HTString.c -$(LOB)/HTRules$(_O) : $(OE) $(CMN)HTRules.c $(CMN)HTUtils.h $(CMN)Version.make \ +$(LOB)/HTRules$o : $(OE) $(CMN)HTRules.c $(CMN)HTUtils.h $(CMN)Version.make \ $(CMN)HTAAProt.h $(COMPILE) -DVC=\"$(VC)\" $(CMN)HTRules.c -$(LOB)/SGML$(_O) : $(OE) $(CMN)SGML.c $(CMN)HTUtils.h $(CMN)UCAux.h +$(LOB)/SGML$o : $(OE) $(CMN)SGML.c $(CMN)HTUtils.h $(CMN)UCAux.h $(COMPILE) $(CMN)SGML.c -$(LOB)/HTMLGen$(_O) : $(OE) $(CMN)HTMLGen.c $(CMN)HTUtils.h $(CMN)HTMLDTD.h +$(LOB)/HTMLGen$o : $(OE) $(CMN)HTMLGen.c $(CMN)HTUtils.h $(CMN)HTMLDTD.h $(COMPILE) $(CMN)HTMLGen.c -$(LOB)/HTMLDTD$(_O) : $(OE) $(CMN)HTMLDTD.c $(CMN)SGML.h +$(LOB)/HTMLDTD$o : $(OE) $(CMN)HTMLDTD.c $(CMN)SGML.h $(COMPILE) $(CMN)HTMLDTD.c -$(LOB)/HTPlain$(_O) : $(OE) $(CMN)HTPlain.c $(CMN)HTPlain.h $(CMN)HTStream.h \ +$(LOB)/HTPlain$o : $(OE) $(CMN)HTPlain.c $(CMN)HTPlain.h $(CMN)HTStream.h \ $(CMN)UCAux.h $(COMPILE) $(CMN)HTPlain.c -$(LOB)/HTWAIS$(_O) : $(OE) $(CMN)HTWAIS.c $(CMN)HTUtils.h $(CMN)HTList.h +$(LOB)/HTWAIS$o : $(OE) $(CMN)HTWAIS.c $(CMN)HTUtils.h $(CMN)HTList.h $(COMPILE) $(WAISINC) $(CMN)HTWAIS.c -$(LOB)/HTWSRC$(_O) : $(OE) $(CMN)HTWSRC.c $(CMN)HTUtils.h $(CMN)HTList.h +$(LOB)/HTWSRC$o : $(OE) $(CMN)HTWSRC.c $(CMN)HTUtils.h $(CMN)HTList.h $(COMPILE) $(CMN)HTWSRC.c # Access Authorization -$(LOB)/HTAAUtil$(_O) : $(OE) $(CMN)HTAAUtil.c $(CMN)HTAAUtil.h \ +$(LOB)/HTAAUtil$o : $(OE) $(CMN)HTAAUtil.c $(CMN)HTAAUtil.h \ $(CMN)HTUtils.h $(CMN)HTString.h $(COMPILE) $(CMN)HTAAUtil.c -$(LOB)/HTGroup$(_O) : $(OE) $(CMN)HTGroup.c $(CMN)HTGroup.h \ +$(LOB)/HTGroup$o : $(OE) $(CMN)HTGroup.c $(CMN)HTGroup.h \ $(CMN)HTAAUtil.h \ $(CMN)HTAssoc.h $(CMN)HTLex.h $(COMPILE) $(CMN)HTGroup.c -$(LOB)/HTAABrow$(_O) : $(OE) $(CMN)HTAABrow.c $(CMN)HTAABrow.h \ +$(LOB)/HTAABrow$o : $(OE) $(CMN)HTAABrow.c $(CMN)HTAABrow.h \ $(CMN)HTAAUtil.h $(CMN)HTUU.h \ $(CMN)HTUtils.h $(CMN)HTString.h \ $(CMN)HTParse.h $(CMN)HTList.h \ $(CMN)HTAssoc.h $(COMPILE) $(CMN)HTAABrow.c -$(LOB)/HTAAProt$(_O) : $(OE) $(CMN)HTAAProt.c $(CMN)HTAAProt.h \ +$(LOB)/HTAAProt$o : $(OE) $(CMN)HTAAProt.c $(CMN)HTAAProt.h \ $(CMN)HTUtils.h $(CMN)HTAAUtil.h \ $(CMN)HTAssoc.h $(CMN)HTLex.h $(COMPILE) $(CMN)HTAAProt.c -$(LOB)/HTAssoc$(_O) : $(OE) $(CMN)HTAssoc.c $(CMN)HTAssoc.h \ +$(LOB)/HTAssoc$o : $(OE) $(CMN)HTAssoc.c $(CMN)HTAssoc.h \ $(CMN)HTUtils.h $(CMN)HTString.h $(CMN)HTList.h $(COMPILE) $(CMN)HTAssoc.c -$(LOB)/HTLex$(_O) : $(OE) $(CMN)HTLex.c $(CMN)HTLex.h $(CMN)HTUtils.h +$(LOB)/HTLex$o : $(OE) $(CMN)HTLex.c $(CMN)HTLex.h $(CMN)HTUtils.h $(COMPILE) $(CMN)HTLex.c -$(LOB)/HTUU$(_O) : $(OE) $(CMN)HTUU.c $(CMN)HTUU.h $(CMN)HTUtils.h +$(LOB)/HTUU$o : $(OE) $(CMN)HTUU.c $(CMN)HTUU.h $(CMN)HTUtils.h $(COMPILE) $(CMN)HTUU.c # Communications & Files -$(LOB)/HTTP$(_O) : $(OE) $(CMN)HTTP.c $(CMN)HTUtils.h $(CMN)HTAABrow.h +$(LOB)/HTTP$o : $(OE) $(CMN)HTTP.c $(CMN)HTUtils.h $(CMN)HTAABrow.h $(COMPILE) $(CMN)HTTP.c -$(LOB)/HTTCP$(_O) : $(OE) $(CMN)HTTCP.c $(CMN)HTUtils.h +$(LOB)/HTTCP$o : $(OE) $(CMN)HTTCP.c $(CMN)HTUtils.h $(COMPILE) $(CMN)HTTCP.c -$(LOB)/HTFile$(_O) : $(OE) $(CMN)HTFile.c $(CMN)HTUtils.h \ +$(LOB)/HTFile$o : $(OE) $(CMN)HTFile.c $(CMN)HTUtils.h \ $(CMN)HTMLDTD.h $(COMPILE) $(CMN)HTFile.c -$(LOB)/HTBTree$(_O) : $(OE) $(CMN)HTBTree.c $(CMN)HTUtils.h +$(LOB)/HTBTree$o : $(OE) $(CMN)HTBTree.c $(CMN)HTUtils.h $(COMPILE) $(CMN)HTBTree.c -$(LOB)/HTFTP$(_O) : $(OE) $(CMN)HTFTP.c $(CMN)HTUtils.h +$(LOB)/HTFTP$o : $(OE) $(CMN)HTFTP.c $(CMN)HTUtils.h $(COMPILE) $(CMN)HTFTP.c -$(LOB)/HTAccess$(_O) : $(OE) $(CMN)HTAccess.c $(CMN)HTUtils.h +$(LOB)/HTAccess$o : $(OE) $(CMN)HTAccess.c $(CMN)HTUtils.h $(COMPILE) $(CMN)HTAccess.c -$(LOB)/HTParse$(_O) : $(OE) $(CMN)HTParse.c $(CMN)HTUtils.h +$(LOB)/HTParse$o : $(OE) $(CMN)HTParse.c $(CMN)HTUtils.h $(COMPILE) $(CMN)HTParse.c -$(LOB)/HTVMS_WaisUI$(_O) : $(OE) $(CMN)HTVMS_WaisUI.c $(CMN)HTUtils.h +$(LOB)/HTVMS_WaisUI$o : $(OE) $(CMN)HTVMS_WaisUI.c $(CMN)HTUtils.h $(COMPILE) $(CMN)HTVMS_WaisUI.c -$(LOB)/HTDOS$(_O) : $(OE) $(CMN)HTDOS.c $(CMN)HTUtils.h +$(LOB)/HTDOS$o : $(OE) $(CMN)HTDOS.c $(CMN)HTUtils.h $(COMPILE) $(CMN)HTDOS.c # DO NOT DELETE THIS LINE -- make depend depends on it. |