]> git.saurik.com Git - apple/xnu.git/blame - bsd/sys/attr.h
xnu-344.49.tar.gz
[apple/xnu.git] / bsd / sys / attr.h
CommitLineData
1c79356b 1/*
9bccf70c 2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
1c79356b
A
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
43866e37 6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
1c79356b 7 *
43866e37
A
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
1c79356b
A
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
43866e37
A
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
1c79356b
A
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25
26/*
27 * attr.h - attribute data structures and interfaces
28 *
29 * Copyright (c) 1998, Apple Computer, Inc. All Rights Reserved.
30 */
31
32#ifndef _SYS_ATTR_H_
33#define _SYS_ATTR_H_
34
9bccf70c
A
35#include <sys/appleapiopts.h>
36
37#ifdef __APPLE_API_UNSTABLE
1c79356b
A
38#ifndef _SYS_TYPES_H_
39#include <sys/types.h>
40#endif
41#ifndef _SYS_UCRED_H
42#include <sys/ucred.h>
43#endif
44#ifndef _SYS_MOUNT_H_
45#include <sys/mount.h>
46#endif
47#ifndef _SYS_TIME_H_
48#include <sys/time.h>
49#endif
50
51#define FSOPT_NOFOLLOW 0x00000001
52#define FSOPT_NOINMEMUPDATE 0x00000002
53
54typedef u_int32_t text_encoding_t;
55
56typedef u_int32_t fsobj_type_t;
57
58typedef u_int32_t fsobj_tag_t;
59
60typedef u_int32_t fsfile_type_t;
61
62typedef u_int32_t fsvolid_t;
63
64typedef struct fsobj_id {
65 u_int32_t fid_objno;
66 u_int32_t fid_generation;
67} fsobj_id_t;
68
69typedef u_int32_t attrgroup_t;
70
71struct attrlist {
72 u_short bitmapcount; /* number of attr. bit sets in list (should be 5) */
73 u_int16_t reserved; /* (to maintain 4-byte alignment) */
74 attrgroup_t commonattr; /* common attribute group */
75 attrgroup_t volattr; /* Volume attribute group */
76 attrgroup_t dirattr; /* directory attribute group */
77 attrgroup_t fileattr; /* file attribute group */
78 attrgroup_t forkattr; /* fork attribute group */
79};
80#define ATTR_BIT_MAP_COUNT 5
81
82typedef struct attribute_set {
83 attrgroup_t commonattr; /* common attribute group */
84 attrgroup_t volattr; /* Volume attribute group */
85 attrgroup_t dirattr; /* directory attribute group */
86 attrgroup_t fileattr; /* file attribute group */
87 attrgroup_t forkattr; /* fork attribute group */
88} attribute_set_t;
89
90typedef struct attrreference {
91 long attr_dataoffset;
92 size_t attr_length;
93} attrreference_t;
94
95/* XXX PPD This is derived from HFSVolumePriv.h and should perhaps be referenced from there? */
96
97struct diskextent {
98 u_int32_t startblock; /* first block allocated */
99 u_int32_t blockcount; /* number of blocks allocated */
100};
101
102typedef struct diskextent extentrecord[8];
103
104typedef u_int32_t vol_capabilities_set_t[4];
105
106#define VOL_CAPABILITIES_FORMAT 0
107#define VOL_CAPABILITIES_INTERFACES 1
108#define VOL_CAPABILITIES_RESERVED1 2
109#define VOL_CAPABILITIES_RESERVED2 3
110
111typedef struct vol_capabilities_attr {
112 vol_capabilities_set_t capabilities;
113 vol_capabilities_set_t valid;
114} vol_capabilities_attr_t;
115
116#define VOL_CAP_FMT_PERSISTENTOBJECTIDS 0x00000001
117#define VOL_CAP_FMT_SYMBOLICLINKS 0x00000002
118#define VOL_CAP_FMT_HARDLINKS 0x00000004
119
120#define VOL_CAP_INT_SEARCHFS 0x00000001
121#define VOL_CAP_INT_ATTRLIST 0x00000002
122#define VOL_CAP_INT_NFSEXPORT 0x00000004
0b4e3aa0 123#define VOL_CAP_INT_READDIRATTR 0x00000008
1c79356b
A
124
125typedef struct vol_attributes_attr {
126 attribute_set_t validattr;
127 attribute_set_t nativeattr;
128} vol_attributes_attr_t;
129
130#define DIR_MNTSTATUS_MNTPOINT 0x00000001
131
132#define ATTR_CMN_NAME 0x00000001
133#define ATTR_CMN_DEVID 0x00000002
134#define ATTR_CMN_FSID 0x00000004
135#define ATTR_CMN_OBJTYPE 0x00000008
136#define ATTR_CMN_OBJTAG 0x00000010
137#define ATTR_CMN_OBJID 0x00000020
138#define ATTR_CMN_OBJPERMANENTID 0x00000040
139#define ATTR_CMN_PAROBJID 0x00000080
140#define ATTR_CMN_SCRIPT 0x00000100
141#define ATTR_CMN_CRTIME 0x00000200
142#define ATTR_CMN_MODTIME 0x00000400
143#define ATTR_CMN_CHGTIME 0x00000800
144#define ATTR_CMN_ACCTIME 0x00001000
145#define ATTR_CMN_BKUPTIME 0x00002000
146#define ATTR_CMN_FNDRINFO 0x00004000
147#define ATTR_CMN_OWNERID 0x00008000
148#define ATTR_CMN_GRPID 0x00010000
149#define ATTR_CMN_ACCESSMASK 0x00020000
150#define ATTR_CMN_FLAGS 0x00040000
151#define ATTR_CMN_NAMEDATTRCOUNT 0x00080000
152#define ATTR_CMN_NAMEDATTRLIST 0x00100000
153#define ATTR_CMN_USERACCESS 0x00200000
154
155#define ATTR_CMN_VALIDMASK 0x003FFFFF
156#define ATTR_CMN_SETMASK 0x0007FF00
157#define ATTR_CMN_VOLSETMASK 0x00006700
158
159#define ATTR_VOL_FSTYPE 0x00000001
160#define ATTR_VOL_SIGNATURE 0x00000002
161#define ATTR_VOL_SIZE 0x00000004
162#define ATTR_VOL_SPACEFREE 0x00000008
163#define ATTR_VOL_SPACEAVAIL 0x00000010
164#define ATTR_VOL_MINALLOCATION 0x00000020
165#define ATTR_VOL_ALLOCATIONCLUMP 0x00000040
166#define ATTR_VOL_IOBLOCKSIZE 0x00000080
167#define ATTR_VOL_OBJCOUNT 0x00000100
168#define ATTR_VOL_FILECOUNT 0x00000200
169#define ATTR_VOL_DIRCOUNT 0x00000400
170#define ATTR_VOL_MAXOBJCOUNT 0x00000800
171#define ATTR_VOL_MOUNTPOINT 0x00001000
172#define ATTR_VOL_NAME 0x00002000
173#define ATTR_VOL_MOUNTFLAGS 0x00004000
174#define ATTR_VOL_MOUNTEDDEVICE 0x00008000
175#define ATTR_VOL_ENCODINGSUSED 0x00010000
176#define ATTR_VOL_CAPABILITIES 0x00020000
177#define ATTR_VOL_ATTRIBUTES 0x40000000
178#define ATTR_VOL_INFO 0x80000000
179
180#define ATTR_VOL_VALIDMASK 0xC003FFFF
181#define ATTR_VOL_SETMASK 0x80002000
182
183
184/* File/directory attributes: */
185#define ATTR_DIR_LINKCOUNT 0x00000001
186#define ATTR_DIR_ENTRYCOUNT 0x00000002
187#define ATTR_DIR_MOUNTSTATUS 0x00000004
188
189#define ATTR_DIR_VALIDMASK 0x00000007
190#define ATTR_DIR_SETMASK 0x00000000
191
192#define ATTR_FILE_LINKCOUNT 0x00000001
193#define ATTR_FILE_TOTALSIZE 0x00000002
194#define ATTR_FILE_ALLOCSIZE 0x00000004
195#define ATTR_FILE_IOBLOCKSIZE 0x00000008
196#define ATTR_FILE_CLUMPSIZE 0x00000010
197#define ATTR_FILE_DEVTYPE 0x00000020
198#define ATTR_FILE_FILETYPE 0x00000040
199#define ATTR_FILE_FORKCOUNT 0x00000080
200#define ATTR_FILE_FORKLIST 0x00000100
201#define ATTR_FILE_DATALENGTH 0x00000200
202#define ATTR_FILE_DATAALLOCSIZE 0x00000400
203#define ATTR_FILE_DATAEXTENTS 0x00000800
204#define ATTR_FILE_RSRCLENGTH 0x00001000
205#define ATTR_FILE_RSRCALLOCSIZE 0x00002000
206#define ATTR_FILE_RSRCEXTENTS 0x00004000
207
208#define ATTR_FILE_VALIDMASK 0x00007FFF
209#define ATTR_FILE_SETMASK 0x00000020
210
211#define ATTR_FORK_TOTALSIZE 0x00000001
212#define ATTR_FORK_ALLOCSIZE 0x00000002
213
214#define ATTR_FORK_VALIDMASK 0x00000003
215#define ATTR_FORK_SETMASK 0x00000000
216
217#define SRCHFS_START 0x00000001
218#define SRCHFS_MATCHPARTIALNAMES 0x00000002
219#define SRCHFS_MATCHDIRS 0x00000004
220#define SRCHFS_MATCHFILES 0x00000008
221#define SRCHFS_NEGATEPARAMS 0x80000000
222#define SRCHFS_VALIDOPTIONSMASK 0x8000000F
223
224struct fssearchblock {
225 struct attrlist *returnattrs;
226 void *returnbuffer;
227 size_t returnbuffersize;
228 u_long maxmatches;
229 struct timeval timelimit;
230 void *searchparams1;
231 size_t sizeofsearchparams1;
232 void *searchparams2;
233 size_t sizeofsearchparams2;
234 struct attrlist searchattrs;
235};
236
237
238struct searchstate {
239 u_char reserved[556]; // sizeof( SearchState )
240};
241
242
1c79356b
A
243#define FST_EOF (-1) /* end-of-file offset */
244
9bccf70c 245#endif /* __APPLE_API_UNSTABLE */
1c79356b 246#endif /* !_SYS_ATTR_H_ */