LLVM 24.0.0git
PluginAPI_types.h
Go to the documentation of this file.
1/*===----------------------------------------------------------------------===*\
2|* *|
3|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
4|* Exceptions. *|
5|* See https://llvm.org/LICENSE.txt for license information. *|
6|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
7|* *|
8|*===----------------------------------------------------------------------===*|
9|* *|
10|* The types for the LLVM CAS plugin API. *|
11|* The API is experimental and subject to change. *|
12|* *|
13\*===----------------------------------------------------------------------===*/
14
15#ifndef LLVM_C_CAS_PLUGINAPI_TYPES_H
16#define LLVM_C_CAS_PLUGINAPI_TYPES_H
17
18#include <stdbool.h>
19#include <stddef.h>
20#include <stdint.h>
21
22#define LLCAS_VERSION_MAJOR 0
23#define LLCAS_VERSION_MINOR 1
24
25typedef struct llcas_cas_options_s *llcas_cas_options_t;
26typedef struct llcas_cas_s *llcas_cas_t;
27typedef struct llcas_cancellable_s *llcas_cancellable_t;
28
29/**
30 * Digest hash bytes.
31 */
32typedef struct {
33 const uint8_t *data;
34 size_t size;
36
37/**
38 * Data buffer for stored CAS objects.
39 */
40typedef struct {
41 const void *data;
42 size_t size;
44
45/**
46 * Identifier for a CAS object.
47 */
48typedef struct {
51
52/**
53 * A loaded CAS object.
54 */
58
59/**
60 * Object references for a CAS object.
61 */
66
67/**
68 * Return values for a load operation.
69 */
70typedef enum {
71 /**
72 * The object was found.
73 */
75
76 /**
77 * The object was not found.
78 */
80
81 /**
82 * An error occurred.
83 */
86
87/**
88 * Callback for \c llcas_cas_load_object_async.
89 *
90 * \param ctx pointer passed through from the \c llcas_cas_load_object_async
91 * call.
92 * \param error message if an error occurred. If set, the memory it points to
93 * needs to be released via \c llcas_string_dispose.
94 */
97
98/**
99 * Callback for \c llcas_actioncache_get_for_digest_async.
100 *
101 * \param ctx pointer passed through from the
102 * \c llcas_actioncache_get_for_digest_async call.
103 * \param error message if an error occurred. If set, the memory it points to
104 * needs to be released via \c llcas_string_dispose.
105 */
107 llcas_objectid_t, char *error);
108
109/**
110 * Callback for \c llcas_actioncache_put_for_digest_async.
111 *
112 * \param ctx pointer passed through from the
113 * \c llcas_actioncache_put_for_digest_async call.
114 * \param error message if an error occurred. If set, the memory it points to
115 * needs to be released via \c llcas_string_dispose.
116 */
117typedef void (*llcas_actioncache_put_cb)(void *ctx, bool failed, char *error);
118
119#endif /* LLVM_C_CAS_PLUGINAPI_TYPES_H */
struct llcas_cas_options_s * llcas_cas_options_t
struct llcas_cancellable_s * llcas_cancellable_t
void(* llcas_actioncache_get_cb)(void *ctx, llcas_lookup_result_t, llcas_objectid_t, char *error)
Callback for llcas_actioncache_get_for_digest_async.
struct llcas_cas_s * llcas_cas_t
llcas_lookup_result_t
Return values for a load operation.
@ LLCAS_LOOKUP_RESULT_NOTFOUND
The object was not found.
@ LLCAS_LOOKUP_RESULT_SUCCESS
The object was found.
@ LLCAS_LOOKUP_RESULT_ERROR
An error occurred.
void(* llcas_cas_load_object_cb)(void *ctx, llcas_lookup_result_t, llcas_loaded_object_t, char *error)
Callback for llcas_cas_load_object_async.
void(* llcas_actioncache_put_cb)(void *ctx, bool failed, char *error)
Callback for llcas_actioncache_put_for_digest_async.
#define error(X)
Data buffer for stored CAS objects.
const void * data
Digest hash bytes.
const uint8_t * data
A loaded CAS object.
Object references for a CAS object.
Identifier for a CAS object.