2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
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
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
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
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.
23 * @APPLE_LICENSE_HEADER_END@
27 * attr.h - attribute data structures and interfaces
29 * Copyright (c) 1998, Apple Computer, Inc. All Rights Reserved.
35 #include <sys/appleapiopts.h>
37 #ifdef __APPLE_API_UNSTABLE
39 #include <sys/types.h>
42 #include <sys/ucred.h>
45 #include <sys/mount.h>
51 #define FSOPT_NOFOLLOW 0x00000001
52 #define FSOPT_NOINMEMUPDATE 0x00000002
54 typedef u_int32_t text_encoding_t
;
56 typedef u_int32_t fsobj_type_t
;
58 typedef u_int32_t fsobj_tag_t
;
60 typedef u_int32_t fsfile_type_t
;
62 typedef u_int32_t fsvolid_t
;
64 typedef struct fsobj_id
{
66 u_int32_t fid_generation
;
69 typedef u_int32_t attrgroup_t
;
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 */
80 #define ATTR_BIT_MAP_COUNT 5
82 typedef 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 */
90 typedef struct attrreference
{
95 /* XXX PPD This is derived from HFSVolumePriv.h and should perhaps be referenced from there? */
98 u_int32_t startblock
; /* first block allocated */
99 u_int32_t blockcount
; /* number of blocks allocated */
102 typedef struct diskextent extentrecord
[8];
104 typedef u_int32_t vol_capabilities_set_t
[4];
106 #define VOL_CAPABILITIES_FORMAT 0
107 #define VOL_CAPABILITIES_INTERFACES 1
108 #define VOL_CAPABILITIES_RESERVED1 2
109 #define VOL_CAPABILITIES_RESERVED2 3
111 typedef struct vol_capabilities_attr
{
112 vol_capabilities_set_t capabilities
;
113 vol_capabilities_set_t valid
;
114 } vol_capabilities_attr_t
;
116 #define VOL_CAP_FMT_PERSISTENTOBJECTIDS 0x00000001
117 #define VOL_CAP_FMT_SYMBOLICLINKS 0x00000002
118 #define VOL_CAP_FMT_HARDLINKS 0x00000004
120 #define VOL_CAP_INT_SEARCHFS 0x00000001
121 #define VOL_CAP_INT_ATTRLIST 0x00000002
122 #define VOL_CAP_INT_NFSEXPORT 0x00000004
123 #define VOL_CAP_INT_READDIRATTR 0x00000008
125 typedef struct vol_attributes_attr
{
126 attribute_set_t validattr
;
127 attribute_set_t nativeattr
;
128 } vol_attributes_attr_t
;
130 #define DIR_MNTSTATUS_MNTPOINT 0x00000001
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
155 #define ATTR_CMN_VALIDMASK 0x003FFFFF
156 #define ATTR_CMN_SETMASK 0x0007FF00
157 #define ATTR_CMN_VOLSETMASK 0x00006700
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
180 #define ATTR_VOL_VALIDMASK 0xC003FFFF
181 #define ATTR_VOL_SETMASK 0x80002000
184 /* File/directory attributes: */
185 #define ATTR_DIR_LINKCOUNT 0x00000001
186 #define ATTR_DIR_ENTRYCOUNT 0x00000002
187 #define ATTR_DIR_MOUNTSTATUS 0x00000004
189 #define ATTR_DIR_VALIDMASK 0x00000007
190 #define ATTR_DIR_SETMASK 0x00000000
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
208 #define ATTR_FILE_VALIDMASK 0x00007FFF
209 #define ATTR_FILE_SETMASK 0x00000020
211 #define ATTR_FORK_TOTALSIZE 0x00000001
212 #define ATTR_FORK_ALLOCSIZE 0x00000002
214 #define ATTR_FORK_VALIDMASK 0x00000003
215 #define ATTR_FORK_SETMASK 0x00000000
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
224 struct fssearchblock
{
225 struct attrlist
*returnattrs
;
227 size_t returnbuffersize
;
229 struct timeval timelimit
;
231 size_t sizeofsearchparams1
;
233 size_t sizeofsearchparams2
;
234 struct attrlist searchattrs
;
239 u_char reserved
[556]; // sizeof( SearchState )
243 #define FST_EOF (-1) /* end-of-file offset */
245 #endif /* __APPLE_API_UNSTABLE */
246 #endif /* !_SYS_ATTR_H_ */