diff options
Diffstat (limited to 'WWW/Library')
23 files changed, 226 insertions, 234 deletions
diff --git a/WWW/Library/Implementation/HTAABrow.c b/WWW/Library/Implementation/HTAABrow.c index bbb8794e..4208bfea 100644 --- a/WWW/Library/Implementation/HTAABrow.c +++ b/WWW/Library/Implementation/HTAABrow.c @@ -1168,7 +1168,7 @@ PUBLIC BOOL HTAA_shouldRetryWithAuth ARGS4( */ HTAASetup_updateSpecifics(proxy_setup, scheme_specifics); - if (NO == HTConfirm(gettext("Authorization failed. Retry?"))) { + if (NO == HTConfirm(AUTH_FAILED_PROMPT)) { proxy_setup = NULL; return NO; } else { @@ -1227,7 +1227,7 @@ PUBLIC BOOL HTAA_shouldRetryWithAuth ARGS4( */ HTAASetup_updateSpecifics(current_setup, scheme_specifics); - if (NO == HTConfirm(gettext("Authorization failed. Retry?"))) { + if (NO == HTConfirm(AUTH_FAILED_PROMPT)) { current_setup = NULL; return NO; } else { diff --git a/WWW/Library/Implementation/HTAAProt.c b/WWW/Library/Implementation/HTAAProt.c index 0ad16671..9112b856 100644 --- a/WWW/Library/Implementation/HTAAProt.c +++ b/WWW/Library/Implementation/HTAAProt.c @@ -300,8 +300,7 @@ PRIVATE void HTAA_parseProtFile ARGS2(HTAAProt *, prot, fprintf(tfp, "HTAA_parseProtFile: Mask group:\n"); HTAA_printGroupDef(prot->mask_group); - } else fprintf(tfp, "HTAA_parseProtFile: %s\n", - gettext("Mask group syntax error")); + } else fprintf(tfp, "HTAA_parseProtFile: Mask group syntax error\n"); } } /* if "Mask" */ @@ -609,6 +608,7 @@ PRIVATE void save_uid_info ARGS2(char *, name, int, user) */ PUBLIC char * HTAA_UidToName ARGS1(int, uid) { +#ifndef NOUSERS struct passwd *pw; HTList *me = known_pwd; @@ -627,6 +627,7 @@ PUBLIC char * HTAA_UidToName ARGS1(int, uid) save_uid_info(pw->pw_name, pw->pw_uid); return pw->pw_name; } +#endif return ""; } @@ -640,6 +641,7 @@ PUBLIC char * HTAA_UidToName ARGS1(int, uid) */ PUBLIC int HTAA_NameToUid ARGS1(char *, name) { +#ifndef NOUSERS struct passwd *pw; HTList *me = known_pwd; @@ -657,6 +659,7 @@ PUBLIC int HTAA_NameToUid ARGS1(char *, name) save_uid_info(pw->pw_name, pw->pw_uid); return pw->pw_uid; } +#endif return NONESUCH; } @@ -670,6 +673,7 @@ PUBLIC int HTAA_NameToUid ARGS1(char *, name) */ PUBLIC char * HTAA_GidToName ARGS1(int, gid) { +#ifndef NOUSERS struct group *gr; HTList *me = known_grp; @@ -688,6 +692,7 @@ PUBLIC char * HTAA_GidToName ARGS1(int, gid) save_gid_info(gr->gr_name, gr->gr_gid); return gr->gr_name; } +#endif return ""; } @@ -701,6 +706,7 @@ PUBLIC char * HTAA_GidToName ARGS1(int, gid) */ PUBLIC int HTAA_NameToGid ARGS1(char *, name) { +#ifndef NOUSERS struct group *gr; HTList *me = known_grp; @@ -718,5 +724,6 @@ PUBLIC int HTAA_NameToGid ARGS1(char *, name) save_gid_info(gr->gr_name, gr->gr_gid); return gr->gr_gid; } +#endif return NONESUCH; } diff --git a/WWW/Library/Implementation/HTAnchor.c b/WWW/Library/Implementation/HTAnchor.c index a141213c..3e0c4375 100644 --- a/WWW/Library/Implementation/HTAnchor.c +++ b/WWW/Library/Implementation/HTAnchor.c @@ -302,6 +302,7 @@ PRIVATE void free_adult_table NOARGS adult_table[i_counter] = HTAp_freeme->next; if (HTAp_freeme->object) { parent = (HTParentAnchor *)HTAp_freeme->object; + parent->underway = FALSE; HTAnchor_delete(parent); } FREE(HTAp_freeme); @@ -447,6 +448,14 @@ PRIVATE void deleteLinks ARGS1( HTParentAnchor *parent = me->mainLink.dest->parent; /* + * Set the mainLink pointer to zero NOW. If we don't, + * and we get somehow called recursively again for this + * same old me during the HTAnchor_delete below, weird + * things can occasionally happen. - kw + */ + me->mainLink.dest = NULL; + + /* * Remove me from the parent's sources so that the * parent knows one less anchor is it's dest. */ @@ -478,7 +487,6 @@ PRIVATE void deleteLinks ARGS1( * Leave the HTAtom pointed to by type up to other code to * handle (reusable, near static). */ - me->mainLink.dest = NULL; me->mainLink.type = NULL; } @@ -571,6 +579,12 @@ PUBLIC BOOL HTAnchor_delete ARGS1( } /* + * Mark ourselves busy, so that recursive calls of this function + * on this HTParentAnchor will not free it from under our feet. - kw + */ + me->underway = TRUE; + + /* * Recursively try to delete destination anchors of this parent. * In any event, this will tell all destination anchors that we * no longer consider them a destination. @@ -596,6 +610,7 @@ PUBLIC BOOL HTAnchor_delete ARGS1( } } } + me->underway = FALSE; /* * Can't delete parent, still have sources. @@ -619,6 +634,7 @@ PUBLIC BOOL HTAnchor_delete ARGS1( } } } + me->underway = FALSE; /* * Delete our empty list of children. diff --git a/WWW/Library/Implementation/HTChunk.h b/WWW/Library/Implementation/HTChunk.h index 2afcdd9d..6818acec 100644 --- a/WWW/Library/Implementation/HTChunk.h +++ b/WWW/Library/Implementation/HTChunk.h @@ -1,11 +1,11 @@ -/* HTChunk: Flexible array handling for libwww - CHUNK HANDLING: - FLEXIBLE ARRAYS - - This module implements a flexible array. It is a general utility module. A chunk is a - structure which may be extended. These routines create and append data to chunks, - automatically reallocating them as necessary. - +/* HTChunk: Flexible array handling for libwww + * CHUNK HANDLING: + * FLEXIBLE ARRAYS + * + * This module implements a flexible array. It is a general utility module. A + * chunk is a structure which may be extended. These routines create and + * append data to chunks, automatically reallocating them as necessary. + * */ #ifndef HTCHUNK_H #define HTCHUNK_H 1 @@ -14,37 +14,37 @@ #include <UCMap.h> typedef struct { - int size; /* In bytes */ - int growby; /* Allocation unit in bytes */ - int allocated; /* Current size of *data */ - char * data; /* Pointer to malloced area or 0 */ + int size; /* In bytes */ + int growby; /* Allocation unit in bytes */ + int allocated; /* Current size of *data */ + char * data; /* Pointer to malloced area or 0 */ } HTChunk; #ifdef SHORT_NAMES -#define HTChunkClear HTChClea -#define HTChunkPutc HTChPutc -#define HTChunkPuts HTChPuts -#define HTChunkCreate HTChCrea -#define HTChunkTerminate HTChTerm -#define HTChunkEnsure HtChEnsu +#define HTChunkClear HTChClea +#define HTChunkPutc HTChPutc +#define HTChunkPuts HTChPuts +#define HTChunkCreate HTChCrea +#define HTChunkTerminate HTChTerm +#define HTChunkEnsure HtChEnsu #endif /* - -Create new chunk - - ON ENTRY, - - growby The number of bytes to allocate at a time when the chunk is - later extended. Arbitrary but normally a trade-off time vs. - memory - - ON EXIT, - - returns A chunk pointer to the new chunk, - + * + * Create new chunk + * + * ON ENTRY, + * + * growby The number of bytes to allocate at a time when the chunk + * is later extended. Arbitrary but normally a trade-off + * of time vs memory. + * + * ON EXIT, + * + * returns A chunk pointer to the new chunk, + * */ extern HTChunk * HTChunkCreate PARAMS((int growby)); @@ -57,72 +57,72 @@ extern HTChunk * HTChunkCreate2 PARAMS((int growby, size_t needed)); /* - -Free a chunk - - ON ENTRY, - - ch A valid chunk pointer made by HTChunkCreate() - - ON EXIT, - - ch is invalid and may not be used. - + * + * Free a chunk + * + * ON ENTRY, + * + * ch A valid chunk pointer made by HTChunkCreate() + * + * ON EXIT, + * + * ch is invalid and may not be used. + * */ extern void HTChunkFree PARAMS((HTChunk * ch)); /* - -Clear a chunk - - ON ENTRY, - - ch A valid chunk pointer made by HTChunkCreate() - - ON EXIT, - - *ch The size of the chunk is zero. - + * + * Clear a chunk + * + * ON ENTRY, + * + * ch A valid chunk pointer made by HTChunkCreate() + * + * ON EXIT, + * + * *ch The size of the chunk is zero. + * */ extern void HTChunkClear PARAMS((HTChunk * ch)); /* - -Ensure a chunk has a certain space in - - ON ENTRY, - - ch A valid chunk pointer made by HTChunkCreate() - - s The size required - - ON EXIT, - - *ch Has size at least s - + * + * Ensure a chunk has a certain space in + * + * ON ENTRY, + * + * ch A valid chunk pointer made by HTChunkCreate() + * + * s The size required + * + * ON EXIT, + * + * *ch Has size at least s + * */ extern void HTChunkEnsure PARAMS((HTChunk * ch, int s)); /* - -Append a character to a chunk - - ON ENTRY, - - ch A valid chunk pointer made by HTChunkCreate() - - c The character to be appended - - ON EXIT, - - *ch Is one character bigger - + * + * Append a character to a chunk + * + * ON ENTRY, + * + * ch A valid chunk pointer made by HTChunkCreate() + * + * c The character to be appended + * + * ON EXIT, + * + * *ch Is one character bigger + * */ extern void HTChunkPutc PARAMS((HTChunk * ch, char c)); @@ -131,40 +131,40 @@ extern void HTChunkPutb PARAMS((HTChunk * ch, CONST char *b, int l)); extern void HTChunkPutUtf8Char PARAMS((HTChunk * ch, UCode_t code)); /* -Append a string to a chunk - - ON ENTRY, - - ch A valid chunk pointer made by HTChunkCreate() - - str Tpoints to a zero-terminated string to be appended - - ON EXIT, - - *ch Is bigger by strlen(str) - + * Append a string to a chunk + * + * ON ENTRY, + * + * ch A valid chunk pointer made by HTChunkCreate() + * + * str Tpoints to a zero-terminated string to be appended + * + * ON EXIT, + * + * *ch Is bigger by strlen(str) + * */ -extern void HTChunkPuts PARAMS((HTChunk * ch, const char *str)); +extern void HTChunkPuts PARAMS((HTChunk * ch, CONST char *str)); /* - -Append a zero character to a chunk - + * + * Append a zero character to a chunk + * */ /* - - ON ENTRY, - - ch A valid chunk pointer made by HTChunkCreate() - - ON EXIT, - - *ch Is one character bigger - + * + * ON ENTRY, + * + * ch A valid chunk pointer made by HTChunkCreate() + * + * ON EXIT, + * + * *ch Is one character bigger + * */ diff --git a/WWW/Library/Implementation/HTFTP.c b/WWW/Library/Implementation/HTFTP.c index 5b405b5b..179de6fd 100644 --- a/WWW/Library/Implementation/HTFTP.c +++ b/WWW/Library/Implementation/HTFTP.c @@ -701,7 +701,7 @@ PRIVATE int get_connection ARGS2( arg); } if (status == HT_INTERRUPTED) { - _HTProgress (gettext("Connection interrupted.")); + _HTProgress (CONNECTION_INTERRUPTED); status = HT_NOT_LOADED; } else { HTAlert(gettext("Unable to connect to FTP host.")); @@ -733,7 +733,7 @@ PRIVATE int get_connection ARGS2( if (status == HT_INTERRUPTED) { CTRACE (tfp, "HTFTP: Interrupted at beginning of login.\n"); - _HTProgress (gettext("Connection interrupted.")); + _HTProgress (CONNECTION_INTERRUPTED); NETCLOSE(control->socket); control->socket = -1; return HT_INTERRUPTED; @@ -771,7 +771,7 @@ PRIVATE int get_connection ARGS2( FREE(command); if (status == HT_INTERRUPTED) { CTRACE (tfp, "HTFTP: Interrupted while sending username.\n"); - _HTProgress (gettext("Connection interrupted.")); + _HTProgress (CONNECTION_INTERRUPTED); NETCLOSE(control->socket); control->socket = -1; return HT_INTERRUPTED; @@ -835,7 +835,7 @@ PRIVATE int get_connection ARGS2( if (status == HT_INTERRUPTED) { CTRACE (tfp, "HTFTP: Interrupted while sending password.\n"); - _HTProgress (gettext("Connection interrupted.")); + _HTProgress (CONNECTION_INTERRUPTED); NETCLOSE(control->socket); control->socket = -1; return HT_INTERRUPTED; @@ -849,7 +849,7 @@ PRIVATE int get_connection ARGS2( status = response(temp); if (status == HT_INTERRUPTED) { CTRACE (tfp, "HTFTP: Interrupted while sending password.\n"); - _HTProgress (gettext("Connection interrupted.")); + _HTProgress (CONNECTION_INTERRUPTED); NETCLOSE(control->socket); control->socket = -1; return HT_INTERRUPTED; @@ -2531,7 +2531,7 @@ unload_btree: if (WasInterrupted || HTCheckForInterrupt()) { if (server_type != CMS_SERVER) response(NIL); - _HTProgress(gettext("Data transfer interrupted.")); + _HTProgress(TRANSFER_INTERRUPTED); return HT_LOADED; } if (server_type != CMS_SERVER) @@ -2594,7 +2594,7 @@ PUBLIC int HTFTPLoad ARGS4( status = response(port_command); if (status == HT_INTERRUPTED) { CTRACE (tfp, "HTFTP: Interrupted in response (port_command)\n"); - _HTProgress (gettext("Connection interrupted.")); + _HTProgress (CONNECTION_INTERRUPTED); NETCLOSE (control->socket); control->socket = -1; close_master_socket (); @@ -3231,7 +3231,7 @@ listen: rv = HTParseSocket(format, format_out, anchor, data_soc, sink); if (rv == HT_INTERRUPTED) - _HTProgress(gettext("Data transfer interrupted.")); + _HTProgress(TRANSFER_INTERRUPTED); HTInitInput(control->socket); /* Reset buffering to control connection DD 921208 */ diff --git a/WWW/Library/Implementation/HTFWriter.c b/WWW/Library/Implementation/HTFWriter.c index 5ce2bfab..6e4f8e42 100644 --- a/WWW/Library/Implementation/HTFWriter.c +++ b/WWW/Library/Implementation/HTFWriter.c @@ -238,7 +238,7 @@ PUBLIC HTStream* HTSaveAndExecute ARGS3( HTStream* me; if (HTClientHost) { - HTAlert(gettext("Can't save data to file -- please run WWW locally")); + HTAlert(CANNOT_SAVE_REMOTE); return HTBlackHole(); } @@ -256,7 +256,7 @@ PUBLIC HTStream* HTSaveAndExecute ARGS3( me->fp = fopen (fnam, "w"); if (!me->fp) { - HTAlert(gettext("Can't open temporary file!")); + HTAlert(CANNOT_OPEN_TEMP); FREE(fnam); FREE(me); return NULL; @@ -313,7 +313,7 @@ PUBLIC HTStream* HTSaveLocally ARGS3( HTStream* me; if (HTClientHost) { - HTAlert(gettext("Can't save data to file -- please run WWW locally")); + HTAlert(CANNOT_SAVE_REMOTE); return HTBlackHole(); } @@ -333,13 +333,13 @@ PUBLIC HTStream* HTSaveLocally ARGS3( if (suffix) strcat(fnam, suffix); /* Save Panel */ - answer = HTPrompt(gettext("Give name of file to save in", fnam)); + answer = HTPrompt(GIVE_FILENAME, fnam); FREE(fnam); me->fp = fopen (answer, "w"); if (!me->fp) { - HTAlert(gettext("Can't open local file to write into.")); + HTAlert(CANNOT_OPEN_OUTPUT); FREE(answer); FREE(me); return NULL; diff --git a/WWW/Library/Implementation/HTFile.c b/WWW/Library/Implementation/HTFile.c index a4f35b1a..4dd8960a 100644 --- a/WWW/Library/Implementation/HTFile.c +++ b/WWW/Library/Implementation/HTFile.c @@ -178,6 +178,13 @@ PRIVATE void LYListFmtParse ARGS5( "r-S", "r-s", "rwS", "rws", 0 }; #define PBIT(a, n, s) (s) ? psbits[((a) >> (n)) & 0x7] : \ pbits[((a) >> (n)) & 0x7] +#ifdef S_ISVTX + static char *ptbits[] = { "--T", "--t", "-wT", "-wt", + "r-T", "r-t", "rwT", "rwt", 0 }; +#define PTBIT(a, s) (s) ? ptbits[(a) & 0x7] : pbits[(a) & 0x7] +#else +#define PTBIT(a, s) (a, 0, 0) +#endif if (lstat(file, &st) < 0) fmtstr = "%a"; /* can't stat so just do anchor */ @@ -294,7 +301,7 @@ PRIVATE void LYListFmtParse ARGS5( sprintf(buf, "%c%s%s%s", type, PBIT(st.st_mode, 6, st.st_mode & S_ISUID), PBIT(st.st_mode, 3, st.st_mode & S_ISGID), - PBIT(st.st_mode, 0, 0)); + PTBIT(st.st_mode, st.st_mode & S_ISVTX)); sprintf(fmt, "%%%ss", start); sprintf(buf, fmt, buf); break; diff --git a/WWW/Library/Implementation/HTFile.h b/WWW/Library/Implementation/HTFile.h index 9c7686f1..a88b1285 100644 --- a/WWW/Library/Implementation/HTFile.h +++ b/WWW/Library/Implementation/HTFile.h @@ -50,7 +50,7 @@ extern char * HTnameOfFile_WWW PARAMS((CONST char * name, BOOL WWW_prefix, BOOL /* ** Make a WWW name from a full local path name */ -extern char * WWW_nameOfFile PARAMS((const char * name)); +extern char * WWW_nameOfFile PARAMS((CONST char * name)); /* ** Generate the name of a cache file diff --git a/WWW/Library/Implementation/HTFinger.c b/WWW/Library/Implementation/HTFinger.c index f7cc893d..5485e0af 100644 --- a/WWW/Library/Implementation/HTFinger.c +++ b/WWW/Library/Implementation/HTFinger.c @@ -183,7 +183,7 @@ PRIVATE int response ARGS5( if (interrupted_in_htgetcharacter) { CTRACE(tfp, "HTFinger: Interrupted in HTGetCharacter, apparently.\n"); - _HTProgress (gettext("Connection interrupted.")); + _HTProgress (CONNECTION_INTERRUPTED); goto end_html; } @@ -385,7 +385,7 @@ PUBLIC int HTLoadFinger ARGS4( if (status == HT_INTERRUPTED) { /* Interrupt cleanly */ CTRACE(tfp, "HTFinger: Interrupted on connect; recovering cleanly.\n"); - HTProgress (gettext("Connection interrupted.")); + HTProgress (CONNECTION_INTERRUPTED); FREE(str); FREE(command); return HT_NOT_LOADED; diff --git a/WWW/Library/Implementation/HTFormat.c b/WWW/Library/Implementation/HTFormat.c index bdad295d..46892a98 100644 --- a/WWW/Library/Implementation/HTFormat.c +++ b/WWW/Library/Implementation/HTFormat.c @@ -561,7 +561,7 @@ PUBLIC int HTCopy ARGS4( } if (HTCheckForInterrupt()) { - _HTProgress (gettext("Data transfer interrupted.")); + _HTProgress (TRANSFER_INTERRUPTED); (*targetClass._abort)(sink, NULL); if (bytes) rv = HT_INTERRUPTED; @@ -576,7 +576,7 @@ PUBLIC int HTCopy ARGS4( if (status == 0) { break; } else if (status == HT_INTERRUPTED) { - _HTProgress (gettext("Data transfer interrupted.")); + _HTProgress (TRANSFER_INTERRUPTED); (*targetClass._abort)(sink, NULL); if (bytes) rv = HT_INTERRUPTED; @@ -680,7 +680,7 @@ PUBLIC int HTFileCopy ARGS2( HTDisplayPartial(); if (HTCheckForInterrupt()) { - _HTProgress (gettext("Data transfer interrupted.")); + _HTProgress (TRANSFER_INTERRUPTED); if (bytes) { rv = HT_INTERRUPTED; } else { @@ -747,7 +747,7 @@ PRIVATE int HTGzFileCopy ARGS2( HTDisplayPartial(); if (HTCheckForInterrupt()) { - _HTProgress (gettext("Data transfer interrupted.")); + _HTProgress (TRANSFER_INTERRUPTED); if (bytes) { rv = HT_INTERRUPTED; } else { diff --git a/WWW/Library/Implementation/HTGopher.c b/WWW/Library/Implementation/HTGopher.c index 9066dafc..ba239db4 100644 --- a/WWW/Library/Implementation/HTGopher.c +++ b/WWW/Library/Implementation/HTGopher.c @@ -1240,7 +1240,7 @@ PRIVATE int generate_cso_report ARGS2( if (interrupted_in_htgetcharacter) { buf[0] = '\0'; CTRACE(tfp, "HTLoadCSO: Interrupted in HTGetCharacter, apparently.\n"); - _HTProgress (gettext("Connection interrupted.")); + _HTProgress (CONNECTION_INTERRUPTED); goto end_CSOreport; } @@ -1492,7 +1492,7 @@ PRIVATE int HTLoadCSO ARGS4( ** Interrupt cleanly. */ CTRACE(tfp, "HTLoadCSO: Interrupted on connect; recovering cleanly.\n"); - _HTProgress (gettext("Connection interrupted.")); + _HTProgress (CONNECTION_INTERRUPTED); return HT_NOT_LOADED; } if (status < 0) { @@ -1524,7 +1524,7 @@ PRIVATE int HTLoadCSO ARGS4( if (status) { NETCLOSE(s); if (status == HT_INTERRUPTED) { - _HTProgress (gettext("Connection interrupted.")); + _HTProgress (CONNECTION_INTERRUPTED); } else if (buf[0] != '\0') { HTAlert(buf); } else { @@ -1540,7 +1540,7 @@ PRIVATE int HTLoadCSO ARGS4( if (!temp) { outofmem(__FILE__, "HTLoadCSO"); } - sprintf(temp, gettext("Sorry, no known way of converting %s to %s."), + sprintf(temp, CANNOT_CONVERT_I_TO_O, HTAtom_name(format_in), HTAtom_name(format_out)); HTAlert(temp); FREE(temp); @@ -1853,7 +1853,7 @@ PRIVATE int HTLoadGopher ARGS4( ** Interrupt cleanly. */ CTRACE(tfp, "HTGopher: Interrupted on connect; recovering cleanly.\n"); - _HTProgress (gettext("Connection interrupted.")); + _HTProgress (CONNECTION_INTERRUPTED); FREE(command); return HT_NOT_LOADED; } diff --git a/WWW/Library/Implementation/HTMIME.c b/WWW/Library/Implementation/HTMIME.c index a7417f78..81226f66 100644 --- a/WWW/Library/Implementation/HTMIME.c +++ b/WWW/Library/Implementation/HTMIME.c @@ -2112,7 +2112,7 @@ PUBLIC int main ARGS2( fp = stdin; } else { if ((fp = fopen(av[i], "r")) == NULL) { - fprintf(stderr, gettext("%s: cannot open %s\n"), av[0], av[i]); + fprintf(stderr, "%s: cannot open %s\n", av[0], av[i]); exit(1); } } diff --git a/WWW/Library/Implementation/HTNews.c b/WWW/Library/Implementation/HTNews.c index d9185caf..ed14d41f 100644 --- a/WWW/Library/Implementation/HTNews.c +++ b/WWW/Library/Implementation/HTNews.c @@ -358,7 +358,7 @@ PRIVATE NNTPAuthResult HTHandleAuthInfo ARGS1( sprintf(buffer, "AUTHINFO USER %.*s%c%c", 495, UserName, CR, LF); if ((status = response(buffer)) < 0) { if (status == HT_INTERRUPTED) - _HTProgress(gettext("Connection interrupted.")); + _HTProgress(CONNECTION_INTERRUPTED); else HTAlert(gettext("Connection closed ???")); if (auth) { @@ -442,7 +442,7 @@ PRIVATE NNTPAuthResult HTHandleAuthInfo ARGS1( sprintf(buffer, "AUTHINFO PASS %.*s%c%c", 495, PassWord, CR, LF); if ((status = response(buffer)) < 0) { if (status == HT_INTERRUPTED) { - _HTProgress(gettext("Connection interrupted.")); + _HTProgress(CONNECTION_INTERRUPTED); } else { HTAlert(gettext("Connection closed ???")); } @@ -2039,7 +2039,7 @@ PRIVATE int HTLoadNews ARGS4( p1++; } if (!(p1 && *p1)) { - HTAlert(gettext("Invalid URL!")); + HTAlert(WWW_ILLEGAL_URL_MESSAGE); return(HT_NO_DATA); } if (!(cp = HTParse(arg, "", PARSE_HOST)) || *cp == '\0') { @@ -2335,7 +2335,7 @@ PRIVATE int HTLoadNews ARGS4( ** Interrupt cleanly. */ CTRACE(tfp, "HTNews: Interrupted on connect; recovering cleanly.\n"); - _HTProgress(gettext("Connection interrupted.")); + _HTProgress(CONNECTION_INTERRUPTED); if (!(post_wanted || reply_wanted || spost_wanted || sreply_wanted)) { ABORT_TARGET; @@ -2383,7 +2383,7 @@ PRIVATE int HTLoadNews ARGS4( NEWS_NETCLOSE(s); s = -1; if (status == HT_INTERRUPTED) { - _HTProgress(gettext("Connection interrupted.")); + _HTProgress(CONNECTION_INTERRUPTED); if (!(post_wanted || reply_wanted || spost_wanted || sreply_wanted)) { ABORT_TARGET; @@ -2412,7 +2412,7 @@ PRIVATE int HTLoadNews ARGS4( HTCanPost = FALSE; if (post_wanted || reply_wanted || spost_wanted || sreply_wanted) { - HTAlert(gettext("Cannot POST to this host.")); + HTAlert(CANNOT_POST); FREE(NewsHREF); if (ProxyHREF) { StrAllocCopy(NewsHost, ProxyHost); @@ -2433,7 +2433,7 @@ PRIVATE int HTLoadNews ARGS4( if (post_wanted || reply_wanted || spost_wanted || sreply_wanted) { if (!HTCanPost) { - HTAlert(gettext("Cannot POST to this host.")); + HTAlert(CANNOT_POST); FREE(NewsHREF); if (ProxyHREF) { StrAllocCopy(NewsHost, ProxyHost); @@ -2451,7 +2451,7 @@ PRIVATE int HTLoadNews ARGS4( postfile = LYNewsPost(ListArg, (reply_wanted || sreply_wanted)); } if (postfile == NULL) { - HTProgress(gettext("Cancelled!")); + HTProgress(CANCELLED); FREE(NewsHREF); if (ProxyHREF) { StrAllocCopy(NewsHost, ProxyHost); @@ -2473,7 +2473,7 @@ PRIVATE int HTLoadNews ARGS4( sprintf(buffer, "mode reader%c%c", CR, LF); if ((status = response(buffer)) == HT_INTERRUPTED) { - _HTProgress(gettext("Connection interrupted.")); + _HTProgress(CONNECTION_INTERRUPTED); break; } if (status == 480) { @@ -2488,7 +2488,7 @@ PRIVATE int HTLoadNews ARGS4( break; } if ((status = response(buffer)) == HT_INTERRUPTED) { - _HTProgress(gettext("Connection interrupted.")); + _HTProgress(CONNECTION_INTERRUPTED); break; } } @@ -2496,7 +2496,7 @@ PRIVATE int HTLoadNews ARGS4( Send_NNTP_command: if ((status = response(command)) == HT_INTERRUPTED) { - _HTProgress(gettext("Connection interrupted.")); + _HTProgress(CONNECTION_INTERRUPTED); break; } if (status < 0) { @@ -2585,7 +2585,7 @@ Send_NNTP_command: ** Handle posting of an article. - FM */ if (status != 340) { - HTAlert(gettext("Cannot POST to this host.")); + HTAlert(CANNOT_POST); if (postfile) { HTSYS_remove(postfile); } @@ -2630,7 +2630,7 @@ Send_NNTP_command: status = read_article(); } if (status == HT_INTERRUPTED) { - _HTProgress(gettext("Connection interrupted.")); + _HTProgress(CONNECTION_INTERRUPTED); status = HT_LOADED; } if (!(post_wanted || reply_wanted || diff --git a/WWW/Library/Implementation/HTRules.c b/WWW/Library/Implementation/HTRules.c index c8f48c33..29235921 100644 --- a/WWW/Library/Implementation/HTRules.c +++ b/WWW/Library/Implementation/HTRules.c @@ -67,14 +67,10 @@ PRIVATE rule * rule_tail = 0; /* Pointer to last on list */ ** returns 0 if success, -1 if error. */ -#ifdef __STDC__ -PUBLIC int HTAddRule (HTRuleOp op, const char * pattern, const char * equiv) -#else -int HTAddRule(op, pattern, equiv) - HTRuleOp op; - char * pattern; - char * equiv; -#endif +PUBLIC int HTAddRule ARGS3( + HTRuleOp, op, + CONST char *, pattern, + CONST char *, equiv) { /* BYTE_ADDRESSING removed and memory check - AS - 1 Sep 93 */ rule * temp; char * pPattern; @@ -129,11 +125,7 @@ int HTAddRule(op, pattern, equiv) ** See also ** HTAddRule() */ -#ifdef __STDC__ -int HTClearRules(void) -#else -int HTClearRules() -#endif +int HTClearRules NOARGS { while (rules) { rule * temp = rules; @@ -169,12 +161,8 @@ int HTClearRules() ** protected, and so it knows how to handle it. ** -- AL */ -#ifdef __STDC__ -char * HTTranslate(const char * required) -#else -char * HTTranslate(required) - char * required; -#endif +char * HTTranslate ARGS1( + CONST char *, required) { rule * r; char *current = NULL; @@ -299,7 +287,8 @@ char * HTTranslate(required) ** ** returns 0 OK, < 0 syntax error. */ -PUBLIC int HTSetConfiguration ARGS1(CONST char *, config) +PUBLIC int HTSetConfiguration ARGS1( + CONST char *, config) { HTRuleOp op; char * line = NULL; @@ -392,7 +381,8 @@ PUBLIC int HTSetConfiguration ARGS1(CONST char *, config) ** The strings may not contain spaces. */ -int HTLoadRules ARGS1(CONST char *, filename) +int HTLoadRules ARGS1( + CONST char *, filename) { FILE * fp = fopen(filename, "r"); char line[LINE_LENGTH+1]; diff --git a/WWW/Library/Implementation/HTRules.h b/WWW/Library/Implementation/HTRules.h index 3eb37169..2bbe6def 100644 --- a/WWW/Library/Implementation/HTRules.h +++ b/WWW/Library/Implementation/HTRules.h @@ -1,17 +1,19 @@ -/* Configuration Manager for libwww - CONFIGURATION MANAGER - - Author Tim Berners-Lee/CERN. Public domain. Please mail changes to timbl@info.cern.ch. - - The configuration information loaded includes tables (file suffixes, presentation - methods) in other modules. The most likely routines needed by developers will be: - - HTSetConfiguration to load configuration information. - - HTLoadRules to load a whole file of configuration information - - HTTranslate to translate a URL using the rule table. - +/* Configuration Manager for libwww + * CONFIGURATION MANAGER + * + * Author Tim Berners-Lee/CERN. Public domain. Please mail changes to + * timbl@info.cern.ch. + * + * The configuration information loaded includes tables (file suffixes, + * presentation methods) in other modules. The most likely routines needed by + * developers will be: + * + * HTSetConfiguration to load configuration information. + * + * HTLoadRules to load a whole file of configuration information + * + * HTTranslate to translate a URL using the rule table. + * */ #ifndef HTRULE_H #define HTRULE_H @@ -66,7 +68,7 @@ HTAddRule: Add rule to the list large. */ -extern int HTAddRule PARAMS((HTRuleOp op, const char * pattern, const char * equiv)); +extern int HTAddRule PARAMS((HTRuleOp op, CONST char * pattern, CONST char * equiv)); /* @@ -82,12 +84,7 @@ HTClearRules: Clear all rules */ -#ifdef __STDC__ -extern int HTClearRules(void); -#else -extern int HTClearRules(); -#endif - +extern int HTClearRules PARAMS((void)); /* @@ -108,12 +105,7 @@ HTTranslate: Translate by rules a copy of the original. */ -#ifdef __STDC__ -extern char * HTTranslate(const char * required); -#else -extern char * HTTranslate(); -#endif - +extern char * HTTranslate PARAMS((CONST char * required)); /* @@ -147,17 +139,10 @@ HtLoadRules: Load the rules from a file */ -#ifdef __STDC__ -extern int HTLoadRules(const char * filename); -#else -extern int HTLoadRules(); -#endif +extern int HTLoadRules PARAMS((CONST char * filename)); /* */ #endif /* HTUtils.h */ -/* - - end */ diff --git a/WWW/Library/Implementation/HTString.c b/WWW/Library/Implementation/HTString.c index d8698633..b5ed973a 100644 --- a/WWW/Library/Implementation/HTString.c +++ b/WWW/Library/Implementation/HTString.c @@ -233,8 +233,8 @@ PUBLIC char * HTNextField ARGS1( */ PUBLIC char * HTNextTok ARGS4( char **, pstr, - const char *, delims, - const char *, bracks, + CONST char *, delims, + CONST char *, bracks, char *, found) { char * p = *pstr; diff --git a/WWW/Library/Implementation/HTTCP.c b/WWW/Library/Implementation/HTTCP.c index 6abde5f5..1f201aea 100644 --- a/WWW/Library/Implementation/HTTCP.c +++ b/WWW/Library/Implementation/HTTCP.c @@ -454,7 +454,6 @@ PUBLIC int HTParseInet ARGS2( struct timeval timeout; int dns_patience = 30; /* how many seconds will we wait for DNS? */ int child_exited = 0; - int ok_to_select_stdin = -1; /* ** Reap any children that have terminated since last time @@ -539,16 +538,7 @@ PUBLIC int HTParseInet ARGS2( ** selectable! /dev/null isn't, on some systems, which ** makes some useful Lynx invocations fail. -BL */ - if (ok_to_select_stdin == -1) { - timeout.tv_sec = 0; - timeout.tv_usec = 0; - FD_SET(0, &readfds); /* stdin -BL */ - selret = select(1, &readfds, NULL, NULL, &timeout); - if (selret >= 0) ok_to_select_stdin = 1; - else ok_to_select_stdin = 0; - FD_ZERO(&readfds); - } - if (ok_to_select_stdin) FD_SET(0, &readfds); + if (isatty(fileno(stdin))) FD_SET(fileno(stdin), &readfds); #endif /* USE_SLANG */ timeout.tv_sec = 1; timeout.tv_usec = 0; diff --git a/WWW/Library/Implementation/HTTCP.h b/WWW/Library/Implementation/HTTCP.h index 05e8278f..a1a428c9 100644 --- a/WWW/Library/Implementation/HTTCP.h +++ b/WWW/Library/Implementation/HTTCP.h @@ -24,11 +24,7 @@ ** it is to be kept. */ #ifndef _WINDOWS -#ifdef __STDC__ - extern const char * HTInetString(struct sockaddr_in* mysin); -#else - extern char * HTInetString(); -#endif +extern CONST char * HTInetString PARAMS((struct sockaddr_in* mysin)); #endif diff --git a/WWW/Library/Implementation/HTTP.c b/WWW/Library/Implementation/HTTP.c index 4ee74ace..2f2e4c45 100644 --- a/WWW/Library/Implementation/HTTP.c +++ b/WWW/Library/Implementation/HTTP.c @@ -130,12 +130,12 @@ PRIVATE int HTLoadHTTP ARGS4 ( if (!url) { status = -3; - _HTProgress (gettext("Bad request.")); + _HTProgress (BAD_REQUEST); goto done; } if (!*url) { status = -2; - _HTProgress (gettext("Bad request.")); + _HTProgress (BAD_REQUEST); goto done; } @@ -173,7 +173,7 @@ try_again: ** Interrupt cleanly. */ CTRACE (tfp, "HTTP: Interrupted on connect; recovering cleanly.\n"); - _HTProgress (gettext("Connection interrupted.")); + _HTProgress (CONNECTION_INTERRUPTED); status = HT_NOT_LOADED; goto done; } @@ -655,7 +655,7 @@ try_again: */ if (status == HT_INTERRUPTED) { CTRACE (tfp, "HTTP: Interrupted initial read.\n"); - _HTProgress (gettext("Connection interrupted.")); + _HTProgress (CONNECTION_INTERRUPTED); HTTP_NETCLOSE(s, handle); status = HT_NO_DATA; goto clean_up; @@ -1093,7 +1093,7 @@ try_again: * Impatient user. - FM */ CTRACE (tfp, "HTTP: Interrupted followup read.\n"); - _HTProgress (gettext("Connection interrupted.")); + _HTProgress (CONNECTION_INTERRUPTED); status = HT_INTERRUPTED; goto clean_up; } @@ -1685,7 +1685,7 @@ Cookie2_continuation: char buffer[1024]; /* @@@@@@@@ */ HTTP_NETCLOSE(s, handle); - sprintf(buffer, gettext("Sorry, no known way of converting %s to %s."), + sprintf(buffer, CANNOT_CONVERT_I_TO_O, HTAtom_name(format_in), HTAtom_name(format_out)); _HTProgress (buffer); status = -1; diff --git a/WWW/Library/Implementation/HTTelnet.c b/WWW/Library/Implementation/HTTelnet.c index 51096e3a..cc366cf7 100644 --- a/WWW/Library/Implementation/HTTelnet.c +++ b/WWW/Library/Implementation/HTTelnet.c @@ -30,8 +30,6 @@ #include <HTAccess.h> #include <HTAlert.h> -#include <userdefs.h> /* for TELNET_COMMAND and RLOGIN_COMMAND */ - #include <LYStrings.h> #include <LYLeaks.h> diff --git a/WWW/Library/Implementation/HTUtils.h b/WWW/Library/Implementation/HTUtils.h index 0d2f1f6c..7e90dc8e 100644 --- a/WWW/Library/Implementation/HTUtils.h +++ b/WWW/Library/Implementation/HTUtils.h @@ -432,4 +432,6 @@ extern FILE *TraceFP NOPARAMS; #define SHORTENED_RBIND /* FIXME: do this in configure-script */ +#include <userdefs.h> + #endif /* HTUTILS_H */ diff --git a/WWW/Library/Implementation/HTWAIS.c b/WWW/Library/Implementation/HTWAIS.c index 1440a5f8..b21aafd7 100644 --- a/WWW/Library/Implementation/HTWAIS.c +++ b/WWW/Library/Implementation/HTWAIS.c @@ -164,7 +164,7 @@ PRIVATE int mosaic_connect_to_server ARGS3( HTAlert (gettext("Could not connect to WAIS server.")); return 0; } else if (rv == -1) { - HTAlert (gettext("Connection interrupted.")); + HTAlert (CONNECTION_INTERRUPTED); return -1; } @@ -949,7 +949,7 @@ PUBLIC int HTLoadWAIS ARGS4( CTRACE(tfp, "HTWAIS: Slice number %ld\n", count); if (HTCheckForInterrupt()) { - HTAlert (gettext("Data transfer interrupted.")); + HTAlert (TRANSFER_INTERRUPTED); (*target->isa->_abort)(target, NULL); #ifdef VMS FREE(type); @@ -993,7 +993,7 @@ PUBLIC int HTLoadWAIS ARGS4( false /* true verbose */ ); if (rv == HT_INTERRUPTED) { - HTAlert (gettext("Data transfer interrupted.")); + HTAlert (TRANSFER_INTERRUPTED); return_status = HT_INTERRUPTED; FREE_TARGET; FREE(type); diff --git a/WWW/Library/Implementation/SGML.c b/WWW/Library/Implementation/SGML.c index 53005d65..d55c74fb 100644 --- a/WWW/Library/Implementation/SGML.c +++ b/WWW/Library/Implementation/SGML.c @@ -1386,6 +1386,7 @@ top1: (!context->element_stack || (context->element_stack->tag && (context->element_stack->tag->contents == SGML_MIXED || + context->element_stack->tag->contents == SGML_ELEMENT || context->element_stack->tag->contents == SGML_PCDATA || context->element_stack->tag->contents == SGML_RCDATA)))) { /* |