GALANTHUS / ABI FUNCTION REFERENCE
gln_remove_local_cache
Declared in <galanthus/c_api/gln_capi.h>.
GLN_API gln_status_t GLN_CALL gln_remove_local_cache(
const char* in_cache_path,
const char* in_key_path_or_null,
int* out_removed_or_null,
gln_error_t* out_error);
Purpose
Removes one local-cache payload and its matching protected-key sidecar.
Use this helper when a profile cache is reset so encrypted payload and sidecar key lifecycle stay paired.
Nullable parameter slots (in_key_path_or_null, out_removed_or_null, out_error) may be passed as NULL; all other non-value parameters follow the nullability shown in the table.
Return
Returns GLN_OK on success and a non-OK gln_status_t value on failure.
| Type | Nullability | Ownership |
|---|---|---|
gln_status_t | value | value |
Parameters
| Name | Direction | Type | Nullability | Ownership |
|---|---|---|---|---|
in_cache_path | input | const char* | nonnull | borrowed |
in_key_path_or_null | input | const char* | nullable | borrowed |
out_removed_or_null | output | int* | nullable | caller_allocated_output |
out_error | output | gln_error_t* | nullable | caller_allocated_output |
Remove Semantics
The function removes both in_cache_path and the matching sidecar key path. When in_key_path_or_null is supplied, that custom sidecar path is removed; otherwise the Galanthus default sidecar path is removed.
out_removed_or_null, when supplied, receives nonzero if either file existed and was removed and zero when neither file existed.
Failure Cases
The call returns GLN_ERR_INVALID_ARG when in_cache_path is NULL or empty. Filesystem failures while removing either path return a non-OK status.