]> git.saurik.com Git - apple/cf.git/blame - CFBundlePriv.h
CF-1151.16.tar.gz
[apple/cf.git] / CFBundlePriv.h
CommitLineData
9ce05555 1/*
d8b101a4 2 * Copyright (c) 2014 Apple Inc. All rights reserved.
9ce05555
A
3 *
4 * @APPLE_LICENSE_HEADER_START@
d7384798 5 *
9ce05555
A
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.
d7384798 12 *
9ce05555
A
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.
d7384798 20 *
9ce05555
A
21 * @APPLE_LICENSE_HEADER_END@
22 */
f64f9b69 23
9ce05555 24/* CFBundlePriv.h
d7384798 25 Copyright (c) 1999-2014, Apple Inc. All rights reserved.
9ce05555
A
26*/
27
28#if !defined(__COREFOUNDATION_CFBUNDLEPRIV__)
29#define __COREFOUNDATION_CFBUNDLEPRIV__ 1
30
31#include <CoreFoundation/CFBase.h>
32#include <CoreFoundation/CFArray.h>
33#include <CoreFoundation/CFBundle.h>
34#include <CoreFoundation/CFDictionary.h>
35#include <CoreFoundation/CFString.h>
36#include <CoreFoundation/CFURL.h>
37
bd5b749c 38CF_EXTERN_C_BEGIN
9ce05555
A
39
40/* Finder stuff */
41CF_EXPORT
42const CFStringRef _kCFBundlePackageTypeKey;
43CF_EXPORT
44const CFStringRef _kCFBundleSignatureKey;
45CF_EXPORT
46const CFStringRef _kCFBundleIconFileKey;
47CF_EXPORT
48const CFStringRef _kCFBundleDocumentTypesKey;
49CF_EXPORT
50const CFStringRef _kCFBundleURLTypesKey;
51
52/* Localizable Finder stuff */
53CF_EXPORT
54const CFStringRef _kCFBundleDisplayNameKey;
55CF_EXPORT
56const CFStringRef _kCFBundleShortVersionStringKey;
57CF_EXPORT
58const CFStringRef _kCFBundleGetInfoStringKey;
59CF_EXPORT
60const CFStringRef _kCFBundleGetInfoHTMLKey;
61
62/* Sub-keys for CFBundleDocumentTypes dictionaries */
63CF_EXPORT
64const CFStringRef _kCFBundleTypeNameKey;
65CF_EXPORT
66const CFStringRef _kCFBundleTypeRoleKey;
67CF_EXPORT
68const CFStringRef _kCFBundleTypeIconFileKey;
69CF_EXPORT
70const CFStringRef _kCFBundleTypeOSTypesKey;
71CF_EXPORT
72const CFStringRef _kCFBundleTypeExtensionsKey;
73CF_EXPORT
74const CFStringRef _kCFBundleTypeMIMETypesKey;
75
76/* Sub-keys for CFBundleURLTypes dictionaries */
77CF_EXPORT
78const CFStringRef _kCFBundleURLNameKey;
79CF_EXPORT
80const CFStringRef _kCFBundleURLIconFileKey;
81CF_EXPORT
82const CFStringRef _kCFBundleURLSchemesKey;
83
84/* Compatibility key names */
85CF_EXPORT
86const CFStringRef _kCFBundleOldExecutableKey;
87CF_EXPORT
88const CFStringRef _kCFBundleOldInfoDictionaryVersionKey;
89CF_EXPORT
90const CFStringRef _kCFBundleOldNameKey;
91CF_EXPORT
92const CFStringRef _kCFBundleOldIconFileKey;
93CF_EXPORT
94const CFStringRef _kCFBundleOldDocumentTypesKey;
95CF_EXPORT
96const CFStringRef _kCFBundleOldShortVersionStringKey;
97
98/* Compatibility CFBundleDocumentTypes key names */
99CF_EXPORT
100const CFStringRef _kCFBundleOldTypeNameKey;
101CF_EXPORT
102const CFStringRef _kCFBundleOldTypeRoleKey;
103CF_EXPORT
104const CFStringRef _kCFBundleOldTypeIconFileKey;
105CF_EXPORT
106const CFStringRef _kCFBundleOldTypeExtensions1Key;
107CF_EXPORT
108const CFStringRef _kCFBundleOldTypeExtensions2Key;
109CF_EXPORT
110const CFStringRef _kCFBundleOldTypeOSTypesKey;
111
cf7d2af9
A
112/* For platform specification */
113CF_EXPORT
114const CFStringRef _kCFBundleSupportedPlatformsKey;
115
116/* For Code Signing */
117CF_EXPORT
118const CFStringRef _kCFBundleResourceSpecificationKey;
119
9ce05555
A
120
121/* Functions for examining directories that may "look like" bundles */
122
123CF_EXPORT
124CFURLRef _CFBundleCopyBundleURLForExecutableURL(CFURLRef url);
125
126CF_EXPORT
127Boolean _CFBundleURLLooksLikeBundle(CFURLRef url);
128
129CF_EXPORT
130CFBundleRef _CFBundleCreateIfLooksLikeBundle(CFAllocatorRef allocator, CFURLRef url);
131
132CF_EXPORT
133CFBundleRef _CFBundleGetMainBundleIfLooksLikeBundle(void);
134
bd5b749c
A
135CF_EXPORT
136Boolean _CFBundleMainBundleInfoDictionaryComesFromResourceFork(void);
137
9ce05555
A
138CF_EXPORT
139CFBundleRef _CFBundleCreateWithExecutableURLIfLooksLikeBundle(CFAllocatorRef allocator, CFURLRef url);
140
d8925383
A
141CF_EXPORT
142CFURLRef _CFBundleCopyMainBundleExecutableURL(Boolean *looksLikeBundle);
9ce05555 143
bd5b749c
A
144CF_EXPORT
145CFBundleRef _CFBundleGetExistingBundleWithBundleURL(CFURLRef bundleURL);
146
d7384798 147// This function is obsolete.
cf7d2af9
A
148CF_EXPORT
149CFArrayRef _CFBundleGetSupportedPlatforms(CFBundleRef bundle);
150
151CF_EXPORT
152CFStringRef _CFBundleGetCurrentPlatform(void);
153
154
155/* For Code Signing */
156
d7384798 157// This function is obsolete. Use CFBundleCreate instead.
cf7d2af9 158CF_EXPORT
d7384798 159CFBundleRef _CFBundleCreateIfMightBeBundle(CFAllocatorRef allocator, CFURLRef url) CF_DEPRECATED(10_6, 10_10, 2_0, 8_0);
cf7d2af9 160
d7384798 161// This function is for code signing only. Do not use this function.
cf7d2af9
A
162CF_EXPORT
163CFBundleRef _CFBundleCreateWithExecutableURLIfMightBeBundle(CFAllocatorRef allocator, CFURLRef url);
164
165
9ce05555
A
166/* Functions for examining the structure of a bundle */
167
168CF_EXPORT
a48904a4 169CFURLRef _CFBundleCopyResourceForkURL(CFBundleRef bundle) CF_AVAILABLE_MAC(10_0);
9ce05555
A
170
171CF_EXPORT
172CFURLRef _CFBundleCopyInfoPlistURL(CFBundleRef bundle);
173
174
175/* Functions for working without a bundle instance */
176
177CF_EXPORT
178CFURLRef _CFBundleCopyExecutableURLInDirectory(CFURLRef url);
179
180CF_EXPORT
181CFURLRef _CFBundleCopyOtherExecutableURLInDirectory(CFURLRef url);
182
183
184/* Functions for dealing with localizations */
185
186CF_EXPORT
187void _CFBundleGetLanguageAndRegionCodes(SInt32 *languageCode, SInt32 *regionCode);
188// may return -1 for either one if no code can be found
189
190CF_EXPORT
191Boolean CFBundleGetLocalizationInfoForLocalization(CFStringRef localizationName, SInt32 *languageCode, SInt32 *regionCode, SInt32 *scriptCode, CFStringEncoding *stringEncoding);
192 /* Gets the appropriate language and region codes, and the default */
193 /* script code and encoding, for the localization specified. */
194 /* Pass NULL for the localizationName to get these values for the */
195 /* single most preferred localization in the current context. */
196 /* May give -1 if there is no language or region code for a particular */
197 /* localization. Returns false if CFBundle has no information about */
198 /* the given localization. */
199
200CF_EXPORT
201CFStringRef CFBundleCopyLocalizationForLocalizationInfo(SInt32 languageCode, SInt32 regionCode, SInt32 scriptCode, CFStringEncoding stringEncoding);
202 /* Returns the default localization for the combination of codes */
203 /* specified. Pass in -1 for language, region code, or script code, or */
204 /* 0xFFFF for stringEncoding, if you do not wish to specify one of these. */
205
d7384798
A
206// Get a localized string for a specific localization (including processing as strings dict file). This skips the usual cache for localized strings.
207CF_EXPORT CFStringRef CFBundleCopyLocalizedStringForLocalization(CFBundleRef bundle, CFStringRef key, CFStringRef value, CFStringRef tableName, CFStringRef localizationName) CF_AVAILABLE(10_10, 8_0);
208
9ce05555
A
209CF_EXPORT
210void _CFBundleSetDefaultLocalization(CFStringRef localizationName);
211
212
213/* Functions for dealing specifically with CFM executables */
214
215CF_EXPORT
216void *_CFBundleGetCFMFunctionPointerForName(CFBundleRef bundle, CFStringRef funcName);
217
218CF_EXPORT
219void _CFBundleGetCFMFunctionPointersForNames(CFBundleRef bundle, CFArrayRef functionNames, void *ftbl[]);
220
221CF_EXPORT
222void _CFBundleSetCFMConnectionID(CFBundleRef bundle, void *connectionID);
223
224
225/* Miscellaneous functions */
226
227CF_EXPORT
228CFStringRef _CFBundleCopyFileTypeForFileURL(CFURLRef url);
229
d8925383
A
230CF_EXPORT
231CFStringRef _CFBundleCopyFileTypeForFileData(CFDataRef data);
232
9ce05555
A
233CF_EXPORT
234Boolean _CFBundleGetHasChanged(CFBundleRef bundle);
235
236CF_EXPORT
a48904a4 237void _CFBundleFlushCaches(void) CF_DEPRECATED(10_0, 10_8, 2_0, 6_0);
9ce05555 238
d8925383 239CF_EXPORT
a48904a4 240void _CFBundleFlushCachesForURL(CFURLRef url) CF_DEPRECATED(10_0, 10_8, 2_0, 6_0);
d8925383 241
bd5b749c
A
242CF_EXPORT
243void _CFBundleFlushBundleCaches(CFBundleRef bundle); // The previous two functions flush cached resource paths; this one also flushes bundle-specific caches such as the info dictionary and strings files
244
8ca704e1
A
245CF_EXPORT
246CFArrayRef _CFBundleCopyAllBundles(void); // Pending publication, the only known client of this is PowerBox. Email david_smith@apple.com before using this.
247
9ce05555
A
248CF_EXPORT
249void _CFBundleSetStringsFilesShared(CFBundleRef bundle, Boolean flag);
250
251CF_EXPORT
252Boolean _CFBundleGetStringsFilesShared(CFBundleRef bundle);
253
8ca704e1
A
254CF_EXPORT
255CFURLRef _CFBundleCopyFrameworkURLForExecutablePath(CFStringRef executablePath);
256
d7384798
A
257#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)
258#include <xpc/xpc.h>
259CF_EXPORT
260void _CFBundleSetupXPCBootstrap(xpc_object_t bootstrap) CF_AVAILABLE(10_10, 8_0);
261#endif
9ce05555
A
262
263/* Functions deprecated as SPI */
264
265CF_EXPORT
266CFDictionaryRef _CFBundleGetLocalInfoDictionary(CFBundleRef bundle); // deprecated in favor of CFBundleGetLocalInfoDictionary
267
268CF_EXPORT
269CFPropertyListRef _CFBundleGetValueForInfoKey(CFBundleRef bundle, CFStringRef key); // deprecated in favor of CFBundleGetValueForInfoDictionaryKey
270
271CF_EXPORT
272Boolean _CFBundleGetPackageInfoInDirectory(CFAllocatorRef alloc, CFURLRef url, UInt32 *packageType, UInt32 *packageCreator); // deprecated in favor of CFBundleGetPackageInfoInDirectory
273
274CF_EXPORT
275CFDictionaryRef _CFBundleCopyInfoDictionaryInResourceFork(CFURLRef url); // CFBundleCopyInfoDictionaryForURL is usually preferred; for the main bundle, however, no special call is necessary, since the info dictionary will automatically be available whether the app is bundled or not
276
277CF_EXPORT
278CFURLRef _CFBundleCopyPrivateFrameworksURL(CFBundleRef bundle); // deprecated in favor of CFBundleCopyPrivateFrameworksURL
279
280CF_EXPORT
281CFURLRef _CFBundleCopySharedFrameworksURL(CFBundleRef bundle); // deprecated in favor of CFBundleCopySharedFrameworksURL
282
283CF_EXPORT
284CFURLRef _CFBundleCopySharedSupportURL(CFBundleRef bundle); // deprecated in favor of CFBundleCopySharedSupportURL
285
286CF_EXPORT
287CFURLRef _CFBundleCopyBuiltInPlugInsURL(CFBundleRef bundle); // deprecated in favor of CFBundleCopyBuiltInPlugInsURL
288
9ce05555
A
289CF_EXPORT
290CFURLRef _CFBundleCopyResourceURLForLanguage(CFBundleRef bundle, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName, CFStringRef language); // deprecated in favor of CFBundleCopyResourceURLForLocalization
291
292CF_EXPORT
293CFArrayRef _CFBundleCopyResourceURLsOfTypeForLanguage(CFBundleRef bundle, CFStringRef resourceType, CFStringRef subDirName, CFStringRef language); // deprecated in favor of CFBundleCopyResourceURLsOfTypeForLocalization
294
295CF_EXPORT
bd5b749c 296CFBundleRefNum _CFBundleOpenBundleResourceFork(CFBundleRef bundle); // deprecated in favor of CFBundleOpenBundleResourceMap
9ce05555
A
297
298CF_EXPORT
299void _CFBundleCloseBundleResourceFork(CFBundleRef bundle); // deprecated in favor of CFBundleCloseBundleResourceMap
300
bd5b749c 301CF_EXTERN_C_END
9ce05555
A
302
303#endif /* ! __COREFOUNDATION_CFBUNDLEPRIV__ */
304