1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef SANDBOX_MAC_XPC_STUBS_HEADER_FRAGMENT_
6 #define SANDBOX_MAC_XPC_STUBS_HEADER_FRAGMENT_
8 #include <bsm/libbsm.h>
10 #include "sandbox/sandbox_export.h"
12 // Declare or include public types.
13 #if !defined(MAC_OS_X_VERSION_10_7) || \
14 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
17 typedef void* xpc_object_t;
26 // Declare private types.
28 typedef struct _xpc_pipe_s* xpc_pipe_t;
31 #if defined(MAC_OS_X_VERSION_10_7) && \
32 MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
33 // Redeclare methods that only exist on 10.7+ to suppress
34 // -Wpartial-availability warnings.
36 XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 void
37 xpc_dictionary_set_int64(xpc_object_t xdict, const char* key, int64_t value);
39 XPC_EXPORT XPC_NONNULL1 void xpc_release(xpc_object_t object);
41 XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL
42 bool xpc_dictionary_get_bool(xpc_object_t xdict, const char* key);
44 XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL int64_t
45 xpc_dictionary_get_int64(xpc_object_t xdict, const char* key);
47 XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL
48 const char* xpc_dictionary_get_string(xpc_object_t xdict, const char* key);
50 XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL uint64_t
51 xpc_dictionary_get_uint64(xpc_object_t xdict, const char* key);
53 XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 void
54 xpc_dictionary_set_uint64(xpc_object_t xdict, const char* key, uint64_t value);
56 XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT xpc_object_t
57 xpc_dictionary_create(const char* const* keys,
58 const xpc_object_t* values,
60 XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL_ALL
62 xpc_dictionary_create_reply(xpc_object_t original);
64 XPC_EXPORT XPC_MALLOC XPC_WARN_RESULT XPC_NONNULL1
65 char* xpc_copy_description(xpc_object_t object);
69 #endif // SANDBOX_MAC_XPC_STUBS_HEADER_FRAGMENT_