mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 09:02:01 +00:00
Fixes from dawn
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4761 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
cbfab8d67a
commit
921c2240ef
8 changed files with 357 additions and 90 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Wed Aug 25 15:44:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||||
|
|
||||||
|
Fixes for memory leak in property-list parsing from dawn.
|
||||||
|
|
||||||
Wed Aug 25 11:37:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
Wed Aug 25 11:37:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||||
|
|
||||||
* Source/Makefile.postamble: Added rules to build some files without
|
* Source/Makefile.postamble: Added rules to build some files without
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __NSException_h_GNUSTEP_BASE_INCLUDE
|
#ifndef __NSException_h_GNUSTEP_BASE_INCLUDE
|
||||||
|
@ -65,6 +65,7 @@ extern NSString *NSInternalInconsistencyException;
|
||||||
extern NSString *NSInvalidArgumentException;
|
extern NSString *NSInvalidArgumentException;
|
||||||
extern NSString *NSMallocException;
|
extern NSString *NSMallocException;
|
||||||
extern NSString *NSRangeException;
|
extern NSString *NSRangeException;
|
||||||
|
extern NSString *NSCharacterConversionException;
|
||||||
|
|
||||||
/* Exception handler definitions */
|
/* Exception handler definitions */
|
||||||
typedef struct _NSHandler
|
typedef struct _NSHandler
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __NSString_h_GNUSTEP_BASE_INCLUDE
|
#ifndef __NSString_h_GNUSTEP_BASE_INCLUDE
|
||||||
|
@ -241,16 +241,16 @@ enum {
|
||||||
+ (NSString*) stringWithString: (NSString*) aString;
|
+ (NSString*) stringWithString: (NSString*) aString;
|
||||||
+ (NSString*) localizedStringWithFormat: (NSString*) format, ...;
|
+ (NSString*) localizedStringWithFormat: (NSString*) format, ...;
|
||||||
+ (NSString*) stringWithFormat: (NSString*)format
|
+ (NSString*) stringWithFormat: (NSString*)format
|
||||||
arguments: (va_list)argList;
|
arguments: (va_list)argList;
|
||||||
- (id) initWithFormat: (NSString*)format
|
- (id) initWithFormat: (NSString*)format
|
||||||
locale: (NSDictionary*)dictionary;
|
locale: (NSDictionary*)dictionary;
|
||||||
- (id) initWithFormat: (NSString*)format
|
- (id) initWithFormat: (NSString*)format
|
||||||
locale: (NSDictionary*)dictionary
|
locale: (NSDictionary*)dictionary
|
||||||
arguments: (va_list)argList;
|
arguments: (va_list)argList;
|
||||||
- (NSString*) substringWithRange: (NSRange)aRange;
|
- (NSString*) substringWithRange: (NSRange)aRange;
|
||||||
- (NSComparisonResult) caseInsensitiveCompare: (NSString*)aString;
|
- (NSComparisonResult) caseInsensitiveCompare: (NSString*)aString;
|
||||||
- (BOOL) writeToFile: (NSString*)filename
|
- (BOOL) writeToFile: (NSString*)filename
|
||||||
atomically: (BOOL)useAuxiliaryFile;
|
atomically: (BOOL)useAuxiliaryFile;
|
||||||
- (double) doubleValue;
|
- (double) doubleValue;
|
||||||
+ (NSStringEncoding*)availableStringEncodings;
|
+ (NSStringEncoding*)availableStringEncodings;
|
||||||
+ (NSString*)localizedNameOfStringEncoding:(NSStringEncoding)encoding;
|
+ (NSString*)localizedNameOfStringEncoding:(NSStringEncoding)encoding;
|
||||||
|
@ -259,7 +259,7 @@ enum {
|
||||||
contentsEnd:(unsigned int *)contentsEndIndex
|
contentsEnd:(unsigned int *)contentsEndIndex
|
||||||
forRange:(NSRange)aRange;
|
forRange:(NSRange)aRange;
|
||||||
- (NSRange)lineRangeForRange:(NSRange)aRange;
|
- (NSRange)lineRangeForRange:(NSRange)aRange;
|
||||||
|
- (const char*) lossyCString;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NO_GNUSTEP
|
#ifndef NO_GNUSTEP
|
||||||
|
@ -312,7 +312,14 @@ compiler warning.
|
||||||
@interface NSMutableString : NSString <NSMutableString>
|
@interface NSMutableString : NSString <NSMutableString>
|
||||||
@end
|
@end
|
||||||
|
|
||||||
/* Because the compiler thinks that @".." strings are NXConstantString's. */
|
/*
|
||||||
|
* Because the compiler thinks that @".." strings are NXConstantString's.
|
||||||
|
* NB. An NXConstantString has a length and a pointer to char as it's ivars
|
||||||
|
* but an NSGCString also has a hash value - the code has to be careful not
|
||||||
|
* to use the _hash ivar if the class is actually an NXConstantString.
|
||||||
|
* If you modify and NSGCString method to use the _hash ivar, you must
|
||||||
|
* override that method in NXConstantString, to avoid using the ivar.
|
||||||
|
*/
|
||||||
#include <Foundation/NSGString.h>
|
#include <Foundation/NSGString.h>
|
||||||
#include <Foundation/NSGCString.h>
|
#include <Foundation/NSGCString.h>
|
||||||
@interface NXConstantString : NSGCString
|
@interface NXConstantString : NSGCString
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
@ -338,6 +338,15 @@ static IMP msInitImp; /* designated initialiser for mutable */
|
||||||
return (const char*)r;
|
return (const char*)r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (const char *) lossyCString
|
||||||
|
{
|
||||||
|
unsigned char *r = (unsigned char*)_fastMallocBuffer(_count+1);
|
||||||
|
|
||||||
|
memcpy(r, _contents_chars, _count);
|
||||||
|
r[_count] = '\0';
|
||||||
|
return (const char*)r;
|
||||||
|
}
|
||||||
|
|
||||||
- (void) getCString: (char*)buffer
|
- (void) getCString: (char*)buffer
|
||||||
{
|
{
|
||||||
memcpy(buffer, _contents_chars, _count);
|
memcpy(buffer, _contents_chars, _count);
|
||||||
|
@ -453,8 +462,7 @@ static IMP msInitImp; /* designated initialiser for mutable */
|
||||||
return NO;
|
return NO;
|
||||||
c = fastClassOfInstance(anObject);
|
c = fastClassOfInstance(anObject);
|
||||||
|
|
||||||
if (c == _fastCls._NSGCString || c == _fastCls._NSGMutableCString
|
if (c == _fastCls._NSGCString || c == _fastCls._NSGMutableCString)
|
||||||
|| c == _fastCls._NXConstantString)
|
|
||||||
{
|
{
|
||||||
NSGCString *other = (NSGCString*)anObject;
|
NSGCString *other = (NSGCString*)anObject;
|
||||||
|
|
||||||
|
@ -470,6 +478,16 @@ static IMP msInitImp; /* designated initialiser for mutable */
|
||||||
return NO;
|
return NO;
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
else if (c == _fastCls._NXConstantString)
|
||||||
|
{
|
||||||
|
NSGCString *other = (NSGCString*)anObject;
|
||||||
|
|
||||||
|
if (_count != other->_count)
|
||||||
|
return NO;
|
||||||
|
if (memcmp(_contents_chars, other->_contents_chars, _count) != 0)
|
||||||
|
return NO;
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
else if (c == _fastCls._NSGString || c == _fastCls._NSGMutableString)
|
else if (c == _fastCls._NSGString || c == _fastCls._NSGMutableString)
|
||||||
{
|
{
|
||||||
if (strCompCsUs(self, anObject, 0, (NSRange){0,_count}) == NSOrderedSame)
|
if (strCompCsUs(self, anObject, 0, (NSRange){0,_count}) == NSOrderedSame)
|
||||||
|
@ -494,8 +512,7 @@ static IMP msInitImp; /* designated initialiser for mutable */
|
||||||
if (aString == nil)
|
if (aString == nil)
|
||||||
return NO;
|
return NO;
|
||||||
c = fastClassOfInstance(aString);
|
c = fastClassOfInstance(aString);
|
||||||
if (c == _fastCls._NSGCString || c == _fastCls._NSGMutableCString
|
if (c == _fastCls._NSGCString || c == _fastCls._NSGMutableCString)
|
||||||
|| c == _fastCls._NXConstantString)
|
|
||||||
{
|
{
|
||||||
NSGCString *other = (NSGCString*)aString;
|
NSGCString *other = (NSGCString*)aString;
|
||||||
|
|
||||||
|
@ -511,6 +528,16 @@ static IMP msInitImp; /* designated initialiser for mutable */
|
||||||
return NO;
|
return NO;
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
else if (c == _fastCls._NXConstantString)
|
||||||
|
{
|
||||||
|
NSGCString *other = (NSGCString*)aString;
|
||||||
|
|
||||||
|
if (_count != other->_count)
|
||||||
|
return NO;
|
||||||
|
if (memcmp(_contents_chars, other->_contents_chars, _count) != 0)
|
||||||
|
return NO;
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
else if (c == _fastCls._NSGString || c == _fastCls._NSGMutableString)
|
else if (c == _fastCls._NSGString || c == _fastCls._NSGMutableString)
|
||||||
{
|
{
|
||||||
if (strCompCsUs(self, aString, 0, (NSRange){0,_count}) == NSOrderedSame)
|
if (strCompCsUs(self, aString, 0, (NSRange){0,_count}) == NSOrderedSame)
|
||||||
|
@ -700,7 +727,7 @@ static IMP msInitImp; /* designated initialiser for mutable */
|
||||||
[NSException raise: NSGenericException
|
[NSException raise: NSGenericException
|
||||||
format: @"%@ at line %u", data.err, data.lin];
|
format: @"%@ at line %u", data.err, data.lin];
|
||||||
}
|
}
|
||||||
return result;
|
return AUTORELEASE(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSDictionary*) propertyListFromStringsFileFormat
|
- (NSDictionary*) propertyListFromStringsFileFormat
|
||||||
|
@ -723,7 +750,7 @@ static IMP msInitImp; /* designated initialiser for mutable */
|
||||||
[NSException raise: NSGenericException
|
[NSException raise: NSGenericException
|
||||||
format: @"%@ at line %u", data.err, data.lin];
|
format: @"%@ at line %u", data.err, data.lin];
|
||||||
}
|
}
|
||||||
return result;
|
return AUTORELEASE(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSRange) rangeOfComposedCharacterSequenceAtIndex: (unsigned)anIndex
|
- (NSRange) rangeOfComposedCharacterSequenceAtIndex: (unsigned)anIndex
|
||||||
|
@ -1137,6 +1164,22 @@ stringDecrementCountAndFillHoleAt(NSGMutableCStringStruct *self,
|
||||||
|
|
||||||
@implementation NXConstantString
|
@implementation NXConstantString
|
||||||
|
|
||||||
|
+ (id) allocWithZone: (NSZone*)z
|
||||||
|
{
|
||||||
|
[NSException raise: NSGenericException
|
||||||
|
format: @"Attempt to allocate an NXConstantString"];
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id) initWithCStringNoCopy: (char*)byteString
|
||||||
|
length: (unsigned int)length
|
||||||
|
fromZone: (NSZone*)zone
|
||||||
|
{
|
||||||
|
[NSException raise: NSGenericException
|
||||||
|
format: @"Attempt to init an NXConstantString"];
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NXConstantString overrides [-dealloc] so that it is never deallocated.
|
* NXConstantString overrides [-dealloc] so that it is never deallocated.
|
||||||
* If we pass an NXConstantString to another process or record it in an
|
* If we pass an NXConstantString to another process or record it in an
|
||||||
|
@ -1213,4 +1256,139 @@ stringDecrementCountAndFillHoleAt(NSGMutableCStringStruct *self,
|
||||||
return (unichar)_contents_chars[index];
|
return (unichar)_contents_chars[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (unsigned) hash
|
||||||
|
{
|
||||||
|
return _fastImp._NSString_hash(self, @selector(hash));
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL) isEqual: (id)anObject
|
||||||
|
{
|
||||||
|
Class c;
|
||||||
|
if (anObject == self)
|
||||||
|
{
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
if (anObject == nil)
|
||||||
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
c = fastClassOfInstance(anObject);
|
||||||
|
|
||||||
|
if (c == _fastCls._NSGCString || c == _fastCls._NSGMutableCString
|
||||||
|
|| c == _fastCls._NXConstantString)
|
||||||
|
{
|
||||||
|
NXConstantString *other = (NXConstantString*)anObject;
|
||||||
|
|
||||||
|
if (_count != other->_count)
|
||||||
|
return NO;
|
||||||
|
if (memcmp(_contents_chars, other->_contents_chars, _count) != 0)
|
||||||
|
return NO;
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
else if (c == _fastCls._NSGString || c == _fastCls._NSGMutableString)
|
||||||
|
{
|
||||||
|
if (strCompCsUs(self, anObject, 0, (NSRange){0,_count}) == NSOrderedSame)
|
||||||
|
return YES;
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
else if (c == nil)
|
||||||
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
else if (fastClassIsKindOfClass(c, _fastCls._NSString))
|
||||||
|
{
|
||||||
|
return _fastImp._NSString_isEqualToString_(self,
|
||||||
|
@selector(isEqualToString:), anObject);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL) isEqualToString: (NSString*)aString
|
||||||
|
{
|
||||||
|
Class c;
|
||||||
|
|
||||||
|
if (aString == self)
|
||||||
|
{
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
if (aString == nil)
|
||||||
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
c = fastClassOfInstance(aString);
|
||||||
|
if (c == _fastCls._NSGCString || c == _fastCls._NSGMutableCString
|
||||||
|
|| c == _fastCls._NXConstantString)
|
||||||
|
{
|
||||||
|
NXConstantString *other = (NXConstantString*)aString;
|
||||||
|
|
||||||
|
if (_count != other->_count)
|
||||||
|
return NO;
|
||||||
|
if (memcmp(_contents_chars, other->_contents_chars, _count) != 0)
|
||||||
|
return NO;
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
else if (c == _fastCls._NSGString || c == _fastCls._NSGMutableString)
|
||||||
|
{
|
||||||
|
if (strCompCsUs(self, aString, 0, (NSRange){0,_count}) == NSOrderedSame)
|
||||||
|
return YES;
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
else if (c == nil)
|
||||||
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
else if (fastClassIsKindOfClass(c, _fastCls._NSString))
|
||||||
|
{
|
||||||
|
return _fastImp._NSString_isEqualToString_(self,
|
||||||
|
@selector(isEqualToString:), aString);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id) mutableCopy
|
||||||
|
{
|
||||||
|
NSGMutableCString *obj;
|
||||||
|
|
||||||
|
obj = (NSGMutableCString*)NSAllocateObject(_fastCls._NSGMutableCString,
|
||||||
|
0, NSDefaultMallocZone());
|
||||||
|
if (obj)
|
||||||
|
{
|
||||||
|
obj = (*msInitImp)(obj, msInitSel, _count);
|
||||||
|
if (obj)
|
||||||
|
{
|
||||||
|
NXConstantString *tmp = (NXConstantString*)obj;
|
||||||
|
|
||||||
|
memcpy(tmp->_contents_chars, _contents_chars, _count);
|
||||||
|
tmp->_count = _count;
|
||||||
|
tmp->_hash = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id) mutableCopyWithZone: (NSZone*)z
|
||||||
|
{
|
||||||
|
NSGMutableCString *obj;
|
||||||
|
|
||||||
|
obj = (NSGMutableCString*)NSAllocateObject(_fastCls._NSGMutableCString, 0, z);
|
||||||
|
if (obj)
|
||||||
|
{
|
||||||
|
obj = (*msInitImp)(obj, msInitSel, _count);
|
||||||
|
if (obj)
|
||||||
|
{
|
||||||
|
NXConstantString *tmp = (NXConstantString*)obj;
|
||||||
|
|
||||||
|
memcpy(tmp->_contents_chars, _contents_chars, _count);
|
||||||
|
tmp->_count = _count;
|
||||||
|
tmp->_hash = 0; // No hash available yet.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
@ -110,13 +110,16 @@
|
||||||
{
|
{
|
||||||
Class c;
|
Class c;
|
||||||
if (anObject == self)
|
if (anObject == self)
|
||||||
return YES;
|
{
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
if (anObject == nil)
|
if (anObject == nil)
|
||||||
return NO;
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
c = fastClassOfInstance(anObject);
|
c = fastClassOfInstance(anObject);
|
||||||
if (c == _fastCls._NSGString || c == _fastCls._NSGMutableString
|
if (c == _fastCls._NSGString || c == _fastCls._NSGMutableString
|
||||||
|| c == _fastCls._NSGCString || c == _fastCls._NSGMutableCString
|
|| c == _fastCls._NSGCString || c == _fastCls._NSGMutableCString)
|
||||||
|| c == _fastCls._NXConstantString)
|
|
||||||
{
|
{
|
||||||
NSGString *other = (NSGString*)anObject;
|
NSGString *other = (NSGString*)anObject;
|
||||||
NSRange r = {0, _count};
|
NSRange r = {0, _count};
|
||||||
|
@ -146,13 +149,28 @@
|
||||||
}
|
}
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
else if (c == _fastCls._NXConstantString)
|
||||||
|
{
|
||||||
|
NSGString *other = (NSGString*)anObject;
|
||||||
|
NSRange r = {0, _count};
|
||||||
|
|
||||||
|
if (strCompUsCs(self, other, 0, r) == NSOrderedSame)
|
||||||
|
return YES;
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
else if (c == nil)
|
else if (c == nil)
|
||||||
return NO;
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
else if (fastClassIsKindOfClass(c, _fastCls._NSString))
|
else if (fastClassIsKindOfClass(c, _fastCls._NSString))
|
||||||
return _fastImp._NSString_isEqualToString_(self,
|
{
|
||||||
@selector(isEqualToString:), anObject);
|
return _fastImp._NSString_isEqualToString_(self,
|
||||||
|
@selector(isEqualToString:), anObject);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return NO;
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initializing Newly Allocated Strings
|
// Initializing Newly Allocated Strings
|
||||||
|
@ -388,7 +406,7 @@
|
||||||
[NSException raise: NSGenericException
|
[NSException raise: NSGenericException
|
||||||
format: @"%@ at line %u", data.err, data.lin];
|
format: @"%@ at line %u", data.err, data.lin];
|
||||||
}
|
}
|
||||||
return result;
|
return AUTORELEASE(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSDictionary*) propertyListFromStringsFileFormat
|
- (NSDictionary*) propertyListFromStringsFileFormat
|
||||||
|
@ -411,7 +429,7 @@
|
||||||
[NSException raise: NSGenericException
|
[NSException raise: NSGenericException
|
||||||
format: @"%@ at line %u", data.err, data.lin];
|
format: @"%@ at line %u", data.err, data.lin];
|
||||||
}
|
}
|
||||||
return result;
|
return AUTORELEASE(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -506,18 +524,23 @@ static inline void
|
||||||
stringIncrementCountAndMakeHoleAt(NSGMutableStringStruct *self,
|
stringIncrementCountAndMakeHoleAt(NSGMutableStringStruct *self,
|
||||||
int index, int size)
|
int index, int size)
|
||||||
{
|
{
|
||||||
#ifndef STABLE_MEMCPY
|
if (self->_count || size)
|
||||||
{
|
{
|
||||||
int i;
|
NSCAssert(index+size<=self->_count,@"index+size>length");
|
||||||
for (i = self->_count; i >= index; i--)
|
NSCAssert(self->_count+size<=self->_capacity,@"length+size>capacity");
|
||||||
self->_contents_chars[i+size] = self->_contents_chars[i];
|
#ifndef STABLE_MEMCPY
|
||||||
}
|
{
|
||||||
#else
|
int i;
|
||||||
memcpy(self->_contents_chars + index,
|
for (i = self->_count; i >= index; i--)
|
||||||
self->_contents_chars + index + size,
|
self->_contents_chars[i+size] = self->_contents_chars[i];
|
||||||
2*(self->_count - index));
|
}
|
||||||
#endif /* STABLE_MEMCPY */
|
#else
|
||||||
(self->_count) += size;
|
memcpy(self->_contents_chars + index,
|
||||||
|
self->_contents_chars + index + size,
|
||||||
|
2*(self->_count - index));
|
||||||
|
#endif /* STABLE_MEMCPY */
|
||||||
|
(self->_count) += size;
|
||||||
|
};
|
||||||
(self->_hash) = 0;
|
(self->_hash) = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -525,18 +548,22 @@ static inline void
|
||||||
stringDecrementCountAndFillHoleAt(NSGMutableStringStruct *self,
|
stringDecrementCountAndFillHoleAt(NSGMutableStringStruct *self,
|
||||||
int index, int size)
|
int index, int size)
|
||||||
{
|
{
|
||||||
(self->_count) -= size;
|
if (self->_count || size)
|
||||||
#ifndef STABLE_MEMCPY
|
{
|
||||||
{
|
NSCAssert(index+size<=self->_count,@"index+size>length");
|
||||||
int i;
|
(self->_count) -= size;
|
||||||
for (i = index; i <= self->_count; i++)
|
#ifndef STABLE_MEMCPY
|
||||||
self->_contents_chars[i] = self->_contents_chars[i+size];
|
{
|
||||||
}
|
int i;
|
||||||
#else
|
for (i = index; i <= self->_count; i++)
|
||||||
memcpy(self->_contents_chars + index + size,
|
self->_contents_chars[i] = self->_contents_chars[i+size];
|
||||||
self->_contents_chars + index,
|
}
|
||||||
2*(self->_count - index));
|
#else
|
||||||
#endif // STABLE_MEMCPY
|
memcpy(self->_contents_chars + index + size,
|
||||||
|
self->_contents_chars + index,
|
||||||
|
2*(self->_count - index));
|
||||||
|
#endif // STABLE_MEMCPY
|
||||||
|
};
|
||||||
(self->_hash) = 0;
|
(self->_hash) = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Caveats:
|
/* Caveats:
|
||||||
|
@ -536,10 +536,13 @@ handle_printf_atsign (FILE *stream,
|
||||||
format_to_go = formatter_pos+2;
|
format_to_go = formatter_pos+2;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/* Specifiers from K&R C 2nd ed. */
|
|
||||||
spec_pos = strpbrk(formatter_pos+1, "dioxXucsfeEgGpn\0");
|
spec_pos = strpbrk(formatter_pos+1, "dioxXucsfeEgGpn\0");
|
||||||
switch (*spec_pos)
|
switch (*spec_pos)
|
||||||
{
|
{
|
||||||
|
#ifndef powerpc
|
||||||
|
/* FIXME: vsprintf on powerpc apparently advances the arg list
|
||||||
|
so this doesn't need to be done. Make a more general check
|
||||||
|
for this */
|
||||||
case 'd': case 'i': case 'o':
|
case 'd': case 'i': case 'o':
|
||||||
case 'x': case 'X': case 'u': case 'c':
|
case 'x': case 'X': case 'u': case 'c':
|
||||||
va_arg(arg_list, int);
|
va_arg(arg_list, int);
|
||||||
|
@ -558,8 +561,8 @@ handle_printf_atsign (FILE *stream,
|
||||||
case 'n':
|
case 'n':
|
||||||
va_arg(arg_list, int*);
|
va_arg(arg_list, int*);
|
||||||
break;
|
break;
|
||||||
|
#endif /* NOT powerpc */
|
||||||
case '\0':
|
case '\0':
|
||||||
/* Make sure loop exits on next iteration. */
|
|
||||||
spec_pos--;
|
spec_pos--;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1398,8 +1401,21 @@ handle_printf_atsign (FILE *stream,
|
||||||
|
|
||||||
- (const char*) cString
|
- (const char*) cString
|
||||||
{
|
{
|
||||||
[self subclassResponsibility: _cmd];
|
NSData *d = [self dataUsingEncoding: _DefaultStringEncoding
|
||||||
return NULL;
|
allowLossyConversion: NO];
|
||||||
|
if (d == nil)
|
||||||
|
{
|
||||||
|
[NSException raise: NSCharacterConversionException
|
||||||
|
format: @"unable to convert to cString"];
|
||||||
|
}
|
||||||
|
return (const char*)[d bytes];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (const char*) lossyCString
|
||||||
|
{
|
||||||
|
NSData *d = [self dataUsingEncoding: _DefaultStringEncoding
|
||||||
|
allowLossyConversion: YES];
|
||||||
|
return (const char*)[d bytes];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (unsigned) cStringLength
|
- (unsigned) cStringLength
|
||||||
|
@ -1551,7 +1567,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
char t;
|
char t;
|
||||||
unsigned char *buff;
|
unsigned char *buff;
|
||||||
|
|
||||||
buff = (unsigned char*)NSZoneMalloc(NSDefaultMallocZone(), len);
|
buff = (unsigned char*)NSZoneMalloc(NSDefaultMallocZone(), len+1);
|
||||||
if (!flag)
|
if (!flag)
|
||||||
{
|
{
|
||||||
for (count = 0; count < len; count++)
|
for (count = 0; count < len; count++)
|
||||||
|
@ -1587,6 +1603,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
buff[count] = '\0';
|
||||||
return [NSData dataWithBytesNoCopy: buff length: count];
|
return [NSData dataWithBytesNoCopy: buff length: count];
|
||||||
}
|
}
|
||||||
else if (encoding == NSUnicodeStringEncoding)
|
else if (encoding == NSUnicodeStringEncoding)
|
||||||
|
@ -2438,7 +2455,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
[NSException raise: NSGenericException
|
[NSException raise: NSGenericException
|
||||||
format: @"%@ at line %u", data.err, data.lin];
|
format: @"%@ at line %u", data.err, data.lin];
|
||||||
}
|
}
|
||||||
return result;
|
return AUTORELEASE(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSDictionary*) propertyListFromStringsFileFormat
|
- (NSDictionary*) propertyListFromStringsFileFormat
|
||||||
|
@ -2464,7 +2481,7 @@ handle_printf_atsign (FILE *stream,
|
||||||
[NSException raise: NSGenericException
|
[NSException raise: NSGenericException
|
||||||
format: @"%@ at line %u", data.err, data.lin];
|
format: @"%@ at line %u", data.err, data.lin];
|
||||||
}
|
}
|
||||||
return result;
|
return AUTORELEASE(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
@ -72,6 +72,7 @@ NSString *NSInternalInconsistencyException =
|
||||||
NSString *NSInvalidArgumentException = @"NSInvalidArgumentException";
|
NSString *NSInvalidArgumentException = @"NSInvalidArgumentException";
|
||||||
NSString *NSMallocException = @"NSMallocException";
|
NSString *NSMallocException = @"NSMallocException";
|
||||||
NSString *NSRangeException = @"NSRangeException";
|
NSString *NSRangeException = @"NSRangeException";
|
||||||
|
NSString *NSCharacterConversionException = @"NSCharacterConversionException";
|
||||||
|
|
||||||
/* Exception handler */
|
/* Exception handler */
|
||||||
NSUncaughtExceptionHandler *_NSUncaughtExceptionHandler;
|
NSUncaughtExceptionHandler *_NSUncaughtExceptionHandler;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -85,9 +85,6 @@ static Class plDictionary;
|
||||||
static id (*plSet)(id, SEL, id, id);
|
static id (*plSet)(id, SEL, id, id);
|
||||||
static id (*plInit)(id, SEL, void*, unsigned) = 0;
|
static id (*plInit)(id, SEL, void*, unsigned) = 0;
|
||||||
static id (*plAlloc)(Class, SEL, NSZone*);
|
static id (*plAlloc)(Class, SEL, NSZone*);
|
||||||
#ifndef GS_WITH_GC
|
|
||||||
static id (*plAutorelease)(id, SEL);
|
|
||||||
#endif
|
|
||||||
#if GSPLUNI
|
#if GSPLUNI
|
||||||
static SEL plSel = @selector(initWithCharacters:length:);
|
static SEL plSel = @selector(initWithCharacters:length:);
|
||||||
#else
|
#else
|
||||||
|
@ -103,10 +100,6 @@ static void setupPl(Class c)
|
||||||
[c methodForSelector: @selector(allocWithZone:)];
|
[c methodForSelector: @selector(allocWithZone:)];
|
||||||
plInit = (id (*)(id, SEL, void*, unsigned))
|
plInit = (id (*)(id, SEL, void*, unsigned))
|
||||||
[c instanceMethodForSelector: plSel];
|
[c instanceMethodForSelector: plSel];
|
||||||
#ifndef GS_WITH_GC
|
|
||||||
plAutorelease = (id (*)(id, SEL))
|
|
||||||
[c instanceMethodForSelector: @selector(autorelease)];
|
|
||||||
#endif
|
|
||||||
plArray = [NSGMutableArray class];
|
plArray = [NSGMutableArray class];
|
||||||
plAdd = (id (*)(id, SEL, id))
|
plAdd = (id (*)(id, SEL, id))
|
||||||
[plArray instanceMethodForSelector: @selector(addObject:)];
|
[plArray instanceMethodForSelector: @selector(addObject:)];
|
||||||
|
@ -366,9 +359,6 @@ static inline id parseQuotedString(pldata* pld)
|
||||||
}
|
}
|
||||||
obj = (*plAlloc)(plCls, @selector(allocWithZone:), NSDefaultMallocZone());
|
obj = (*plAlloc)(plCls, @selector(allocWithZone:), NSDefaultMallocZone());
|
||||||
obj = (*plInit)(obj, plSel, (void*)chars, pld->pos - start - shrink);
|
obj = (*plInit)(obj, plSel, (void*)chars, pld->pos - start - shrink);
|
||||||
#ifndef GS_WITH_GC
|
|
||||||
(*plAutorelease)(obj, @selector(autorelease));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
pld->pos++;
|
pld->pos++;
|
||||||
return obj;
|
return obj;
|
||||||
|
@ -388,9 +378,6 @@ static inline id parseUnquotedString(pldata *pld)
|
||||||
}
|
}
|
||||||
obj = (*plAlloc)(plCls, @selector(allocWithZone:), NSDefaultMallocZone());
|
obj = (*plAlloc)(plCls, @selector(allocWithZone:), NSDefaultMallocZone());
|
||||||
obj = (*plInit)(obj, plSel, (void*)&pld->ptr[start], pld->pos-start);
|
obj = (*plInit)(obj, plSel, (void*)&pld->ptr[start], pld->pos-start);
|
||||||
#ifndef GS_WITH_GC
|
|
||||||
(*plAutorelease)(obj, @selector(autorelease));
|
|
||||||
#endif
|
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -405,8 +392,8 @@ static id parsePlItem(pldata* pld)
|
||||||
{
|
{
|
||||||
NSMutableDictionary *dict;
|
NSMutableDictionary *dict;
|
||||||
|
|
||||||
dict = [[[plDictionary allocWithZone: NSDefaultMallocZone()]
|
dict = [[plDictionary allocWithZone: NSDefaultMallocZone()]
|
||||||
initWithCapacity: 0] autorelease];
|
initWithCapacity: 0];
|
||||||
pld->pos++;
|
pld->pos++;
|
||||||
while (skipSpace(pld) == YES && pld->ptr[pld->pos] != '}')
|
while (skipSpace(pld) == YES && pld->ptr[pld->pos] != '}')
|
||||||
{
|
{
|
||||||
|
@ -417,30 +404,48 @@ static id parsePlItem(pldata* pld)
|
||||||
if (key == nil)
|
if (key == nil)
|
||||||
return nil;
|
return nil;
|
||||||
if (skipSpace(pld) == NO)
|
if (skipSpace(pld) == NO)
|
||||||
return nil;
|
{
|
||||||
|
RELEASE(key);
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
if (pld->ptr[pld->pos] != '=')
|
if (pld->ptr[pld->pos] != '=')
|
||||||
{
|
{
|
||||||
pld->err = @"unexpected character (wanted '=')";
|
pld->err = @"unexpected character (wanted '=')";
|
||||||
|
RELEASE(key);
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
pld->pos++;
|
pld->pos++;
|
||||||
val = parsePlItem(pld);
|
val = parsePlItem(pld);
|
||||||
if (val == nil)
|
if (val == nil)
|
||||||
return nil;
|
{
|
||||||
|
RELEASE(key);
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
if (skipSpace(pld) == NO)
|
if (skipSpace(pld) == NO)
|
||||||
return nil;
|
{
|
||||||
|
RELEASE(key);
|
||||||
|
RELEASE(val);
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
if (pld->ptr[pld->pos] == ';')
|
if (pld->ptr[pld->pos] == ';')
|
||||||
pld->pos++;
|
{
|
||||||
|
pld->pos++;
|
||||||
|
}
|
||||||
else if (pld->ptr[pld->pos] != '}')
|
else if (pld->ptr[pld->pos] != '}')
|
||||||
{
|
{
|
||||||
pld->err = @"unexpected character (wanted ';' or '}')";
|
pld->err = @"unexpected character (wanted ';' or '}')";
|
||||||
|
RELEASE(key);
|
||||||
|
RELEASE(val);
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
(*plSet)(dict, @selector(setObject:forKey:), val, key);
|
(*plSet)(dict, @selector(setObject:forKey:), val, key);
|
||||||
|
RELEASE(key);
|
||||||
|
RELEASE(val);
|
||||||
}
|
}
|
||||||
if (pld->pos >= pld->end)
|
if (pld->pos >= pld->end)
|
||||||
{
|
{
|
||||||
pld->err = @"unexpected end of string when parsing dictionary";
|
pld->err = @"unexpected end of string when parsing dictionary";
|
||||||
|
RELEASE(dict);
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
pld->pos++;
|
pld->pos++;
|
||||||
|
@ -451,8 +456,8 @@ static id parsePlItem(pldata* pld)
|
||||||
{
|
{
|
||||||
NSMutableArray *array;
|
NSMutableArray *array;
|
||||||
|
|
||||||
array = [[[plArray allocWithZone: NSDefaultMallocZone()]
|
array = [[plArray allocWithZone: NSDefaultMallocZone()]
|
||||||
initWithCapacity: 0] autorelease];
|
initWithCapacity: 0];
|
||||||
pld->pos++;
|
pld->pos++;
|
||||||
while (skipSpace(pld) == YES && pld->ptr[pld->pos] != ')')
|
while (skipSpace(pld) == YES && pld->ptr[pld->pos] != ')')
|
||||||
{
|
{
|
||||||
|
@ -460,21 +465,31 @@ static id parsePlItem(pldata* pld)
|
||||||
|
|
||||||
val = parsePlItem(pld);
|
val = parsePlItem(pld);
|
||||||
if (val == nil)
|
if (val == nil)
|
||||||
return nil;
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
if (skipSpace(pld) == NO)
|
if (skipSpace(pld) == NO)
|
||||||
return nil;
|
{
|
||||||
|
RELEASE(val);
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
if (pld->ptr[pld->pos] == ',')
|
if (pld->ptr[pld->pos] == ',')
|
||||||
pld->pos++;
|
{
|
||||||
|
pld->pos++;
|
||||||
|
}
|
||||||
else if (pld->ptr[pld->pos] != ')')
|
else if (pld->ptr[pld->pos] != ')')
|
||||||
{
|
{
|
||||||
pld->err = @"unexpected character (wanted ',' or ')')";
|
pld->err = @"unexpected character (wanted ',' or ')')";
|
||||||
|
RELEASE(val);
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
(*plAdd)(array, @selector(addObject:), val);
|
(*plAdd)(array, @selector(addObject:), val);
|
||||||
|
RELEASE(val);
|
||||||
}
|
}
|
||||||
if (pld->pos >= pld->end)
|
if (pld->pos >= pld->end)
|
||||||
{
|
{
|
||||||
pld->err = @"unexpected end of string when parsing array";
|
pld->err = @"unexpected end of string when parsing array";
|
||||||
|
RELEASE(array);
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
pld->pos++;
|
pld->pos++;
|
||||||
|
@ -488,7 +503,7 @@ static id parsePlItem(pldata* pld)
|
||||||
unsigned char buf[BUFSIZ];
|
unsigned char buf[BUFSIZ];
|
||||||
unsigned len = 0;
|
unsigned len = 0;
|
||||||
|
|
||||||
data = [NSMutableData dataWithCapacity: 0];
|
data = [[NSMutableData alloc] initWithCapacity: 0];
|
||||||
pld->pos++;
|
pld->pos++;
|
||||||
while (skipSpace(pld) == YES && pld->ptr[pld->pos] != '>')
|
while (skipSpace(pld) == YES && pld->ptr[pld->pos] != '>')
|
||||||
{
|
{
|
||||||
|
@ -515,11 +530,13 @@ static id parsePlItem(pldata* pld)
|
||||||
if (pld->pos >= pld->end)
|
if (pld->pos >= pld->end)
|
||||||
{
|
{
|
||||||
pld->err = @"unexpected end of string when parsing data";
|
pld->err = @"unexpected end of string when parsing data";
|
||||||
|
RELEASE(data);
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
if (pld->ptr[pld->pos] != '>')
|
if (pld->ptr[pld->pos] != '>')
|
||||||
{
|
{
|
||||||
pld->err = @"unexpected character in string";
|
pld->err = @"unexpected character in string";
|
||||||
|
RELEASE(data);
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
if (len > 0)
|
if (len > 0)
|
||||||
|
@ -542,8 +559,8 @@ static id parseSfItem(pldata* pld)
|
||||||
{
|
{
|
||||||
NSMutableDictionary *dict;
|
NSMutableDictionary *dict;
|
||||||
|
|
||||||
dict = [[[plDictionary allocWithZone: NSDefaultMallocZone()]
|
dict = [[plDictionary allocWithZone: NSDefaultMallocZone()]
|
||||||
initWithCapacity: 0] autorelease];
|
initWithCapacity: 0];
|
||||||
while (skipSpace(pld) == YES)
|
while (skipSpace(pld) == YES)
|
||||||
{
|
{
|
||||||
id key;
|
id key;
|
||||||
|
@ -558,40 +575,55 @@ static id parseSfItem(pldata* pld)
|
||||||
if (skipSpace(pld) == NO)
|
if (skipSpace(pld) == NO)
|
||||||
{
|
{
|
||||||
pld->err = @"incomplete final entry (no semicolon?)";
|
pld->err = @"incomplete final entry (no semicolon?)";
|
||||||
|
RELEASE(key);
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
if (pld->ptr[pld->pos] == ';')
|
if (pld->ptr[pld->pos] == ';')
|
||||||
{
|
{
|
||||||
pld->pos++;
|
pld->pos++;
|
||||||
(*plSet)(dict, @selector(setObject:forKey:), @"", key);
|
(*plSet)(dict, @selector(setObject:forKey:), @"", key);
|
||||||
|
RELEASE(key);
|
||||||
}
|
}
|
||||||
else if (pld->ptr[pld->pos] == '=')
|
else if (pld->ptr[pld->pos] == '=')
|
||||||
{
|
{
|
||||||
pld->pos++;
|
pld->pos++;
|
||||||
if (skipSpace(pld) == NO)
|
if (skipSpace(pld) == NO)
|
||||||
return nil;
|
{
|
||||||
|
RELEASE(key);
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
if (pld->ptr[pld->pos] == '"')
|
if (pld->ptr[pld->pos] == '"')
|
||||||
val = parseQuotedString(pld);
|
val = parseQuotedString(pld);
|
||||||
else
|
else
|
||||||
val = parseUnquotedString(pld);
|
val = parseUnquotedString(pld);
|
||||||
if (val == nil)
|
if (val == nil)
|
||||||
return nil;
|
{
|
||||||
|
RELEASE(key);
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
if (skipSpace(pld) == NO)
|
if (skipSpace(pld) == NO)
|
||||||
{
|
{
|
||||||
pld->err = @"missing final semicolon";
|
pld->err = @"missing final semicolon";
|
||||||
|
RELEASE(key);
|
||||||
|
RELEASE(val);
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
(*plSet)(dict, @selector(setObject:forKey:), val, key);
|
(*plSet)(dict, @selector(setObject:forKey:), val, key);
|
||||||
|
RELEASE(key);
|
||||||
|
RELEASE(val);
|
||||||
if (pld->ptr[pld->pos] == ';')
|
if (pld->ptr[pld->pos] == ';')
|
||||||
pld->pos++;
|
pld->pos++;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pld->err = @"unexpected character (wanted ';')";
|
pld->err = @"unexpected character (wanted ';')";
|
||||||
|
RELEASE(dict);
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
RELEASE(key);
|
||||||
|
RELEASE(dict);
|
||||||
pld->err = @"unexpected character (wanted '=' or ';')";
|
pld->err = @"unexpected character (wanted '=' or ';')";
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue