2 * Copyright (c) 2013-19 Apple, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
24 #ifndef _XATTR_PROPERTIES_H
25 #define _XATTR_PROPERTIES_H
29 #include <sys/cdefs.h>
30 #include <Availability.h>
35 * CopyOperationIntent_t is used to declare what the intent of the copy is.
36 * Not a bit-field (for now, at least).
38 * CopyOperationIntentCopy indicates that the EA is attached to an object
39 * that is simply being copied. E.g., cp src dst
41 * CopyOperationIntentSave indicates that the EA is attached to an object
42 * being saved; as in a "safe save," the destination is being replaced by
43 * the source, so the question is whether the EA should be applied to the
44 * destination, or generated anew.
46 * CopyOperationIntentShare indicates that the EA is attached to an object that
47 * is being given out to other people. For example, saving to a public folder,
48 * or attaching to an email message.
52 CopyOperationIntentCopy
= 1,
53 CopyOperationIntentSave
,
54 CopyOperationIntentShare
,
55 } CopyOperationIntent_t
;
57 typedef uint64_t CopyOperationProperties_t
;
60 * Various properties used to determine how to handle the xattr during
61 * copying. The intent is that the default is reasonable for most xattrs.
65 * kCopyOperationPropertyNoExport
66 * Declare that the extended property should not be exported; this is
67 * deliberately a bit vague, but this is used by CopyOperationIntentShare
68 * to indicate not to preserve the xattr.
70 #define kCopyOperationPropertyNoExport ((CopyOperationProperties_t)0x0001)
73 * kCopyOperationPropertyContentDependent
74 * Declares the extended attribute to be tied to the contents of the file (or
75 * vice versa), such that it should be re-created when the contents of the
76 * file change. Examples might include cryptographic keys, checksums, saved
77 * position or search information, and text encoding.
79 * This property causes the EA to be preserved for copy and share, but not for
80 * safe save. (In a safe save, the EA exists on the original, and will not
81 * be copied to the new version.)
83 #define kCopyOperationPropertyContentDependent ((CopyOperationProperties_t)0x0002)
86 * kCopyOperationPropertyNeverPreserve
87 * Declares that the extended attribute is never to be copied, for any
90 #define kCopyOperationPropertyNeverPreserve ((CopyOperationProperties_t)0x0004)
94 #endif /* _XATTR_PROPERTIES_H */