mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-15 04:54:14 +02:00
Python wrappers for the disk cache methods
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
#include "data-types.h"
|
||||
|
||||
PyObject* create_disk_cache(void);
|
||||
bool add_to_disk_cache(PyObject *self, const void *key, size_t key_sz, const uint8_t *data, size_t data_sz);
|
||||
bool add_to_disk_cache(PyObject *self, const void *key, size_t key_sz, const void *data, size_t data_sz);
|
||||
bool remove_from_disk_cache(PyObject *self_, const void *key, size_t key_sz);
|
||||
bool read_from_disk_cache(PyObject *self_, const void *key, size_t key_sz, uint8_t **data, size_t *data_sz);
|
||||
void* read_from_disk_cache(PyObject *self_, const void *key, size_t key_sz, void*(allocator)(void*, size_t), void*);
|
||||
static inline void* disk_cache_malloc_allocator(void *x UNUSED, size_t sz) { return malloc(sz); }
|
||||
static inline void* read_from_disk_cache_simple(PyObject *self_, const void *key, size_t key_sz) { return read_from_disk_cache(self_, key, key_sz, disk_cache_malloc_allocator, NULL); }
|
||||
|
||||
Reference in New Issue
Block a user