2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
24 * attr.h - attribute data structures and interfaces
26 * Copyright (c) 1998, Apple Computer, Inc. All Rights Reserved.
32 #include <sys/appleapiopts.h>
34 #ifdef __APPLE_API_UNSTABLE
36 #include <sys/types.h>
39 #include <sys/ucred.h>
42 #include <sys/mount.h>
48 #define FSOPT_NOFOLLOW 0x00000001
49 #define FSOPT_NOINMEMUPDATE 0x00000002
51 typedef u_int32_t text_encoding_t
;
53 typedef u_int32_t fsobj_type_t
;
55 typedef u_int32_t fsobj_tag_t
;
57 typedef u_int32_t fsfile_type_t
;
59 typedef u_int32_t fsvolid_t
;
61 typedef struct fsobj_id
{
63 u_int32_t fid_generation
;
66 typedef u_int32_t attrgroup_t
;
69 u_short bitmapcount
; /* number of attr. bit sets in list (should be 5) */
70 u_int16_t reserved
; /* (to maintain 4-byte alignment) */
71 attrgroup_t commonattr
; /* common attribute group */
72 attrgroup_t volattr
; /* Volume attribute group */
73 attrgroup_t dirattr
; /* directory attribute group */
74 attrgroup_t fileattr
; /* file attribute group */
75 attrgroup_t forkattr
; /* fork attribute group */
77 #define ATTR_BIT_MAP_COUNT 5
79 typedef struct attribute_set
{
80 attrgroup_t commonattr
; /* common attribute group */
81 attrgroup_t volattr
; /* Volume attribute group */
82 attrgroup_t dirattr
; /* directory attribute group */
83 attrgroup_t fileattr
; /* file attribute group */
84 attrgroup_t forkattr
; /* fork attribute group */
87 typedef struct attrreference
{
92 /* XXX PPD This is derived from HFSVolumePriv.h and should perhaps be referenced from there? */
95 u_int32_t startblock
; /* first block allocated */
96 u_int32_t blockcount
; /* number of blocks allocated */
99 typedef struct diskextent extentrecord
[8];
101 typedef u_int32_t vol_capabilities_set_t
[4];
103 #define VOL_CAPABILITIES_FORMAT 0
104 #define VOL_CAPABILITIES_INTERFACES 1
105 #define VOL_CAPABILITIES_RESERVED1 2
106 #define VOL_CAPABILITIES_RESERVED2 3
108 typedef struct vol_capabilities_attr
{
109 vol_capabilities_set_t capabilities
;
110 vol_capabilities_set_t valid
;
111 } vol_capabilities_attr_t
;
113 #define VOL_CAP_FMT_PERSISTENTOBJECTIDS 0x00000001
114 #define VOL_CAP_FMT_SYMBOLICLINKS 0x00000002
115 #define VOL_CAP_FMT_HARDLINKS 0x00000004
117 #define VOL_CAP_INT_SEARCHFS 0x00000001
118 #define VOL_CAP_INT_ATTRLIST 0x00000002
119 #define VOL_CAP_INT_NFSEXPORT 0x00000004
120 #define VOL_CAP_INT_READDIRATTR 0x00000008
122 typedef struct vol_attributes_attr
{
123 attribute_set_t validattr
;
124 attribute_set_t nativeattr
;
125 } vol_attributes_attr_t
;
127 #define DIR_MNTSTATUS_MNTPOINT 0x00000001
129 #define ATTR_CMN_NAME 0x00000001
130 #define ATTR_CMN_DEVID 0x00000002
131 #define ATTR_CMN_FSID 0x00000004
132 #define ATTR_CMN_OBJTYPE 0x00000008
133 #define ATTR_CMN_OBJTAG 0x00000010
134 #define ATTR_CMN_OBJID 0x00000020
135 #define ATTR_CMN_OBJPERMANENTID 0x00000040
136 #define ATTR_CMN_PAROBJID 0x00000080
137 #define ATTR_CMN_SCRIPT 0x00000100
138 #define ATTR_CMN_CRTIME 0x00000200
139 #define ATTR_CMN_MODTIME 0x00000400
140 #define ATTR_CMN_CHGTIME 0x00000800
141 #define ATTR_CMN_ACCTIME 0x00001000
142 #define ATTR_CMN_BKUPTIME 0x00002000
143 #define ATTR_CMN_FNDRINFO 0x00004000
144 #define ATTR_CMN_OWNERID 0x00008000
145 #define ATTR_CMN_GRPID 0x00010000
146 #define ATTR_CMN_ACCESSMASK 0x00020000
147 #define ATTR_CMN_FLAGS 0x00040000
148 #define ATTR_CMN_NAMEDATTRCOUNT 0x00080000
149 #define ATTR_CMN_NAMEDATTRLIST 0x00100000
150 #define ATTR_CMN_USERACCESS 0x00200000
152 #define ATTR_CMN_VALIDMASK 0x003FFFFF
153 #define ATTR_CMN_SETMASK 0x0007FF00
154 #define ATTR_CMN_VOLSETMASK 0x00006700
156 #define ATTR_VOL_FSTYPE 0x00000001
157 #define ATTR_VOL_SIGNATURE 0x00000002
158 #define ATTR_VOL_SIZE 0x00000004
159 #define ATTR_VOL_SPACEFREE 0x00000008
160 #define ATTR_VOL_SPACEAVAIL 0x00000010
161 #define ATTR_VOL_MINALLOCATION 0x00000020
162 #define ATTR_VOL_ALLOCATIONCLUMP 0x00000040
163 #define ATTR_VOL_IOBLOCKSIZE 0x00000080
164 #define ATTR_VOL_OBJCOUNT 0x00000100
165 #define ATTR_VOL_FILECOUNT 0x00000200
166 #define ATTR_VOL_DIRCOUNT 0x00000400
167 #define ATTR_VOL_MAXOBJCOUNT 0x00000800
168 #define ATTR_VOL_MOUNTPOINT 0x00001000
169 #define ATTR_VOL_NAME 0x00002000
170 #define ATTR_VOL_MOUNTFLAGS 0x00004000
171 #define ATTR_VOL_MOUNTEDDEVICE 0x00008000
172 #define ATTR_VOL_ENCODINGSUSED 0x00010000
173 #define ATTR_VOL_CAPABILITIES 0x00020000
174 #define ATTR_VOL_ATTRIBUTES 0x40000000
175 #define ATTR_VOL_INFO 0x80000000
177 #define ATTR_VOL_VALIDMASK 0xC003FFFF
178 #define ATTR_VOL_SETMASK 0x80002000
181 /* File/directory attributes: */
182 #define ATTR_DIR_LINKCOUNT 0x00000001
183 #define ATTR_DIR_ENTRYCOUNT 0x00000002
184 #define ATTR_DIR_MOUNTSTATUS 0x00000004
186 #define ATTR_DIR_VALIDMASK 0x00000007
187 #define ATTR_DIR_SETMASK 0x00000000
189 #define ATTR_FILE_LINKCOUNT 0x00000001
190 #define ATTR_FILE_TOTALSIZE 0x00000002
191 #define ATTR_FILE_ALLOCSIZE 0x00000004
192 #define ATTR_FILE_IOBLOCKSIZE 0x00000008
193 #define ATTR_FILE_CLUMPSIZE 0x00000010
194 #define ATTR_FILE_DEVTYPE 0x00000020
195 #define ATTR_FILE_FILETYPE 0x00000040
196 #define ATTR_FILE_FORKCOUNT 0x00000080
197 #define ATTR_FILE_FORKLIST 0x00000100
198 #define ATTR_FILE_DATALENGTH 0x00000200
199 #define ATTR_FILE_DATAALLOCSIZE 0x00000400
200 #define ATTR_FILE_DATAEXTENTS 0x00000800
201 #define ATTR_FILE_RSRCLENGTH 0x00001000
202 #define ATTR_FILE_RSRCALLOCSIZE 0x00002000
203 #define ATTR_FILE_RSRCEXTENTS 0x00004000
205 #define ATTR_FILE_VALIDMASK 0x00007FFF
206 #define ATTR_FILE_SETMASK 0x00000020
208 #define ATTR_FORK_TOTALSIZE 0x00000001
209 #define ATTR_FORK_ALLOCSIZE 0x00000002
211 #define ATTR_FORK_VALIDMASK 0x00000003
212 #define ATTR_FORK_SETMASK 0x00000000
214 #define SRCHFS_START 0x00000001
215 #define SRCHFS_MATCHPARTIALNAMES 0x00000002
216 #define SRCHFS_MATCHDIRS 0x00000004
217 #define SRCHFS_MATCHFILES 0x00000008
218 #define SRCHFS_NEGATEPARAMS 0x80000000
219 #define SRCHFS_VALIDOPTIONSMASK 0x8000000F
221 struct fssearchblock
{
222 struct attrlist
*returnattrs
;
224 size_t returnbuffersize
;
226 struct timeval timelimit
;
228 size_t sizeofsearchparams1
;
230 size_t sizeofsearchparams2
;
231 struct attrlist searchattrs
;
236 u_char reserved
[556]; // sizeof( SearchState )
240 #define FST_EOF (-1) /* end-of-file offset */
242 #endif /* __APPLE_API_UNSTABLE */
243 #endif /* !_SYS_ATTR_H_ */