Sync usage with man page.
[netbsd-mini2440.git] / sys / compat / darwin / darwin_attr.h
blob8052ddab9f778f29931368e16b7d713b6a2e5267
1 /* $NetBSD: darwin_attr.h,v 1.3.72.2 2008/11/01 21:22:25 christos Exp $ */
3 /*-
4 * Copyright (c) 2003 The NetBSD Foundation, Inc.
5 * All rights reserved.
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Emmanuel Dreyfus
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
32 #ifndef _DARWIN_ATTR_H_
33 #define _DARWIN_ATTR_H_
35 #define DARWIN_US_ASCII 0x0600
37 #define DARWIN_ATTR_BIT_MAP_COUNT 5
38 #define DARWIN_FSOPT_NOFOLLOW 1
40 typedef u_int32_t darwin_attrgroup_t;
41 typedef u_int32_t darwin_text_encoding_t;
42 typedef u_int32_t darwin_fsobj_type_t;
43 typedef u_int32_t darwin_fsobj_tag_t;
44 typedef u_int32_t darwin_fsfile_type_t;
45 typedef u_int32_t darwin_fsvolid_t;
47 typedef struct darwin_fsobj_id {
48 u_int32_t fid_objno;
49 u_int32_t fid_generation;
50 } darwin_fsobj_id_t;
52 struct darwin_attrlist {
53 u_int16_t bitmapcount;
54 u_int16_t reserved;
55 darwin_attrgroup_t commonattr;
56 darwin_attrgroup_t volattr;
57 darwin_attrgroup_t dirattr;
58 darwin_attrgroup_t fileattr;
59 darwin_attrgroup_t forkattr;
62 typedef struct darwin_attribute_set {
63 darwin_attrgroup_t commonattr;
64 darwin_attrgroup_t volattr;
65 darwin_attrgroup_t dirattr;
66 darwin_attrgroup_t fileattr;
67 darwin_attrgroup_t forkattr;
68 } darwin_attribute_set_t;
70 typedef struct darwin_attrreference {
71 long attr_dataoffset;
72 size_t attr_length;
73 } darwin_attrreference_t;
75 struct darwin_diskextent {
76 u_int32_t startblock;
77 u_int32_t blockcount;
80 typedef struct darwin_diskextent darwin_extentrecord[8];
82 typedef u_int32_t darwin_vol_capabilities_set_t[4];
84 #define DARWIN_VOL_CAPABILITIES_FORMAT 0
85 #define DARWIN_VOL_CAPABILITIES_INTERFACES 1
86 #define DARWIN_VOL_CAPABILITIES_RESERVED1 2
87 #define DARWIN_VOL_CAPABILITIES_RESERVED2 3
89 typedef struct darwin_vol_capabilities_attr {
90 darwin_vol_capabilities_set_t capabilities;
91 darwin_vol_capabilities_set_t valid;
92 } darwin_vol_capabilities_attr_t;
94 #define DARWIN_VOL_CAP_FMT_PERSISTENTOBJECTIDS 0x00000001
95 #define DARWIN_VOL_CAP_FMT_SYMBOLICLINKS 0x00000002
96 #define DARWIN_VOL_CAP_FMT_HARDLINKS 0x00000004
98 #define DARWIN_VOL_CAP_INT_SEARCHFS 0x00000001
99 #define DARWIN_VOL_CAP_INT_ATTRLIST 0x00000002
100 #define DARWIN_VOL_CAP_INT_NFSEXPORT 0x00000004
101 #define DARWIN_VOL_CAP_INT_READDIRATTR 0x00000008
103 typedef struct darwin_vol_attributes_attr {
104 darwin_attribute_set_t validattr;
105 darwin_attribute_set_t nativeattr;
106 } darwin_vol_attributes_attr_t;
108 #define DARWIN_DIR_MNTSTATUS_MNTPOINT 0x00000001
110 #define DARWIN_ATTR_CMN_NAME 0x00000001
111 #define DARWIN_ATTR_CMN_DEVID 0x00000002
112 #define DARWIN_ATTR_CMN_FSID 0x00000004
113 #define DARWIN_ATTR_CMN_OBJTYPE 0x00000008
114 #define DARWIN_ATTR_CMN_OBJTAG 0x00000010
115 #define DARWIN_ATTR_CMN_OBJID 0x00000020
116 #define DARWIN_ATTR_CMN_OBJPERMANENTID 0x00000040
117 #define DARWIN_ATTR_CMN_PAROBJID 0x00000080
118 #define DARWIN_ATTR_CMN_SCRIPT 0x00000100
119 #define DARWIN_ATTR_CMN_CRTIME 0x00000200
120 #define DARWIN_ATTR_CMN_MODTIME 0x00000400
121 #define DARWIN_ATTR_CMN_CHGTIME 0x00000800
122 #define DARWIN_ATTR_CMN_ACCTIME 0x00001000
123 #define DARWIN_ATTR_CMN_BKUPTIME 0x00002000
124 #define DARWIN_ATTR_CMN_FNDRINFO 0x00004000
125 #define DARWIN_ATTR_CMN_OWNERID 0x00008000
126 #define DARWIN_ATTR_CMN_GRPID 0x00010000
127 #define DARWIN_ATTR_CMN_ACCESSMASK 0x00020000
128 #define DARWIN_ATTR_CMN_FLAGS 0x00040000
129 #define DARWIN_ATTR_CMN_NAMEDATTRCOUNT 0x00080000
130 #define DARWIN_ATTR_CMN_NAMEDATTRLIST 0x00100000
131 #define DARWIN_ATTR_CMN_USERACCESS 0x00200000
133 #define DARWIN_ATTR_CMN_VALIDMASK 0x003FFFFF
134 #define DARWIN_ATTR_CMN_SETMASK 0x0007FF00
135 #define DARWIN_ATTR_CMN_VOLSETMASK 0x00006700
137 #define DARWIN_ATTR_VOL_FSTYPE 0x00000001
138 #define DARWIN_ATTR_VOL_SIGNATURE 0x00000002
139 #define DARWIN_ATTR_VOL_SIZE 0x00000004
140 #define DARWIN_ATTR_VOL_SPACEFREE 0x00000008
141 #define DARWIN_ATTR_VOL_SPACEAVAIL 0x00000010
142 #define DARWIN_ATTR_VOL_MINALLOCATION 0x00000020
143 #define DARWIN_ATTR_VOL_ALLOCATIONCLUMP 0x00000040
144 #define DARWIN_ATTR_VOL_IOBLOCKSIZE 0x00000080
145 #define DARWIN_ATTR_VOL_OBJCOUNT 0x00000100
146 #define DARWIN_ATTR_VOL_FILECOUNT 0x00000200
147 #define DARWIN_ATTR_VOL_DIRCOUNT 0x00000400
148 #define DARWIN_ATTR_VOL_MAXOBJCOUNT 0x00000800
149 #define DARWIN_ATTR_VOL_MOUNTPOINT 0x00001000
150 #define DARWIN_ATTR_VOL_NAME 0x00002000
151 #define DARWIN_ATTR_VOL_MOUNTFLAGS 0x00004000
152 #define DARWIN_ATTR_VOL_MOUNTEDDEVICE 0x00008000
153 #define DARWIN_ATTR_VOL_ENCODINGSUSED 0x00010000
154 #define DARWIN_ATTR_VOL_CAPABILITIES 0x00020000
155 #define DARWIN_ATTR_VOL_ATTRIBUTES 0x40000000
156 #define DARWIN_ATTR_VOL_INFO 0x80000000
158 #define DARWIN_ATTR_VOL_VALIDMASK 0xC003FFFF
159 #define DARWIN_ATTR_VOL_SETMASK 0x80002000
161 #define DARWIN_ATTR_DIR_LINKCOUNT 0x00000001
162 #define DARWIN_ATTR_DIR_ENTRYCOUNT 0x00000002
163 #define DARWIN_ATTR_DIR_MOUNTSTATUS 0x00000004
165 #define DARWIN_ATTR_DIR_VALIDMASK 0x00000007
166 #define DARWIN_ATTR_DIR_SETMASK 0x00000000
168 #define DARWIN_ATTR_FILE_LINKCOUNT 0x00000001
169 #define DARWIN_ATTR_FILE_TOTALSIZE 0x00000002
170 #define DARWIN_ATTR_FILE_ALLOCSIZE 0x00000004
171 #define DARWIN_ATTR_FILE_IOBLOCKSIZE 0x00000008
172 #define DARWIN_ATTR_FILE_CLUMPSIZE 0x00000010
173 #define DARWIN_ATTR_FILE_DEVTYPE 0x00000020
174 #define DARWIN_ATTR_FILE_FILETYPE 0x00000040
175 #define DARWIN_ATTR_FILE_FORKCOUNT 0x00000080
176 #define DARWIN_ATTR_FILE_FORKLIST 0x00000100
177 #define DARWIN_ATTR_FILE_DATALENGTH 0x00000200
178 #define DARWIN_ATTR_FILE_DATAALLOCSIZE 0x00000400
179 #define DARWIN_ATTR_FILE_DATAEXTENTS 0x00000800
180 #define DARWIN_ATTR_FILE_RSRCLENGTH 0x00001000
181 #define DARWIN_ATTR_FILE_RSRCALLOCSIZE 0x00002000
182 #define DARWIN_ATTR_FILE_RSRCEXTENTS 0x00004000
184 #define DARWIN_ATTR_FILE_VALIDMASK 0x00007FFF
185 #define DARWIN_ATTR_FILE_SETMASK 0x00000020
187 #define DARWIN_ATTR_FORK_TOTALSIZE 0x00000001
188 #define DARWIN_ATTR_FORK_ALLOCSIZE 0x00000002
190 #define DARWIN_ATTR_FORK_VALIDMASK 0x00000003
191 #define DARWIN_ATTR_FORK_SETMASK 0x00000000
193 #define DARWIN_SRCHFS_START 0x00000001
194 #define DARWIN_SRCHFS_MATCHPARTIALNAMES 0x00000002
195 #define DARWIN_SRCHFS_MATCHDIRS 0x00000004
196 #define DARWIN_SRCHFS_MATCHFILES 0x00000008
197 #define DARWIN_SRCHFS_NEGATEPARAMS 0x80000000
198 #define DARWIN_SRCHFS_VALIDOPTIONSMASK 0x8000000F
200 struct darwin_fssearchblock {
201 struct darwin_attrlist *returnattrs;
202 void *returnbuffer;
203 size_t returnbuffersize;
204 u_long maxmatches;
205 struct darwin_timeval timelimit;
206 void *searchparams1;
207 size_t sizeofsearchparams1;
208 void *searchparams2;
209 size_t sizeofsearchparams2;
210 struct darwin_attrlist searchattrs;
214 struct darwin_searchstate {
215 u_char reserved[556];
218 #define DARWIN_FST_EOF (-1)
220 #endif /* _DARWIN_ATTR_H_ */