| 1 | /*! |
| 2 | * @header |
| 3 | * Umbrella header for CoreEntitlements |
| 4 | */ |
| 5 | #ifndef CORE_ENTITLEMENTS_H |
| 6 | #define CORE_ENTITLEMENTS_H |
| 7 | |
| 8 | #define kCSWebBrowserNetworkEntitlement (("com.apple.developer.web-browser-engine.networking")) |
| 9 | #define kCSWebBrowserWebContentEntitlement (("com.apple.developer.web-browser-engine.webcontent")) |
| 10 | #define kCSWebBrowserGPUEntitlement (("com.apple.developer.web-browser-engine.rendering")) |
| 11 | #define kCSWebBrowserHostEntitlement (("com.apple.developer.web-browser-engine.host")) |
| 12 | |
| 13 | #ifdef __cplusplus |
| 14 | extern "C" { |
| 15 | #endif |
| 16 | |
| 17 | typedef const struct CERuntime* CERuntime_t; |
| 18 | typedef struct CEQueryContext* CEQueryContext_t; |
| 19 | |
| 20 | #define _CE_INDIRECT 1 |
| 21 | |
| 22 | #ifdef TXM |
| 23 | #include <attributes.h> |
| 24 | #include <ptrcheck.h> |
| 25 | #endif |
| 26 | |
| 27 | #if defined(__has_feature) && __has_feature(bounds_attributes) |
| 28 | #define CE_HEADER_INDEXABLE __attribute__((__indexable__)) |
| 29 | #else |
| 30 | #define |
| 31 | #endif |
| 32 | |
| 33 | #include <os/base.h> |
| 34 | #include <CoreEntitlements/Errors.h> |
| 35 | #include <CoreEntitlements/Result.h> |
| 36 | #include <CoreEntitlements/Runtime.h> |
| 37 | #include <CoreEntitlements/Entitlements.h> |
| 38 | #include <CoreEntitlements/Serialization.h> |
| 39 | #include <CoreEntitlements/Index.h> |
| 40 | |
| 41 | __ptrcheck_abi_assume_single(); |
| 42 | |
| 43 | /*! |
| 44 | * @typedef CEType_t |
| 45 | * @brief Represents a type of element supported by CoreEntitlements |
| 46 | * |
| 47 | * @const kCETypeUnknown |
| 48 | * An unknown type |
| 49 | * |
| 50 | * @const kCETypeDictionary |
| 51 | * A dictionary container |
| 52 | * |
| 53 | * @const kCETypeSequence |
| 54 | * An ordered sequence container |
| 55 | * |
| 56 | * @const kCETypeInteger |
| 57 | * An integer. |
| 58 | * |
| 59 | * @const kCETypeString |
| 60 | * A string of bytes. |
| 61 | * |
| 62 | * @const kCETypeBool |
| 63 | * A boolean. |
| 64 | */ |
| 65 | OS_CLOSED_ENUM(CEType, uint32_t, |
| 66 | kCETypeUnknown = 0, |
| 67 | kCETypeDictionary = 1, |
| 68 | kCETypeSequence = 2, |
| 69 | kCETypeInteger = 3, |
| 70 | kCETypeString = 4, |
| 71 | kCETypeBool = 5, |
| 72 | kCETypeData = 6); |
| 73 | |
| 74 | /*! |
| 75 | * @function CE_RT_LOG |
| 76 | * Log a single message via the current runtime |
| 77 | * Only called if the runtime supports logging. |
| 78 | */ |
| 79 | #define CE_RT_LOG(msg) do { if (rt->log) { rt->log(rt, "[%s]: %s\n", __FUNCTION__, msg); } } while(0) |
| 80 | |
| 81 | /*! |
| 82 | * @function CE_RT_LOGF |
| 83 | * Logs using the passed in format. Printf like. |
| 84 | * Only called if the runtime supports logging. |
| 85 | */ |
| 86 | #define CE_RT_LOGF(fmt, ...) do { if (rt->log) { rt->log(rt, "[%s]: " fmt, __FUNCTION__, __VA_ARGS__); } } while(0) |
| 87 | |
| 88 | /*! |
| 89 | * @function CE_RT_ABORT |
| 90 | * Invokes the runtime abort function with a passed in message. |
| 91 | * This function should not return. |
| 92 | */ |
| 93 | #define CE_RT_ABORT(...) do { rt->abort(rt, "[%s]: %s\n", __FUNCTION__, __VA_ARGS__); } while(0) |
| 94 | |
| 95 | #ifdef __cplusplus |
| 96 | } |
| 97 | #endif |
| 98 | |
| 99 | #endif |
| 100 | |