From ee1b63a7ad7c3713480ba92393a31fb349310664 Mon Sep 17 00:00:00 2001 From: fedor Date: Mon, 16 Nov 1998 19:36:51 +0000 Subject: [PATCH] Add methods from Rhapsody. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@3220 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 15 ++++++++++++ Headers/gnustep/base/NSBundle.h | 2 ++ Headers/gnustep/base/NSCharacterSet.h | 1 + Headers/gnustep/base/NSConnection.h | 20 +++++++++++++++- Headers/gnustep/base/NSLock.h | 6 +++++ Headers/gnustep/base/fast.x | 1 + Source/NSBundle.m | 10 ++++++++ Source/NSCharacterSet.m | 5 ++++ Source/NSConnection.m | 33 +++++++++++++++++++++++++-- Source/NSLock.m | 26 +++++++++++++++++++++ 10 files changed, 116 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index f1ac17d4e..54d1c4794 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +Mon Nov 16 14:29:35 1998 Adam Fedor + + * src/NSBundle.m [+allBundles]: New method (unimplemented). + [+allFrameworks]: Likewise. + * src/NSCharacterSet.m [+punctuationCharacterSet]: Likewise. + * src/NSLock.m [-lockBeforeDate:]: Likewise. + [-lockWhenCondition:beforeDate:]: Likewise. + * src/NSConnection.m: Likewise. + * src/include/NSBundle.h: New methods; + * src/include/NSCharacterSet.h: Likewise. + * src/include/NSLock.h: Likewise. + * src/include/NSConnection.h: Likewise. + + * src/include/fast.x: Fix /* in comment. + Thu Nov 12 17:30:00 1998 Richard Frith-Macdonald src/NSFormatter.m: New class diff --git a/Headers/gnustep/base/NSBundle.h b/Headers/gnustep/base/NSBundle.h index f7aa67b12..5e51a52fb 100644 --- a/Headers/gnustep/base/NSBundle.h +++ b/Headers/gnustep/base/NSBundle.h @@ -45,6 +45,8 @@ extern NSString* NSLoadedClasses; unsigned int _version; } ++ (NSArray *) allBundles; ++ (NSArray *) allFrameworks; + (NSBundle *) mainBundle; + (NSBundle *) bundleForClass: (Class)aClass; + (NSBundle *) bundleWithPath: (NSString *)path; diff --git a/Headers/gnustep/base/NSCharacterSet.h b/Headers/gnustep/base/NSCharacterSet.h index 79b7d89e9..5a6adf1ac 100644 --- a/Headers/gnustep/base/NSCharacterSet.h +++ b/Headers/gnustep/base/NSCharacterSet.h @@ -39,6 +39,7 @@ + (NSCharacterSet *)letterCharacterSet; + (NSCharacterSet *)lowercaseLetterCharacterSet; + (NSCharacterSet *)nonBaseCharacterSet; ++ (NSCharacterSet *)punctuationCharacterSet; + (NSCharacterSet *)uppercaseLetterCharacterSet; + (NSCharacterSet *)whitespaceAndNewlineCharacterSet; + (NSCharacterSet *)whitespaceCharacterSet; diff --git a/Headers/gnustep/base/NSConnection.h b/Headers/gnustep/base/NSConnection.h index 7d98211dd..567bc69d3 100644 --- a/Headers/gnustep/base/NSConnection.h +++ b/Headers/gnustep/base/NSConnection.h @@ -37,6 +37,7 @@ @class NSDistantObject; @class NSPort; +@class NSData; /* * Keys for the NSDictionary returned by [NSConnection -statistics] @@ -85,17 +86,23 @@ extern NSString *NSConnectionProxyCount; /* Objects received */ + (NSArray*) allConnections; + (NSConnection*) connectionWithRegisteredName: (NSString*)n host: (NSString*)h; ++ (id)currentConversation; + (NSConnection*) defaultConnection; + (NSDistantObject*) rootProxyForConnectionWithRegisteredName: (NSString*)name host: (NSString*)host; - (void) addRequestMode: (NSString*)mode; +- (void) addRunLoop: (NSRunLoop *)runloop; - (id) delegate; +- (void) enableMultipleThreads; +- (BOOL) multipleThreadsEnabled; - (BOOL) independantConversationQueueing; - (void) invalidate; - (BOOL) isValid; - (BOOL) registerName: (NSString*)name; +- (NSArray *) remoteObjects; - (void) removeRequestMode: (NSString*)mode; +- (void) removeRunLoop: (NSRunLoop *)runloop; - (NSTimeInterval) replyTimeout; - (NSArray*) requestModes; - (NSTimeInterval) requestTimeout; @@ -211,7 +218,12 @@ extern NSString *NSConnectionProxyCount; /* Objects received */ - (void) addProxy: (NSDistantObject*)aProxy; - (id) includesProxyForTarget: (void*)target; - (void) removeProxy: (NSDistantObject*)aProxy; -- (id ) localObjects; + +// It seems to be a non pure-OPENSTEP definition... +//- (id ) localObjects; +// +// new def : +- (NSArray *)localObjects; - (void) addLocalObject: anObj; - (id) includesLocalObject: anObj; - (void) removeLocalObject: anObj; @@ -276,6 +288,12 @@ extern NSString *ConnectionBecameInvalidNotification; * sent bycopy, in which case the actual object is returned. * To force bycopy, an object should return itsself. */ + + +- (BOOL)authenticateComponents: (NSArray *)components + withData: (NSData *)authenticationData; +- (NSData *)authenticationDataForComponents: (NSArray *)components; + @end #define CONNECTION_DEFAULT_TIMEOUT 15.0 /* in seconds */ diff --git a/Headers/gnustep/base/NSLock.h b/Headers/gnustep/base/NSLock.h index a0edcbca6..8e5b3b3e7 100644 --- a/Headers/gnustep/base/NSLock.h +++ b/Headers/gnustep/base/NSLock.h @@ -55,6 +55,7 @@ } - (BOOL)tryLock; +- (BOOL)lockBeforeDate:(NSDate *)limit; // NSLocking protocol - (void)lock; @@ -85,6 +86,10 @@ - (void)unlockWithCondition:(int)value; - (BOOL)tryLock; - (BOOL)tryLockWhenCondition:(int)value; +// Acquiring the lock with a date condition +- (BOOL)lockBeforeDate:(NSDate *)limit; +- (BOOL)lockWhenCondition:(int)condition + beforeDate:(NSDate *)limit; // NSLocking protocol - (void)lock; @@ -107,6 +112,7 @@ } - (BOOL)tryLock; +- (BOOL)lockBeforeDate:(NSDate *)limit; // NSLocking protocol - (void)lock; diff --git a/Headers/gnustep/base/fast.x b/Headers/gnustep/base/fast.x index 53402a890..2fa36c140 100644 --- a/Headers/gnustep/base/fast.x +++ b/Headers/gnustep/base/fast.x @@ -114,6 +114,7 @@ extern void _fastBuildCache(); * The '_fastMallocBuffer()' function is called to get a chunk of * memory that will automatically be released when the current * autorelease pool goes away. + */ extern void *_fastMallocBuffer(unsigned size); /* diff --git a/Source/NSBundle.m b/Source/NSBundle.m index 9722f337c..6cb97ee5f 100644 --- a/Source/NSBundle.m +++ b/Source/NSBundle.m @@ -246,6 +246,16 @@ _bundle_load_callback(Class theClass, Category *theCategory) } } ++ (NSArray *) allBundles +{ + return [self notImplemented: _cmd]; +} + ++ (NSArray *) allFrameworks +{ + return [self notImplemented: _cmd]; +} + + (NSBundle *)mainBundle { [load_lock lock]; diff --git a/Source/NSCharacterSet.m b/Source/NSCharacterSet.m index e46fd1df1..6fd9392ee 100644 --- a/Source/NSCharacterSet.m +++ b/Source/NSCharacterSet.m @@ -229,6 +229,11 @@ static NSLock* cache_lock = nil; return [self _bitmapForSet:@"nonbaseCharSet" number: 7]; } ++ (NSCharacterSet *)punctuationCharacterSet; +{ + return [self notImplemented: _cmd]; +} + + (NSCharacterSet *)uppercaseLetterCharacterSet { return [self _bitmapForSet:@"uppercaseCharSet" number: 8]; diff --git a/Source/NSConnection.m b/Source/NSConnection.m index 074a31e93..ba8e1e077 100644 --- a/Source/NSConnection.m +++ b/Source/NSConnection.m @@ -362,6 +362,12 @@ static int messages_received_count; return newConn; } ++ (id)currentConversation +{ + [self notImplemented: _cmd]; + return self; +} + + (NSDistantObject*) rootProxyForConnectionWithRegisteredName: (NSString*)n host: (NSString*)h { @@ -444,6 +450,18 @@ static int messages_received_count; return independant_queueing; } +- (void) enableMultipleThreads +{ + [self notImplemented: _cmd]; +} + +- (BOOL) multipleThreadsEnabled +{ + [self notImplemented: _cmd]; + return NO; +} + + - (id) init { id newPort = [[default_receive_port_class newForReceiving] autorelease]; @@ -560,6 +578,12 @@ static int messages_received_count; [super release]; } +- (NSArray *) remoteObjects +{ + [self notImplemented: _cmd]; + return nil; +} + - (void) removeRequestMode: (NSString*)mode { if ([request_modes containsObject:mode]) { @@ -568,6 +592,11 @@ static int messages_received_count; } } +- (void) removeRunLoop: (NSRunLoop *)runloop +{ + [self notImplemented: _cmd]; +} + - (NSTimeInterval) replyTimeout { return reply_timeout; @@ -1922,7 +1951,7 @@ static int messages_received_count; [self _release_targets:&aProxy count:1]; } -- (id ) localObjects +- (NSArray *) localObjects { id c; @@ -1933,7 +1962,7 @@ static int messages_received_count; return c; } -- (id ) proxies +- (NSArray *) proxies { id c; diff --git a/Source/NSLock.m b/Source/NSLock.m index b6c989070..9e33c5810 100644 --- a/Source/NSLock.m +++ b/Source/NSLock.m @@ -102,6 +102,12 @@ NSString *NSRecursiveLockException = @"NSRecursiveLockException"; return YES; } +- (BOOL)lockBeforeDate:(NSDate *)limit +{ + [self notImplemented: _cmd]; + return NO; +} + // NSLocking protocol - (void) lock { @@ -290,6 +296,20 @@ NSString *NSRecursiveLockException = @"NSRecursiveLockException"; } } +// Acquiring the lock with a date condition +- (BOOL)lockBeforeDate:(NSDate *)limit +{ + [self notImplemented: _cmd]; + return NO; +} + +- (BOOL)lockWhenCondition:(int)condition + beforeDate:(NSDate *)limit +{ + [self notImplemented: _cmd]; + return NO; +} + // NSLocking protocol // These methods ignore the condition - (void) lock @@ -376,6 +396,12 @@ NSString *NSRecursiveLockException = @"NSRecursiveLockException"; return YES; } +- (BOOL)lockBeforeDate:(NSDate *)limit +{ + [self notImplemented: _cmd]; + return NO; +} + // NSLocking protocol - (void) lock {