JULEA
jkv.h
Go to the documentation of this file.
1 /*
2  * JULEA - Flexible storage framework
3  * Copyright (C) 2017-2024 Michael Kuhn
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
23 #ifndef JULEA_KV_KV_H
24 #define JULEA_KV_KV_H
25 
26 #if !defined(JULEA_KV_H) && !defined(JULEA_KV_COMPILATION)
27 #error "Only <julea-kv.h> can be included directly."
28 #endif
29 
30 #include <glib.h>
31 
32 #include <julea.h>
33 
34 G_BEGIN_DECLS
35 
44 struct JKV;
45 
46 typedef struct JKV JKV;
47 
53 typedef void (*JKVGetFunc)(gpointer, guint32, gpointer);
54 
69 JKV* j_kv_new(gchar const* namespace, gchar const* key);
70 
86 JKV* j_kv_new_for_index(guint32 index, gchar const* namespace, gchar const* key);
87 
101 JKV* j_kv_ref(JKV* kv);
102 
112 void j_kv_unref(JKV* kv);
113 
114 G_DEFINE_AUTOPTR_CLEANUP_FUNC(JKV, j_kv_unref)
115 
116 
128 void j_kv_put(JKV* kv, gpointer value, guint32 value_len, GDestroyNotify value_destroy, JBatch* batch);
129 
139 void j_kv_delete(JKV* kv, JBatch* batch);
140 
152 void j_kv_get(JKV* kv, gpointer* value, guint32* value_len, JBatch* batch);
153 
165 void j_kv_get_callback(JKV* kv, JKVGetFunc func, gpointer data, JBatch* batch);
166 
171 G_END_DECLS
172 
173 #endif
void j_kv_put(JKV *kv, gpointer value, guint32 value_len, GDestroyNotify value_destroy, JBatch *batch)
Definition: jkv.c:594
void j_kv_delete(JKV *kv, JBatch *batch)
Definition: jkv.c:620
JKV * j_kv_new_for_index(guint32 index, gchar const *namespace, gchar const *key)
Definition: jkv.c:545
JKV * j_kv_ref(JKV *kv)
Definition: jkv.c:566
void j_kv_get_callback(JKV *kv, JKVGetFunc func, gpointer data, JBatch *batch)
Definition: jkv.c:664
void j_kv_get(JKV *kv, gpointer *value, guint32 *value_len, JBatch *batch)
Definition: jkv.c:638
JKV * j_kv_new(gchar const *namespace, gchar const *key)
Definition: jkv.c:525
void(* JKVGetFunc)(gpointer, guint32, gpointer)
Definition: jkv.h:53
void j_kv_unref(JKV *kv)
Definition: jkv.c:578
Definition: jbatch.c:49
Definition: jkv.c:69
gchar * key
Definition: jkv.c:78
guint32 index
Definition: jkv.c:73