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