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:
mccallum 1997-05-03 17:25:25 +00:00
parent 47f8cb6098
commit ec967cff6b
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 NSLog (NSString* format, ...);
extern void NSLogv (NSString* format, va_list args); 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 #ifndef YES
#define YES 1 #define YES 1
#endif YES #endif YES

View file

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

View file

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

View file

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

View file

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

View file

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