mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 17:12:03 +00:00
More tidyups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@12019 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
1d5e765abd
commit
81589b35ad
5 changed files with 93 additions and 122 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2002-01-07 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Tools/AGSHtml.m: Minor speedup.
|
||||||
|
* Tools/AGSParser.m: Rewrite handling of standards information to fix
|
||||||
|
bug in NO_GNUSTEP handling.
|
||||||
|
* Source/GNUmakefile: Don't document concrete number stuff ... not
|
||||||
|
public.
|
||||||
|
|
||||||
Sun Jan 6 22:33:55 2002 Nicola Pero <n.pero@mi.flashnet.it>
|
Sun Jan 6 22:33:55 2002 Nicola Pero <n.pero@mi.flashnet.it>
|
||||||
|
|
||||||
* Tools/HTMLLinker.m: Rewritten to fixup links by link name rather
|
* Tools/HTMLLinker.m: Rewritten to fixup links by link name rather
|
||||||
|
|
|
@ -95,9 +95,11 @@
|
||||||
Class isa;
|
Class isa;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NO_GNUSTEP
|
||||||
#if GS_WITH_GC
|
#if GS_WITH_GC
|
||||||
+ (BOOL) requiresTypedMemory;
|
+ (BOOL) requiresTypedMemory;
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
+ (void) initialize;
|
+ (void) initialize;
|
||||||
+ (id) allocWithZone: (NSZone*)z;
|
+ (id) allocWithZone: (NSZone*)z;
|
||||||
+ (id) alloc;
|
+ (id) alloc;
|
||||||
|
@ -164,6 +166,8 @@ NSComparisonResult;
|
||||||
|
|
||||||
enum {NSNotFound = 0x7fffffff};
|
enum {NSNotFound = 0x7fffffff};
|
||||||
|
|
||||||
|
#ifndef NO_GNUSTEP
|
||||||
|
|
||||||
@interface NSObject (NEXTSTEP)
|
@interface NSObject (NEXTSTEP)
|
||||||
- error:(const char *)aString, ...;
|
- error:(const char *)aString, ...;
|
||||||
- notImplemented:(SEL)aSel;
|
- notImplemented:(SEL)aSel;
|
||||||
|
@ -171,7 +175,6 @@ enum {NSNotFound = 0x7fffffff};
|
||||||
Removed because OpenStep has -(NSString*)name; */
|
Removed because OpenStep has -(NSString*)name; */
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#ifndef NO_GNUSTEP
|
|
||||||
/* Global lock to be used by classes when operating on any global
|
/* Global lock to be used by classes when operating on any global
|
||||||
data that invoke other methods which also access global; thus,
|
data that invoke other methods which also access global; thus,
|
||||||
creating the potential for deadlock. */
|
creating the potential for deadlock. */
|
||||||
|
@ -189,7 +192,7 @@ GS_EXPORT NSRecursiveLock *gnustep_global_lock;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface NSObject (GNU)
|
@interface NSObject (GNU)
|
||||||
- (int) compare: (id)anObject;
|
- (NSComparisonResult) compare: (id)anObject;
|
||||||
/*
|
/*
|
||||||
* Default description methods -
|
* Default description methods -
|
||||||
* [descriptionWithLocale:] calls [description]
|
* [descriptionWithLocale:] calls [description]
|
||||||
|
|
|
@ -310,7 +310,6 @@ NSCalendarDate.h \
|
||||||
NSCharacterSet.h \
|
NSCharacterSet.h \
|
||||||
NSClassDescription.h \
|
NSClassDescription.h \
|
||||||
NSCoder.h \
|
NSCoder.h \
|
||||||
NSConcreteNumber.h \
|
|
||||||
NSConnection.h \
|
NSConnection.h \
|
||||||
NSData.h \
|
NSData.h \
|
||||||
NSDate.h \
|
NSDate.h \
|
||||||
|
@ -366,6 +365,7 @@ NSZone.h
|
||||||
FOUNDATION_HEADERS = \
|
FOUNDATION_HEADERS = \
|
||||||
Foundation.h \
|
Foundation.h \
|
||||||
NSByteOrder.h \
|
NSByteOrder.h \
|
||||||
|
NSConcreteNumber.h \
|
||||||
NSKeyValueCoding.h \
|
NSKeyValueCoding.h \
|
||||||
NSPathUtilities.h \
|
NSPathUtilities.h \
|
||||||
NSSerialization.h \
|
NSSerialization.h \
|
||||||
|
|
|
@ -281,13 +281,47 @@ static NSMutableSet *textNodes = nil;
|
||||||
{
|
{
|
||||||
NSArray *a = [dict allKeys];
|
NSArray *a = [dict allKeys];
|
||||||
unsigned c = [a count];
|
unsigned c = [a count];
|
||||||
|
NSMutableSet *unitNames = nil;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
NSString *sep = @"";
|
NSString *sep = @"";
|
||||||
|
BOOL isInUnit = NO;
|
||||||
|
|
||||||
|
if ([type isEqual: @"method"] || [type isEqual: @"ivariable"])
|
||||||
|
{
|
||||||
|
isInUnit = YES;
|
||||||
if ([type isEqual: @"ivariable"])
|
if ([type isEqual: @"ivariable"])
|
||||||
{
|
{
|
||||||
sep = @"*";
|
sep = @"*";
|
||||||
}
|
}
|
||||||
|
else if (unit != nil)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Create a mutable set containing the unit name.
|
||||||
|
*/
|
||||||
|
unitNames = [NSMutableSet setWithObject: unit];
|
||||||
|
/*
|
||||||
|
* if the unit is a class, add all its categories to the set.
|
||||||
|
*/
|
||||||
|
if ([unit hasSuffix: @")"] == NO)
|
||||||
|
{
|
||||||
|
NSArray *categoryNames;
|
||||||
|
unsigned l = [unit length];
|
||||||
|
|
||||||
|
categoryNames = [[dict objectForKey: @"category"] allKeys];
|
||||||
|
i = [categoryNames count];
|
||||||
|
while (i-- > 0)
|
||||||
|
{
|
||||||
|
NSString *n = [categoryNames objectAtIndex: i];
|
||||||
|
|
||||||
|
if ([n hasPrefix: unit] == YES && [n length] > l
|
||||||
|
&& [n characterAtIndex: i] == '(')
|
||||||
|
{
|
||||||
|
[unitNames addObject: n];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
a = [a sortedArrayUsingSelector: @selector(compare:)];
|
a = [a sortedArrayUsingSelector: @selector(compare:)];
|
||||||
|
|
||||||
[buf appendString: indent];
|
[buf appendString: indent];
|
||||||
|
@ -298,33 +332,25 @@ static NSMutableSet *textNodes = nil;
|
||||||
|
|
||||||
for (i = 0; i < c; i++)
|
for (i = 0; i < c; i++)
|
||||||
{
|
{
|
||||||
if ([type isEqual: @"method"] || [type isEqual: @"ivariable"])
|
if (isInUnit == YES)
|
||||||
{
|
{
|
||||||
NSString *ref = [a objectAtIndex: i];
|
NSString *ref = [a objectAtIndex: i];
|
||||||
NSDictionary *units = [dict objectForKey: ref];
|
NSDictionary *units = [dict objectForKey: ref];
|
||||||
NSMutableArray *b = [[units allKeys] mutableCopy];
|
NSMutableArray *b = [[units allKeys] mutableCopy];
|
||||||
unsigned j;
|
unsigned j;
|
||||||
|
|
||||||
if (unit != nil)
|
if (unitNames != nil)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Remove any listing for methods not in the
|
* Remove any listing for methods not in the
|
||||||
* current unit or in categories of the
|
* current unit or in categories of the current class.
|
||||||
* current class.
|
|
||||||
*/
|
*/
|
||||||
for (j = 0; j < [b count]; j++)
|
for (j = 0; j < [b count]; j++)
|
||||||
{
|
{
|
||||||
NSString *u = [b objectAtIndex: j];
|
NSString *u = [b objectAtIndex: j];
|
||||||
|
|
||||||
if ([unit isEqual: u] == NO)
|
if ([unitNames member: u] == NO)
|
||||||
{
|
{
|
||||||
if ([unit hasSuffix: @")"] == NO
|
|
||||||
&& [u hasPrefix: unit] == YES
|
|
||||||
&& [u characterAtIndex: [unit length]]
|
|
||||||
== '(')
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
[b removeObjectAtIndex: j--];
|
[b removeObjectAtIndex: j--];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1289,9 +1289,8 @@ fail:
|
||||||
else if (ifStack == nil)
|
else if (ifStack == nil)
|
||||||
{
|
{
|
||||||
ifStack = [[NSMutableArray alloc] initWithCapacity: 4];
|
ifStack = [[NSMutableArray alloc] initWithCapacity: 4];
|
||||||
[ifStack addObject: @"OpenStep"];
|
[ifStack addObject: [NSSet setWithObjects:
|
||||||
[ifStack addObject: @"MacOS-X"];
|
@"OpenStep", @"MacOS-X", @"GNUstep", nil]];
|
||||||
[ifStack addObject: @"GNUstep"];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1302,67 +1301,23 @@ fail:
|
||||||
*/
|
*/
|
||||||
- (void) setStandards: (NSMutableDictionary*)dict
|
- (void) setStandards: (NSMutableDictionary*)dict
|
||||||
{
|
{
|
||||||
unsigned c = [ifStack count];
|
NSSet *set = [ifStack lastObject];
|
||||||
BOOL hadG = NO;
|
|
||||||
BOOL hadM = NO;
|
|
||||||
BOOL hadO = NO;
|
|
||||||
|
|
||||||
if (c > 0)
|
if ([set count] > 0)
|
||||||
{
|
{
|
||||||
NSMutableString *s = nil;
|
NSMutableString *s = nil;
|
||||||
BOOL found = NO;
|
NSEnumerator *e = [set objectEnumerator];
|
||||||
|
NSString *name;
|
||||||
|
|
||||||
s = [NSMutableString stringWithCString: "<standards>"];
|
s = [NSMutableString stringWithCString: "<standards>"];
|
||||||
while (c-- > 0)
|
while ((name = [e nextObject]) != nil)
|
||||||
{
|
{
|
||||||
NSString *name = [ifStack objectAtIndex: c];
|
|
||||||
|
|
||||||
/*
|
|
||||||
* We don't produce output for empty strings or
|
|
||||||
* the 'NotGNUstep' string.
|
|
||||||
*/
|
|
||||||
if ([name isEqualToString: @""] == YES
|
|
||||||
|| [name isEqualToString: @"NotGNUstep"] == YES)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if ([name isEqualToString: @"GNUstep"] == YES
|
|
||||||
|| [name isEqualToString: @"NotGNUstep"] == YES)
|
|
||||||
{
|
|
||||||
if (hadG == YES)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
hadG = YES;
|
|
||||||
}
|
|
||||||
if ([name isEqualToString: @"OpenStep"] == YES
|
|
||||||
|| [name isEqualToString: @"NotOpenStep"] == YES)
|
|
||||||
{
|
|
||||||
if (hadO == YES)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
hadO = YES;
|
|
||||||
}
|
|
||||||
if ([name isEqualToString: @"MacOS-X"] == YES
|
|
||||||
|| [name isEqualToString: @"NotMacOS-X"] == YES)
|
|
||||||
{
|
|
||||||
if (hadM == YES)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
hadM = YES;
|
|
||||||
}
|
|
||||||
found = YES;
|
|
||||||
[s appendFormat: @"<%@ />", name];
|
[s appendFormat: @"<%@ />", name];
|
||||||
}
|
}
|
||||||
if (found == YES)
|
|
||||||
{
|
|
||||||
[s appendString: @"</standards>"];
|
[s appendString: @"</standards>"];
|
||||||
[dict setObject: s forKey: @"Standards"];
|
[dict setObject: s forKey: @"Standards"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read in the file to be parsed and store it in a temporary unicode
|
* Read in the file to be parsed and store it in a temporary unicode
|
||||||
|
@ -2043,71 +1998,42 @@ fail:
|
||||||
|
|
||||||
if ([directive isEqual: @"endif"] == YES)
|
if ([directive isEqual: @"endif"] == YES)
|
||||||
{
|
{
|
||||||
unsigned c = [ifStack count];
|
if ([ifStack count] <= 1)
|
||||||
|
|
||||||
if (c == 0)
|
|
||||||
{
|
{
|
||||||
[self log: @"Unexpected #endif (no matching #if)"];
|
[self log: @"Unexpected #endif (no matching #if)"];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
[ifStack removeObjectAtIndex: c - 1];
|
[ifStack removeLastObject];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ([directive isEqual: @"elif"] == YES)
|
else if ([directive isEqual: @"elif"] == YES)
|
||||||
{
|
{
|
||||||
unsigned c = [ifStack count];
|
if ([ifStack count] <= 1)
|
||||||
|
|
||||||
if (c == 0)
|
|
||||||
{
|
{
|
||||||
[self log: @"Unexpected #else (no matching #if)"];
|
[self log: @"Unexpected #else (no matching #if)"];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
[ifStack replaceObjectAtIndex: c - 1 withObject: @""];
|
[ifStack removeLastObject];
|
||||||
|
[ifStack addObject: [ifStack lastObject]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ([directive isEqual: @"else"] == YES)
|
else if ([directive isEqual: @"else"] == YES)
|
||||||
{
|
{
|
||||||
unsigned c = [ifStack count];
|
if ([ifStack count] <= 1)
|
||||||
|
|
||||||
if (c == 0)
|
|
||||||
{
|
{
|
||||||
[self log: @"Unexpected #else (no matching #if)"];
|
[self log: @"Unexpected #else (no matching #if)"];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NSString *item = [ifStack objectAtIndex: --c];
|
[ifStack removeLastObject];
|
||||||
|
[ifStack addObject: [ifStack lastObject]];
|
||||||
if ([item isEqual: @"GNUstep"] == YES)
|
|
||||||
{
|
|
||||||
[ifStack replaceObjectAtIndex: c withObject: @"NotGNUstep"];
|
|
||||||
}
|
|
||||||
else if ([item isEqual: @"NotGNUstep"] == YES)
|
|
||||||
{
|
|
||||||
[ifStack replaceObjectAtIndex: c withObject: @"GNUstep"];
|
|
||||||
}
|
|
||||||
else if ([item isEqual: @"OpenStep"] == YES)
|
|
||||||
{
|
|
||||||
[ifStack replaceObjectAtIndex: c withObject: @"NotOpenStep"];
|
|
||||||
}
|
|
||||||
else if ([item isEqual: @"NotOpenStep"] == YES)
|
|
||||||
{
|
|
||||||
[ifStack replaceObjectAtIndex: c withObject: @"OpenStep"];
|
|
||||||
}
|
|
||||||
else if ([item isEqual: @"MacOS-X"] == YES)
|
|
||||||
{
|
|
||||||
[ifStack replaceObjectAtIndex: c withObject: @"NotMacOS-X"];
|
|
||||||
}
|
|
||||||
else if ([item isEqual: @"NotMacOS-X"] == YES)
|
|
||||||
{
|
|
||||||
[ifStack replaceObjectAtIndex: c withObject: @"MacOS-X"];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ([directive isEqual: @"if"] == YES)
|
else if ([directive isEqual: @"if"] == YES)
|
||||||
{
|
{
|
||||||
[ifStack addObject: @""];
|
[ifStack addObject: [ifStack lastObject]];
|
||||||
}
|
}
|
||||||
else if ([directive hasPrefix: @"if"] == YES)
|
else if ([directive hasPrefix: @"if"] == YES)
|
||||||
{
|
{
|
||||||
|
@ -2119,43 +2045,51 @@ fail:
|
||||||
}
|
}
|
||||||
if (pos < length && buffer[pos] != '\n')
|
if (pos < length && buffer[pos] != '\n')
|
||||||
{
|
{
|
||||||
|
NSMutableSet *set = [[ifStack lastObject] mutableCopy];
|
||||||
NSString *arg = [self parseIdentifier];
|
NSString *arg = [self parseIdentifier];
|
||||||
NSString *val = @"";
|
|
||||||
|
|
||||||
if ([arg isEqual: @"NO_GNUSTEP"] == YES)
|
if ([arg isEqual: @"NO_GNUSTEP"] == YES)
|
||||||
{
|
{
|
||||||
if (isIfDef == YES)
|
if (isIfDef == YES)
|
||||||
{
|
{
|
||||||
val = @"NotGNUstep";
|
[self log: @"Unexpected #ifdef NO_GNUSTEP (nonsense)"];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
val = @"GNUstep";
|
[set removeObject: @"MacOS-X"];
|
||||||
|
[set addObject: @"NotMacOS-X"];
|
||||||
|
[set removeObject: @"OpenStep"];
|
||||||
|
[set addObject: @"NotOpenStep"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ([arg isEqual: @"STRICT_MACOS_X"] == YES)
|
else if ([arg isEqual: @"STRICT_MACOS_X"] == YES)
|
||||||
{
|
{
|
||||||
if (isIfDef == YES)
|
if (isIfDef == YES)
|
||||||
{
|
{
|
||||||
val = @"MacOS-X";
|
[set removeObject: @"NotMacOS-X"];
|
||||||
|
[set addObject: @"MacOS-X"];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
val = @"NotMacOS-X";
|
[set removeObject: @"MacOS-X"];
|
||||||
|
[set addObject: @"NotMacOS-X"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ([arg isEqual: @"STRICT_OPENSTEP"] == YES)
|
else if ([arg isEqual: @"STRICT_OPENSTEP"] == YES)
|
||||||
{
|
{
|
||||||
if (isIfDef == YES)
|
if (isIfDef == YES)
|
||||||
{
|
{
|
||||||
val = @"OpenStep";
|
[set removeObject: @"NotOpenStep"];
|
||||||
|
[set addObject: @"OpenStep"];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
val = @"NotOpenStep";
|
[set removeObject: @"OpenStep"];
|
||||||
|
[set addObject: @"NotOpenStep"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[ifStack addObject: val];
|
[ifStack addObject: set];
|
||||||
|
RELEASE(set);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue