+2006-07-04 Helge Hess <helge.hess@opengroupware.org>
+
+ * use %p for pointer formats, fixed gcc 4.1 warnings, minor code
+ cleanups (v4.5.30)
+
2006-05-16 Marcus Mueller <znek@mulle-kybernetik.com>
* EOQualifier+LDAP.h: changed EOControl related includes into imports
return [parts count] > 1
? [parts subarrayWithRange:NSMakeRange(1, [parts count] - 1)]
- : [NSArray array];
+ : (NSArray *)[NSArray array];
}
- (NSArray *)subtypes {
objs[i] = [[NSString alloc] initWithString:@""];
}
else {
- objs[i] = (![data isNotNull]) ? (id)@"" : [self stringFromData:data];
+ objs[i] = [data isNotNull]
+ ? [self stringFromData:data] : (NSString *)@"";
}
}
NSMutableString *s;
s = [NSMutableString stringWithCapacity:100];
- [s appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
+ [s appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])];
[s appendFormat:@" name='%@'", [self attributeName]];
[s appendString:@" values="];
- (BOOL)bindWithMethod:(NSString *)_method
binddn:(NSString *)_login credentials:(NSString *)_cred
{
+ static NSString *loginKey = @"login";
+ NSDictionary *ui;
+ NSException *e;
int method, err;
const char *l, *p;
return YES;
}
- [[self _exceptionForErrorCode:err
- operation:@"bind"
- userInfo:[NSDictionary dictionaryWithObject:_login ? _login : @"<nil>"
- forKey:@"login"]]
- raise];
+ /* exceptions */
+
+ if (_login == nil) _login = @"<nil>";
+ ui = [[NSDictionary alloc]
+ initWithObjects:&_login forKeys:&loginKey count:1];
+ e = [self _exceptionForErrorCode:err operation:@"bind" userInfo:ui];
+ [ui release]; ui = nil;
+
+ [e raise];
return NO;
}
NSMutableString *s;
s = [NSMutableString stringWithCapacity:100];
- [s appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
+ [s appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])];
if ([self isBound])
[s appendString:@" bound"];
if (LDAPDebugEnabled)
[self logWithFormat:@"check pwd of login '%@' on %@", _login, _baseDN];
- if ([_pwd length] == 0) {
+ if (![_pwd isNotEmpty]) {
if (LDAPDebugEnabled) [self logWithFormat:@" no password provided."];
return NO;
}
}
strDN = [self dnForLogin:_login baseDN:_baseDN];
- if ([strDN length] == 0) {
+ if (![strDN isNotEmpty]) {
if (LDAPDebugEnabled) {
[self logWithFormat:@" missing dn for login %@ atBaseDN %@",
_login, _baseDN];
if (LDAPDebugEnabled) {
[self logWithFormat:@" attempting to bind login %@ DN: %@ %s!",
_login, strDN,
- [_pwd length] > 0 ? "(with password) " : "(empty password) "];
+ [_pwd isNotEmpty] ? "(with password) " : "(empty password) "];
}
/*
NSLog(@"LDAP: check pwd of login '%@' on %@,%i,%@ ...",
_login, _hostName, _port, _baseDN);
}
- if ([_pwd length] == 0) {
+ if (![_pwd isNotEmpty]) {
if (LDAPDebugEnabled) [self logWithFormat:@" no password provided."];
return NO;
}
NSMutableString *s;
s = [NSMutableString stringWithCapacity:100];
- [s appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
+ [s appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])];
[s appendFormat:@" dn='%@'", [self dn]];
if ((nctxs = [self->connection namingContexts])) {
if ([nctxs count] > 1)
NSLog(@"WARNING: more than one naming context handled by server !");
- if ([nctxs count] > 0)
+ if ([nctxs isNotEmpty])
_rootDN = [[nctxs objectAtIndex:0] lowercaseString];
}
}
if (![_path isAbsolutePath])
_path = [[self currentDirectoryPath] stringByAppendingPathComponent:_path];
- if ([_path length] == 0) return nil;
+ if (![_path isNotEmpty]) return nil;
NSAssert1([_path isAbsolutePath],
@"path %@ is not an absolute path (after append to cwd) !", _path);
if ([pathComponent isEqualToString:@"."])
continue;
- if ([pathComponent length] == 0)
+ if (![pathComponent isNotEmpty])
continue;
if ([pathComponent isEqualToString:@"/"]) {
NSString *dn;
NSString *path;
- if ([_path length] == 0)
+ if (![_path isNotEmpty])
return NO;
if ((dn = [self dnForPath:_path]) == nil)
NSMutableString *ms;
ms = [NSMutableString stringWithCapacity:64];
- [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
+ [ms appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])];
if (self->rootDN)
[ms appendFormat:@" root=%@", self->rootDN];
NSString *d;
s = [[NSMutableString alloc] init];
- [s appendFormat:@"<0x%08X[%@]: ", self, NSStringFromClass([self class])];
+ [s appendFormat:@"<0x%p[%@]: ", self, NSStringFromClass([self class])];
[s appendFormat:@" host=%@", self->host];
[s appendFormat:@" port=%i", self->port];
[s appendFormat:@" dn=%@", self->dn];
NSMutableString *s;
s = [NSMutableString stringWithCapacity:100];
- [s appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
+ [s appendFormat:@"<0x%p[%@]:", self, NSStringFromClass([self class])];
[s appendFormat:@" msgid=%i", [self messageID]];
[s appendFormat:@" duration=%.2fs", [self duration]];
s = [[NSMutableString alloc] initWithCapacity:200];
[s appendString:@"ldap://"];
- [s appendString:self->host ? self->host : @"localhost"];
+ [s appendString:self->host != nil ? self->host : (NSString *)@"localhost"];
if (self->port > 0) [s appendFormat:@":%i", self->port];
[s appendString:@"/"];
NSString *s;
s = _stripSpaces(self);
- if ([s length] == 0)
+ if (![s isNotEmpty])
return _component;
s = [dnSeparator stringByAppendingString:self];
MAJOR_VERSION=4
MINOR_VERSION=5
-SUBMINOR_VERSION:=29
+SUBMINOR_VERSION:=30