mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
Various fixes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@8810 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8cd613c188
commit
4d3a165d8a
11 changed files with 104 additions and 59 deletions
|
@ -1,3 +1,10 @@
|
|||
2001-01-26 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSArray.m: Fix failure to assign result of init to self
|
||||
(similar fixes in various other files).
|
||||
* Tools/gsdoc.m: Fix error in parsing items containing mixed elements.
|
||||
* Documentation/gsdoc/NSTimeZone.gsdoc: Fix erro in markup.
|
||||
|
||||
2001-01-25 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* configure.in: Add check for rexcent versions of gmp
|
||||
|
|
|
@ -16,8 +16,7 @@
|
|||
<class name="NSTimeZone" super="NSObject">
|
||||
<declared>Foundation/NSTimeZone.h</declared>
|
||||
<conform>NSCoding</conform>
|
||||
<desc>
|
||||
</desc>
|
||||
<desc>
|
||||
<p>
|
||||
If the GNUstep time zone datafiles become too out of date, one
|
||||
can download an updated database from <uref
|
||||
|
@ -40,6 +39,7 @@
|
|||
wildly between OSes (this could be a big problem when
|
||||
archiving is used between different systems).
|
||||
</p>
|
||||
</desc>
|
||||
|
||||
<method type="NSDictionary*" factory="yes">
|
||||
<sel>abbreviationDictionary</sel>
|
||||
|
|
|
@ -21,7 +21,30 @@
|
|||
</p>
|
||||
<hr>
|
||||
|
||||
|
||||
<p>
|
||||
|
||||
If the GNUstep time zone datafiles become too out of date, one
|
||||
can download an updated database from <a href ="ftp://elsie.nci.nih.gov/pub/">ftp://elsie.nci.nih.gov/pub/</a>
|
||||
and compile it as specified in the README file in the
|
||||
NSTimeZones directory.
|
||||
|
||||
Time zone names in NSDates should be GMT, MET etc. not
|
||||
Europe/Berlin, America/Washington etc.
|
||||
|
||||
The problem with this is that various time zones may use the
|
||||
same abbreviation (e.g. Australia/Brisbane and
|
||||
America/New_York both use EST), and some time zones
|
||||
may have different rules for daylight saving time even if the
|
||||
abbreviation and offsets from UTC are the same.
|
||||
|
||||
The problems with depending on the OS for providing time zone
|
||||
info are that some methods for the NSTimeZone classes might be
|
||||
difficult to implement, and also that time zone names may vary
|
||||
wildly between OSes (this could be a big problem when
|
||||
archiving is used between different systems).
|
||||
</p>
|
||||
|
||||
|
||||
<h2>Instance Variables </h2>
|
||||
<ul>
|
||||
</ul>
|
||||
|
|
|
@ -347,7 +347,7 @@ static SEL eqSel;
|
|||
|
||||
[aCoder decodeValueOfObjCType: @encode(unsigned)
|
||||
at: &count];
|
||||
if ([self initWithCapacity: count] == nil)
|
||||
if ((self = [self initWithCapacity: count]) == nil)
|
||||
{
|
||||
[NSException raise: NSMallocException
|
||||
format: @"Unable to make array"];
|
||||
|
|
|
@ -201,7 +201,8 @@
|
|||
{
|
||||
int i;
|
||||
|
||||
if ([self initWithCapacity: c] == nil)
|
||||
self = [self initWithCapacity: c];
|
||||
if (self == nil)
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
|
|
@ -437,7 +437,7 @@ static SEL rlSel;
|
|||
RELEASE(myString);
|
||||
if ([result isKindOfClass: NSArrayClass])
|
||||
{
|
||||
[self initWithArray: result];
|
||||
self = [self initWithArray: result];
|
||||
return self;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -424,7 +424,7 @@ static SEL appSel;
|
|||
RELEASE(myString);
|
||||
if ([result isKindOfClass: NSDictionaryClass])
|
||||
{
|
||||
[self initWithDictionary: result];
|
||||
self = [self initWithDictionary: result];
|
||||
return self;
|
||||
}
|
||||
}
|
||||
|
@ -975,13 +975,16 @@ static NSString *indentStrings[] = {
|
|||
forKeys: (id*)keys
|
||||
count: (unsigned)count
|
||||
{
|
||||
IMP setObj;
|
||||
|
||||
[self initWithCapacity: count];
|
||||
setObj = [self methodForSelector: setSel];
|
||||
while (count--)
|
||||
self = [self initWithCapacity: count];
|
||||
if (self != nil)
|
||||
{
|
||||
(*setObj)(self, setSel, objects[count], keys[count]);
|
||||
IMP setObj;
|
||||
|
||||
setObj = [self methodForSelector: setSel];
|
||||
while (count--)
|
||||
{
|
||||
(*setObj)(self, setSel, objects[count], keys[count]);
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
|
|
@ -502,10 +502,13 @@ static Class NSMutableSet_concrete_class;
|
|||
- (id) initWithObjects: (id*)objects
|
||||
count: (unsigned)count
|
||||
{
|
||||
[self initWithCapacity: count];
|
||||
while (count--)
|
||||
self = [self initWithCapacity: count];
|
||||
if (self != nil)
|
||||
{
|
||||
[self addObject: objects[count]];
|
||||
while (count--)
|
||||
{
|
||||
[self addObject: objects[count]];
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
|
|
@ -459,7 +459,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
}
|
||||
else
|
||||
{
|
||||
[self initWithFileDescriptor: 2 closeOnDealloc: NO];
|
||||
self = [self initWithFileDescriptor: 2 closeOnDealloc: NO];
|
||||
fh_stderr = self;
|
||||
}
|
||||
self = fh_stderr;
|
||||
|
@ -477,7 +477,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
}
|
||||
else
|
||||
{
|
||||
[self initWithFileDescriptor: 0 closeOnDealloc: NO];
|
||||
self = [self initWithFileDescriptor: 0 closeOnDealloc: NO];
|
||||
fh_stdin = self;
|
||||
}
|
||||
self = fh_stdin;
|
||||
|
@ -495,7 +495,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
}
|
||||
else
|
||||
{
|
||||
[self initWithFileDescriptor: 1 closeOnDealloc: NO];
|
||||
self = [self initWithFileDescriptor: 1 closeOnDealloc: NO];
|
||||
fh_stdout = self;
|
||||
}
|
||||
self = fh_stdout;
|
||||
|
|
|
@ -401,7 +401,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
}
|
||||
else
|
||||
{
|
||||
[self initWithFileDescriptor: 2 closeOnDealloc: NO];
|
||||
self = [self initWithFileDescriptor: 2 closeOnDealloc: NO];
|
||||
fh_stderr = self;
|
||||
}
|
||||
self = fh_stderr;
|
||||
|
@ -419,7 +419,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
}
|
||||
else
|
||||
{
|
||||
[self initWithFileDescriptor: 0 closeOnDealloc: NO];
|
||||
self = [self initWithFileDescriptor: 0 closeOnDealloc: NO];
|
||||
fh_stdin = self;
|
||||
}
|
||||
self = fh_stdin;
|
||||
|
@ -437,7 +437,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
}
|
||||
else
|
||||
{
|
||||
[self initWithFileDescriptor: 1 closeOnDealloc: NO];
|
||||
self = [self initWithFileDescriptor: 1 closeOnDealloc: NO];
|
||||
fh_stdout = self;
|
||||
}
|
||||
self = fh_stdout;
|
||||
|
|
|
@ -1951,52 +1951,60 @@ loader(const char *url, const char *eid, xmlParserCtxtPtr *ctxt)
|
|||
|
||||
- (NSString *) parseItem: (xmlNodePtr)node
|
||||
{
|
||||
NSMutableString *text = [NSMutableString string];
|
||||
|
||||
NSDebugMLLog(@"debug", @"Start parsing item");
|
||||
node = node->children;
|
||||
|
||||
if (strcmp(node->name, "class") == 0
|
||||
|| strcmp(node->name, "category") == 0
|
||||
|| strcmp(node->name, "protocol") == 0
|
||||
|| strcmp(node->name, "function") == 0
|
||||
|| strcmp(node->name, "macro") == 0
|
||||
|| strcmp(node->name, "type") == 0
|
||||
|| strcmp(node->name, "variable") == 0
|
||||
|| strcmp(node->name, "ivariable") == 0
|
||||
|| strcmp(node->name, "constant") == 0)
|
||||
while (node != 0)
|
||||
{
|
||||
return [self parseDef: node];
|
||||
}
|
||||
BOOL step = YES;
|
||||
|
||||
if (strcmp(node->name, "list") == 0
|
||||
|| strcmp(node->name, "enum") == 0
|
||||
|| strcmp(node->name, "deflist") == 0
|
||||
|| strcmp(node->name, "qalist") == 0)
|
||||
{
|
||||
return [self parseList: node];
|
||||
}
|
||||
|
||||
if (strcmp(node->name, "p") == 0)
|
||||
{
|
||||
NSString *elem = [self parseText: node->children];
|
||||
|
||||
if (elem == nil)
|
||||
if (strcmp(node->name, "class") == 0
|
||||
|| strcmp(node->name, "category") == 0
|
||||
|| strcmp(node->name, "protocol") == 0
|
||||
|| strcmp(node->name, "function") == 0
|
||||
|| strcmp(node->name, "macro") == 0
|
||||
|| strcmp(node->name, "type") == 0
|
||||
|| strcmp(node->name, "variable") == 0
|
||||
|| strcmp(node->name, "ivariable") == 0
|
||||
|| strcmp(node->name, "constant") == 0)
|
||||
{
|
||||
return nil;
|
||||
[text appendString: [self parseDef: node]];
|
||||
}
|
||||
return [NSString stringWithFormat: @"<p>\r\n%@</p>\r\n", elem];
|
||||
}
|
||||
else if (strcmp(node->name, "list") == 0
|
||||
|| strcmp(node->name, "enum") == 0
|
||||
|| strcmp(node->name, "deflist") == 0
|
||||
|| strcmp(node->name, "qalist") == 0)
|
||||
{
|
||||
[text appendString: [self parseList: node]];
|
||||
}
|
||||
else if (strcmp(node->name, "p") == 0)
|
||||
{
|
||||
NSString *elem = [self parseText: node->children];
|
||||
|
||||
if (strcmp(node->name, "example") == 0)
|
||||
{
|
||||
return [self parseExample: node];
|
||||
if (elem != nil)
|
||||
{
|
||||
[text appendFormat: @"<p>\r\n%@</p>\r\n", elem];
|
||||
}
|
||||
}
|
||||
else if (strcmp(node->name, "example") == 0)
|
||||
{
|
||||
[text appendString: [self parseExample: node]];
|
||||
}
|
||||
else if (strcmp(node->name, "embed") == 0)
|
||||
{
|
||||
[text appendString: [self parseEmbed: node]];
|
||||
}
|
||||
else
|
||||
{
|
||||
[text appendString: [self parseText: node end: &node]];
|
||||
step = NO;
|
||||
}
|
||||
if (step == YES)
|
||||
node = node->next;
|
||||
}
|
||||
|
||||
if (strcmp(node->name, "embed") == 0)
|
||||
{
|
||||
return [self parseEmbed: node];
|
||||
}
|
||||
|
||||
return [self parseText: node];
|
||||
return text;
|
||||
}
|
||||
|
||||
- (NSString *) parseList: (xmlNodePtr)node
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue