mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 09:02:01 +00:00
Misc bugfixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@3184 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
187adaade4
commit
38e2c2f7c1
2 changed files with 40 additions and 12 deletions
|
@ -32,6 +32,14 @@
|
||||||
|
|
||||||
#include "../Tools/gdnc.h"
|
#include "../Tools/gdnc.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Macros to build text to start name server and to give an error
|
||||||
|
* message about it - they include installation path information.
|
||||||
|
*/
|
||||||
|
#define stringify_it(X) #X
|
||||||
|
#define make_gdnc_cmd(X) stringify_it(X) "/Tools/"GNUSTEP_TARGET_DIR"/gdnc &"
|
||||||
|
#define make_gdnc_err(X) "check that " stringify_it(X) "/Tools/"GNUSTEP_TARGET_DIR"/gdnc is running."
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Global variables for distributed notification center types.
|
* Global variables for distributed notification center types.
|
||||||
*/
|
*/
|
||||||
|
@ -45,7 +53,7 @@ NSString *NSLocalNotificationCenterType =
|
||||||
- (void) postNotificationName: (NSString*)name
|
- (void) postNotificationName: (NSString*)name
|
||||||
object: (NSString*)object
|
object: (NSString*)object
|
||||||
userInfo: (NSData*)info
|
userInfo: (NSData*)info
|
||||||
selector: (SEL)aSelector
|
selector: (NSString*)aSelector
|
||||||
to: (unsigned long)observer;
|
to: (unsigned long)observer;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@ -131,7 +139,7 @@ static NSDistributedNotificationCenter *defCenter = nil;
|
||||||
[NSException raise: NSInvalidArgumentException
|
[NSException raise: NSInvalidArgumentException
|
||||||
format: @"nul selector"];
|
format: @"nul selector"];
|
||||||
}
|
}
|
||||||
if (notificationName != nil ||
|
if (notificationName != nil &&
|
||||||
[notificationName isKindOfClass: [NSString class]] == NO)
|
[notificationName isKindOfClass: [NSString class]] == NO)
|
||||||
{
|
{
|
||||||
[NSException raise: NSInvalidArgumentException
|
[NSException raise: NSInvalidArgumentException
|
||||||
|
@ -153,7 +161,7 @@ static NSDistributedNotificationCenter *defCenter = nil;
|
||||||
{
|
{
|
||||||
[self _connect];
|
[self _connect];
|
||||||
[(id<GDNCProtocol>)remote addObserver: (unsigned long)anObserver
|
[(id<GDNCProtocol>)remote addObserver: (unsigned long)anObserver
|
||||||
selector: aSelector
|
selector: NSStringFromSelector(aSelector)
|
||||||
name: notificationName
|
name: notificationName
|
||||||
object: anObject
|
object: anObject
|
||||||
suspensionBehavior: suspensionBehavior
|
suspensionBehavior: suspensionBehavior
|
||||||
|
@ -323,8 +331,27 @@ static NSDistributedNotificationCenter *defCenter = nil;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
[NSException raise: NSInternalInconsistencyException
|
static BOOL recursion = NO;
|
||||||
format: @"unable to contact GDNC server"];
|
|
||||||
|
if (recursion == NO)
|
||||||
|
{
|
||||||
|
NSLog(@"NSDistributedNotificationCenter failed to contact GDNC server.\n");
|
||||||
|
NSLog(@"Attempting to start GDNC process - this will take several seconds.\n");
|
||||||
|
system(make_gdnc_cmd(GNUSTEP_INSTALL_PREFIX));
|
||||||
|
sleep(8);
|
||||||
|
NSLog(@"Retrying connection to the GDNC server.\n");
|
||||||
|
recursion = YES;
|
||||||
|
[self _connect];
|
||||||
|
recursion = NO;
|
||||||
|
NSLog(@"Connection to GDNC server established.\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
recursion = NO;
|
||||||
|
[NSException raise: NSInternalInconsistencyException
|
||||||
|
format: @"unable to contact GDNC server - %s",
|
||||||
|
make_gdnc_err(GNUSTEP_INSTALL_PREFIX)];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -348,7 +375,7 @@ static NSDistributedNotificationCenter *defCenter = nil;
|
||||||
- (void) postNotificationName: (NSString*)name
|
- (void) postNotificationName: (NSString*)name
|
||||||
object: (NSString*)object
|
object: (NSString*)object
|
||||||
userInfo: (NSData*)info
|
userInfo: (NSData*)info
|
||||||
selector: (SEL)aSelector
|
selector: (NSString*)aSelector
|
||||||
to: (unsigned long)observer
|
to: (unsigned long)observer
|
||||||
{
|
{
|
||||||
id userInfo;
|
id userInfo;
|
||||||
|
@ -359,7 +386,8 @@ static NSDistributedNotificationCenter *defCenter = nil;
|
||||||
notification = [NSNotification notificationWithName: name
|
notification = [NSNotification notificationWithName: name
|
||||||
object: object
|
object: object
|
||||||
userInfo: userInfo];
|
userInfo: userInfo];
|
||||||
[recipient performSelector: aSelector withObject: notification];
|
[recipient performSelector: sel_get_any_typed_uid([aSelector cString])
|
||||||
|
withObject: notification];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -249,11 +249,11 @@ const NSHashTableCallBacks NSIntHashCallBacks =
|
||||||
|
|
||||||
const NSHashTableCallBacks NSNonOwnedPointerHashCallBacks =
|
const NSHashTableCallBacks NSNonOwnedPointerHashCallBacks =
|
||||||
{
|
{
|
||||||
(NSHT_hash_func_t) _NS_owned_void_p_hash,
|
(NSHT_hash_func_t) _NS_non_owned_void_p_hash,
|
||||||
(NSHT_isEqual_func_t) _NS_owned_void_p_is_equal,
|
(NSHT_isEqual_func_t) _NS_non_owned_void_p_is_equal,
|
||||||
(NSHT_retain_func_t) _NS_owned_void_p_retain,
|
(NSHT_retain_func_t) _NS_non_owned_void_p_retain,
|
||||||
(NSHT_release_func_t) _NS_owned_void_p_release,
|
(NSHT_release_func_t) _NS_non_owned_void_p_release,
|
||||||
(NSHT_describe_func_t) _NS_owned_void_p_describe
|
(NSHT_describe_func_t) _NS_non_owned_void_p_describe
|
||||||
};
|
};
|
||||||
|
|
||||||
const NSHashTableCallBacks NSNonRetainedObjectHashCallBacks =
|
const NSHashTableCallBacks NSNonRetainedObjectHashCallBacks =
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue