-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathPatchedFile.m
55 lines (39 loc) · 1.09 KB
/
PatchedFile.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//
// PatchedFile.m
// tetherKit
//
// Created by Kevin Bradley on 12/30/10.
// Copyright 2011 Fire Core, LLC. All rights reserved.
//
#import "PatchedFile.h"
@implementation PatchedFile
@synthesize originalFile, patchFile, md5;
- (void)dealloc
{
[originalFile release];
[patchFile release];
[md5 release];
originalFile = nil;
patchFile = nil;
md5 = nil;
[super dealloc];
}
-(NSDictionary *)patchDictionary
{
return [NSDictionary dictionaryWithObjectsAndKeys:originalFile, @"inputFile", patchFile, @"patchFile", md5, @"md5", nil];
}
void QuietLog (NSString *format, ...) {
if (format == nil) {
printf("nil\n");
return;
}
// Get a reference to the arguments that follow the format parameter
va_list argList;
va_start(argList, format);
// Perform format string argument substitution, reinstate %% escapes, then print
NSString *s = [[NSString alloc] initWithFormat:format arguments:argList];
fprintf(stdout, "%s\n", [[s stringByReplacingOccurrencesOfString:@"%%" withString:@"%%%%"] UTF8String]);
[s release];
va_end(argList);
}
@end