16#ifndef LLVM_C_CAS_PLUGINAPI_FUNCTIONS_H
17#define LLVM_C_CAS_PLUGINAPI_FUNCTIONS_H
24#define LLCAS_PUBLIC __declspec(dllexport)
91 const char *value,
char **
error);
180 const char *printed_digest,
181 uint8_t *bytes,
size_t bytes_size,
196 char **printed_id,
char **
error);
296 const char *filepath,
343 const char *filepath,
char **
error);
389 bool globally,
char **
error);
#define LLVM_C_EXTERN_C_BEGIN
#define LLVM_C_EXTERN_C_END
LLCAS_PUBLIC bool llcas_digest_print(llcas_cas_t, llcas_digest_t, char **printed_id, char **error)
Returns a string for the given digest bytes that can be passed to llcas_digest_parse.
LLCAS_PUBLIC void llcas_cancellable_dispose(llcas_cancellable_t)
Releases memory associated with given llcas_cancellable_t.
LLVM_C_EXTERN_C_BEGIN LLCAS_PUBLIC void llcas_get_plugin_version(unsigned *major, unsigned *minor)
Returns the LLCAS_VERSION_MAJOR and LLCAS_VERSION_MINOR values that the plugin was compiled with.
LLCAS_PUBLIC void llcas_actioncache_get_for_digest_async(llcas_cas_t, llcas_digest_t key, bool globally, void *ctx_cb, llcas_actioncache_get_cb, llcas_cancellable_t *cancel_tok)
Like llcas_actioncache_get_for_digest but result is provided to a callback function.
LLCAS_PUBLIC llcas_cas_t llcas_cas_create(llcas_cas_options_t, char **error)
Creates a new llcas_cas_t object.
LLCAS_PUBLIC int64_t llcas_cas_get_ondisk_size(llcas_cas_t, char **error)
Get the local storage size of the CAS/cache data in bytes.
LLCAS_PUBLIC bool llcas_cas_store_from_filepath(llcas_cas_t, const char *filepath, llcas_objectid_t *p_id, char **error)
Stores the data of a file and provides its associated llcas_objectid_t.
LLCAS_PUBLIC char * llcas_cas_get_hash_schema_name(llcas_cas_t)
LLCAS_PUBLIC void llcas_string_dispose(char *)
Releases memory of C string pointers provided by other functions.
LLCAS_PUBLIC bool llcas_cas_validate(llcas_cas_t, bool check_hash, char **error)
Validate the CAS contents.
LLCAS_PUBLIC llcas_cas_options_t llcas_cas_options_create(void)
Options object to configure creation of llcas_cas_t.
LLCAS_PUBLIC bool llcas_actioncache_validate(llcas_cas_t, char **error)
Validate the action cache contents.
LLCAS_PUBLIC bool llcas_loaded_object_export_data_to_filepath(llcas_cas_t, llcas_loaded_object_t, const char *filepath, char **error)
Exports the data of an object to a file path.
LLCAS_PUBLIC llcas_lookup_result_t llcas_actioncache_get_for_digest(llcas_cas_t, llcas_digest_t key, llcas_objectid_t *p_value, bool globally, char **error)
Retrieves the llcas_objectid_t value associated with a key.
LLCAS_PUBLIC bool llcas_cas_store_object(llcas_cas_t, llcas_data_t, const llcas_objectid_t *refs, size_t refs_count, llcas_objectid_t *p_id, char **error)
Stores the object with the provided data buffer and llcas_objectid_t references, and provides its ass...
LLCAS_PUBLIC void llcas_cas_options_set_ondisk_path(llcas_cas_options_t, const char *path)
Receives a local file-system path that the plugin should use for any on-disk resources/caches.
LLCAS_PUBLIC size_t llcas_object_refs_get_count(llcas_cas_t, llcas_object_refs_t)
LLCAS_PUBLIC bool llcas_cas_prune_ondisk_data(llcas_cas_t, char **error)
Prune local storage to reduce its size according to the desired size limit.
LLCAS_PUBLIC unsigned llcas_digest_parse(llcas_cas_t, const char *printed_digest, uint8_t *bytes, size_t bytes_size, char **error)
Parses the printed digest and returns the digest hash bytes.
LLCAS_PUBLIC llcas_objectid_t llcas_object_refs_get_id(llcas_cas_t, llcas_object_refs_t, size_t index)
LLCAS_PUBLIC void llcas_cas_dispose(llcas_cas_t)
Releases memory of llcas_cas_t.
LLCAS_PUBLIC void llcas_cas_load_object_async(llcas_cas_t, llcas_objectid_t, void *ctx_cb, llcas_cas_load_object_cb, llcas_cancellable_t *cancel_tok)
Like llcas_cas_load_object but loading happens via a callback function.
LLCAS_PUBLIC void llcas_actioncache_put_for_digest_async(llcas_cas_t, llcas_digest_t key, llcas_objectid_t value, bool globally, void *ctx_cb, llcas_actioncache_put_cb, llcas_cancellable_t *cancel_tok)
Like llcas_actioncache_put_for_digest but result is provided to a callback function.
LLCAS_PUBLIC void llcas_cas_options_set_client_version(llcas_cas_options_t, unsigned major, unsigned minor)
Receives the LLCAS_VERSION_MAJOR and LLCAS_VERSION_MINOR values that the client was compiled with.
LLCAS_PUBLIC llcas_lookup_result_t llcas_cas_contains_object(llcas_cas_t, llcas_objectid_t, bool globally, char **error)
Checks whether a llcas_objectid_t points to an existing object.
LLCAS_PUBLIC bool llcas_actioncache_put_for_digest(llcas_cas_t, llcas_digest_t key, llcas_objectid_t value, bool globally, char **error)
Associates a llcas_objectid_t value with a key.
LLCAS_PUBLIC llcas_lookup_result_t llcas_cas_load_object(llcas_cas_t, llcas_objectid_t, llcas_loaded_object_t *, char **error)
Loads the object that llcas_objectid_t points to.
LLCAS_PUBLIC bool llcas_cas_get_objectid(llcas_cas_t, llcas_digest_t digest, llcas_objectid_t *p_id, char **error)
Provides the llcas_objectid_t value for the given llcas_digest_t.
LLCAS_PUBLIC llcas_digest_t llcas_objectid_get_digest(llcas_cas_t, llcas_objectid_t)
LLCAS_PUBLIC llcas_object_refs_t llcas_loaded_object_get_refs(llcas_cas_t, llcas_loaded_object_t)
LLCAS_PUBLIC llcas_data_t llcas_loaded_object_get_data(llcas_cas_t, llcas_loaded_object_t)
LLCAS_PUBLIC bool llcas_cas_set_ondisk_size_limit(llcas_cas_t, int64_t size_limit, char **error)
Set the size for limiting disk storage growth.
LLCAS_PUBLIC void llcas_cancellable_cancel(llcas_cancellable_t)
Cancels the asynchronous query associated with the llcas_cancellable_t.
LLCAS_PUBLIC void llcas_cas_options_dispose(llcas_cas_options_t)
LLCAS_PUBLIC bool llcas_cas_options_set_option(llcas_cas_options_t, const char *name, const char *value, char **error)
Receives a name/value strings pair, for the plugin to set as a custom option it supports.
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.
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.
Data buffer for stored CAS objects.
Object references for a CAS object.
Identifier for a CAS object.