File: darwin.h

package info (click to toggle)
dump 0.4b44-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,416 kB
  • sloc: ansic: 17,861; sh: 3,415; makefile: 220; sed: 5
file content (133 lines) | stat: -rw-r--r-- 3,505 bytes parent folder | download | duplicates (12)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/*
 *
 */

#if defined(DUMP_MACOSX)

#ifndef DARWIN_H
#define DARWIN_H

#define INFOLEN 32
#define CORRECT 2


#define DARWIN_RSRC_NAME "/..namedfork/rsrc"
#define DARWIN_FINFO_NAME "/..namedfork/finfo"
/*
 * some structs from the HFS+ info for OS X
 * - including the header file causes messy clashes
 */

struct FndrFileInfo {
    u_int32_t     fdType;        /* file type */
    u_int32_t     fdCreator;    /* file creator */
    u_int16_t     fdFlags;    /* Finder flags */
    struct {
        int16_t    v;        /* file's location */
        int16_t    h;
    } fdLocation;
    int16_t     opaque;
};
typedef struct FndrFileInfo FndrFileInfo;

struct FndrDirInfo {
        struct {                        /* folder's window rectangle */
            int16_t     top;
            int16_t     left;
            int16_t     bottom;
            int16_t     right;
        } frRect;
        unsigned short  frFlags;        /* Finder flags */
        struct {
            u_int16_t   v;              /* folder's location */
            u_int16_t   h;
        } frLocation;
        int16_t         opaque;
};
typedef struct FndrDirInfo FndrDirInfo;


struct FndrOpaqueInfo {
    int8_t opaque[16];
};
typedef struct FndrOpaqueInfo FndrOpaqueInfo;

struct fndrinfo_block_t {
        FndrFileInfo    finderInfo;
        FndrOpaqueInfo  extendedFinderInfo;
};
typedef struct fndrinfo_block_t fndrinfo_block_t;

struct attrinfo_block_t {
        unsigned long info_length;
	u_int32_t	objid_low;
	u_int32_t	objid_high;
	struct timespec created;
	struct timespec backup;
	union {
		fndrinfo_block_t	finfo;
		FndrDirInfo		dinfo;
        } o;
	off_t	rsrc_length;
};
typedef struct attrinfo_block_t attrinfo_block_t;


#define ASINGLE_MAGIC	0x00051600	/* all in one file */
#define ADOUBLE_MAGIC	0x00051607	/* resource + info, data separated */

#define ASD_VERSION1	0x00010000	/* the original version */
#define ASD_VERSION2	0x00020000	/* the second version */

typedef struct ASDHeader {
	u_long	magic;			/* either single or double */
	u_long	version;		/* ASD_VERSION2 */
	u_char	filler[16];		/* reserved, zero */
	u_short	entries;		/* the number of entries */
	/* the entries follow */
} ASDHeader, *ASDHeaderPtr, **ASDHeaderHandle;

typedef enum {
	EntryDataFork = 1,
	EntryRSRCFork,
	EntryRealName,
	EntryComment,
	EntryBWIcon,
	EntryColorIcon,
	EntryOldFileInfo,
	EntryFileDates,
	EntryFinderInfo,
	EntryMacFileInfo,
	EntryProDOSInfo,
	EntryMSDOSInfo,
	EntryShortName,
	EntryAFPFileInfo,
	EntryDirID
} ASDEntryType;

typedef struct {
	u_long	entryID;		/* the entry type (forced to long) */
	u_long	offset;			/* offset in file of entry */
	u_long	len;			/* length of entry */
} ASDEntry, *ASDEntryPtr, **ASDEntryHandle;

typedef struct {
	u_long	creationDate;
	u_long	modificationDate;
	u_long	backupDate;
	u_long	accessDate;
} FileDates, *FileDatesPtr;

typedef struct dumpfinderinfo {
 FndrFileInfo fndrinfo;	/* 0: size = 16 bytes, same for FndrDirInfo */
 u_int32_t createDate;	/* 16: date and time of creation */
 u_int32_t contentModDate;/* 20: date/time of last content modification */
 u_int32_t attributeModDate;/* 24: date/time of last attribute modification */
 u_int32_t accessDate; /* 30: date/time of last access (MacOS X only) */
 u_int32_t backupDate; /* 34: date/time of last backup */
 u_int32_t textEncoding;	/* 36: hint for name conversions */
 char filler[980]; /* 40: for later expansion, 40 + 980 - 4 = TP_BSIZE - 4 */
} DumpFinderInfo, *DumpFinderInfoPtr;

#endif /* DARWIN_H */
#endif