[OGo-GNUstep-Port] NSString extensions
Filip Van Raemdonck
gnustep-port@opengroupware.org
Fri, 18 Jul 2003 20:28:18 +0200
--WhfpMioaduB5tiZL
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Hi,
Some string extensions used in OGo are not in gnustep-base anymore;
attached is a patch which fixes that by changing the conditions whether
they should be built internally or not.
Also in the patch are two more small fixes, one for (not) linking
Foundation extensions and another for (not) including Foundation
extension headers.
Regards,
Filip
--
<liiwi> www.benefon.fi is running Microsoft-IIS/4.0 on Solaris
<netgod> neat trick
<liiwi> hmms. how come I think that netcraft is on crack
--WhfpMioaduB5tiZL
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff-skyrix-core
--- opengroupware.org-core-0.9.0cvs20030718.orig/NGExtensions/FdExt.subproj/NSString+misc.m
+++ opengroupware.org-core-0.9.0cvs20030718/NGExtensions/FdExt.subproj/NSString+misc.m
@@ -20,9 +20,9 @@
*/
// $Id: NSString+misc.m,v 1.3 2003/07/11 17:12:49 jan Exp $
-#import "common.h"
-#import "NGMemoryAllocation.h"
-#import "NSString+misc.h"
+#include "common.h"
+#include "NGMemoryAllocation.h"
+#include "NSString+misc.h"
#if !LIB_FOUNDATION_LIBRARY && !GNUSTEP_BASE_LIBRARY
# import <FoundationExt/objc-api.h>
@@ -66,7 +66,7 @@
}
buffer[pos] = '\0';
-#if NeXT_Foundation_LIBRARY
+#if NeXT_Foundation_LIBRARY || GNUSTEP_BASE_LIBRARY
{
NSString *s;
--- opengroupware.org-core-0.9.0cvs20030718.orig/NGExtensions/NGExtensions/NSString+Ext.h
+++ opengroupware.org-core-0.9.0cvs20030718/NGExtensions/NGExtensions/NSString+Ext.h
@@ -23,31 +23,40 @@
#ifndef __NGExtensions_NSString_Ext_H__
#define __NGExtensions_NSString_Ext_H__
#import <Foundation/NSString.h>
-/* specific to gstep-base, supported in libFoundation */
+#if !LIB_FOUNDATION_LIBRARY
+
+@interface NSString(lfNSURLUtilities)
+
+- (BOOL)isAbsoluteURL;
+- (NSString *)urlScheme;
-#if !LIB_FOUNDATION_LIBRARY && !GNUSTEP_BASE_LIBRARY
+@end
@interface NSString(GSAdditions)
+/* the following are not available in gstep-base 1.6 */
+
- (NSString *)stringWithoutPrefix:(NSString *)_prefix;
- (NSString *)stringWithoutSuffix:(NSString *)_suffix;
+- (NSString *)stringByTrimmingLeadWhiteSpaces;
+- (NSString *)stringByTrimmingTailWhiteSpaces;
+- (NSString *)stringByTrimmingWhiteSpaces;
+
+#if !GNUSTEP_BASE_LIBRARY
- (NSString *)stringByReplacingString:(NSString *)_orignal
withString:(NSString *)_replacement;
- (NSString *)stringByTrimmingLeadSpaces;
- (NSString *)stringByTrimmingTailSpaces;
- (NSString *)stringByTrimmingSpaces;
-
-/* the following are not available in gstep-base 1.6 ? */
-- (NSString *)stringByTrimmingLeadWhiteSpaces;
-- (NSString *)stringByTrimmingTailWhiteSpaces;
-- (NSString *)stringByTrimmingWhiteSpaces;
+#endif
@end /* NSString(GSAdditions) */
+#if !GNUSTEP_BASE_LIBRARY
@interface NSMutableString(GNUstepCompatibility)
- (void)trimLeadSpaces;
@@ -55,20 +64,8 @@
- (void)trimSpaces;
@end /* NSMutableString(GNUstepCompatibility) */
+#endif /* !GNUSTEP_BASE_LIBRARY */
-#endif
-
-/* specific to libFoundation */
-
-#if !LIB_FOUNDATION_LIBRARY
-
-@interface NSString(lfNSURLUtilities)
-
-- (BOOL)isAbsoluteURL;
-- (NSString *)urlScheme;
-
-@end
-
-#endif
+#endif /* !LIB_FOUNDATION_LIBRARY */
#endif /* __NGExtensions_NSString_Ext_H__ */
--- opengroupware.org-core-0.9.0cvs20030718.orig/NGStreams/GNUmakefile.preamble
+++ opengroupware.org-core-0.9.0cvs20030718/NGStreams/GNUmakefile.preamble
@@ -10,7 +10,7 @@
endif
ifeq ($(FOUNDATION_LIB),nx)
-libNGStreams_LIBRARIES_DEPEND_UPON += -lFoundationExt
+#libNGStreams_LIBRARIES_DEPEND_UPON += -lFoundationExt
endif
ifeq ($(reentrant),yes)
--- opengroupware.org-core-0.9.0cvs20030718.orig/NGStreams/common.h
+++ opengroupware.org-core-0.9.0cvs20030718/NGStreams/common.h
@@ -25,7 +25,7 @@
// common include files
-#import <Foundation/Foundation.h>
+#include <Foundation/Foundation.h>
// configuration
@@ -55,8 +55,10 @@
# import <FoundationExt/NSException.h>
# import <FoundationExt/NSObjectMacros.h>
#else
+#ifndef GNUSTEP_BASE_LIBRARY
# include <extensions/exceptions/GeneralExceptions.h>
#endif
+#endif
#if !LIB_FOUNDATION_LIBRARY && !NeXT_Foundation_LIBRARY
# define NSWillBecomeMultiThreadedNotification NSBecomingMultiThreaded
--WhfpMioaduB5tiZL--