remove libcaps dependancy on libxp by using PL/PR routines instead of XP_*

This commit is contained in:
alecf%netscape.com 1999-08-27 04:09:41 +00:00
parent 1d24a36c44
commit 6c2881ae30
8 changed files with 38 additions and 42 deletions

View File

@ -51,7 +51,8 @@ EXTRA_DSO_LDOPTS = \
-L$(DIST)/bin \
-L$(DIST)/lib \
$(ZLIB_LIBS) \
-lxp \
-lxpcom \
-lmozjs \
$(NSPR_LIBS) \
$(NULL)

View File

@ -19,7 +19,6 @@
#include "nsCodebasePrincipal.h"
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
#include "xp.h"
#include "nsIURL.h"
static NS_DEFINE_IID(kICodebasePrincipalIID, NS_ICODEBASEPRINCIPAL_IID);

View File

@ -17,7 +17,6 @@
*/
#include "nsCodebasePrincipal.h"
#include "nsJSPrincipals.h"
#include "xp.h"
#include "plstr.h"
PR_STATIC_CALLBACK(void *)

View File

@ -17,7 +17,8 @@
*/
/*describes the state and duration of privileges*/
#include "nsPrivilege.h"
#include "xp.h"
#include "prlog.h"
#include "plstr.h"
static NS_DEFINE_IID(kIPrivilegeIID, NS_IPRIVILEGE_IID);
@ -125,7 +126,7 @@ nsPrivilege::ToString(char * * result)
privStr = "blank";
break;
default:
PR_ASSERT(FALSE);
PR_ASSERT(PR_FALSE);
privStr = "error";
break;
}
@ -144,13 +145,13 @@ nsPrivilege::ToString(char * * result)
privStr = "blank";
break;
default:
PR_ASSERT(FALSE);
PR_ASSERT(PR_FALSE);
privStr = "error";
break;
}
itsString = new char[strlen(privStr) + strlen(durStr) + 1];
XP_STRCPY(itsString, privStr);
XP_STRCAT(itsString, durStr);
PL_strcpy(itsString, privStr);
PL_strcat(itsString, durStr);
result = & itsString;
return NS_OK;
}

View File

@ -49,7 +49,6 @@ static JSec_Principal RDF_CreatePrincipal(nsPrincipal *prin);
#endif /* ENABLE_RDF */
PR_BEGIN_EXTERN_C
#include "xp.h"
#include "prefapi.h"
PRBool
@ -144,31 +143,31 @@ nsPrivilegeManager::FindPrivilege(char * privStr)
{
PRInt16 privState;
PRInt16 privDuration;
if (XP_STRCMP(privStr, "allowed in scope") == 0) {
if (PL_strcmp(privStr, "allowed in scope") == 0) {
privState = nsIPrivilege::PrivilegeState_Allowed;
privDuration = nsIPrivilege::PrivilegeDuration_Scope;
} else if (XP_STRCMP(privStr, "allowed in session") == 0) {
} else if (PL_strcmp(privStr, "allowed in session") == 0) {
privState = nsIPrivilege::PrivilegeState_Allowed;
privDuration = nsIPrivilege::PrivilegeDuration_Session;
} else if (XP_STRCMP(privStr, "allowed forever") == 0) {
} else if (PL_strcmp(privStr, "allowed forever") == 0) {
privState = nsIPrivilege::PrivilegeState_Allowed;
privDuration = nsIPrivilege::PrivilegeDuration_Forever;
} else if (XP_STRCMP(privStr, "forbidden forever") == 0) {
} else if (PL_strcmp(privStr, "forbidden forever") == 0) {
privState = nsIPrivilege::PrivilegeState_Forbidden;
privDuration = nsIPrivilege::PrivilegeDuration_Forever;
} else if (XP_STRCMP(privStr, "forbidden in session") == 0) {
} else if (PL_strcmp(privStr, "forbidden in session") == 0) {
privState = nsIPrivilege::PrivilegeState_Forbidden;
privDuration = nsIPrivilege::PrivilegeDuration_Session;
} else if (XP_STRCMP(privStr, "forbidden in scope") == 0) {
} else if (PL_strcmp(privStr, "forbidden in scope") == 0) {
privState = nsIPrivilege::PrivilegeState_Forbidden;
privDuration = nsIPrivilege::PrivilegeDuration_Scope;
} else if (XP_STRCMP(privStr, "blank forever") == 0) {
} else if (PL_strcmp(privStr, "blank forever") == 0) {
privState = nsIPrivilege::PrivilegeState_Blank;
privDuration = nsIPrivilege::PrivilegeDuration_Forever;
} else if (XP_STRCMP(privStr, "blank in session") == 0) {
} else if (PL_strcmp(privStr, "blank in session") == 0) {
privState = nsIPrivilege::PrivilegeState_Blank;
privDuration = nsIPrivilege::PrivilegeDuration_Session;
} else if (XP_STRCMP(privStr, "blank in scope") == 0) {
} else if (PL_strcmp(privStr, "blank in scope") == 0) {
privState = nsIPrivilege::PrivilegeState_Blank;
privDuration = nsIPrivilege::PrivilegeDuration_Scope;
} else {

View File

@ -22,8 +22,7 @@
#include "nsPrincipalManager.h"
#include "nsUserTarget.h"
#include "nsUserDialogHelper.h"
#include "xp.h"
#include "xpgetstr.h"
#include "prmem.h"
#include "plhash.h"
/* XXXXXXXX Begin oF HACK */
@ -363,11 +362,11 @@ java_netscape_security_getTargetDetails(const char * charSetName, char * targetN
char * targetRisk, * targetDescription;
primTarget->GetDescription(& targetDescription);
primTarget->GetRisk(& targetRisk);
XP_STRCAT(desc, "<option>");
XP_STRCAT(desc, targetDescription);
XP_STRCAT(desc, " (");
XP_STRCAT(desc, targetRisk);
XP_STRCAT(desc, ")");
PL_strcat(desc, "<option>");
PL_strcat(desc, targetDescription);
PL_strcat(desc, " (");
PL_strcat(desc, targetRisk);
PL_strcat(desc, ")");
}
* details = desc;
// Should we consider caching the details desc?
@ -677,7 +676,7 @@ nsTarget::nsTarget(char *name, nsIPrincipal * prin, PRInt32 risk, char * riskCol
/* init method makes a copy of all its arguments. Thus we need
* to free the URL, which was allocated by JavaSecUI_getHelpURL.
*/
XP_FREE(url);
PR_Free(url);
}
nsTarget::~nsTarget(void)
@ -959,10 +958,10 @@ nsTarget::ToString(char * * result)
char * prinStr = "<none>";
if (itsPrincipal != NULL) itsPrincipal->ToString(& prinStr);
itsString = new char [strlen(TARGET_STR) + strlen(itsName) + strlen(PRIN_STR) + strlen(prinStr) + 1];
XP_STRCPY(itsString, TARGET_STR);
XP_STRCAT(itsString, itsName);
XP_STRCAT(itsString, PRIN_STR);
XP_STRCAT(itsString, prinStr);
PL_strcpy(itsString, TARGET_STR);
PL_strcat(itsString, itsName);
PL_strcat(itsString, PRIN_STR);
PL_strcat(itsString, prinStr);
result = & itsString;
return NS_OK;
}
@ -984,23 +983,23 @@ nsTarget::Init(char * name, nsIPrincipal * prin, nsTargetArray * targetArray,
PR_ASSERT(name != NULL);
PR_ASSERT(prin != NULL);
itsName = new char[strlen(name) + 1];
XP_STRCPY(itsName, name);
PL_strcpy(itsName, name);
itsPrincipal = prin;
itsRegistered = PR_FALSE;
itsRisk = risk;
if (riskColor) {
itsRiskColorStr = new char[strlen(riskColor) + 1];
XP_STRCPY(itsRiskColorStr, riskColor);
} else itsRiskColorStr = XP_STRDUP(JavaSecUI_getString(CAPS_TARGET_RISK_COLOR_HIGH));
PL_strcpy(itsRiskColorStr, riskColor);
} else itsRiskColorStr = PL_strdup(JavaSecUI_getString(CAPS_TARGET_RISK_COLOR_HIGH));
if (description == NULL) description = name;
itsDescriptionStr = new char[strlen(description) + 1];
XP_STRCPY(itsDescriptionStr, description);
PL_strcpy(itsDescriptionStr, description);
if (detailDescription == NULL) detailDescription = itsDescriptionStr;
itsDetailDescriptionStr = new char[strlen(detailDescription) + 1];
XP_STRCPY(itsDetailDescriptionStr, detailDescription);
PL_strcpy(itsDetailDescriptionStr, detailDescription);
if (url != NULL) {
itsURLStr = new char[strlen(url) + 1];
XP_STRCPY(itsURLStr, url);
PL_strcpy(itsURLStr, url);
} else itsURLStr = NULL;
itsTargetArray = NULL;
itsString = NULL;

View File

@ -26,8 +26,7 @@
*
*/
#include "nsUserDialogHelper.h"
#include "xp.h"
#include "xpgetstr.h"
#include "prmem.h"
#include "prprf.h"
#include "nsTarget.h"
@ -88,9 +87,9 @@ char * JavaSecUI_getHelpURL(int id)
PR_ASSERT(tag != NULL);
PR_ASSERT(java_sec_help_url != NULL);
char *helpURL = (char *)XP_ALLOC(strlen(java_sec_help_url) + strlen(tag) + 1);
XP_STRCPY(helpURL, java_sec_help_url);
XP_STRCAT(helpURL, tag);
char *helpURL = (char *)PR_Malloc(strlen(java_sec_help_url) + strlen(tag) + 1);
PL_strcpy(helpURL, java_sec_help_url);
PL_strcat(helpURL, tag);
return helpURL;
}

View File

@ -16,7 +16,6 @@
* Reserved.
*/
#include "xp.h"
#include "nsUserTarget.h"
#include "prtypes.h"