From 46a406db90076a69941402c93301cb79c3500a6e Mon Sep 17 00:00:00 2001 From: "mcmullen%netscape.com" Date: Thu, 14 Jan 1999 23:21:06 +0000 Subject: [PATCH] Added all the nucache files to the memory module project (as a group) so that NU_CACHE can be turned on with a flick of the wrist, made the modular memory library build with the NU_CACHE flag turned on, fixed build warnings and errors. The NU_CACHE flag is still OFF, because the database code doesn't exist for Macintosh or Unix :-( git-svn-id: svn://10.0.0.236/trunk@17778 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/lib/xp/xp_stub.c | 12 +++--- mozilla/network/cache/nu/src/nsCachePref.cpp | 41 +++---------------- mozilla/network/macbuild/network.mcp | Bin 124575 -> 145935 bytes mozilla/network/main/mkautocf.c | 1 + mozilla/network/main/mkgeturl.c | 2 +- mozilla/network/main/mkstream.c | 2 +- mozilla/network/module/nsHttpURLFactory.cpp | 1 + mozilla/network/module/nsHttpUrl.cpp | 3 +- mozilla/network/module/nsIRelatedLinks.h | 1 + mozilla/network/module/nsNetFactory.cpp | 1 + mozilla/network/protocol/about/mkabout.c | 6 +-- mozilla/network/protocol/http/mkaccess.c | 8 ++-- mozilla/network/protocol/http/mkhttp.c | 12 +++--- 13 files changed, 31 insertions(+), 59 deletions(-) diff --git a/mozilla/lib/xp/xp_stub.c b/mozilla/lib/xp/xp_stub.c index 37cf00c6f5d..ca269225db0 100644 --- a/mozilla/lib/xp/xp_stub.c +++ b/mozilla/lib/xp/xp_stub.c @@ -72,12 +72,12 @@ XP_GetBuiltinString(int16 i) if ( - ((ret = mcom_include_merrors_i_strings (i))) || - ((ret = mcom_include_secerr_i_strings (i))) || - ((ret = mcom_include_sec_dialog_strings(i))) || - ((ret = mcom_include_sslerr_i_strings (i))) || - ((ret = mcom_include_xp_error_i_strings(i))) || - ((ret = mcom_include_xp_msg_i_strings (i))) + ((ret = mcom_include_merrors_i_strings (i)) != 0) || + ((ret = mcom_include_secerr_i_strings (i)) != 0) || + ((ret = mcom_include_sec_dialog_strings(i)) != 0) || + ((ret = mcom_include_sslerr_i_strings (i)) != 0) || + ((ret = mcom_include_xp_error_i_strings(i)) != 0) || + ((ret = mcom_include_xp_msg_i_strings (i)) != 0) ) { return ret; diff --git a/mozilla/network/cache/nu/src/nsCachePref.cpp b/mozilla/network/cache/nu/src/nsCachePref.cpp index 858ff19eeb1..61b94ce94f3 100644 --- a/mozilla/network/cache/nu/src/nsCachePref.cpp +++ b/mozilla/network/cache/nu/src/nsCachePref.cpp @@ -113,50 +113,19 @@ nsCachePref::SetupPrefs(const char* i_Pref) if (bSetupAll || !PL_strcmp(i_Pref,CACHE_DIR_PREF)) { -#ifdef XP_MAC - tempPref = CPrefs::GetCachePath(); - if (tempPref) - { - if (m_DiskCacheFolder) - delete m_DiskCacheFolder; + if (PREF_OK == PREF_CopyPathPref(CACHE_DIR_PREF,&tempPref)) + { + PR_ASSERT(tempPref); + delete [] m_DiskCacheFolder; m_DiskCacheFolder = new char[PL_strlen(tempPref)+2]; - if (!m_DiskCacheFolder) { if (tempPref) PR_Free(tempPref); return; } - /* Changing the mac path to unix because nspr converts - it the other way round and cant deal with it being a mac path */ - m_DiskCacheFolder[0]='/'; - m_DiskCacheFolder[1]='\0'; - PL_strcat(m_DiskCacheFolder, tempPref); - char *tempPref2 = m_DiskCacheFolder+1; - while (*tempPref2) - { - if (*tempPref2 == ':') - *tempPref2 = '/'; - tempPref2++; - } - - } -#else - if (PREF_OK == PREF_CopyCharPref(CACHE_DIR_PREF,&tempPref)) - { - PR_ASSERT(tempPref); - if (m_DiskCacheFolder) - delete m_DiskCacheFolder; - m_DiskCacheFolder = new char[PL_strlen(tempPref)+1]; - if (!m_DiskCacheFolder) - { - if (tempPref) - PR_Free(tempPref); - return; - } PL_strcpy(m_DiskCacheFolder, tempPref); - } -#endif + } else //TODO set to temp folder { #if defined(MODULAR_NETLIB) && defined(XP_PC) diff --git a/mozilla/network/macbuild/network.mcp b/mozilla/network/macbuild/network.mcp index 6c0bedfc8ee0fbdf9039bbd3e397556fd5ef28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MH7ue@6QA2?T zpSg2x!`c;*%8;F%$tRe0>9e#pC==~OtorYh4xOS_`Wi+DkRUEidx;F|SK>u_K1sJz64-t3AVE8;s{xtWYP!*+Qw z@8ZpD%IA!Yy0fOKQC)BKS;r+4qv=)f^#CKd`6K$H!B;)W1GqI*v8HKt!;{=viN3#a z-HMfrABGPvLm%=0t1M`2)`rKOFqCUU`yY(C49#1{gIB~jjs1-=b8d_~vKN4>YYVYY zAh28e50-+fs|@KJK-;7JP25ket~bOAqbSq<-ObZsQ11f7DngMI4_Ulk9>r7IKNY9Q)tdpazC+>FyxUlbGnp{0JkSp8lyHogXYG$n& zBa*G&thn@G`NPQ`!OcE63?+L64{n41P_jpGKjx1o+gOx^6)cSfpgq`XLF0?Dr5UHN zE&h^@JTW?)Y@_5?@R#*~OJ|3ZZJhcE{1xpVx-pz=qs0barg_!A=nK>MPQO2lzD}-T z&V_xIw)@Z9j#8dY%>lJqoit;|XK>h{9W1Oio-`vI0)HdU$D!6qGtT`EzESg8?WlFm we2;J%9G|n2+3JnaIr9yuc{XcqyHK|^Mh`y2^D`D7fk98|yZ1WU_!DI8U+N#E)&Kwi diff --git a/mozilla/network/main/mkautocf.c b/mozilla/network/main/mkautocf.c index f02ebe637e1..f4729cf165e 100644 --- a/mozilla/network/main/mkautocf.c +++ b/mozilla/network/main/mkautocf.c @@ -55,6 +55,7 @@ #include "jsapi.h" #include "jscompat.h" #include "jspubtd.h" +#include "jsautocf.h" /* for XP_GetString() */ #include "xpgetstr.h" diff --git a/mozilla/network/main/mkgeturl.c b/mozilla/network/main/mkgeturl.c index 47e06ae45e1..26da1e0b278 100644 --- a/mozilla/network/main/mkgeturl.c +++ b/mozilla/network/main/mkgeturl.c @@ -2982,7 +2982,7 @@ redo_load_switch: /* come here on file/ftp retry */ this_entry->proxy_conf, &this_entry->proxy_addr, &this_entry->socks_host, - &this_entry->socks_port)) + &this_entry->socks_port)) != 0 && this_entry->proxy_addr ) { diff --git a/mozilla/network/main/mkstream.c b/mozilla/network/main/mkstream.c index a2db4e9c228..aa6f278eda0 100644 --- a/mozilla/network/main/mkstream.c +++ b/mozilla/network/main/mkstream.c @@ -607,7 +607,7 @@ NET_DumpDecoders() net_ConverterStruct * cs_ptr; XP_List *list_ptr = net_decoder_list[FO_PRESENT]; - while((cs_ptr = XP_ListNextObject(list_ptr))) + while((cs_ptr = XP_ListNextObject(list_ptr)) != 0) { char *msg = PR_smprintf("in: %s out: %d\n",cs_ptr->encoding_in, cs_ptr->format_out); diff --git a/mozilla/network/module/nsHttpURLFactory.cpp b/mozilla/network/module/nsHttpURLFactory.cpp index 92f60215698..09b4555f704 100644 --- a/mozilla/network/module/nsHttpURLFactory.cpp +++ b/mozilla/network/module/nsHttpURLFactory.cpp @@ -19,6 +19,7 @@ #include "nsIProtocolURLFactory.h" #include "nsHttpUrl.h" #include "nsINetService.h" +#include "nsNetThread.h" #include "nsIServiceManager.h" #include "nsString.h" diff --git a/mozilla/network/module/nsHttpUrl.cpp b/mozilla/network/module/nsHttpUrl.cpp index 635a12b6227..07e645b5e39 100644 --- a/mozilla/network/module/nsHttpUrl.cpp +++ b/mozilla/network/module/nsHttpUrl.cpp @@ -30,8 +30,7 @@ #include "prmem.h" #include "plstr.h" #include "nsCRT.h" - -MWContext *new_stub_context(URL_Struct *URL_s); +#include "nsStubContext.h" static NS_DEFINE_IID(kIOutputStreamIID, NS_IOUTPUTSTREAM_IID); static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); diff --git a/mozilla/network/module/nsIRelatedLinks.h b/mozilla/network/module/nsIRelatedLinks.h index 8bcb2fc2766..c7004d0d898 100644 --- a/mozilla/network/module/nsIRelatedLinks.h +++ b/mozilla/network/module/nsIRelatedLinks.h @@ -68,6 +68,7 @@ public: }; +extern "C" void RL_Init(); extern "C" nsIRelatedLinks * NS_NewRelatedLinks(); #endif diff --git a/mozilla/network/module/nsNetFactory.cpp b/mozilla/network/module/nsNetFactory.cpp index 166b73a432a..659dd69e680 100644 --- a/mozilla/network/module/nsNetFactory.cpp +++ b/mozilla/network/module/nsNetFactory.cpp @@ -21,6 +21,7 @@ #include "nsISupports.h" #include "nsINetService.h" #include "nsNetService.h" +#include "nsRepository.h" /* This implementation of the network service factory is presently * only taking advantage of the service retrieval benefit that the diff --git a/mozilla/network/protocol/about/mkabout.c b/mozilla/network/protocol/about/mkabout.c index 26a1256772e..c01346c7011 100644 --- a/mozilla/network/protocol/about/mkabout.c +++ b/mozilla/network/protocol/about/mkabout.c @@ -79,7 +79,7 @@ static PRHashTable *net_AboutTable = NULL; PRIVATE PRIntn net_AboutComparator(const void *v1, const void *v2) { char *idx = NULL; - if (idx = PL_strchr((char *) v1, '?')) { + if ((idx = PL_strchr((char *) v1, '?')) != 0) { int len = (int)(idx - (char *) v1); return PL_strncasecmp((char *) v1, (char *) v2, len) == 0; } else { @@ -101,7 +101,7 @@ PRIVATE PLHashNumber net_HashAbout(const void *key) PRIVATE PRBool net_DoRegisteredAbout(const char *which, ActiveEntry *entry) { NET_AboutCB cb; - if (cb = (NET_AboutCB) PL_HashTableLookup(net_AboutTable, which)) { + if ((cb = (NET_AboutCB) PL_HashTableLookup(net_AboutTable, which))!= 0) { return cb(which, entry->format_out, entry->URL_s, entry->window_id); } return PR_FALSE; @@ -138,7 +138,7 @@ net_OutputURLDocInfo(MWContext *ctxt, char *which, char **data, int32 *length) char buf[64]; char *tmp=0; char *escaped; - char *sec_msg, *il_msg; + char *il_msg; NET_FindURLInCache(URL_s, ctxt); diff --git a/mozilla/network/protocol/http/mkaccess.c b/mozilla/network/protocol/http/mkaccess.c index acc225b6238..dc8b14a619a 100644 --- a/mozilla/network/protocol/http/mkaccess.c +++ b/mozilla/network/protocol/http/mkaccess.c @@ -216,7 +216,7 @@ net_CheckForAuthorization(char * address, Bool exact_match) * http://uname:pwd@host.com, so make sure we don't compare an address * passed in with one with an auth struct->path until we remove/reduce the * address passed in. */ - if( (afterProto=PL_strstr(address, "://")) ) { + if( (afterProto=PL_strstr(address, "://")) != 0 ) { afterProto=afterProto+3; tmp=*afterProto; *afterProto='\0'; @@ -224,7 +224,7 @@ net_CheckForAuthorization(char * address, Bool exact_match) *afterProto=tmp; /* temporarily truncate after first slash, if any. */ - if( (fSlash=PL_strchr(afterProto, '/')) ) + if( (fSlash=PL_strchr(afterProto, '/')) != 0) *fSlash='\0'; atSign=PL_strchr(afterProto, '@'); if(fSlash) @@ -915,8 +915,8 @@ NET_AskForAuthString(MWContext *context, prev_auth->password = password; prev_auth->path = 0; /* Don't save username/password info in the auth struct path. */ - if( (atSign=PL_strchr(new_address, '@')) ) { - if( (host=PL_strstr(new_address, "://")) ) { + if( (atSign=PL_strchr(new_address, '@')) != 0) { + if( (host=PL_strstr(new_address, "://")) != 0) { char tmp; host+=3; tmp=*host; diff --git a/mozilla/network/protocol/http/mkhttp.c b/mozilla/network/protocol/http/mkhttp.c index 66ad120c911..fa758df8d72 100644 --- a/mozilla/network/protocol/http/mkhttp.c +++ b/mozilla/network/protocol/http/mkhttp.c @@ -88,7 +88,7 @@ extern int XP_PROGRESS_TRYAGAIN; extern int XP_PROGRESS_WAIT_REPLY; extern int XP_HR_TRANSFER_INTERRUPTED; extern int XP_TRANSFER_INTERRUPTED; -extern int XP_ERRNO_EIO; +extern int XP_ERRNO_EIO; #ifdef TRUST_LABELS extern void ProcessCookiesAndTrustLabels( ActiveEntry *ce ); @@ -1264,9 +1264,9 @@ net_build_http_request (URL_Struct * URL_s, char *atSign=NULL; char *path=NULL; - if( (path=PL_strchr(colon+3, '/')) ) + if( (path=PL_strchr(colon+3, '/')) != 0) *path='\0'; - if( (atSign=PL_strchr(colon, '@')) ) { + if( (atSign=PL_strchr(colon, '@')) != 0) { /* We found a username and/or a password, don't let it through */ char temp; if(path) @@ -1467,7 +1467,7 @@ net_build_http_request (URL_Struct * URL_s, /* Figure out which kind of proxy we're using: PAC or straight proxy. * DON'T FREE tempURL!!! */ - if ( (tempURL = net_GetPACUrl()) && (*tempURL) ) + if ( (tempURL = net_GetPACUrl()) != NULL && (*tempURL) ) proxyServer = NET_ParseURL(tempURL, GET_HOST_PART | GET_PATH_PART @@ -2545,7 +2545,7 @@ net_setup_http_stream(ActiveEntry * ce) { /* Figure out which kind of proxy we're using: PAC or straight proxy. * DON'T FREE tempURL!!! */ - if ( (tempURL = net_GetPACUrl()) && (*tempURL) ) + if ( (tempURL = net_GetPACUrl()) != NULL && (*tempURL) ) proxyServer = NET_ParseURL(tempURL, GET_HOST_PART | GET_PATH_PART | GET_USERNAME_PART | GET_PASSWORD_PART); else proxyServer = cd->proxy_server; @@ -3788,7 +3788,7 @@ HTTP_ReadPrefs(void) NET_SetSendRefererHeader(b); } -MODULE_PRIVATE int PR_CALLBACK HTTP_PrefChangedFunc(const char *pref, void *data) +static int PR_CALLBACK HTTP_PrefChangedFunc(const char *pref, void *data) { HTTP_ReadPrefs(); return TRUE;