PageRenderTime 17ms CodeModel.GetById 13ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/core/externals/update-engine/externals/google-toolbox-for-mac/Foundation/GTMServiceManagement.h

http://macfuse.googlecode.com/
C++ Header | 77 lines | 18 code | 16 blank | 43 comment | 0 complexity | 46bc0b69a8a506ab0e4ff5ff024fddfd MD5 | raw file
 1//
 2//  GTMServiceManagement.h
 3//
 4//  Copyright 2010 Google Inc.
 5//
 6//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
 7//  use this file except in compliance with the License.  You may obtain a copy
 8//  of the License at
 9//
10//  http://www.apache.org/licenses/LICENSE-2.0
11//
12//  Unless required by applicable law or agreed to in writing, software
13//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
15//  License for the specific language governing permissions and limitations under
16//  the License.
17//
18
19#include "GTMDefines.h"
20
21#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4
22
23#include <launch.h>
24#include <CoreFoundation/CoreFoundation.h>
25
26GTM_EXTERN_C_BEGIN
27
28// Done in C as opposed to Objective-C as lots of services may not want
29// to bring in Obj-C libraries.
30
31// For rough documentation on these methods please see
32// <ServiceManagement/ServiceManagement.h> from the 10.6 sdk.
33// This reimplements some of the ServiceManagement framework on 10.5.
34// Caller takes ownership of error if necessary.
35
36Boolean GTMSMJobSubmit(CFDictionaryRef job, CFErrorRef *error);
37Boolean GTMSMJobRemove(CFStringRef jobLabel, CFErrorRef *error);
38
39// Caller takes ownership of the returned type.
40// Note that the dictionary returned will have 0 for machports.
41// To get a machport, use bootstrap_look_up, or NSMachBootstrapServer.
42CFDictionaryRef GTMSMJobCopyDictionary(CFStringRef jobLabel);
43
44// This one is conspiciously absent from the ServiceManagement framework.
45// Performs a check-in for the running process and returns its dictionary with
46// the appropriate sockets and machports filled in.
47// Caller  takes ownership of the returned type.
48CFDictionaryRef GTMSMCopyJobCheckInDictionary(CFErrorRef *error);
49
50// The official ServiceManagement version returns an array of job dictionaries.
51// This returns a dictionary of job dictionaries where the key is the label
52// of the job, and the value is the dictionary for the job of that label.
53// Caller takes ownership of the returned type.
54CFDictionaryRef GTMSMCopyAllJobDictionaries(void);
55
56
57// Convert a CFType (and any of it's subitems) into a launch_data_t.
58// Caller takes ownership of the returned type if it isn't added to a launch
59// data container type.
60launch_data_t GTMLaunchDataCreateFromCFType(CFTypeRef cf_type_ref,
61                                            CFErrorRef *error);
62
63// Convert a launch_data_t (and any of it's subitems) into a CFType.
64// If |convert_non_standard_objects| is true, file descriptors and machports
65// will be included in the returned dictionary, otherwise they will be ignored.
66// Caller is takes ownership of the returned type.
67CFTypeRef GTMCFTypeCreateFromLaunchData(launch_data_t ldata,
68                                        bool convert_non_standard_objects,
69                                        CFErrorRef *error);
70
71// Returns the list of exports defined by launchd.
72// Caller is takes ownership of the returned type.
73CFDictionaryRef GTMCopyLaunchdExports();
74
75GTM_EXTERN_C_END
76
77#endif //  if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4