|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. ! 3: * ! 4: * @APPLE_LICENSE_HEADER_START@ ! 5: * ! 6: * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights ! 7: * Reserved. This file contains Original Code and/or Modifications of ! 8: * Original Code as defined in and that are subject to the Apple Public ! 9: * Source License Version 1.1 (the "License"). You may not use this file ! 10: * except in compliance with the License. Please obtain a copy of the ! 11: * License at http://www.apple.com/publicsource and read it before using ! 12: * this file. ! 13: * ! 14: * The Original Code and all software distributed under the License are ! 15: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER ! 16: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, ! 17: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, ! 18: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the ! 19: * License for the specific language governing rights and limitations ! 20: * under the License. ! 21: * ! 22: * @APPLE_LICENSE_HEADER_END@ ! 23: */ ! 24: ! 25: /* ! 26: * attr.h - attribute data structures and interfaces ! 27: * ! 28: * Copyright (c) 1998, Apple Computer, Inc. All Rights Reserved. ! 29: * ! 30: * History: ! 31: * 2/18/98 Pat Dirks, Apple Computer New Today ! 32: * ! 33: */ ! 34: ! 35: #ifndef _SYS_ATTR_H_ ! 36: #define _SYS_ATTR_H_ ! 37: ! 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: ! 48: typedef u_int32_t text_encoding_t; ! 49: ! 50: typedef u_int32_t fsobj_type_t; ! 51: ! 52: typedef u_int32_t fsobj_tag_t; ! 53: ! 54: typedef u_int32_t fsfile_type_t; ! 55: ! 56: typedef u_int32_t fsvolid_t; ! 57: ! 58: typedef struct fsobj_id { ! 59: u_int32_t fid_objno; ! 60: u_int32_t fid_generation; ! 61: } fsobj_id_t; ! 62: ! 63: typedef u_int32_t attrgroup_t; ! 64: ! 65: struct attrlist { ! 66: u_short bitmapcount; /* number of attr. bit sets in list (should be 5) */ ! 67: u_int16_t reserved; /* (to maintain 4-byte alignment) */ ! 68: attrgroup_t commonattr; /* common attribute group */ ! 69: attrgroup_t volattr; /* Volume attribute group */ ! 70: attrgroup_t dirattr; /* directory attribute group */ ! 71: attrgroup_t fileattr; /* file attribute group */ ! 72: attrgroup_t forkattr; /* fork attribute group */ ! 73: }; ! 74: ! 75: typedef struct attrreference { ! 76: long attr_dataoffset; ! 77: size_t attr_length; ! 78: } attrreference_t; ! 79: ! 80: /* XXX PPD This is derived from HFSVolumePriv.h and should perhaps be referenced from there? */ ! 81: ! 82: struct diskextent { ! 83: u_int32_t startblock; /* first block allocated */ ! 84: u_int32_t blockcount; /* number of blocks allocated */ ! 85: }; ! 86: ! 87: typedef struct diskextent extentrecord[8]; ! 88: ! 89: #define ATTR_BIT_MAP_COUNT 5 ! 90: ! 91: #define ATTR_CMN_NAME 0x00000001 ! 92: #define ATTR_CMN_DEVID 0x00000002 ! 93: #define ATTR_CMN_FSID 0x00000004 ! 94: #define ATTR_CMN_OBJTYPE 0x00000008 ! 95: #define ATTR_CMN_OBJTAG 0x00000010 ! 96: #define ATTR_CMN_OBJID 0x00000020 ! 97: #define ATTR_CMN_OBJPERMANENTID 0x00000040 ! 98: #define ATTR_CMN_PAROBJID 0x00000080 ! 99: #define ATTR_CMN_SCRIPT 0x00000100 ! 100: #define ATTR_CMN_CRTIME 0x00000200 ! 101: #define ATTR_CMN_MODTIME 0x00000400 ! 102: #define ATTR_CMN_CHGTIME 0x00000800 ! 103: #define ATTR_CMN_ACCTIME 0x00001000 ! 104: #define ATTR_CMN_BKUPTIME 0x00002000 ! 105: #define ATTR_CMN_FNDRINFO 0x00004000 ! 106: #define ATTR_CMN_OWNERID 0x00008000 ! 107: #define ATTR_CMN_GRPID 0x00010000 ! 108: #define ATTR_CMN_ACCESSMASK 0x00020000 ! 109: #define ATTR_CMN_FLAGS 0x00040000 ! 110: #define ATTR_CMN_NAMEDATTRCOUNT 0x00080000 ! 111: #define ATTR_CMN_NAMEDATTRLIST 0x00100000 ! 112: ! 113: #define ATTR_CMN_VALIDMASK 0x001FFFFF ! 114: #define ATTR_CMN_SETMASK 0x0007FF00 ! 115: #define ATTR_CMN_VOLSETMASK 0x00006700 ! 116: ! 117: #define ATTR_VOL_FSTYPE 0x00000001 ! 118: #define ATTR_VOL_SIGNATURE 0x00000002 ! 119: #define ATTR_VOL_SIZE 0x00000004 ! 120: #define ATTR_VOL_SPACEFREE 0x00000008 ! 121: #define ATTR_VOL_SPACEAVAIL 0x00000010 ! 122: #define ATTR_VOL_MINALLOCATION 0x00000020 ! 123: #define ATTR_VOL_ALLOCATIONCLUMP 0x00000040 ! 124: #define ATTR_VOL_IOBLOCKSIZE 0x00000080 ! 125: #define ATTR_VOL_OBJCOUNT 0x00000100 ! 126: #define ATTR_VOL_FILECOUNT 0x00000200 ! 127: #define ATTR_VOL_DIRCOUNT 0x00000400 ! 128: #define ATTR_VOL_MAXOBJCOUNT 0x00000800 ! 129: #define ATTR_VOL_MOUNTPOINT 0x00001000 ! 130: #define ATTR_VOL_NAME 0x00002000 ! 131: #define ATTR_VOL_MOUNTFLAGS 0x00004000 ! 132: #define ATTR_VOL_INFO 0x80000000 ! 133: ! 134: #define ATTR_VOL_VALIDMASK 0x80007FFF ! 135: #define ATTR_VOL_SETMASK 0x80002000 ! 136: ! 137: ! 138: /* File/directory attributes: */ ! 139: #define ATTR_DIR_LINKCOUNT 0x00000001 ! 140: #define ATTR_DIR_ENTRYCOUNT 0x00000002 ! 141: ! 142: #define ATTR_DIR_VALIDMASK 0x00000003 ! 143: #define ATTR_DIR_SETMASK 0x00000000 ! 144: ! 145: #define ATTR_FILE_LINKCOUNT 0x00000001 ! 146: #define ATTR_FILE_TOTALSIZE 0x00000002 ! 147: #define ATTR_FILE_ALLOCSIZE 0x00000004 ! 148: #define ATTR_FILE_IOBLOCKSIZE 0x00000008 ! 149: #define ATTR_FILE_CLUMPSIZE 0x00000010 ! 150: #define ATTR_FILE_DEVTYPE 0x00000020 ! 151: #define ATTR_FILE_FILETYPE 0x00000040 ! 152: #define ATTR_FILE_FORKCOUNT 0x00000080 ! 153: #define ATTR_FILE_FORKLIST 0x00000100 ! 154: #define ATTR_FILE_DATALENGTH 0x00000200 ! 155: #define ATTR_FILE_DATAALLOCSIZE 0x00000400 ! 156: #define ATTR_FILE_DATAEXTENTS 0x00000800 ! 157: #define ATTR_FILE_RSRCLENGTH 0x00001000 ! 158: #define ATTR_FILE_RSRCALLOCSIZE 0x00002000 ! 159: #define ATTR_FILE_RSRCEXTENTS 0x00004000 ! 160: ! 161: #define ATTR_FILE_VALIDMASK 0x00007FFF ! 162: #define ATTR_FILE_SETMASK 0x00000020 ! 163: ! 164: #define ATTR_FORK_TOTALSIZE 0x00000001 ! 165: #define ATTR_FORK_ALLOCSIZE 0x00000002 ! 166: ! 167: #define ATTR_FORK_VALIDMASK 0x00000003 ! 168: #define ATTR_FORK_SETMASK 0x00000000 ! 169: ! 170: struct fullcommonattrblock { ! 171: dev_t device; ! 172: fsid_t fs; ! 173: fsobj_type_t fsobjtype; ! 174: fsobj_tag_t fsobjtag; ! 175: fsobj_id_t fsobjid; ! 176: fsobj_id_t fsparid; ! 177: attrreference_t name; ! 178: text_encoding_t nameEncoding; ! 179: struct timespec cr_time; ! 180: struct timespec m_time; ! 181: struct timespec c_time; ! 182: struct timespec a_time; ! 183: struct timespec b_time; ! 184: u_int8_t finderinfo[32]; ! 185: uid_t owner; ! 186: gid_t group; ! 187: mode_t mode; ! 188: u_int32_t namedattr_count; ! 189: attrreference_t namedattr_list; ! 190: u_int32_t flags; ! 191: }; ! 192: ! 193: struct fullvolumeattrblock { ! 194: u_int32_t fstype; ! 195: u_int32_t signature; ! 196: off_t size; ! 197: off_t spacefree; ! 198: off_t spaceavail; ! 199: off_t minallocation; ! 200: off_t allocationclump; ! 201: size_t ioblocksize; ! 202: u_int32_t objcount; ! 203: u_int32_t filecount; ! 204: u_int32_t dircount; ! 205: u_int32_t maxobjcount; ! 206: attrreference_t mountpoint; ! 207: }; ! 208: ! 209: struct fulldirattrblock { ! 210: u_int32_t linkcount; ! 211: u_int32_t entrycount; ! 212: }; ! 213: ! 214: struct fullfileattrblock { ! 215: u_int32_t linkcount; ! 216: off_t totalsize; ! 217: off_t allocatedsize; ! 218: size_t ioblocksize; ! 219: size_t clumpsize; ! 220: u_int32_t devtype; ! 221: u_int32_t filetype; ! 222: u_int32_t forkcount; ! 223: attrreference_t forklist; ! 224: off_t dataforklength; ! 225: off_t dataforkallocated; ! 226: extentrecord dataextents; ! 227: off_t rsrcforklength; ! 228: off_t rsrforkallocated; ! 229: extentrecord rsrcextents; ! 230: u_int32_t entrycount; ! 231: dev_t devicetype; ! 232: }; ! 233: ! 234: struct fullforkattrblock { ! 235: off_t totalsize; ! 236: off_t allocatedsize; ! 237: }; ! 238: ! 239: struct fullattrblock { ! 240: u_int32_t attrblocklength; ! 241: struct fullcommonattrblock c; ! 242: union { ! 243: struct fullvolumeattrblock v; ! 244: struct fulldirattrblock d; ! 245: struct fullfileattrblock f; ! 246: struct fullforkattrblock fork; ! 247: } u; ! 248: }; ! 249: ! 250: ! 251: #define SRCHFS_START 0x00000001 ! 252: #define SRCHFS_MATCHPARTIALNAMES 0x00000002 ! 253: #define SRCHFS_MATCHDIRS 0x00000004 ! 254: #define SRCHFS_MATCHFILES 0x00000008 ! 255: #define SRCHFS_NEGATEPARAMS 0x80000000 ! 256: #define SRCHFS_VALIDOPTIONSMASK 0x8000000F ! 257: ! 258: struct fssearchblock { ! 259: struct attrlist *returnattrs; ! 260: void *returnbuffer; ! 261: size_t returnbuffersize; ! 262: u_long maxmatches; ! 263: struct timeval timelimit; ! 264: void *searchparams1; ! 265: size_t sizeofsearchparams1; ! 266: void *searchparams2; ! 267: size_t sizeofsearchparams2; ! 268: struct attrlist searchattrs; ! 269: }; ! 270: ! 271: ! 272: struct searchstate { ! 273: u_char reserved[556]; // sizeof( SearchState ) ! 274: }; ! 275: ! 276: ! 277: ! 278: #define FST_EOF (-1) /* end-of-file offset */ ! 279: ! 280: __BEGIN_DECLS ! 281: /* XXX PPD This should be moved to dirent.h to be with getdirentries(2) et al. */ ! 282: //int getdirentriesattr(int fd, const struct attrlist *attrspec, void *attrbuf, size_t bufsize, long //*cookie); ! 283: ! 284: __END_DECLS ! 285: ! 286: #endif /* !_SYS_ATTR_H_ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.