Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(960)

Side by Side Diff: class-dump/src/CDLCDylib.m

Issue 7793008: Add the 3.3.3 sources for class-dump. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « class-dump/src/CDLCDylib.h ('k') | class-dump/src/CDLCDylinker.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // -*- mode: ObjC -*-
2
3 // This file is part of class-dump, a utility for examining the Objective-C seg ment of Mach-O files.
4 // Copyright (C) 1997-1998, 2000-2001, 2004-2010 Steve Nygard.
5
6 #import "CDLCDylib.h"
7
8 #import "CDFatFile.h"
9 #import "CDMachOFile.h"
10
11 static NSString *CDDylibVersionString(unsigned long version)
12 {
13 return [NSString stringWithFormat:@"%d.%d.%d", version >> 16, (version >> 8) & 0xff, version & 0xff];
14 }
15
16 @implementation CDLCDylib
17
18 - (id)initWithDataCursor:(CDDataCursor *)cursor machOFile:(CDMachOFile *)aMachOF ile;
19 {
20 NSUInteger length;
21
22 if ([super initWithDataCursor:cursor machOFile:aMachOFile] == nil)
23 return nil;
24
25 dylibCommand.cmd = [cursor readInt32];
26 dylibCommand.cmdsize = [cursor readInt32];
27
28 dylibCommand.dylib.name.offset = [cursor readInt32];
29 dylibCommand.dylib.timestamp = [cursor readInt32];
30 dylibCommand.dylib.current_version = [cursor readInt32];
31 dylibCommand.dylib.compatibility_version = [cursor readInt32];
32
33 length = dylibCommand.cmdsize - sizeof(dylibCommand);
34 //NSLog(@"expected length: %u", length);
35
36 path = [[cursor readStringOfLength:length encoding:NSASCIIStringEncoding] re tain];
37 //NSLog(@"path: %@", path);
38
39 return self;
40 }
41
42 - (void)dealloc;
43 {
44 [path release];
45
46 [super dealloc];
47 }
48
49 - (uint32_t)cmd;
50 {
51 return dylibCommand.cmd;
52 }
53
54 - (uint32_t)cmdsize;
55 {
56 return dylibCommand.cmdsize;
57 }
58
59 - (NSString *)path;
60 {
61 return path;
62 }
63
64 - (uint32_t)timestamp;
65 {
66 return dylibCommand.dylib.timestamp;
67 }
68
69 - (uint32_t)currentVersion;
70 {
71 return dylibCommand.dylib.current_version;
72 }
73
74 - (uint32_t)compatibilityVersion;
75 {
76 return dylibCommand.dylib.compatibility_version;
77 }
78
79 - (NSString *)formattedCurrentVersion;
80 {
81 return CDDylibVersionString([self currentVersion]);
82 }
83
84 - (NSString *)formattedCompatibilityVersion;
85 {
86 return CDDylibVersionString([self compatibilityVersion]);
87 }
88
89 #if 0
90 - (NSString *)extraDescription;
91 {
92 return [NSString stringWithFormat:@"%@ (compatibility version %@, current ve rsion %@, timestamp %d [%@])",
93 [self path], CDDylibVersionString([self compatibilityVersio n]), CDDylibVersionString([self currentVersion]),
94 [self timestamp], [NSDate dateWithTimeIntervalSince1970:[se lf timestamp]]];
95 }
96 #endif
97
98 @end
OLDNEW
« no previous file with comments | « class-dump/src/CDLCDylib.h ('k') | class-dump/src/CDLCDylinker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698