]> git.saurik.com Git - apple/cf.git/blob - CFURLPriv.h
CF-744.12.tar.gz
[apple/cf.git] / CFURLPriv.h
1 /*
2 * Copyright (c) 2012 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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
11 * file.
12 *
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.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24 /* CFURLPriv.h
25 Copyright (c) 2008-2012, Apple Inc. All rights reserved.
26 */
27
28 #if !defined(__COREFOUNDATION_CFURLPRIV__)
29 #define __COREFOUNDATION_CFURLPRIV__ 1
30
31 #include <CoreFoundation/CFBase.h>
32 #include <CoreFoundation/CFError.h>
33 #include <CoreFoundation/CFArray.h>
34 #include <CoreFoundation/CFDictionary.h>
35 #include <CoreFoundation/CFString.h>
36 #include <CoreFoundation/CFURL.h>
37 #if TARGET_OS_MAC
38 #include <sys/param.h>
39 #include <sys/mount.h>
40 #include <CoreFoundation/CFFileSecurity.h>
41 #include <CoreFoundation/CFURLEnumerator.h>
42 #include <CoreFoundation/CFDate.h>
43 #endif
44
45 CF_EXTERN_C_BEGIN
46
47 #if TARGET_OS_MAC
48
49 enum {
50 // Resource I/O related errors, with kCFErrorURLKey containing URL
51 kCFURLNoSuchResourceError = 4, // Attempt to do a file system operation on a non-existent file
52 kCFURLResourceLockingError = 255, // Couldn't get a lock on file
53 kCFURLReadUnknownError = 256, // Read error (reason unknown)
54 kCFURLReadNoPermissionError = 257, // Read error (permission problem)
55 kCFURLReadInvalidResourceNameError = 258, // Read error (invalid file name)
56 kCFURLReadCorruptResourceError = 259, // Read error (file corrupt, bad format, etc)
57 kCFURLReadNoSuchResourceError = 260, // Read error (no such file)
58 kCFURLReadInapplicableStringEncodingError = 261, // Read error (string encoding not applicable) also kCFStringEncodingErrorKey
59 kCFURLReadUnsupportedSchemeError = 262, // Read error (unsupported URL scheme)
60 kCFURLReadTooLargeError = 263, // Read error (file too large)
61 kCFURLReadUnknownStringEncodingError = 264, // Read error (string encoding of file contents could not be determined)
62 kCFURLWriteUnknownError = 512, // Write error (reason unknown)
63 kCFURLWriteNoPermissionError = 513, // Write error (permission problem)
64 kCFURLWriteInvalidResourceNameError = 514, // Write error (invalid file name)
65 kCFURLWriteInapplicableStringEncodingError = 517, // Write error (string encoding not applicable) also kCFStringEncodingErrorKey
66 kCFURLWriteUnsupportedSchemeError = 518, // Write error (unsupported URL scheme)
67 kCFURLWriteOutOfSpaceError = 640, // Write error (out of storage space)
68 kCFURLWriteVolumeReadOnlyError = 642, // Write error (readonly volume)
69 } CF_ENUM_AVAILABLE(10_5, 2_0);
70
71
72 /*
73 Error user dictionary keys
74 */
75 CF_EXPORT
76 const CFStringRef kCFURLKeyArrayErrorKey CF_AVAILABLE(10_6, 4_0);
77
78
79 /*
80 Private File System Property Keys
81 */
82 CF_EXPORT const CFStringRef _kCFURLPathKey CF_AVAILABLE(10_6, 4_0);
83 /* File system path (CFString) */
84
85 CF_EXPORT const CFStringRef _kCFURLVolumeIDKey CF_AVAILABLE(10_6, 4_0);
86 /* Volume ID (CFNumber) */
87
88 CF_EXPORT const CFStringRef _kCFURLInodeNumberKey CF_AVAILABLE(10_6, 4_0);
89 /* 64-bit inode number (the inode number from the file system) (CFNumber) */
90
91 CF_EXPORT const CFStringRef _kCFURLFileIDKey CF_AVAILABLE(10_6, 4_0);
92 /* 64-bit file ID (for tracking a file by ID. This may or may not be the inode number) (CFNumber) */
93
94 CF_EXPORT const CFStringRef _kCFURLParentDirectoryIDKey CF_AVAILABLE(10_6, 4_0);
95 /* 64-bit file ID (for tracking a parent directory by ID. This may or may not be the inode number) (CFNumber) */
96
97 CF_EXPORT const CFStringRef _kCFURLDistinctLocalizedNameKey CF_AVAILABLE(10_6, 4_0);
98 /* The localized name, if it is disnct from the real name. Otherwise, NULL (CFString) */
99
100 CF_EXPORT const CFStringRef _kCFURLNameExtensionKey CF_AVAILABLE(10_6, 4_0);
101 /* The name extenison (CFString) */
102
103 CF_EXPORT const CFStringRef _kCFURLFinderInfoKey CF_AVAILABLE(10_6, 4_0);
104 /* A 16-byte Finder Info structure immediately followed by a 16-byte Extended Finder Info structure (CFData) */
105
106 CF_EXPORT const CFStringRef _kCFURLIsCompressedKey CF_AVAILABLE(10_6, 4_0);
107 /* True if resource's data is transparently compressed by the system on its storage device (CFBoolean) */
108
109 CF_EXPORT const CFStringRef _kCFURLIsApplicationKey CF_AVAILABLE(10_6, 4_0);
110 /* True if resource is an application (CFBoolean) */
111
112 CF_EXPORT const CFStringRef _kCFURLCanSetHiddenExtensionKey CF_AVAILABLE(10_6, 4_0);
113 /* True if the filename extension can be hidden or unhidden (CFBoolean) */
114
115 CF_EXPORT const CFStringRef _kCFURLIsReadableKey CF_AVAILABLE(10_6, 4_0);
116 /* OBSOLETE */CF_EXPORT const CFStringRef _kCFURLUserCanReadKey CF_DEPRECATED(10_0, 10_6, 2_0, 4_0);
117 /* True if current user can read the resource (CFBoolean) */
118
119 CF_EXPORT const CFStringRef _kCFURLIsWriteableKey CF_AVAILABLE(10_6, 4_0);
120 /* OBSOLETE */CF_EXPORT const CFStringRef _kCFURLUserCanWriteKey CF_DEPRECATED(10_0, 10_6, 2_0, 4_0);
121 /* True if current user can write to the resource (CFBoolean) */
122
123 CF_EXPORT const CFStringRef _kCFURLIsExecutableKey CF_AVAILABLE(10_6, 4_0);
124 /* OBSOLETE */CF_EXPORT const CFStringRef _kCFURLUserCanExecuteKey CF_DEPRECATED(10_0, 10_6, 2_0, 4_0);
125 /* True if current user can execute a file resource or search a directory resource (CFBoolean) */
126
127 CF_EXPORT const CFStringRef _kCFURLParentDirectoryIsVolumeRootKey CF_AVAILABLE(10_6, 4_0);
128 /* True if the parent directory is the root of a volume (CFBoolean) */
129
130 CF_EXPORT const CFStringRef _kCFURLFileSecurityKey CF_AVAILABLE(10_6, 4_0);
131 /* The file's security settings (FSFileSecurity, CarbonCore/Files.h) */
132
133 CF_EXPORT const CFStringRef _kCFURLFileSizeOfResourceForkKey CF_AVAILABLE(10_6, 4_0);
134 /* Size in bytes of the resource fork (CFNumber) */
135
136 CF_EXPORT const CFStringRef _kCFURLFileAllocatedSizeOfResourceForkKey CF_AVAILABLE(10_6, 4_0);
137 /* Size in bytes of the blocks allocated for the resource fork (CFNumber) */
138
139 CF_EXPORT const CFStringRef _kCFURLEffectiveIconImageDataKey CF_AVAILABLE(10_6, 4_0);
140 /* Icon image data, i.e. raw pixel data (CFData) */
141
142 CF_EXPORT const CFStringRef _kCFURLCustomIconImageDataKey CF_AVAILABLE(10_6, 4_0);
143 /* Icon image data of the item's custom icon, if any (CFData) */
144
145 CF_EXPORT const CFStringRef _kCFURLEffectiveIconFlattenedReferenceDataKey CF_AVAILABLE(10_6, 4_0);
146 /* Icon flattened reference, suitable for cheaply sharing the effective icon reference across processess (CFData) */
147
148 CF_EXPORT const CFStringRef _kCFURLBundleIdentifierKey CF_AVAILABLE(10_6, 4_0);
149 /* If resource is a bundle, the bundle identifier (CFString) */
150
151 CF_EXPORT const CFStringRef _kCFURLVersionKey CF_AVAILABLE(10_6, 4_0);
152 /* If resource is a bundle, the bundle version (CFBundleVersion) as a string (CFString) */
153
154 CF_EXPORT const CFStringRef _kCFURLShortVersionStringKey CF_AVAILABLE(10_6, 4_0);
155 /* If resource is a bundle, the bundle short version (CFBundleShortVersionString) as a string (CFString) */
156
157 CF_EXPORT const CFStringRef _kCFURLOwnerIDKey CF_AVAILABLE(10_6, 4_0);
158 /* 32-bit owner ID (uid_t) (CFNumber) */
159
160 CF_EXPORT const CFStringRef _kCFURLGroupIDKey CF_AVAILABLE(10_6, 4_0);
161 /* 32-bit group ID (gid_t) (CFNumber) */
162
163 CF_EXPORT const CFStringRef _kCFURLStatModeKey CF_AVAILABLE(10_6, 4_0);
164 /* 32-bit group ID (mode_t) (CFNumber) */
165
166 CF_EXPORT const CFStringRef _kCFURLLocalizedNameDictionaryKey CF_AVAILABLE(10_7, NA);
167 /* For items with localized display names, the dictionary of all available localizations. The keys are the cannonical locale strings for the available localizations. (CFDictionary) */
168
169 CF_EXPORT const CFStringRef _kCFURLLocalizedTypeDescriptionDictionaryKey CF_AVAILABLE(10_7, NA);
170 /* The dictionary of all available localizations of the item kind string. The keys are the cannonical locale strings for the available localizations. (CFDictionary) */
171
172 CF_EXPORT const CFStringRef _kCFURLApplicationCategoriesKey CF_AVAILABLE(10_7, NA);
173 /* The array of category UTI strings associated with the url. (CFArray) */
174
175 CF_EXPORT const CFStringRef _kCFURLApplicationHighResolutionModeIsMagnifiedKey CF_AVAILABLE(10_7, NA);
176 /* True if the app runs with magnified 1x graphics on a 2x display (Per-user, CFBoolean) */
177
178 CF_EXPORT const CFStringRef _kCFURLCanSetApplicationHighResolutionModeIsMagnifiedKey CF_AVAILABLE(10_7, NA);
179 /* True if the app can run in either magnified or native resolution modes (Read only, CFBoolean) */
180
181 CF_EXPORT const CFStringRef _kCFURLWriterBundleIdentifierKey CF_AVAILABLE(10_8, NA);
182 /* The bundle identifier of the process writing to this object (Read-write, value type CFString) */
183
184 /* Additional volume properties */
185
186 CF_EXPORT const CFStringRef _kCFURLVolumeRefNumKey CF_AVAILABLE(10_6, 4_0);
187 /* The Carbon File Manager's FSVolumeRefNum for the resource volume (CFNumber) */
188
189 CF_EXPORT const CFStringRef _kCFURLVolumeUUIDStringKey CF_AVAILABLE(10_6, 4_0);
190 /* The volume's persistent unique ID as a string, or NULL if not available (CFString) */
191
192 CF_EXPORT const CFStringRef _kCFURLVolumeCreationDateKey CF_AVAILABLE(10_6, 4_0);
193 /* Value type CFDate */
194
195 CF_EXPORT const CFStringRef _kCFURLVolumeIsLocalKey CF_AVAILABLE(10_6, 4_0);
196 /* Volume is on a locally connected device -- not a network volume (CFBoolean) */
197
198 CF_EXPORT const CFStringRef _kCFURLVolumeIsAutomountKey CF_AVAILABLE(10_6, 4_0);
199 /* Volume was mounted by the automounter (CFBoolean) */
200
201 CF_EXPORT const CFStringRef _kCFURLVolumeDontBrowseKey CF_AVAILABLE(10_6, 4_0);
202 /* Don't browse: generally, not shown to users (CFBoolean) */
203
204 CF_EXPORT const CFStringRef _kCFURLVolumeIsReadOnlyKey CF_AVAILABLE(10_6, 4_0);
205 /* Mounted read-only (CFBoolean) */
206
207 CF_EXPORT const CFStringRef _kCFURLVolumeIsQuarantinedKey CF_AVAILABLE(10_6, 4_0);
208 /* Mounted quarantined (CFBoolean) */
209
210 CF_EXPORT const CFStringRef _kCFURLVolumeIsEjectableKey CF_AVAILABLE(10_6, 4_0);
211 /* Volume is ejectable media (CD, DVD, etc) (CFBoolean) */
212
213 CF_EXPORT const CFStringRef _kCFURLVolumeIsRemovableKey CF_AVAILABLE(10_6, 4_0);
214 /* Volume can be disconnected (USB, FireWire) (CFBoolean) */
215
216 CF_EXPORT const CFStringRef _kCFURLVolumeIsInternalKey CF_AVAILABLE(10_6, 4_0);
217 /* Device is on an internal bus/channel (Note: this has different behavior than the public VolumeIsInternal key) (CFBoolean) */
218
219 CF_EXPORT const CFStringRef _kCFURLVolumeIsExternalKey CF_AVAILABLE(10_6, 4_0);
220 /* Device is on an external bus/channel (CFBoolean) */
221
222 CF_EXPORT const CFStringRef _kCFURLVolumeIsDiskImageKey CF_AVAILABLE(10_6, 4_0);
223 /* Volume is a mounted disk image (CFBoolean) */
224
225 CF_EXPORT const CFStringRef _kCFURLDiskImageBackingURLKey CF_AVAILABLE(10_6, 4_0);
226 /* If volume is a mounted disk image, the URL of the backing disk image (CFURL) */
227
228 CF_EXPORT const CFStringRef _kCFURLVolumeIsFileVaultKey CF_AVAILABLE(10_6, 4_0);
229 /* Volume uses File Vault encryption (CFBoolean) */
230
231 CF_EXPORT const CFStringRef _kCFURLVolumeIsiDiskKey CF_AVAILABLE(10_6, 4_0);
232 /* Volume is an iDisk (CFBoolean) */
233
234 CF_EXPORT const CFStringRef _kCFURLVolumeiDiskUserNameKey CF_AVAILABLE(10_6, 4_0);
235 /* If volume is an iDisk, the base member name of the iDisk owner (CFString) */
236
237 CF_EXPORT const CFStringRef _kCFURLVolumeIsLocaliDiskMirrorKey CF_AVAILABLE(10_6, 4_0);
238 /* Volume is a local mirror of an iDisk (CFBoolean) */
239
240 CF_EXPORT const CFStringRef _kCFURLVolumeIsiPodKey CF_AVAILABLE(10_6, 4_0);
241 /* Volume is on an iPod (CFBoolean) */
242
243 CF_EXPORT const CFStringRef _kCFURLVolumeIsCDKey CF_AVAILABLE(10_6, 4_0);
244 /* Volume is a CD (audio or CD-ROM). (CFBoolean) */
245
246 CF_EXPORT const CFStringRef _kCFURLVolumeIsDVDKey CF_AVAILABLE(10_6, 4_0);
247 /* Volume is a DVD (CFBoolean) */
248
249 CF_EXPORT const CFStringRef _kCFURLVolumeIsDeviceFileSystemKey CF_AVAILABLE(10_7, 5_0);
250 /* Volume is devfs (CFBoolean) */
251
252 CF_EXPORT const CFStringRef _kCFURLVolumeIsHFSStandardKey CF_AVAILABLE(10_6, 4_0);
253 /* Volume is HFS standard (which includes AFP volumes). Directory IDs, but not file IDs, can be looked up. (CFBoolean) */
254
255 /* Keys specific to bookmarks at this time */
256 CF_EXPORT const CFStringRef _kCFURLPropertyKeyFullPathString CF_AVAILABLE(10_6, 4_0);
257 /* the full filesystem path of the item the bookmark was create against */
258
259 CF_EXPORT const CFStringRef _kCFURLURLString CF_AVAILABLE(10_6, 4_0);
260 /* the url string ( possibly relative to a base url ) of the url this bookmark was created against. */
261
262 CF_EXPORT const CFStringRef _kCFURLFileIDData CF_AVAILABLE(10_6, 4_0);
263 /* the url string ( possibly relative to a base url ) of the url this bookmark was created against. */
264
265 CF_EXPORT const CFStringRef _kCFURLResolvedFromBookmarkDataKey CF_AVAILABLE(10_6, 4_0);
266 /* the bookmark data that was resolved to produce the URL, if any (CFData) */
267
268 CF_EXPORT const CFStringRef _kCFURLVolumeMountPointStringKey CF_AVAILABLE(10_6, 4_0);
269 /* the volume mountpoint string (Read-only, value type CFString) */
270
271 CF_EXPORT const CFStringRef _kCFURLCompleteMountURLKey CF_AVAILABLE(10_6, 4_0);
272 /* the URL to mount the volume on which the resource is stored, if any (Read-only, value type CFURL) */
273
274
275
276 /*
277 Some common boolean properties can be accessed as a bitfield
278 for better performance -- see _CFURLGetResourcePropertyFlags() and
279 _CFURLCopyResourcePropertyValuesAndFlags(), below.
280 */
281 enum {
282 kCFURLResourceIsRegularFile = 0x00000001,
283 kCFURLResourceIsDirectory = 0x00000002,
284 kCFURLResourceIsSymbolicLink = 0x00000004,
285 kCFURLResourceIsVolume = 0x00000008,
286 kCFURLResourceIsPackage = 0x00000010,
287 kCFURLResourceIsSystemImmutable = 0x00000020,
288 kCFURLResourceIsUserImmutable = 0x00000040,
289 kCFURLResourceIsHidden = 0x00000080,
290 kCFURLResourceHasHiddenExtension = 0x00000100,
291 kCFURLResourceIsApplication = 0x00000200,
292 kCFURLResourceIsCompressed = 0x00000400,
293 /* OBSOLETE */ kCFURLResourceIsSystemCompressed = 0x00000400, /* -> kCFURLResourceIsCompressed */
294 kCFURLCanSetHiddenExtension = 0x00000800,
295 kCFURLResourceIsReadable = 0x00001000,
296 kCFURLResourceIsWriteable = 0x00002000,
297 kCFURLResourceIsExecutable = 0x00004000, /* execute files or search directories */
298 kCFURLIsAliasFile = 0x00008000,
299 kCFURLIsMountTrigger = 0x00010000,
300 };
301 typedef unsigned long long CFURLResourcePropertyFlags;
302
303
304 /*
305 _CFURLGetResourceFlags - Returns a bit array of resource flags in the "flags"
306 output parameter. Only flags whose corresponding bits are set in the "mask" parameter
307 are valid in the output bit array. Returns true on success, false if an error occurs.
308 Optional output error: the error is set to a valid CFErrorRef if and only if the function
309 returns false. A valid output error must be released by the caller.
310 */
311 CF_EXPORT
312 Boolean _CFURLGetResourcePropertyFlags(CFURLRef url, CFURLResourcePropertyFlags mask, CFURLResourcePropertyFlags *flags, CFErrorRef *error) CF_AVAILABLE(10_6, 4_0);
313
314
315 /*
316 File resource properties which can be obtained with _CFURLCopyFilePropertyValuesAndFlags().
317 */
318 typedef CF_OPTIONS(unsigned long long, CFURLFilePropertyBitmap) {
319 kCFURLName = 0x0000000000000001,
320 kCFURLLinkCount = 0x0000000000000002,
321 kCFURLVolumeIdentifier = 0x0000000000000004,
322 kCFURLObjectIdentifier = 0x0000000000000008,
323 kCFURLCreationDate = 0x0000000000000010,
324 kCFURLContentModificationDate = 0x0000000000000020,
325 kCFURLAttributeModificationDate = 0x0000000000000040,
326 kCFURLFileSize = 0x0000000000000080,
327 kCFURLFileAllocatedSize = 0x0000000000000100,
328 kCFURLFileSizeOfResourceFork = 0x0000000000000200,
329 kCFURLFileAllocatedSizeOfResourceFork = 0x0000000000000400,
330 kCFURLFinderInfo = 0x0000000000000800,
331 kCFURLFileSecurity = 0x0000000000001000,
332 };
333
334 /*
335 The structure where _CFURLCopyFilePropertyValuesAndFlags() returns file resource properties.
336 */
337 struct _CFURLFilePropertyValues {
338 CFStringRef name; /* you are responsible for releasing this if you ask for it and get it */
339 uint32_t linkCount;
340 uint64_t volumeIdentifier;
341 uint64_t objectIdentifier;
342 CFAbsoluteTime creationDate;
343 CFAbsoluteTime contentModificationDate;
344 CFAbsoluteTime attributeModificationDate;
345 uint64_t fileSize;
346 uint64_t fileAllocatedSize;
347 uint64_t fileSizeOfResourceFork;
348 uint64_t fileAllocatedSizeOfResourceFork;
349 uint8_t finderInfo[32];
350 CFFileSecurityRef fileSecurity; /* you are responsible for releasing this if you ask for it and get it */
351 };
352 typedef struct _CFURLFilePropertyValues _CFURLFilePropertyValues;
353
354 /*
355 _CFURLCopyResourcePropertyValuesAndFlags - Returns property values as simple types
356 whenever possible. Returns a bit array of resource flags in the "flags"
357 output parameter. Only flags whose corresponding bits are set in the "mask" parameter
358 are valid in the output bit array. Returns true on success, false if an error occurs.
359 Optional output error: the error is set to a valid CFErrorRef if and only if the function
360 returns false. A valid output error must be released by the caller.
361 */
362 CF_EXPORT
363 Boolean _CFURLCopyResourcePropertyValuesAndFlags( CFURLRef url, CFURLFilePropertyBitmap requestProperties, CFURLFilePropertyBitmap *actualProperties, struct _CFURLFilePropertyValues *properties, CFURLResourcePropertyFlags propertyFlagsMask, CFURLResourcePropertyFlags *propertyFlags, CFErrorRef *error) CF_AVAILABLE(10_7, 4_0);
364
365 /*
366 Volume property flags
367 */
368 typedef CF_OPTIONS(unsigned long long, CFURLVolumePropertyFlags) {
369 kCFURLVolumeIsLocal = 0x1LL, // Local device (vs. network device)
370 kCFURLVolumeIsAutomount = 0x2LL, // Mounted by the automounter
371 kCFURLVolumeDontBrowse = 0x4LL, // Hidden from user browsing
372 kCFURLVolumeIsReadOnly = 0x8LL, // Mounted read-only
373 kCFURLVolumeIsQuarantined = 0x10LL, // Mounted with quarantine bit
374 kCFURLVolumeIsEjectable = 0x20LL,
375 kCFURLVolumeIsRemovable = 0x40LL,
376 kCFURLVolumeIsInternal = 0x80LL,
377 kCFURLVolumeIsExternal = 0x100LL,
378 kCFURLVolumeIsDiskImage = 0x200LL,
379 kCFURLVolumeIsFileVault = 0x400LL,
380 kCFURLVolumeIsLocaliDiskMirror = 0x800LL,
381 kCFURLVolumeIsiPod = 0x1000LL,
382 kCFURLVolumeIsiDisk = 0x2000LL,
383 kCFURLVolumeIsCD = 0x4000LL,
384 kCFURLVolumeIsDVD = 0x8000LL,
385 kCFURLVolumeIsDeviceFileSystem = 0x10000LL,
386 // IMPORTANT: The values of the following flags must stay in sync with the
387 // VolumeCapabilities flags in CarbonCore (FileIDTreeStorage.h)
388 kCFURLVolumeSupportsPersistentIDs = 0x100000000LL,
389 kCFURLVolumeSupportsSearchFS = 0x200000000LL,
390 kCFURLVolumeSupportsExchange = 0x400000000LL,
391 // reserved 0x800000000LL,
392 kCFURLVolumeSupportsSymbolicLinks = 0x1000000000LL,
393 kCFURLVolumeSupportsDenyModes = 0x2000000000LL,
394 kCFURLVolumeSupportsCopyFile = 0x4000000000LL,
395 kCFURLVolumeSupportsReadDirAttr = 0x8000000000LL,
396 kCFURLVolumeSupportsJournaling = 0x10000000000LL,
397 kCFURLVolumeSupportsRename = 0x20000000000LL,
398 kCFURLVolumeSupportsFastStatFS = 0x40000000000LL,
399 kCFURLVolumeSupportsCaseSensitiveNames = 0x80000000000LL,
400 kCFURLVolumeSupportsCasePreservedNames = 0x100000000000LL,
401 kCFURLVolumeSupportsFLock = 0x200000000000LL,
402 kCFURLVolumeHasNoRootDirectoryTimes = 0x400000000000LL,
403 kCFURLVolumeSupportsExtendedSecurity = 0x800000000000LL,
404 kCFURLVolumeSupports2TBFileSize = 0x1000000000000LL,
405 kCFURLVolumeSupportsHardLinks = 0x2000000000000LL,
406 kCFURLVolumeSupportsMandatoryByteRangeLocks = 0x4000000000000LL,
407 kCFURLVolumeSupportsPathFromID = 0x8000000000000LL,
408 // reserved 0x10000000000000LL,
409 kCFURLVolumeIsJournaling = 0x20000000000000LL,
410 kCFURLVolumeSupportsSparseFiles = 0x40000000000000LL,
411 kCFURLVolumeSupportsZeroRuns = 0x80000000000000LL,
412 kCFURLVolumeSupportsVolumeSizes = 0x100000000000000LL,
413 kCFURLVolumeSupportsRemoteEvents = 0x200000000000000LL,
414 kCFURLVolumeSupportsHiddenFiles = 0x400000000000000LL,
415 kCFURLVolumeSupportsDecmpFSCompression = 0x800000000000000LL,
416 kCFURLVolumeHas64BitObjectIDs = 0x1000000000000000LL,
417 kCFURLVolumePropertyFlagsAll = 0xffffffffffffffffLL
418 };
419
420
421 /*
422 _CFURLGetVolumePropertyFlags - Returns a bit array of volume properties.
423 Only flags whose corresponding bits are set in the "mask" parameter are valid
424 in the output bit array. Returns true on success, false if an error occurs.
425 Optional output error: the error is set to a valid CFErrorRef if and only if the function
426 returns false. A valid output error must be released by the caller.
427 */
428 CF_EXPORT
429 Boolean _CFURLGetVolumePropertyFlags(CFURLRef url, CFURLVolumePropertyFlags mask, CFURLVolumePropertyFlags *flags, CFErrorRef *error) CF_AVAILABLE(10_6, 4_0);
430
431 /*
432 _CFURLSetResourcePropertyForKeyAndUpdateFileCache - Works mostly like CFURLSetResourcePropertyForKey
433 except that file system properties are updated in the URL's file cache (if it has a valid cache)
434 and dependant properties are not flushed. This means that values in the cache may not match what
435 is on the file system (see <rdar://problem/8371295> for details).
436
437 Only for use by DesktopServices!
438 */
439 CF_EXPORT
440 Boolean _CFURLSetResourcePropertyForKeyAndUpdateFileCache(CFURLRef url, CFStringRef key, CFTypeRef propertyValue, CFErrorRef *error) CF_AVAILABLE(10_7, NA);
441
442 /*
443 _CFURLCreateDisplayPathComponentsArray()
444
445 Summary:
446 _FileURLCreateDisplayPathComponentsArray creates a CFArray of
447 CFURLs for each component in the path leading up to the target
448 URL. This routine is suitable for clients who wish to show the
449 path leading up to a file system item. NOTE: This routine can be
450 I/O intensive, so use it sparingly, and cache the results if
451 possible.
452
453 Discussion:
454 The CFURLs in the result CFArray are ordered from the target URL
455 to the root of the display path. For example, if the target URL
456 is file://localhost/System/Library/ the CFURLs in the array will
457 be ordered: file://localhost/System/Library/,
458 file://localhost/System/, and then file://localhost/
459
460 Parameters:
461
462 targetURL:
463 The target URL.
464
465 error:
466 A pointer to a CFErrorRef, or NULL. If error is non-NULL and
467 the function result is NULL, this will be filled in with a
468 CFErrorRef representing the error that occurred.
469
470 Result:
471 A CFArray or NULL if an error occurred.
472 */
473 CF_EXPORT
474 CFArrayRef _CFURLCreateDisplayPathComponentsArray(CFURLRef url, CFErrorRef *error) CF_AVAILABLE(10_7, 4_0);
475
476 /* Returns true for URLs that locate file system resources. */
477 CF_EXPORT
478 Boolean _CFURLIsFileURL(CFURLRef url) CF_AVAILABLE(10_6, 4_0);
479
480 /* Returns true for file URLs that use the file reference form */
481 CF_EXPORT
482 Boolean _CFURLIsFileReferenceURL(CFURLRef url) CF_AVAILABLE(10_6, 4_0);
483
484 /* For use by Core Services */
485 CF_EXPORT
486 void *__CFURLResourceInfoPtr(CFURLRef url) CF_AVAILABLE(10_6, 4_0);
487
488 CF_EXPORT
489 void __CFURLSetResourceInfoPtr(CFURLRef url, void *ptr) CF_AVAILABLE(10_6, 4_0);
490
491 #if TARGET_OS_MAC
492
493 CF_EXPORT
494 CFURLRef _CFURLCreateFileReferenceURLFromIDs( CFAllocatorRef allocator, fsid_t fsid, UInt64 inodeNumber ) CF_AVAILABLE(10_7, NA);
495
496 /* _CFURLVolumeIdentifierGetVolumeRefNum is used by LaunchServices */
497 CF_EXPORT
498 SInt16 _CFURLVolumeIdentifierGetVolumeRefNum(UInt64 volumeIdentifier) CF_AVAILABLE(10_7, NA);
499
500 CF_EXPORT
501 CFURLRef _CFURLCreateFileReferenceURLFromFSRef(CFAllocatorRef allocator, const struct FSRef *ref) CF_AVAILABLE(10_7, NA);
502
503 /* _CFURLGetFSRef is a very lightweight version of CFURLGetFSRef that assumes the CFURL is a file URL and the properties needed to create a FSRef are available in the file URL's cache. This is for use only by CarbonCore's FileOperations SPI and API. */
504 CF_EXPORT
505 Boolean _CFURLGetFSRef(CFURLRef url, struct FSRef *fsRef) CF_AVAILABLE(10_7, NA);
506
507 /* _CFURLGetObjectInformationNoIO is used by LaunchServices */
508 CF_EXPORT
509 Boolean _CFURLGetObjectInformationNoIO(CFURLRef url, UInt64 * volumeIdentifier, UInt64 * objectIdentifier, UInt32 * statMode) CF_AVAILABLE(10_7, NA);
510
511 #endif
512
513 struct FSCatalogInfo;
514 struct HFSUniStr255;
515
516 /* _CFURLGetCatalogInfo is used by LaunchServices */
517 CF_EXPORT
518 SInt32 _CFURLGetCatalogInfo(CFURLRef url, UInt32 whichInfo, struct FSCatalogInfo *catalogInfo, struct HFSUniStr255 *name) CF_AVAILABLE(10_7, 5_0);
519
520 /* _CFURLReplaceObject SPI */
521
522 /* options for _CFURLReplaceObject */
523 enum {
524 // _CFURLItemReplacementUsingOriginalMetadataOnly = 1, // not used
525 _CFURLItemReplacementUsingNewMetadataOnly = 2,
526 // _CFURLItemReplacementByMergingMetadata = 3, // not used
527 _CFURLItemReplacementWithoutDeletingBackupItem = 1 << 4
528 };
529
530 CF_EXPORT
531 Boolean _CFURLReplaceObject( CFAllocatorRef allocator, CFURLRef originalItemURL, CFURLRef newItemURL, CFStringRef newName, CFStringRef backupItemName, CFOptionFlags options, CFURLRef *resultingURL, CFErrorRef *error ) CF_AVAILABLE(10_7, 5_0);
532
533
534 #if (TARGET_OS_MAC) || CF_BUILDING_CF || NSBUILDINGFOUNDATION
535 CF_EXPORT
536 CFURLEnumeratorResult _CFURLEnumeratorGetURLsBulk(CFURLEnumeratorRef enumerator, CFIndex maximumURLs, CFIndex *actualURLs, CFURLRef *urls, CFErrorRef *error) CF_AVAILABLE(10_6, 4_0);
537 #endif
538
539 #if TARGET_OS_MAC
540
541 enum {
542 kCFBookmarkFileCreationWithoutOverwritingExistingFile = ( 1UL << 8 ), // if destination file already exists don't overwrite it and return an error
543 kCFBookmarkFileCreationWithoutAppendingAliasExtension = ( 1UL << 9 ), // don't add / change whatever extension is on the created alias file
544 kCFBookmarkFileCreationWithoutCreatingResourceFork = ( 1UL << 10 ), // don't create the resource-fork half of the alias file
545
546 kCFURLBookmarkCreationAllowCreationIfResourceDoesNotExistMask = ( 1 << 28 ), // allow creation of a bookmark to a file: scheme with a CFURLRef of item which may not exist. If the filesystem item does not exist, the created bookmark contains essentially no properties beyond the url string.
547
548 kCFURLBookmarkCreationDoNotIncludeSandboxExtensionsMask = ( 1 << 29 ), // If set, sandbox extensions are not included in created bookmarks. Ordinarily, bookmarks ( except those created suitable for putting into a bookmark file ) will have a sandbox extension added for the item
549 };
550
551 enum {
552 kCFBookmarkResolutionPerformRelativeResolutionFirstMask CF_ENUM_AVAILABLE(10_8,6_0) = ( 1 << 11 ), // perform relative resolution before absolute resolution. If this bit is set, for this to be useful a relative URL must also have been passed in and the bookmark when created must have been created relative to another url.
553 };
554
555 typedef CF_ENUM(CFIndex, CFURLBookmarkMatchResult) {
556 kCFURLBookmarkComparisonUnableToCompare = 0x00000000, /* the two bookmarks could not be compared for some reason */
557 kCFURLBookmarkComparisonNoMatch = 0x00001000, /* Bookmarks do not refer to the same item */
558 kCFURLBookmarkComparisonUnlikelyToMatch = 0x00002000, /* it is unlikely that the two items refer to the same filesystem item */
559 kCFURLBookmarkComparisonLikelyToMatch = 0x00004000, /* it is likely that the two items refer to the same filesystem item ( but, they may not ) */
560 kCFURLBookmarkComparisonMatch = 0x00008000, /* the two items refer to the same item, but other information in the bookmarks may not match */
561 kCFURLBookmarkComparisonExactMatch = 0x0000f000 /* the two bookmarks are identical */
562 };
563
564 /* Keys specific to bookmarks at this time */
565 CF_EXPORT const CFStringRef _kCFURLPropertyKeyFullPathString; // the full filesystem path of the item the bookmark was create against
566 CF_EXPORT const CFStringRef _kCFURLURLString; // the url string ( possibly relative to a base url ) of the url this bookmark was created against.
567 CF_EXPORT const CFStringRef _kCFURLFileIDData; // the url string ( possibly relative to a base url ) of the url this bookmark was created against.
568
569 CFURLBookmarkMatchResult _CFURLCompareBookmarkData( CFDataRef bookmark1Ref, CFDataRef bookmark2Ref, CFURLRef relativeToURL, CFArrayRef* matchingPropertyKeys ) CF_AVAILABLE(10_7, NA);
570
571 CF_EXPORT
572 CFURLBookmarkMatchResult _CFURLBookmarkDataCompare(CFDataRef bookmark1Ref, CFDataRef bookmark2Ref, CFURLRef relativeToURL, CFArrayRef* matchingPropertyKeys) CF_AVAILABLE(10_7, NA); // Use _CFURLCompareBookmarkData() instead
573
574 CF_EXPORT
575 OSStatus _CFURLBookmarkDataToAliasHandle(CFDataRef bookmarkRef, void* aliasHandleP) CF_AVAILABLE(10_7, NA);
576
577 #endif
578
579 /*
580 The following are properties that can be asked of bookmark data objects in addition to the resource properties
581 from CFURL itself.
582 */
583
584 extern const CFStringRef kCFURLBookmarkOriginalPathKey CF_AVAILABLE(10_7, 5_0);
585 extern const CFStringRef kCFURLBookmarkOriginalRelativePathKey CF_AVAILABLE(10_7, 5_0);
586 extern const CFStringRef kCFURLBookmarkOriginalRelativePathComponentsArrayKey CF_AVAILABLE(10_7, 5_0);
587 extern const CFStringRef kCFURLBookmarkOriginalVolumeNameKey CF_AVAILABLE(10_7, 5_0);
588 extern const CFStringRef kCFURLBookmarkOriginalVolumeCreationDateKey CF_AVAILABLE(10_7, 5_0);
589
590 #endif /* TARGET_OS_MAC */
591
592 CF_EXTERN_C_END
593
594 #endif /* ! __COREFOUNDATION_CFURLPRIV__ */
595