From ccf76ff3ee0357cb8a08f7f536061b2bded39d9e Mon Sep 17 00:00:00 2001 From: atotic Date: Fri, 15 May 1998 16:59:14 +0000 Subject: [PATCH] Removed NSstring.* because of conflicts with raptor, renamed to macstrdlibxetras git-svn-id: svn://10.0.0.236/trunk@1750 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/lib/mac/NSStdLib/include/NSstring.h | 27 ---- mozilla/lib/mac/NSStdLib/src/NSstring.c | 140 -------------------- 2 files changed, 167 deletions(-) delete mode 100644 mozilla/lib/mac/NSStdLib/include/NSstring.h delete mode 100644 mozilla/lib/mac/NSStdLib/src/NSstring.c diff --git a/mozilla/lib/mac/NSStdLib/include/NSstring.h b/mozilla/lib/mac/NSStdLib/include/NSstring.h deleted file mode 100644 index 499ef2f4986..00000000000 --- a/mozilla/lib/mac/NSStdLib/include/NSstring.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -*- 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. - */ - -/* - Definitions for all routines normally found in string.h, but not there in the Metrowerks - ANSII headers. -*/ -extern char *strdup(const char *source); - -extern int strcasecmp(const char*, const char*); - -extern int strncasecmp(const char*, const char*, int length); diff --git a/mozilla/lib/mac/NSStdLib/src/NSstring.c b/mozilla/lib/mac/NSStdLib/src/NSstring.c deleted file mode 100644 index 997d53ea655..00000000000 --- a/mozilla/lib/mac/NSStdLib/src/NSstring.c +++ /dev/null @@ -1,140 +0,0 @@ -/* -*- 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 -#include - -#include -#include -#include - -/* - -#include "prtypes.h" -#ifndef NSPR20 -#include "prglobal.h" -#endif - -#include "xp_mem.h" -*/ -#include "NSstring.h" - -extern void* Flush_Allocate(size_t, Boolean); - -int strcmpcore(const char*, const char*, int, int); - - -/* -size_t strlen(const char *source) -{ - size_t currentLength = 0; - - if (source == NULL) - return currentLength; - - while (*source++ != '\0') - currentLength++; - - return currentLength; -} -*/ - -int strcmpcore(const char *str1, const char *str2, int caseSensitive, int length) -{ - char currentChar1, currentChar2; - int compareLength = (length >= 0); - - while (1) { - - if (compareLength) { - - if ( length <= 0 ) - return 0; - length--; - - } - - currentChar1 = *str1; - currentChar2 = *str2; - - if (!caseSensitive) { - - if ((currentChar1 >= 'a') && (currentChar1 <= 'z')) - currentChar1 += ('A' - 'a'); - - if ((currentChar2 >= 'a') && (currentChar2 <= 'z')) - currentChar2 += ('A' - 'a'); - - - } - - if (currentChar1 == '\0') - break; - - if (currentChar1 != currentChar2) - return currentChar1 - currentChar2; - - str1++; - str2++; - - } - - return currentChar1 - currentChar2; -} - -/* -int strcmp(const char *str1, const char *str2) -{ - return strcmpcore(str1, str2, true, -1); -} -*/ - -int strcasecmp(const char *str1, const char *str2) -{ - /* This doesnÕt really belong here; but since it uses strcmpcore, weÕll keep it. */ - return strcmpcore(str1, str2, false, -1); -} - - -int strncasecmp(const char *str1, const char *str2, int length) -{ - /* This doesnÕt really belong here; but since it uses strcmpcore, weÕll keep it. */ - return strcmpcore(str1, str2, false, length); -} - - -char *strdup(const char *source) -{ - char *newAllocation; - size_t stringLength; - -/* -#ifdef DEBUG - PR_ASSERT(source); -#endif -*/ - - stringLength = strlen(source) + 1; - - /* since this gets freed by an XP_FREE, it must do an XP_ALLOC */ - /* newAllocation = (char *)XP_ALLOC(stringLength); */ - newAllocation = (char *)Flush_Allocate(stringLength, 0); - if (newAllocation == NULL) - return NULL; - BlockMoveData(source, newAllocation, stringLength); - return newAllocation; -}