Update dict (vtype_variable)
This commit is contained in:
+10
-10
@@ -7,7 +7,7 @@
|
||||
#ifndef LIBCDSB_DICT_H
|
||||
#define LIBCDSB_DICT_H
|
||||
|
||||
typedef int (*dict_access_callback)(const void* key, vtype key_type, void* value, vtype value_type, void* data);
|
||||
typedef int (*dict_access_callback)(vtype_variable key, vtype_variable value, void* data);
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
@@ -17,10 +17,10 @@ inline void dict_init(vtype_dict* x) { x->nodes = (void*)(x->capacity = x->size
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
#define dict_pop(x, key, data, callback) libcdsb_dict_find (x, _LIBCDSB_value_pointer(key), _LIBCDSB_vtypeof(key), data, callback, 1)
|
||||
#define dict_get(x, key, data, callback) libcdsb_dict_find (x, _LIBCDSB_value_pointer(key), _LIBCDSB_vtypeof(key), data, callback, 0)
|
||||
#define dict_update(x, key, value) libcdsb_dict_update (x, _LIBCDSB_value_pointer(key), _LIBCDSB_vtypeof(key), _LIBCDSB_value_pointer(value), _LIBCDSB_vtypeof(value), 0, 0)
|
||||
#define dict_inject(x, key, value) libcdsb_dict_inject (x, _LIBCDSB_value_pointer(key), _LIBCDSB_vtypeof(key), _LIBCDSB_value_pointer(value), _LIBCDSB_vtypeof(value), 0, 0)
|
||||
#define dict_pop(x, key, data, callback) libcdsb_dict_find (x, libcdsb_variable_build(_LIBCDSB_value_pointer(key), _LIBCDSB_vtypeof(key)), data, callback, 1)
|
||||
#define dict_get(x, key, data, callback) libcdsb_dict_find (x, libcdsb_variable_build(_LIBCDSB_value_pointer(key), _LIBCDSB_vtypeof(key)), data, callback, 0)
|
||||
#define dict_update(x, key, value) libcdsb_dict_update (x, libcdsb_variable_build(_LIBCDSB_value_pointer(key), _LIBCDSB_vtypeof(key)), libcdsb_variable_build(_LIBCDSB_value_pointer(value), _LIBCDSB_vtypeof(value)), 0, 0)
|
||||
#define dict_inject(x, key, value) libcdsb_dict_inject (x, libcdsb_variable_build(_LIBCDSB_value_pointer(key), _LIBCDSB_vtypeof(key)), libcdsb_variable_build(_LIBCDSB_value_pointer(value), _LIBCDSB_vtypeof(value)), 0, 0)
|
||||
#define dict_foreach(x, data, callback) libcdsb_dict_foreach (x, data, callback, 0)
|
||||
#define dict_remove(x, key) dict_pop (x, key, 0, 0)
|
||||
|
||||
@@ -28,10 +28,10 @@ inline void dict_init(vtype_dict* x) { x->nodes = (void*)(x->capacity = x->size
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
extern bool libcdsb_dict_update (vtype_dict* x, const void* key, vtype key_type, const void* value, vtype value_type, void* data, dict_access_callback) Nonnull__(1);
|
||||
extern bool libcdsb_dict_inject (vtype_dict* x, const void* key, vtype key_type, const void* value, vtype value_type, void* data, dict_access_callback) Nonnull__(1);
|
||||
extern int libcdsb_dict_find (vtype_dict* x, const void* key, vtype key_type, void* data, dict_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_dict_foreach (vtype_dict* x, void* data, dict_access_callback, bool flush) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_shrink_to_fit(vtype_dict* x) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update (vtype_dict* x, vtype_variable key, vtype_variable value, void* data, dict_access_callback) Nonnull__(1);
|
||||
extern bool libcdsb_dict_inject (vtype_dict* x, vtype_variable key, vtype_variable value, void* data, dict_access_callback) Nonnull__(1);
|
||||
extern int libcdsb_dict_find (vtype_dict* x, vtype_variable key, void* data, dict_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_dict_foreach (vtype_dict* x, void* data, dict_access_callback, bool flush) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_shrink_to_fit(vtype_dict* x) Nonnull__(1);
|
||||
|
||||
#endif /* LIBCDSB_DICT_H */
|
||||
|
||||
Reference in New Issue
Block a user