diff --git a/mozilla/network/cnvts/cvcolor.c b/mozilla/network/cnvts/cvcolor.c index 66eee699948..d878bd4e68a 100644 --- a/mozilla/network/cnvts/cvcolor.c +++ b/mozilla/network/cnvts/cvcolor.c @@ -186,7 +186,7 @@ PRIVATE int net_ColorHTMLWrite (NET_StreamClass *stream, CONST char *s, int32 l) PR_FREEIF(tmp_markup); tmp_markup = NULL; } - else if(!XP_IS_SPACE(*cp)) + else if(!NET_IS_SPACE(*cp)) { obj->state = IN_BEGIN_TAG; obj->tag_index = 0; @@ -200,7 +200,7 @@ PRIVATE int net_ColorHTMLWrite (NET_StreamClass *stream, CONST char *s, int32 l) /* go to the IN_TAG state when we see * the first whitespace */ - if(XP_IS_SPACE(*cp)) + if(NET_IS_SPACE(*cp)) { StrAllocCopy(new_markup, END_TAG_NAME_MARKUP); sprintf(tiny_buf, "%c", *cp); @@ -262,7 +262,7 @@ PRIVATE int net_ColorHTMLWrite (NET_StreamClass *stream, CONST char *s, int32 l) * we will enter the UNQUOTED or the QUOTED * ATTRIBUTE state */ - if(!XP_IS_SPACE(*cp)) + if(!NET_IS_SPACE(*cp)) { if(*cp == '"') { @@ -297,7 +297,7 @@ PRIVATE int net_ColorHTMLWrite (NET_StreamClass *stream, CONST char *s, int32 l) case IN_UNQUOTED_ATTRIBUTE_VALUE: unquoted_attribute_jump_point: /* do nothing until you find a whitespace */ - if(XP_IS_SPACE(*cp)) + if(NET_IS_SPACE(*cp)) { StrAllocCopy(new_markup, END_ATTRIBUTE_VALUE_MARKUP); sprintf(tiny_buf, "%c", *cp); @@ -375,7 +375,7 @@ unquoted_attribute_jump_point: break; case IN_AMPERSAND_THINGY: /* do nothing until you find a ';' or space */ - if(*cp == ';' || XP_IS_SPACE(*cp)) + if(*cp == ';' || NET_IS_SPACE(*cp)) { sprintf(tiny_buf, "%c", *cp); StrAllocCopy(new_markup, tiny_buf); diff --git a/mozilla/network/cnvts/cvpics.c b/mozilla/network/cnvts/cvpics.c index 2d05e7290ea..e9c11722f3a 100644 --- a/mozilla/network/cnvts/cvpics.c +++ b/mozilla/network/cnvts/cvpics.c @@ -156,7 +156,7 @@ PRIVATE int net_PICSLabelFinderWrite (NET_StreamClass *stream, CONST char *s, in { net_EndPICSLabelFinderTag(obj); } - else if(!XP_IS_SPACE(*cp)) + else if(!NET_IS_SPACE(*cp)) { /* capture all tag data */ tiny_buf[0] = *cp; @@ -179,7 +179,7 @@ PRIVATE int net_PICSLabelFinderWrite (NET_StreamClass *stream, CONST char *s, in tiny_buf[1] = '\0'; StrAllocCat(obj->tag_data, tiny_buf); - if(XP_IS_SPACE(*cp)) + if(NET_IS_SPACE(*cp)) { obj->state = IN_TAG; obj->tag[obj->tag_index] = '\0'; @@ -229,7 +229,7 @@ PRIVATE int net_PICSLabelFinderWrite (NET_StreamClass *stream, CONST char *s, in * we will enter the UNQUOTED or the QUOTED * ATTRIBUTE state */ - if(!XP_IS_SPACE(*cp)) + if(!NET_IS_SPACE(*cp)) { if(*cp == '"') { @@ -260,7 +260,7 @@ PRIVATE int net_PICSLabelFinderWrite (NET_StreamClass *stream, CONST char *s, in unquoted_attribute_jump_point: /* do nothing until you find a whitespace */ - if(XP_IS_SPACE(*cp)) + if(NET_IS_SPACE(*cp)) { obj->state = IN_TAG; } @@ -304,7 +304,7 @@ unquoted_attribute_jump_point: break; case IN_AMPERSAND_THINGY: /* do nothing until you find a ';' or space */ - if(*cp == ';' || XP_IS_SPACE(*cp)) + if(*cp == ';' || NET_IS_SPACE(*cp)) { sprintf(tiny_buf, "%c", *cp); obj->state = IN_CONTENT; diff --git a/mozilla/network/cnvts/cvview.c b/mozilla/network/cnvts/cvview.c index e9b89083e4d..b973367cc5e 100644 --- a/mozilla/network/cnvts/cvview.c +++ b/mozilla/network/cnvts/cvview.c @@ -334,7 +334,7 @@ NET_ExtViewerConverter (int format_out, end = XP_StripLine(prog); /* Extract the leaf name of the program: " /bin/sh -foo" ==> "sh". */ - for (; *end && !XP_IS_SPACE(*end); end++) + for (; *end && !NET_IS_SPACE(*end); end++) ; *end = 0; diff --git a/mozilla/network/module/nsNetService.cpp b/mozilla/network/module/nsNetService.cpp index 0432b9e135f..1779c2cd73f 100644 --- a/mozilla/network/module/nsNetService.cpp +++ b/mozilla/network/module/nsNetService.cpp @@ -29,10 +29,34 @@ void free_stub_context(MWContext *window_id); void bam_exit_routine(URL_Struct *URL_s, int status, MWContext *window_id); extern "C" { +#include "fileurl.h" +#include "httpurl.h" +#include "ftpurl.h" +#include "abouturl.h" +#include "gophurl.h" +#include "fileurl.h" +#include "remoturl.h" +#include "netcache.h" + extern char *XP_AppCodeName; extern char *XP_AppVersion; }; +/* + * Initialize our protocols + */ + +extern "C" void NET_ClientProtocolInitialize() +{ + NET_InitFileProtocol(); + NET_InitHTTPProtocol(); + NET_InitMemCacProtocol(); + NET_InitFTPProtocol(); + NET_InitAboutProtocol(); + NET_InitGopherProtocol(); + NET_InitRemoteProtocol(); +} + static NS_DEFINE_IID(kIProtocolConnectionIID, NS_IPROTOCOLCONNECTION_IID); diff --git a/mozilla/network/module/nsNetStubs.cpp b/mozilla/network/module/nsNetStubs.cpp index c3d3b0c1e15..f4e2f8030cd 100644 --- a/mozilla/network/module/nsNetStubs.cpp +++ b/mozilla/network/module/nsNetStubs.cpp @@ -32,15 +32,6 @@ extern "C" { #include "xp_reg.h" #include "secnav.h" #include "preenc.h" - -#include "fileurl.h" -#include "httpurl.h" -#include "ftpurl.h" -#include "abouturl.h" -#include "gophurl.h" -#include "fileurl.h" -#include "remoturl.h" -#include "netcache.h" }; /* From libimg */ @@ -54,18 +45,6 @@ extern "C" { extern "C" { -void NET_ClientProtocolInitialize() -{ - NET_InitFileProtocol(); - NET_InitHTTPProtocol(); - NET_InitMemCacProtocol(); - NET_InitFTPProtocol(); - NET_InitAboutProtocol(); - NET_InitGopherProtocol(); - NET_InitRemoteProtocol(); -} - - /* Meta charset is weakest. Only set doc_csid if no http or override */ void INTL_SetCSIDocCSID (INTL_CharSetInfo c, int16 doc_csid) @@ -253,42 +232,6 @@ INTL_GetCSIMimeCharset (INTL_CharSetInfo c) return NULL; } - - -/* - *--------------------------------------------------------------------------- - * From ns/lib/libparse/pa_hash.c - *--------------------------------------------------------------------------- - */ - -/************************************* - * Function: pa_tokenize_tag - * - * Description: This function maps the passed in string - * to one of the valid tag element tokens, or to - * the UNKNOWN token. - * - * Params: Takes a \0 terminated string. - * - * Returns: a 32 bit token to describe this tag element. On error, - * which means it was not passed an unknown tag element string, - * it returns the token P_UNKNOWN. - * - * Performance Notes: - * Profiling on mac revealed this routine as a big (5%) time sink. - * This function was stolen from pa_mdl.c and merged with the perfect - * hashing code and the tag comparison code so it would be flatter (fewer - * function calls) since those are still expensive on 68K and x86 machines. - *************************************/ - -intn -pa_tokenize_tag(char *str) -{ - MOZ_FUNCTION_STUB; - return -1; /* P_UNKNOWN */; -} - - /* *--------------------------------------------------------------------------- * From ns/lib/libparse/pa_parse.c @@ -828,15 +771,6 @@ IL_Type(const char *buf, int32 len) return 0; /* IL_NOTFOUND */ } - -PRBool -IL_PreferredStream(URL_Struct *urls) -{ - MOZ_FUNCTION_STUB; - return PR_FALSE; -} - - NET_StreamClass * IL_NewStream (FO_Present_Types format_out, void *type, @@ -1303,9 +1237,9 @@ WH_FileName (const char *NetName, XP_FileType type) bChopSlash = FALSE; if(bChopSlash) - newName = XP_STRDUP(&(NetName[1])); + newName = PL_strdup(&(NetName[1])); else - newName = XP_STRDUP(NetName); + newName = PL_strdup(NetName); if(!newName) return NULL; @@ -2504,10 +2438,10 @@ NET_BACopy (char **destination, const char *source, size_t length) } else { - *destination = (char *) XP_ALLOC (length); + *destination = (char *) PR_Malloc (length); if (*destination == NULL) return(NULL); - XP_MEMCPY(*destination, source, length); + memcpy(*destination, source, length); } return *destination; } @@ -2528,20 +2462,20 @@ NET_BACat (char **destination, { if (*destination) { - *destination = (char *) XP_REALLOC (*destination, destination_length + source_length); + *destination = (char *) PR_Realloc (*destination, destination_length + source_length); if (*destination == NULL) return(NULL); - XP_MEMMOVE (*destination + destination_length, source, source_length); + memmove (*destination + destination_length, source, source_length); } else { - *destination = (char *) XP_ALLOC (source_length); + *destination = (char *) PR_Malloc (source_length); if (*destination == NULL) return(NULL); - XP_MEMCPY(*destination, source, source_length); + memcpy(*destination, source, source_length); } } @@ -2564,11 +2498,11 @@ NET_SACopy (char **destination, const char *source) } else { - *destination = (char *) XP_ALLOC (XP_STRLEN(source) + 1); + *destination = (char *) PR_Malloc (PL_strlen(source) + 1); if (*destination == NULL) return(NULL); - XP_STRCPY (*destination, source); + PL_strcpy (*destination, source); } return *destination; } @@ -2582,20 +2516,20 @@ NET_SACat (char **destination, const char *source) { if (*destination) { - int length = XP_STRLEN (*destination); - *destination = (char *) XP_REALLOC (*destination, length + XP_STRLEN(source) + 1); + int length = PL_strlen (*destination); + *destination = (char *) PR_Realloc (*destination, length + PL_strlen(source) + 1); if (*destination == NULL) return(NULL); - XP_STRCPY (*destination + length, source); + PL_strcpy (*destination + length, source); } else { - *destination = (char *) XP_ALLOC (XP_STRLEN(source) + 1); + *destination = (char *) PR_Malloc (PL_strlen(source) + 1); if (*destination == NULL) return(NULL); - XP_STRCPY (*destination, source); + PL_strcpy (*destination, source); } } return *destination; @@ -2634,17 +2568,17 @@ char *XP_AppendStr(char *in, const char *append) { int alen, inlen; - alen = XP_STRLEN(append); + alen = PL_strlen(append); if (in) { - inlen = XP_STRLEN(in); - in = (char*) XP_REALLOC(in,inlen+alen+1); + inlen = PL_strlen(in); + in = (char*) PR_Realloc(in,inlen+alen+1); if (in) { - XP_MEMCPY(in+inlen, append, alen+1); + memcpy(in+inlen, append, alen+1); } } else { - in = (char*) XP_ALLOC(alen+1); + in = (char*) PR_Malloc(alen+1); if (in) { - XP_MEMCPY(in, append, alen+1); + memcpy(in, append, alen+1); } } return in; diff --git a/mozilla/network/protocol/ftp/mkftp.c b/mozilla/network/protocol/ftp/mkftp.c index 012980c7b8f..df7d64987a2 100644 --- a/mozilla/network/protocol/ftp/mkftp.c +++ b/mozilla/network/protocol/ftp/mkftp.c @@ -3223,7 +3223,7 @@ net_parse_ls_line (char *line, NET_FileEntryInfo *entry_info) char *ptr; for (ptr = &line[PL_strlen(line) - 1]; - (ptr > line+13) && (!XP_IS_SPACE(*ptr) || !net_is_ls_date(ptr-12)); ptr--) + (ptr > line+13) && (!NET_IS_SPACE(*ptr) || !net_is_ls_date(ptr-12)); ptr--) ; /* null body */ save_char = *ptr; *ptr = '\0'; @@ -3240,7 +3240,7 @@ net_parse_ls_line (char *line, NET_FileEntryInfo *entry_info) /* find the first whitespace and terminate */ for(ptr=line; *ptr != '\0'; ptr++) - if(XP_IS_SPACE(*ptr)) + if(NET_IS_SPACE(*ptr)) { *ptr = '\0'; break; @@ -3449,7 +3449,7 @@ net_parse_dir_entry (char *entry, int server_type) * syntax. But most NT servers use the DOS dir syntax. * If there is a space at position 8 then it's a DOS dir syntax */ - if(server_type == FTP_NT_TYPE && !XP_IS_SPACE(entry[8])) + if(server_type == FTP_NT_TYPE && !NET_IS_SPACE(entry[8])) server_type = FTP_UNIX_TYPE; switch (server_type) @@ -3534,7 +3534,7 @@ net_parse_dir_entry (char *entry, int server_type) remove_size=TRUE; /* size is not useful */ /* strip off " -> pathname" */ - for (i = len - 1; (i > 3) && (!XP_IS_SPACE(entry[i]) + for (i = len - 1; (i > 3) && (!NET_IS_SPACE(entry[i]) || (entry[i-1] != '>') || (entry[i-2] != '-') || (entry[i-3] != ' ')); i--) diff --git a/mozilla/network/protocol/gopher/mkgopher.c b/mozilla/network/protocol/gopher/mkgopher.c index 02e9e86e53f..509a756f831 100644 --- a/mozilla/network/protocol/gopher/mkgopher.c +++ b/mozilla/network/protocol/gopher/mkgopher.c @@ -273,7 +273,7 @@ net_parse_menu (ActiveEntry * cur_entry) if (gopher_type == GTYPE_TEXT) { int i=0; - while(XP_IS_SPACE(name[i])) i++; + while(NET_IS_SPACE(name[i])) i++; if(!PL_strlen(name)) gopher_type = GTYPE_INFO; } diff --git a/mozilla/network/protocol/http/mkaccess.c b/mozilla/network/protocol/http/mkaccess.c index ee9c11972f7..c5d44090825 100644 --- a/mozilla/network/protocol/http/mkaccess.c +++ b/mozilla/network/protocol/http/mkaccess.c @@ -50,6 +50,7 @@ /* for XP_GetString() */ #include "xpgetstr.h" + extern int XP_CONFIRM_AUTHORIZATION_FAIL; extern int XP_ACCESS_ENTER_USERNAME; extern int XP_ACCESS_ENTER_USERNAME; @@ -1683,7 +1684,7 @@ net_IntSetCookieString(MWContext * context, /* terminate at first space or semi-colon */ for(ptr=path_from_header; *ptr != '\0'; ptr++) - if(XP_IS_SPACE(*ptr) || *ptr == ';' || *ptr == ',') { + if(NET_IS_SPACE(*ptr) || *ptr == ';' || *ptr == ',') { *ptr = '\0'; break; } @@ -1709,7 +1710,7 @@ net_IntSetCookieString(MWContext * context, /* terminate at first space or semi-colon */ for(ptr=domain_from_header; *ptr != '\0'; ptr++) - if(XP_IS_SPACE(*ptr) || *ptr == ';' || *ptr == ',') { + if(NET_IS_SPACE(*ptr) || *ptr == ';' || *ptr == ',') { *ptr = '\0'; break; } @@ -2718,7 +2719,7 @@ PRIVATE net_AuthType net_auth_type(char *name) { if (name) { - while (*name && XP_IS_SPACE(*name)) + while (*name && NET_IS_SPACE(*name)) name++; if (!PL_strncasecmp(name, "basic", 5)) return AUTH_BASIC; @@ -2779,7 +2780,7 @@ bin2hex(unsigned char *data, int len) * structure. * */ -#define SKIP_WS(p) while((*(p)) && XP_IS_SPACE(*(p))) p++ +#define SKIP_WS(p) while((*(p)) && NET_IS_SPACE(*(p))) p++ PRIVATE PRBool next_params(char **pp, char **name, char **value) @@ -2799,7 +2800,7 @@ next_params(char **pp, char **name, char **value) } else { *value = q; - while (*q && !XP_IS_SPACE(*q)) q++; + while (*q && !NET_IS_SPACE(*q)) q++; if (*q) *q++ = '\0'; } @@ -2824,7 +2825,7 @@ net_parse_authenticate_line(char *auth, net_AuthStruct *ret) SKIP_WS(p); ret->auth_type = net_auth_type(p); - while (*p && !XP_IS_SPACE(*p)) p++; + while (*p && !NET_IS_SPACE(*p)) p++; while (next_params(&p, &name, &value)) { if (!PL_strcasecmp(name, "realm")) diff --git a/mozilla/network/protocol/nntp/mknews.c b/mozilla/network/protocol/nntp/mknews.c index d84396b5ee3..6ddfa820275 100644 --- a/mozilla/network/protocol/nntp/mknews.c +++ b/mozilla/network/protocol/nntp/mknews.c @@ -2271,7 +2271,7 @@ net_read_news_list (ActiveEntry *ce) } /* find whitespace seperator if it exits */ - for(i=0; line[i] != '\0' && !XP_IS_SPACE(line[i]); i++) + for(i=0; line[i] != '\0' && !NET_IS_SPACE(line[i]); i++) ; /* null body */ if(line[i] == '\0') @@ -3374,7 +3374,7 @@ static int net_list_pretty_names_response(ActiveEntry *ce) { int i; /* find whitespace seperator if it exits */ - for (i=0; line[i] != '\0' && !XP_IS_SPACE(line[i]); i++) + for (i=0; line[i] != '\0' && !NET_IS_SPACE(line[i]); i++) ; /* null body */ if(line[i] == '\0') @@ -3461,7 +3461,7 @@ static int net_list_xactive_response(ActiveEntry *ce) char *s = line; /* format is "rec.arts.movies.past-films 7302 7119 csp" */ - while (*s && !XP_IS_SPACE(*s)) + while (*s && !NET_IS_SPACE(*s)) s++; if (s) {