plutil: make it build

This commit is contained in:
root 2020-09-23 16:57:09 +08:00
parent 8b46d8d042
commit ce4b65a26d
2 changed files with 4 additions and 22 deletions

View file

@ -31,23 +31,6 @@
static IMP originalRead = 0;
static IMP originalWrite = 0;
// The whole PAppend and indent table thing again. Later?
static void
OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
NSPropertyListFormat x, NSMutableData *dest)
{
// Generate declaration w/ type
if (lev == 0)
;
// Main loop
// Add semicolon
if (lev == 0 && x == NSPropertyListObjectiveCFormat)
[dest appendBytes:";" length:1];
[dest appendBytes:"\n" length:1];
}
@implementation NSPropertyListSerialization (PLUtilAdditions)
+ (NSData *)_pdataFromPropertyList:(id)aPropertyList
format:(NSPropertyListFormat)aFormat
@ -71,9 +54,8 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
return dest;
case NSPropertyListObjectiveCFormat:
case NSPropertyListSwiftFormat:
dest = [NSMutableData dataWithCapacity:1024];
OAppend(aPropertyList, loc, 0, 2, aFormat, dest);
return dest;
*anErrorString = @"Not implemented";
return nil;
default:
return (*originalWrite)(self, _cmd, aPropertyList, aFormat, anErrorString);
}

View file

@ -32,7 +32,7 @@
#import "Foundation/NSString.h"
#import "Foundation/NSUserDefaults.h"
#import "Foundation/NSValue.h"
#import "NSPropertyList+PLutil.h"
#import "NSPropertyList+PLUtil.h"
// From NSPropertyList.m
extern void
@ -325,7 +325,7 @@ dumpToFile(id obj, NSPropertyListFormat fmt, NSString *outfile)
format:fmt
options:0
errorDescription:&errorString];
if (anError)
if (errorString)
{
GSPrintf(stderr, @"Dumping %@ as format %@ - %@\n", obj, fmt,
errorString);