Landing MODULAR_NETLIB_BRANCH on windows.

This commit is contained in:
scullin 1998-05-27 22:13:00 +00:00
Родитель b9d1162d8f
Коммит 4abbc8d703
4 изменённых файлов: 136 добавлений и 7 удалений

80
lib/xp/makefile.win Normal file
Просмотреть файл

@ -0,0 +1,80 @@
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
NODEPEND=1
IGNORE_MANIFEST = 1
#//------------------------------------------------------------------------
#//
#// Specify the depth of the current directory relative to the
#// root of NS
#//
#//------------------------------------------------------------------------
DEPTH= ..\..\
MAKE_OBJ_TYPE=DLL
#//------------------------------------------------------------------------
#//
#// Define any Public Make Variables here: (ie. PDFFILE, MAPFILE, ...)
#//
#//------------------------------------------------------------------------
LIBNAME=xplib
#//------------------------------------------------------------------------
#//
#// Define the files necessary to build the target (ie. OBJS)
#//
#//------------------------------------------------------------------------
OBJS= \
.\$(OBJDIR)\xp_stub.obj \
.\$(OBJDIR)\xp_file.obj \
.\$(OBJDIR)\xp_list.obj \
.\$(OBJDIR)\allxpstr.obj \
.\$(OBJDIR)\xp_error.obj \
$(NULL)
#//------------------------------------------------------------------------
#//
#// Define any Public Targets here (ie. PROGRAM, LIBRARY, DLL, ...)
#// (these must be defined before the common makefiles are included)
#//
#//------------------------------------------------------------------------
LIBRARY=.\$(OBJDIR)\$(LIBNAME).lib
#//------------------------------------------------------------------------
#//
#// Define any local options for the make tools
#// (ie. LCFLAGS, LLFLAGS, LLIBS, LINCS)
#//
#//------------------------------------------------------------------------
LINCS=$(LINCS) -I. \
-I$(PUBLIC)\security
# clobber and clobber_all will remove the following garbage:
GARBAGE= $(GARBAGE) _gen
#//------------------------------------------------------------------------
#//
#// Include the common makefile rules
#//
#//------------------------------------------------------------------------
include <$(DEPTH)/config/rules.mak>
export:: $(LIBRARY)
$(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib

Просмотреть файл

@ -18,6 +18,7 @@
#include "xp.h" #include "xp.h"
#include "plstr.h"
#include "prmon.h" #include "prmon.h"
#ifdef NSPR20 #ifdef NSPR20
@ -906,7 +907,7 @@ xp_FileName (const char *name, XP_FileType type, char* buf, char* configBuf)
if (dot) { if (dot) {
len = dot - name + 1; len = dot - name + 1;
XP_STRNCPY_SAFE(buf, name, len); PL_strncpyz(buf, name, len);
}/* if */ }/* if */
XP_STRCAT (buf, ".nab"); XP_STRCAT (buf, ".nab");
@ -948,7 +949,7 @@ xp_FileName (const char *name, XP_FileType type, char* buf, char* configBuf)
dot = XP_STRRCHR(name, '.'); dot = XP_STRRCHR(name, '.');
if (dot) { if (dot) {
len = dot - name + 1; len = dot - name + 1;
XP_STRNCPY_SAFE(buf, name, len); PL_strncpyz(buf, name, len);
}/* if */ }/* if */
XP_STRCAT (buf, ".vcf"); XP_STRCAT (buf, ".vcf");
@ -984,7 +985,7 @@ xp_FileName (const char *name, XP_FileType type, char* buf, char* configBuf)
dot = XP_STRRCHR(name, '.'); dot = XP_STRRCHR(name, '.');
if (dot) { if (dot) {
len = dot - name + 1; len = dot - name + 1;
XP_STRNCPY_SAFE(buf, name, len); PL_strncpyz(buf, name, len);
}/* if */ }/* if */
XP_STRCAT (buf, ".ldif"); XP_STRCAT (buf, ".ldif");
@ -1077,7 +1078,7 @@ xp_FileName (const char *name, XP_FileType type, char* buf, char* configBuf)
prefbuf, &len) == PREF_NOERROR) prefbuf, &len) == PREF_NOERROR)
&& *prefbuf == '/') && *prefbuf == '/')
/* guard against assert: line 806, file xp_file.c */ /* guard against assert: line 806, file xp_file.c */
XP_STRNCPY_SAFE(buf, prefbuf, len); PL_strncpyz(buf, prefbuf, len);
/* Copy back to the buffer that was passed in. /* Copy back to the buffer that was passed in.
* We couldn't have PREF_GetCharPref() just put it there * We couldn't have PREF_GetCharPref() just put it there
* initially because the size of buf wasn't passed in * initially because the size of buf wasn't passed in
@ -1116,6 +1117,7 @@ xp_FileName (const char *name, XP_FileType type, char* buf, char* configBuf)
name = buf; name = buf;
break; break;
#ifndef NO_SECURITY
case xpCryptoPolicy: case xpCryptoPolicy:
{ {
extern void fe_GetProgramDirectory(char *path, int len); extern void fe_GetProgramDirectory(char *path, int len);
@ -1138,7 +1140,7 @@ xp_FileName (const char *name, XP_FileType type, char* buf, char* configBuf)
sprintf(buf, "%.900s/%s", conf_dir, policyFN); sprintf(buf, "%.900s/%s", conf_dir, policyFN);
break; break;
} }
#endif
case xpPKCS12File: case xpPKCS12File:
/* Convert /a/b/c/foo to /a/b/c/foo.p12 (note leading dot) */ /* Convert /a/b/c/foo to /a/b/c/foo.p12 (note leading dot) */
{ {
@ -1153,7 +1155,7 @@ xp_FileName (const char *name, XP_FileType type, char* buf, char* configBuf)
/* include NULL in length */ /* include NULL in length */
len = XP_STRLEN(name) + 1; len = XP_STRLEN(name) + 1;
XP_STRNCPY_SAFE(buf, name, len); PL_strncpyz(buf, name, len);
/* we want to concatenate ".p12" if it is not the /* we want to concatenate ".p12" if it is not the
* last 4 characters of the name already. * last 4 characters of the name already.
@ -1165,7 +1167,7 @@ xp_FileName (const char *name, XP_FileType type, char* buf, char* configBuf)
* only side effect -- this allows for the filename * only side effect -- this allows for the filename
* ".p12" which is fine. * ".p12" which is fine.
*/ */
if((len >= 5) && XP_STRCASECMP(&(name[len-4-1]), ".p12")) { if((len >= 5) && PL_strcasecmp(&(name[len-4-1]), ".p12")) {
XP_STRCAT(buf, ".p12"); XP_STRCAT(buf, ".p12");
} else if(len < 5) { } else if(len < 5) {
/* can't be ".p12", so we append ".p12" */ /* can't be ".p12", so we append ".p12" */

Просмотреть файл

@ -254,6 +254,7 @@ strncasecomp (const char* one, const char * two, int n)
} }
} }
#ifndef MODULAR_NETLIB /* moved to nsNetStubs.cpp */
/* Allocate a new copy of a block of binary data, and returns it /* Allocate a new copy of a block of binary data, and returns it
*/ */
PUBLIC char * PUBLIC char *
@ -448,6 +449,7 @@ char *XP_Cat(char *a0, ...)
va_end(ap); va_end(ap);
return result; return result;
} }
#endif
/************************************************************************ /************************************************************************
* These are "safe" versions of the runtime library routines. The RTL * These are "safe" versions of the runtime library routines. The RTL

45
lib/xp/xp_stub.c Normal file
Просмотреть файл

@ -0,0 +1,45 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "prlog.h"
#ifdef DEBUG
char *
NOT_NULL (const char *x)
{
PR_ASSERT(x);
return (char *)x;
}
#endif
void XP_AssertAtLine( char *pFileName, int iLine )
{
PR_Assert("XP Assert", pFileName, iLine);
}
/* XP_GetString
*
* This one takes XP string ID (which is used mainly by libnet, libsec)
* and loads String from resource file (netscape.rc3).
*/
char *XP_GetString(int id)
{
return "Not implemented...";
}