Changes from Scott Christley. See ChangeLog Mar 4 10:47:18

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2295 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Andrew McCallum 1997-05-03 17:25:25 +00:00
parent 89f78cc23b
commit 2969f845d4
6 changed files with 24 additions and 26 deletions

View file

@ -42,6 +42,13 @@ extern NSLog_printf_handler *_NSLog_printf_handler;
extern void NSLog (NSString* format, ...);
extern void NSLogv (NSString* format, va_list args);
/* Debug logging which can be enabled/disabled */
#ifdef DEBUGLOG
#define NSDebugLog(format, args...) NSLog(format, ## args)
#else
#define NSDebugLog(format, args...)
#endif
#ifndef YES
#define YES 1
#endif YES

View file

@ -68,6 +68,7 @@ typedef enum _NSStringEncoding
length: (unsigned int)length;
+ (NSString*) stringWithCString: (const char*) byteString;
+ (NSString*) stringWithFormat: (NSString*)format,...;
+ (NSString*) stringWithContentsOfFile:(NSString *)path;
// Initializing Newly Allocated Strings
- (id) initWithCharactersNoCopy: (unichar*)chars

View file

@ -58,7 +58,7 @@
#endif
#include <Foundation/NSObject.h>
@class String;
#include <Foundation/NSObjCRuntime.h>
/* The following group of lines maintained by the gstep-base src/Makefile */
#define @VERSION@

View file

@ -112,12 +112,6 @@ static NSString* platform =
#else
nil;
#endif
static NSString* gnustep_libdir =
#ifdef GNUSTEP_INSTALL_LIBDIR
@GNUSTEP_INSTALL_LIBDIR;
#else
nil;
#endif
/* Declaration from find_exec.c */
extern char *objc_find_executable(const char *name);
@ -502,17 +496,6 @@ _bundle_load_callback(Class theClass, Category *theCategory)
while ((language = [enumerate nextObject]))
[array addObject: _bundle_resource_path(primary, bundlePath, language)];
if (gnustep_libdir)
{
primary = [NSString stringWithCString: [gnustep_libdir cString]];
[array addObject: _bundle_resource_path(primary, bundlePath, nil)];
enumerate = [languages objectEnumerator];
while ((language = [enumerate nextObject]))
[array addObject:
_bundle_resource_path(primary, bundlePath, language)];
}
return array;
}

View file

@ -28,6 +28,12 @@
#include <Foundation/NSLock.h>
static NSString* NSCharacterSet_PATH = @"NSCharacterSets";
static NSString* gnustep_libdir =
#ifdef GNUSTEP_INSTALL_LIBDIR
@GNUSTEP_INSTALL_LIBDIR;
#else
nil;
#endif
/* A simple array for caching standard bitmap sets */
#define MAX_STANDARD_SETS 12
@ -61,6 +67,7 @@ static NSLock* cache_lock = nil;
{
NSCharacterSet* set;
NSString *path;
NSBundle *gstep_base_bundle = [NSBundle bundleWithPath: gnustep_libdir];
if (!cache_lock)
cache_lock = [NSLock new];
@ -70,15 +77,15 @@ static NSLock* cache_lock = nil;
if (cache_set[number] == nil)
{
NS_DURING
path = [NSBundle pathForResource:setname
ofType:@"dat"
inDirectory:NSCharacterSet_PATH];
path = [gstep_base_bundle pathForResource:setname
ofType:@"dat"
inDirectory:NSCharacterSet_PATH];
/* This is for testing purposes */
if (path == nil || [path length] == 0)
{
path = [NSBundle pathForResource:setname
ofType:@"dat"
inDirectory:@"../NSCharacterSets"];
path = [gstep_base_bundle pathForResource:setname
ofType:@"dat"
inDirectory:@"../NSCharacterSets"];
}
if (path == nil || [path length] == 0)

View file

@ -1230,7 +1230,7 @@ handle_printf_atsign (FILE *stream,
NSString *newstring;
range = [self rangeOfString:@"/" options:NSBackwardsSearch];
if (range.length == 0 && range.location != [self length] - 1)
if (range.location != ([self length] - 1))
newstring = [self stringByAppendingString:@"/"];
else
newstring = self;
@ -1248,7 +1248,7 @@ handle_printf_atsign (FILE *stream,
NSString *newstring;
range = [self rangeOfString:@"." options:NSBackwardsSearch];
if ((range.length == 0) && (range.location != ([self length] - 1)))
if (range.location != ([self length] - 1))
newstring = [self stringByAppendingString:@"."];
else
newstring = self;