Refactor map, add attaching functional

This commit is contained in:
Gregory Lirent 2022-08-19 18:46:51 +03:00
parent b789b133e2
commit 36f03d3d23
15 changed files with 353 additions and 1242 deletions

View File

@ -4,7 +4,7 @@
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include "../include/extra/map.h"
#include "../include/map.h"
typedef vtype_map map_t;
@ -34,20 +34,24 @@ int main(int argc, char** argv) {
map_t map;
vtype_float fl = 0.0;
int a, b;
map_init(&map, VTYPE_INT32);
for (size_t i = 0; i < 28; ++i) {
for (vtype_int32 i = 0; i < 28; ++i) {
if (i%2) {
map_update(&map, i, (vtype_int32)i);
map_update(&map, i, i);
} else {
map_update(&map, i, (vtype_float)fl);
map_update(&map, i, fl);
fl += 0.05;
}
}
map_get(&map, 13, "Get value:", print_value);
map_pop(&map, 18, "Pop value:", print_value);
a = 13;
b = 18;
map_get(&map, a, "Get value:", print_value);
map_pop(&map, b, "Pop value:", print_value);
map_foreach(&map, "Foreach loop:", print_value);

View File

@ -1,42 +0,0 @@
/* This software is licensed by the MIT License, see LICENSE file */
/* Copyright © 2022 Gregory Lirent */
#include "../map.h"
#ifndef LIBCDSB_EXTRA_MAP_H
#define LIBCDSB_EXTRA_MAP_H
#define map_foreach(x, data, callback) libcdsb_map_foreach(x, data, callback, 0)
extern bool libcdsb_map_update (vtype_map* x, const void* key, vtype key_type, const void* value, vtype value_type) Nonnull__(1);
extern int libcdsb_map_find (vtype_map* x, const void* key, vtype key_type, void* data, map_access_callback, bool cut) Nonnull__(1);
extern int libcdsb_map_foreach(vtype_map* x, void* data, map_access_callback, bool flush) Nonnull__(1,3);
#endif /* LIBCDSB_EXTRA_MAP_H */
#if defined(LIBCDSB_SET_H) && !defined(LIBCDSB_EXTRA_MAP_H_EXT)
#define LIBCDSB_EXTRA_MAP_H_EXT
#define map_copy_keys(s) _Generic((s),\
const vtype_map*: vset_copy, vtype_map*: vset_copy,\
const void*: vset_copy, void*: vset_copy\
)((set_t*)(s))
#define map_duplicate_keys(s) _Generic((s),\
const vtype_map*: vset_duplicate, vtype_map*: vset_duplicate,\
const void*: vset_duplicate, void*: vset_duplicate\
)((set_t*)(s))
#define map_copy_init_keys(x, s) _Generic((x),\
vtype_set*: _Generic((s),\
const vtype_map*: vset_copy_init, vtype_map*: vset_copy_init,\
const void*: vset_copy_init, void*: vset_copy_init\
),\
void*: _Generic((s),\
const vtype_map*: vset_copy_init, vtype_map*: vset_copy_init,\
const void*: vset_copy_init, void*: vset_copy_init\
)\
)((x), (set_t*)(s))
#endif /* LIBCDSB_EXTRA_MAP_H_EXT */

View File

@ -7,460 +7,28 @@
#ifndef LIBCDSB_MAP_H
#define LIBCDSB_MAP_H
/*#####################################################################################################################*/
typedef int (*map_access_callback)(const void* key, vtype key_type, void* value, vtype value_type, void* data);
/*#####################################################################################################################*/
extern void map_init(vtype_map* x, vtype key_type) Nonnull__(1);
#define map_pop(x, key, data, callback) _LIBCDSB_Generic (libcdsb_map, find, key)(x, key, data, callback, 1)
#define map_get(x, key, data, callback) _LIBCDSB_Generic (libcdsb_map, find, key)(x, key, data, callback, 0)
#define map_update(x, key, value) _LIBCDSB_Generic2(libcdsb_map, update, key, value)(x, key, value)
#define map_remove(x, key) map_pop(x, key, 0, 0)
/*#####################################################################################################################*/
#define in_map(x, key) (map_get(&x, key, 0, 0) == 0)
#define map_pop(x, key, data, callback) libcdsb_map_find (x, _LIBCDSB_value_pointer(key), _LIBCDSB_vtypeof(key), data, callback, 1)
#define map_get(x, key, data, callback) libcdsb_map_find (x, _LIBCDSB_value_pointer(key), _LIBCDSB_vtypeof(key), data, callback, 0)
#define map_update(x, key, value) libcdsb_map_update (x, _LIBCDSB_value_pointer(key), _LIBCDSB_vtypeof(key), _LIBCDSB_value_pointer(value), _LIBCDSB_vtypeof(value))
#define map_inject(x, key, value) libcdsb_map_inject (x, _LIBCDSB_value_pointer(key), _LIBCDSB_vtypeof(key), _LIBCDSB_value_pointer(value), _LIBCDSB_vtypeof(value))
#define map_foreach(x, data, callback) libcdsb_map_foreach (x, data, callback, 0)
#define map_remove(x, key) map_pop (x, key, 0, 0)
#define in_map(x, key) (map_get(x, key, 0, 0) == 0)
/*#####################################################################################################################*/
extern int libcdsb_map_find_pointer(vtype_map* x, const void* key, void* data, map_access_callback, bool cut) Nonnull__(1);
extern int libcdsb_map_find_cstring(vtype_map* x, const char* key, void* data, map_access_callback, bool cut) Nonnull__(1,2);
extern int libcdsb_map_find_string (vtype_map* x, const vtype_string* key, void* data, map_access_callback, bool cut) Nonnull__(1,2);
extern int libcdsb_map_find_array (vtype_map* x, const vtype_array* key, void* data, map_access_callback, bool cut) Nonnull__(1,2);
extern int libcdsb_map_find_list (vtype_map* x, const vtype_list* key, void* data, map_access_callback, bool cut) Nonnull__(1,2);
extern int libcdsb_map_find_map (vtype_map* x, const vtype_map* key, void* data, map_access_callback, bool cut) Nonnull__(1,2);
extern int libcdsb_map_find_vset (vtype_map* x, const vtype_set* key, void* data, map_access_callback, bool cut) Nonnull__(1,2);
extern int libcdsb_map_find_dict (vtype_map* x, const vtype_dict* key, void* data, map_access_callback, bool cut) Nonnull__(1,2);
extern int libcdsb_map_find_boolean(vtype_map* x, vtype_bool key, void* data, map_access_callback, bool cut) Nonnull__(1);
extern int libcdsb_map_find_int8 (vtype_map* x, vtype_int8 key, void* data, map_access_callback, bool cut) Nonnull__(1);
extern int libcdsb_map_find_int16 (vtype_map* x, vtype_int16 key, void* data, map_access_callback, bool cut) Nonnull__(1);
extern int libcdsb_map_find_int32 (vtype_map* x, vtype_int32 key, void* data, map_access_callback, bool cut) Nonnull__(1);
extern int libcdsb_map_find_int64 (vtype_map* x, vtype_int64 key, void* data, map_access_callback, bool cut) Nonnull__(1);
extern int libcdsb_map_find_uint8 (vtype_map* x, vtype_uint8 key, void* data, map_access_callback, bool cut) Nonnull__(1);
extern int libcdsb_map_find_uint16 (vtype_map* x, vtype_uint16 key, void* data, map_access_callback, bool cut) Nonnull__(1);
extern int libcdsb_map_find_uint32 (vtype_map* x, vtype_uint32 key, void* data, map_access_callback, bool cut) Nonnull__(1);
extern int libcdsb_map_find_uint64 (vtype_map* x, vtype_uint64 key, void* data, map_access_callback, bool cut) Nonnull__(1);
extern int libcdsb_map_find_float (vtype_map* x, vtype_float key, void* data, map_access_callback, bool cut) Nonnull__(1);
extern int libcdsb_map_find_double (vtype_map* x, vtype_double key, void* data, map_access_callback, bool cut) Nonnull__(1);
extern int libcdsb_map_find_ldouble(vtype_map* x, vtype_ldouble key, void* data, map_access_callback, bool cut) Nonnull__(1);
extern bool libcdsb_map_update_pointer_pointer(vtype_map* x, const void* key, const void* value) Nonnull__(1);
extern bool libcdsb_map_update_pointer_cstring(vtype_map* x, const void* key, const char* value) Nonnull__(1,3);
extern bool libcdsb_map_update_pointer_string (vtype_map* x, const void* key, const vtype_string* value) Nonnull__(1,3);
extern bool libcdsb_map_update_pointer_array (vtype_map* x, const void* key, const vtype_array* value) Nonnull__(1,3);
extern bool libcdsb_map_update_pointer_list (vtype_map* x, const void* key, const vtype_list* value) Nonnull__(1,3);
extern bool libcdsb_map_update_pointer_map (vtype_map* x, const void* key, const vtype_map* value) Nonnull__(1,3);
extern bool libcdsb_map_update_pointer_vset (vtype_map* x, const void* key, const vtype_set* value) Nonnull__(1,3);
extern bool libcdsb_map_update_pointer_dict (vtype_map* x, const void* key, const vtype_dict* value) Nonnull__(1,3);
extern bool libcdsb_map_update_pointer_boolean(vtype_map* x, const void* key, vtype_bool value) Nonnull__(1);
extern bool libcdsb_map_update_pointer_int8 (vtype_map* x, const void* key, vtype_int8 value) Nonnull__(1);
extern bool libcdsb_map_update_pointer_int16 (vtype_map* x, const void* key, vtype_int16 value) Nonnull__(1);
extern bool libcdsb_map_update_pointer_int32 (vtype_map* x, const void* key, vtype_int32 value) Nonnull__(1);
extern bool libcdsb_map_update_pointer_int64 (vtype_map* x, const void* key, vtype_int64 value) Nonnull__(1);
extern bool libcdsb_map_update_pointer_uint8 (vtype_map* x, const void* key, vtype_uint8 value) Nonnull__(1);
extern bool libcdsb_map_update_pointer_uint16 (vtype_map* x, const void* key, vtype_uint16 value) Nonnull__(1);
extern bool libcdsb_map_update_pointer_uint32 (vtype_map* x, const void* key, vtype_uint32 value) Nonnull__(1);
extern bool libcdsb_map_update_pointer_uint64 (vtype_map* x, const void* key, vtype_uint64 value) Nonnull__(1);
extern bool libcdsb_map_update_pointer_float (vtype_map* x, const void* key, vtype_float value) Nonnull__(1);
extern bool libcdsb_map_update_pointer_double (vtype_map* x, const void* key, vtype_double value) Nonnull__(1);
extern bool libcdsb_map_update_pointer_ldouble(vtype_map* x, const void* key, vtype_ldouble value) Nonnull__(1);
extern bool libcdsb_map_update_cstring_pointer(vtype_map* x, const char* key, const void* value) Nonnull__(1,2);
extern bool libcdsb_map_update_cstring_cstring(vtype_map* x, const char* key, const char* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_cstring_string (vtype_map* x, const char* key, const vtype_string* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_cstring_array (vtype_map* x, const char* key, const vtype_array* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_cstring_list (vtype_map* x, const char* key, const vtype_list* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_cstring_map (vtype_map* x, const char* key, const vtype_map* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_cstring_vset (vtype_map* x, const char* key, const vtype_set* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_cstring_dict (vtype_map* x, const char* key, const vtype_dict* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_cstring_boolean(vtype_map* x, const char* key, vtype_bool value) Nonnull__(1,2);
extern bool libcdsb_map_update_cstring_int8 (vtype_map* x, const char* key, vtype_int8 value) Nonnull__(1,2);
extern bool libcdsb_map_update_cstring_int16 (vtype_map* x, const char* key, vtype_int16 value) Nonnull__(1,2);
extern bool libcdsb_map_update_cstring_int32 (vtype_map* x, const char* key, vtype_int32 value) Nonnull__(1,2);
extern bool libcdsb_map_update_cstring_int64 (vtype_map* x, const char* key, vtype_int64 value) Nonnull__(1,2);
extern bool libcdsb_map_update_cstring_uint8 (vtype_map* x, const char* key, vtype_uint8 value) Nonnull__(1,2);
extern bool libcdsb_map_update_cstring_uint16 (vtype_map* x, const char* key, vtype_uint16 value) Nonnull__(1,2);
extern bool libcdsb_map_update_cstring_uint32 (vtype_map* x, const char* key, vtype_uint32 value) Nonnull__(1,2);
extern bool libcdsb_map_update_cstring_uint64 (vtype_map* x, const char* key, vtype_uint64 value) Nonnull__(1,2);
extern bool libcdsb_map_update_cstring_float (vtype_map* x, const char* key, vtype_float value) Nonnull__(1,2);
extern bool libcdsb_map_update_cstring_double (vtype_map* x, const char* key, vtype_double value) Nonnull__(1,2);
extern bool libcdsb_map_update_cstring_ldouble(vtype_map* x, const char* key, vtype_ldouble value) Nonnull__(1,2);
extern bool libcdsb_map_update_string_pointer(vtype_map* x, const vtype_string* key, const void* value) Nonnull__(1,2);
extern bool libcdsb_map_update_string_cstring(vtype_map* x, const vtype_string* key, const char* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_string_string (vtype_map* x, const vtype_string* key, const vtype_string* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_string_array (vtype_map* x, const vtype_string* key, const vtype_array* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_string_list (vtype_map* x, const vtype_string* key, const vtype_list* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_string_map (vtype_map* x, const vtype_string* key, const vtype_map* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_string_vset (vtype_map* x, const vtype_string* key, const vtype_set* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_string_dict (vtype_map* x, const vtype_string* key, const vtype_dict* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_string_boolean(vtype_map* x, const vtype_string* key, vtype_bool value) Nonnull__(1,2);
extern bool libcdsb_map_update_string_int8 (vtype_map* x, const vtype_string* key, vtype_int8 value) Nonnull__(1,2);
extern bool libcdsb_map_update_string_int16 (vtype_map* x, const vtype_string* key, vtype_int16 value) Nonnull__(1,2);
extern bool libcdsb_map_update_string_int32 (vtype_map* x, const vtype_string* key, vtype_int32 value) Nonnull__(1,2);
extern bool libcdsb_map_update_string_int64 (vtype_map* x, const vtype_string* key, vtype_int64 value) Nonnull__(1,2);
extern bool libcdsb_map_update_string_uint8 (vtype_map* x, const vtype_string* key, vtype_uint8 value) Nonnull__(1,2);
extern bool libcdsb_map_update_string_uint16 (vtype_map* x, const vtype_string* key, vtype_uint16 value) Nonnull__(1,2);
extern bool libcdsb_map_update_string_uint32 (vtype_map* x, const vtype_string* key, vtype_uint32 value) Nonnull__(1,2);
extern bool libcdsb_map_update_string_uint64 (vtype_map* x, const vtype_string* key, vtype_uint64 value) Nonnull__(1,2);
extern bool libcdsb_map_update_string_float (vtype_map* x, const vtype_string* key, vtype_float value) Nonnull__(1,2);
extern bool libcdsb_map_update_string_double (vtype_map* x, const vtype_string* key, vtype_double value) Nonnull__(1,2);
extern bool libcdsb_map_update_string_ldouble(vtype_map* x, const vtype_string* key, vtype_ldouble value) Nonnull__(1,2);
extern bool libcdsb_map_update_array_pointer(vtype_map* x, const vtype_array* key, const void* value) Nonnull__(1,2);
extern bool libcdsb_map_update_array_cstring(vtype_map* x, const vtype_array* key, const char* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_array_string (vtype_map* x, const vtype_array* key, const vtype_string* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_array_array (vtype_map* x, const vtype_array* key, const vtype_array* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_array_list (vtype_map* x, const vtype_array* key, const vtype_list* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_array_map (vtype_map* x, const vtype_array* key, const vtype_map* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_array_vset (vtype_map* x, const vtype_array* key, const vtype_set* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_array_dict (vtype_map* x, const vtype_array* key, const vtype_dict* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_array_boolean(vtype_map* x, const vtype_array* key, vtype_bool value) Nonnull__(1,2);
extern bool libcdsb_map_update_array_int8 (vtype_map* x, const vtype_array* key, vtype_int8 value) Nonnull__(1,2);
extern bool libcdsb_map_update_array_int16 (vtype_map* x, const vtype_array* key, vtype_int16 value) Nonnull__(1,2);
extern bool libcdsb_map_update_array_int32 (vtype_map* x, const vtype_array* key, vtype_int32 value) Nonnull__(1,2);
extern bool libcdsb_map_update_array_int64 (vtype_map* x, const vtype_array* key, vtype_int64 value) Nonnull__(1,2);
extern bool libcdsb_map_update_array_uint8 (vtype_map* x, const vtype_array* key, vtype_uint8 value) Nonnull__(1,2);
extern bool libcdsb_map_update_array_uint16 (vtype_map* x, const vtype_array* key, vtype_uint16 value) Nonnull__(1,2);
extern bool libcdsb_map_update_array_uint32 (vtype_map* x, const vtype_array* key, vtype_uint32 value) Nonnull__(1,2);
extern bool libcdsb_map_update_array_uint64 (vtype_map* x, const vtype_array* key, vtype_uint64 value) Nonnull__(1,2);
extern bool libcdsb_map_update_array_float (vtype_map* x, const vtype_array* key, vtype_float value) Nonnull__(1,2);
extern bool libcdsb_map_update_array_double (vtype_map* x, const vtype_array* key, vtype_double value) Nonnull__(1,2);
extern bool libcdsb_map_update_array_ldouble(vtype_map* x, const vtype_array* key, vtype_ldouble value) Nonnull__(1,2);
extern bool libcdsb_map_update_list_pointer(vtype_map* x, const vtype_list* key, const void* value) Nonnull__(1,2);
extern bool libcdsb_map_update_list_cstring(vtype_map* x, const vtype_list* key, const char* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_list_string (vtype_map* x, const vtype_list* key, const vtype_string* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_list_array (vtype_map* x, const vtype_list* key, const vtype_array* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_list_list (vtype_map* x, const vtype_list* key, const vtype_list* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_list_map (vtype_map* x, const vtype_list* key, const vtype_map* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_list_vset (vtype_map* x, const vtype_list* key, const vtype_set* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_list_dict (vtype_map* x, const vtype_list* key, const vtype_dict* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_list_boolean(vtype_map* x, const vtype_list* key, vtype_bool value) Nonnull__(1,2);
extern bool libcdsb_map_update_list_int8 (vtype_map* x, const vtype_list* key, vtype_int8 value) Nonnull__(1,2);
extern bool libcdsb_map_update_list_int16 (vtype_map* x, const vtype_list* key, vtype_int16 value) Nonnull__(1,2);
extern bool libcdsb_map_update_list_int32 (vtype_map* x, const vtype_list* key, vtype_int32 value) Nonnull__(1,2);
extern bool libcdsb_map_update_list_int64 (vtype_map* x, const vtype_list* key, vtype_int64 value) Nonnull__(1,2);
extern bool libcdsb_map_update_list_uint8 (vtype_map* x, const vtype_list* key, vtype_uint8 value) Nonnull__(1,2);
extern bool libcdsb_map_update_list_uint16 (vtype_map* x, const vtype_list* key, vtype_uint16 value) Nonnull__(1,2);
extern bool libcdsb_map_update_list_uint32 (vtype_map* x, const vtype_list* key, vtype_uint32 value) Nonnull__(1,2);
extern bool libcdsb_map_update_list_uint64 (vtype_map* x, const vtype_list* key, vtype_uint64 value) Nonnull__(1,2);
extern bool libcdsb_map_update_list_float (vtype_map* x, const vtype_list* key, vtype_float value) Nonnull__(1,2);
extern bool libcdsb_map_update_list_double (vtype_map* x, const vtype_list* key, vtype_double value) Nonnull__(1,2);
extern bool libcdsb_map_update_list_ldouble(vtype_map* x, const vtype_list* key, vtype_ldouble value) Nonnull__(1,2);
extern bool libcdsb_map_update_map_pointer(vtype_map* x, const vtype_map* key, const void* value) Nonnull__(1,2);
extern bool libcdsb_map_update_map_cstring(vtype_map* x, const vtype_map* key, const char* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_map_string (vtype_map* x, const vtype_map* key, const vtype_string* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_map_array (vtype_map* x, const vtype_map* key, const vtype_array* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_map_list (vtype_map* x, const vtype_map* key, const vtype_list* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_map_map (vtype_map* x, const vtype_map* key, const vtype_map* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_map_vset (vtype_map* x, const vtype_map* key, const vtype_set* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_map_dict (vtype_map* x, const vtype_map* key, const vtype_dict* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_map_boolean(vtype_map* x, const vtype_map* key, vtype_bool value) Nonnull__(1,2);
extern bool libcdsb_map_update_map_int8 (vtype_map* x, const vtype_map* key, vtype_int8 value) Nonnull__(1,2);
extern bool libcdsb_map_update_map_int16 (vtype_map* x, const vtype_map* key, vtype_int16 value) Nonnull__(1,2);
extern bool libcdsb_map_update_map_int32 (vtype_map* x, const vtype_map* key, vtype_int32 value) Nonnull__(1,2);
extern bool libcdsb_map_update_map_int64 (vtype_map* x, const vtype_map* key, vtype_int64 value) Nonnull__(1,2);
extern bool libcdsb_map_update_map_uint8 (vtype_map* x, const vtype_map* key, vtype_uint8 value) Nonnull__(1,2);
extern bool libcdsb_map_update_map_uint16 (vtype_map* x, const vtype_map* key, vtype_uint16 value) Nonnull__(1,2);
extern bool libcdsb_map_update_map_uint32 (vtype_map* x, const vtype_map* key, vtype_uint32 value) Nonnull__(1,2);
extern bool libcdsb_map_update_map_uint64 (vtype_map* x, const vtype_map* key, vtype_uint64 value) Nonnull__(1,2);
extern bool libcdsb_map_update_map_float (vtype_map* x, const vtype_map* key, vtype_float value) Nonnull__(1,2);
extern bool libcdsb_map_update_map_double (vtype_map* x, const vtype_map* key, vtype_double value) Nonnull__(1,2);
extern bool libcdsb_map_update_map_ldouble(vtype_map* x, const vtype_map* key, vtype_ldouble value) Nonnull__(1,2);
extern bool libcdsb_map_update_vset_pointer(vtype_map* x, const vtype_set* key, const void* value) Nonnull__(1,2);
extern bool libcdsb_map_update_vset_cstring(vtype_map* x, const vtype_set* key, const char* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_vset_string (vtype_map* x, const vtype_set* key, const vtype_string* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_vset_array (vtype_map* x, const vtype_set* key, const vtype_array* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_vset_list (vtype_map* x, const vtype_set* key, const vtype_list* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_vset_map (vtype_map* x, const vtype_set* key, const vtype_map* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_vset_vset (vtype_map* x, const vtype_set* key, const vtype_set* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_vset_dict (vtype_map* x, const vtype_set* key, const vtype_dict* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_vset_boolean(vtype_map* x, const vtype_set* key, vtype_bool value) Nonnull__(1,2);
extern bool libcdsb_map_update_vset_int8 (vtype_map* x, const vtype_set* key, vtype_int8 value) Nonnull__(1,2);
extern bool libcdsb_map_update_vset_int16 (vtype_map* x, const vtype_set* key, vtype_int16 value) Nonnull__(1,2);
extern bool libcdsb_map_update_vset_int32 (vtype_map* x, const vtype_set* key, vtype_int32 value) Nonnull__(1,2);
extern bool libcdsb_map_update_vset_int64 (vtype_map* x, const vtype_set* key, vtype_int64 value) Nonnull__(1,2);
extern bool libcdsb_map_update_vset_uint8 (vtype_map* x, const vtype_set* key, vtype_uint8 value) Nonnull__(1,2);
extern bool libcdsb_map_update_vset_uint16 (vtype_map* x, const vtype_set* key, vtype_uint16 value) Nonnull__(1,2);
extern bool libcdsb_map_update_vset_uint32 (vtype_map* x, const vtype_set* key, vtype_uint32 value) Nonnull__(1,2);
extern bool libcdsb_map_update_vset_uint64 (vtype_map* x, const vtype_set* key, vtype_uint64 value) Nonnull__(1,2);
extern bool libcdsb_map_update_vset_float (vtype_map* x, const vtype_set* key, vtype_float value) Nonnull__(1,2);
extern bool libcdsb_map_update_vset_double (vtype_map* x, const vtype_set* key, vtype_double value) Nonnull__(1,2);
extern bool libcdsb_map_update_vset_ldouble(vtype_map* x, const vtype_set* key, vtype_ldouble value) Nonnull__(1,2);
extern bool libcdsb_map_update_dict_pointer(vtype_map* x, const vtype_dict* key, const void* value) Nonnull__(1,2);
extern bool libcdsb_map_update_dict_cstring(vtype_map* x, const vtype_dict* key, const char* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_dict_string (vtype_map* x, const vtype_dict* key, const vtype_string* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_dict_array (vtype_map* x, const vtype_dict* key, const vtype_array* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_dict_list (vtype_map* x, const vtype_dict* key, const vtype_list* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_dict_map (vtype_map* x, const vtype_dict* key, const vtype_map* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_dict_vset (vtype_map* x, const vtype_dict* key, const vtype_set* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_dict_dict (vtype_map* x, const vtype_dict* key, const vtype_dict* value) Nonnull__(1,2,3);
extern bool libcdsb_map_update_dict_boolean(vtype_map* x, const vtype_dict* key, vtype_bool value) Nonnull__(1,2);
extern bool libcdsb_map_update_dict_int8 (vtype_map* x, const vtype_dict* key, vtype_int8 value) Nonnull__(1,2);
extern bool libcdsb_map_update_dict_int16 (vtype_map* x, const vtype_dict* key, vtype_int16 value) Nonnull__(1,2);
extern bool libcdsb_map_update_dict_int32 (vtype_map* x, const vtype_dict* key, vtype_int32 value) Nonnull__(1,2);
extern bool libcdsb_map_update_dict_int64 (vtype_map* x, const vtype_dict* key, vtype_int64 value) Nonnull__(1,2);
extern bool libcdsb_map_update_dict_uint8 (vtype_map* x, const vtype_dict* key, vtype_uint8 value) Nonnull__(1,2);
extern bool libcdsb_map_update_dict_uint16 (vtype_map* x, const vtype_dict* key, vtype_uint16 value) Nonnull__(1,2);
extern bool libcdsb_map_update_dict_uint32 (vtype_map* x, const vtype_dict* key, vtype_uint32 value) Nonnull__(1,2);
extern bool libcdsb_map_update_dict_uint64 (vtype_map* x, const vtype_dict* key, vtype_uint64 value) Nonnull__(1,2);
extern bool libcdsb_map_update_dict_float (vtype_map* x, const vtype_dict* key, vtype_float value) Nonnull__(1,2);
extern bool libcdsb_map_update_dict_double (vtype_map* x, const vtype_dict* key, vtype_double value) Nonnull__(1,2);
extern bool libcdsb_map_update_dict_ldouble(vtype_map* x, const vtype_dict* key, vtype_ldouble value) Nonnull__(1,2);
extern bool libcdsb_map_update_boolean_pointer(vtype_map* x, vtype_bool key, const void* value) Nonnull__(1);
extern bool libcdsb_map_update_boolean_cstring(vtype_map* x, vtype_bool key, const char* value) Nonnull__(1,3);
extern bool libcdsb_map_update_boolean_string (vtype_map* x, vtype_bool key, const vtype_string* value) Nonnull__(1,3);
extern bool libcdsb_map_update_boolean_array (vtype_map* x, vtype_bool key, const vtype_array* value) Nonnull__(1,3);
extern bool libcdsb_map_update_boolean_list (vtype_map* x, vtype_bool key, const vtype_list* value) Nonnull__(1,3);
extern bool libcdsb_map_update_boolean_map (vtype_map* x, vtype_bool key, const vtype_map* value) Nonnull__(1,3);
extern bool libcdsb_map_update_boolean_vset (vtype_map* x, vtype_bool key, const vtype_set* value) Nonnull__(1,3);
extern bool libcdsb_map_update_boolean_dict (vtype_map* x, vtype_bool key, const vtype_dict* value) Nonnull__(1,3);
extern bool libcdsb_map_update_boolean_boolean(vtype_map* x, vtype_bool key, vtype_bool value) Nonnull__(1);
extern bool libcdsb_map_update_boolean_int8 (vtype_map* x, vtype_bool key, vtype_int8 value) Nonnull__(1);
extern bool libcdsb_map_update_boolean_int16 (vtype_map* x, vtype_bool key, vtype_int16 value) Nonnull__(1);
extern bool libcdsb_map_update_boolean_int32 (vtype_map* x, vtype_bool key, vtype_int32 value) Nonnull__(1);
extern bool libcdsb_map_update_boolean_int64 (vtype_map* x, vtype_bool key, vtype_int64 value) Nonnull__(1);
extern bool libcdsb_map_update_boolean_uint8 (vtype_map* x, vtype_bool key, vtype_uint8 value) Nonnull__(1);
extern bool libcdsb_map_update_boolean_uint16 (vtype_map* x, vtype_bool key, vtype_uint16 value) Nonnull__(1);
extern bool libcdsb_map_update_boolean_uint32 (vtype_map* x, vtype_bool key, vtype_uint32 value) Nonnull__(1);
extern bool libcdsb_map_update_boolean_uint64 (vtype_map* x, vtype_bool key, vtype_uint64 value) Nonnull__(1);
extern bool libcdsb_map_update_boolean_float (vtype_map* x, vtype_bool key, vtype_float value) Nonnull__(1);
extern bool libcdsb_map_update_boolean_double (vtype_map* x, vtype_bool key, vtype_double value) Nonnull__(1);
extern bool libcdsb_map_update_boolean_ldouble(vtype_map* x, vtype_bool key, vtype_ldouble value) Nonnull__(1);
extern bool libcdsb_map_update_uint8_pointer(vtype_map* x, vtype_uint8 key, const void* value) Nonnull__(1);
extern bool libcdsb_map_update_uint8_cstring(vtype_map* x, vtype_uint8 key, const char* value) Nonnull__(1,3);
extern bool libcdsb_map_update_uint8_string (vtype_map* x, vtype_uint8 key, const vtype_string* value) Nonnull__(1,3);
extern bool libcdsb_map_update_uint8_array (vtype_map* x, vtype_uint8 key, const vtype_array* value) Nonnull__(1,3);
extern bool libcdsb_map_update_uint8_list (vtype_map* x, vtype_uint8 key, const vtype_list* value) Nonnull__(1,3);
extern bool libcdsb_map_update_uint8_map (vtype_map* x, vtype_uint8 key, const vtype_map* value) Nonnull__(1,3);
extern bool libcdsb_map_update_uint8_vset (vtype_map* x, vtype_uint8 key, const vtype_set* value) Nonnull__(1,3);
extern bool libcdsb_map_update_uint8_dict (vtype_map* x, vtype_uint8 key, const vtype_dict* value) Nonnull__(1,3);
extern bool libcdsb_map_update_uint8_boolean(vtype_map* x, vtype_uint8 key, vtype_bool value) Nonnull__(1);
extern bool libcdsb_map_update_uint8_int8 (vtype_map* x, vtype_uint8 key, vtype_int8 value) Nonnull__(1);
extern bool libcdsb_map_update_uint8_int16 (vtype_map* x, vtype_uint8 key, vtype_int16 value) Nonnull__(1);
extern bool libcdsb_map_update_uint8_int32 (vtype_map* x, vtype_uint8 key, vtype_int32 value) Nonnull__(1);
extern bool libcdsb_map_update_uint8_int64 (vtype_map* x, vtype_uint8 key, vtype_int64 value) Nonnull__(1);
extern bool libcdsb_map_update_uint8_uint8 (vtype_map* x, vtype_uint8 key, vtype_uint8 value) Nonnull__(1);
extern bool libcdsb_map_update_uint8_uint16 (vtype_map* x, vtype_uint8 key, vtype_uint16 value) Nonnull__(1);
extern bool libcdsb_map_update_uint8_uint32 (vtype_map* x, vtype_uint8 key, vtype_uint32 value) Nonnull__(1);
extern bool libcdsb_map_update_uint8_uint64 (vtype_map* x, vtype_uint8 key, vtype_uint64 value) Nonnull__(1);
extern bool libcdsb_map_update_uint8_float (vtype_map* x, vtype_uint8 key, vtype_float value) Nonnull__(1);
extern bool libcdsb_map_update_uint8_double (vtype_map* x, vtype_uint8 key, vtype_double value) Nonnull__(1);
extern bool libcdsb_map_update_uint8_ldouble(vtype_map* x, vtype_uint8 key, vtype_ldouble value) Nonnull__(1);
extern bool libcdsb_map_update_uint16_pointer(vtype_map* x, vtype_uint16 key, const void* value) Nonnull__(1);
extern bool libcdsb_map_update_uint16_cstring(vtype_map* x, vtype_uint16 key, const char* value) Nonnull__(1,3);
extern bool libcdsb_map_update_uint16_string (vtype_map* x, vtype_uint16 key, const vtype_string* value) Nonnull__(1,3);
extern bool libcdsb_map_update_uint16_array (vtype_map* x, vtype_uint16 key, const vtype_array* value) Nonnull__(1,3);
extern bool libcdsb_map_update_uint16_list (vtype_map* x, vtype_uint16 key, const vtype_list* value) Nonnull__(1,3);
extern bool libcdsb_map_update_uint16_map (vtype_map* x, vtype_uint16 key, const vtype_map* value) Nonnull__(1,3);
extern bool libcdsb_map_update_uint16_vset (vtype_map* x, vtype_uint16 key, const vtype_set* value) Nonnull__(1,3);
extern bool libcdsb_map_update_uint16_dict (vtype_map* x, vtype_uint16 key, const vtype_dict* value) Nonnull__(1,3);
extern bool libcdsb_map_update_uint16_boolean(vtype_map* x, vtype_uint16 key, vtype_bool value) Nonnull__(1);
extern bool libcdsb_map_update_uint16_int8 (vtype_map* x, vtype_uint16 key, vtype_int8 value) Nonnull__(1);
extern bool libcdsb_map_update_uint16_int16 (vtype_map* x, vtype_uint16 key, vtype_int16 value) Nonnull__(1);
extern bool libcdsb_map_update_uint16_int32 (vtype_map* x, vtype_uint16 key, vtype_int32 value) Nonnull__(1);
extern bool libcdsb_map_update_uint16_int64 (vtype_map* x, vtype_uint16 key, vtype_int64 value) Nonnull__(1);
extern bool libcdsb_map_update_uint16_uint8 (vtype_map* x, vtype_uint16 key, vtype_uint8 value) Nonnull__(1);
extern bool libcdsb_map_update_uint16_uint16 (vtype_map* x, vtype_uint16 key, vtype_uint16 value) Nonnull__(1);
extern bool libcdsb_map_update_uint16_uint32 (vtype_map* x, vtype_uint16 key, vtype_uint32 value) Nonnull__(1);
extern bool libcdsb_map_update_uint16_uint64 (vtype_map* x, vtype_uint16 key, vtype_uint64 value) Nonnull__(1);
extern bool libcdsb_map_update_uint16_float (vtype_map* x, vtype_uint16 key, vtype_float value) Nonnull__(1);
extern bool libcdsb_map_update_uint16_double (vtype_map* x, vtype_uint16 key, vtype_double value) Nonnull__(1);
extern bool libcdsb_map_update_uint16_ldouble(vtype_map* x, vtype_uint16 key, vtype_ldouble value) Nonnull__(1);
extern bool libcdsb_map_update_uint32_pointer(vtype_map* x, vtype_uint32 key, const void* value) Nonnull__(1);
extern bool libcdsb_map_update_uint32_cstring(vtype_map* x, vtype_uint32 key, const char* value) Nonnull__(1,3);
extern bool libcdsb_map_update_uint32_string (vtype_map* x, vtype_uint32 key, const vtype_string* value) Nonnull__(1,3);
extern bool libcdsb_map_update_uint32_array (vtype_map* x, vtype_uint32 key, const vtype_array* value) Nonnull__(1,3);
extern bool libcdsb_map_update_uint32_list (vtype_map* x, vtype_uint32 key, const vtype_list* value) Nonnull__(1,3);
extern bool libcdsb_map_update_uint32_map (vtype_map* x, vtype_uint32 key, const vtype_map* value) Nonnull__(1,3);
extern bool libcdsb_map_update_uint32_vset (vtype_map* x, vtype_uint32 key, const vtype_set* value) Nonnull__(1,3);
extern bool libcdsb_map_update_uint32_dict (vtype_map* x, vtype_uint32 key, const vtype_dict* value) Nonnull__(1,3);
extern bool libcdsb_map_update_uint32_boolean(vtype_map* x, vtype_uint32 key, vtype_bool value) Nonnull__(1);
extern bool libcdsb_map_update_uint32_int8 (vtype_map* x, vtype_uint32 key, vtype_int8 value) Nonnull__(1);
extern bool libcdsb_map_update_uint32_int16 (vtype_map* x, vtype_uint32 key, vtype_int16 value) Nonnull__(1);
extern bool libcdsb_map_update_uint32_int32 (vtype_map* x, vtype_uint32 key, vtype_int32 value) Nonnull__(1);
extern bool libcdsb_map_update_uint32_int64 (vtype_map* x, vtype_uint32 key, vtype_int64 value) Nonnull__(1);
extern bool libcdsb_map_update_uint32_uint8 (vtype_map* x, vtype_uint32 key, vtype_uint8 value) Nonnull__(1);
extern bool libcdsb_map_update_uint32_uint16 (vtype_map* x, vtype_uint32 key, vtype_uint16 value) Nonnull__(1);
extern bool libcdsb_map_update_uint32_uint32 (vtype_map* x, vtype_uint32 key, vtype_uint32 value) Nonnull__(1);
extern bool libcdsb_map_update_uint32_uint64 (vtype_map* x, vtype_uint32 key, vtype_uint64 value) Nonnull__(1);
extern bool libcdsb_map_update_uint32_float (vtype_map* x, vtype_uint32 key, vtype_float value) Nonnull__(1);
extern bool libcdsb_map_update_uint32_double (vtype_map* x, vtype_uint32 key, vtype_double value) Nonnull__(1);
extern bool libcdsb_map_update_uint32_ldouble(vtype_map* x, vtype_uint32 key, vtype_ldouble value) Nonnull__(1);
extern bool libcdsb_map_update_uint64_pointer(vtype_map* x, vtype_uint64 key, const void* value) Nonnull__(1);
extern bool libcdsb_map_update_uint64_cstring(vtype_map* x, vtype_uint64 key, const char* value) Nonnull__(1,3);
extern bool libcdsb_map_update_uint64_string (vtype_map* x, vtype_uint64 key, const vtype_string* value) Nonnull__(1,3);
extern bool libcdsb_map_update_uint64_array (vtype_map* x, vtype_uint64 key, const vtype_array* value) Nonnull__(1,3);
extern bool libcdsb_map_update_uint64_list (vtype_map* x, vtype_uint64 key, const vtype_list* value) Nonnull__(1,3);
extern bool libcdsb_map_update_uint64_map (vtype_map* x, vtype_uint64 key, const vtype_map* value) Nonnull__(1,3);
extern bool libcdsb_map_update_uint64_vset (vtype_map* x, vtype_uint64 key, const vtype_set* value) Nonnull__(1,3);
extern bool libcdsb_map_update_uint64_dict (vtype_map* x, vtype_uint64 key, const vtype_dict* value) Nonnull__(1,3);
extern bool libcdsb_map_update_uint64_boolean(vtype_map* x, vtype_uint64 key, vtype_bool value) Nonnull__(1);
extern bool libcdsb_map_update_uint64_int8 (vtype_map* x, vtype_uint64 key, vtype_int8 value) Nonnull__(1);
extern bool libcdsb_map_update_uint64_int16 (vtype_map* x, vtype_uint64 key, vtype_int16 value) Nonnull__(1);
extern bool libcdsb_map_update_uint64_int32 (vtype_map* x, vtype_uint64 key, vtype_int32 value) Nonnull__(1);
extern bool libcdsb_map_update_uint64_int64 (vtype_map* x, vtype_uint64 key, vtype_int64 value) Nonnull__(1);
extern bool libcdsb_map_update_uint64_uint8 (vtype_map* x, vtype_uint64 key, vtype_uint8 value) Nonnull__(1);
extern bool libcdsb_map_update_uint64_uint16 (vtype_map* x, vtype_uint64 key, vtype_uint16 value) Nonnull__(1);
extern bool libcdsb_map_update_uint64_uint32 (vtype_map* x, vtype_uint64 key, vtype_uint32 value) Nonnull__(1);
extern bool libcdsb_map_update_uint64_uint64 (vtype_map* x, vtype_uint64 key, vtype_uint64 value) Nonnull__(1);
extern bool libcdsb_map_update_uint64_float (vtype_map* x, vtype_uint64 key, vtype_float value) Nonnull__(1);
extern bool libcdsb_map_update_uint64_double (vtype_map* x, vtype_uint64 key, vtype_double value) Nonnull__(1);
extern bool libcdsb_map_update_uint64_ldouble(vtype_map* x, vtype_uint64 key, vtype_ldouble value) Nonnull__(1);
extern bool libcdsb_map_update_int8_pointer(vtype_map* x, vtype_int8 key, const void* value) Nonnull__(1);
extern bool libcdsb_map_update_int8_cstring(vtype_map* x, vtype_int8 key, const char* value) Nonnull__(1,3);
extern bool libcdsb_map_update_int8_string (vtype_map* x, vtype_int8 key, const vtype_string* value) Nonnull__(1,3);
extern bool libcdsb_map_update_int8_array (vtype_map* x, vtype_int8 key, const vtype_array* value) Nonnull__(1,3);
extern bool libcdsb_map_update_int8_list (vtype_map* x, vtype_int8 key, const vtype_list* value) Nonnull__(1,3);
extern bool libcdsb_map_update_int8_map (vtype_map* x, vtype_int8 key, const vtype_map* value) Nonnull__(1,3);
extern bool libcdsb_map_update_int8_vset (vtype_map* x, vtype_int8 key, const vtype_set* value) Nonnull__(1,3);
extern bool libcdsb_map_update_int8_dict (vtype_map* x, vtype_int8 key, const vtype_dict* value) Nonnull__(1,3);
extern bool libcdsb_map_update_int8_boolean(vtype_map* x, vtype_int8 key, vtype_bool value) Nonnull__(1);
extern bool libcdsb_map_update_int8_int8 (vtype_map* x, vtype_int8 key, vtype_int8 value) Nonnull__(1);
extern bool libcdsb_map_update_int8_int16 (vtype_map* x, vtype_int8 key, vtype_int16 value) Nonnull__(1);
extern bool libcdsb_map_update_int8_int32 (vtype_map* x, vtype_int8 key, vtype_int32 value) Nonnull__(1);
extern bool libcdsb_map_update_int8_int64 (vtype_map* x, vtype_int8 key, vtype_int64 value) Nonnull__(1);
extern bool libcdsb_map_update_int8_uint8 (vtype_map* x, vtype_int8 key, vtype_uint8 value) Nonnull__(1);
extern bool libcdsb_map_update_int8_uint16 (vtype_map* x, vtype_int8 key, vtype_uint16 value) Nonnull__(1);
extern bool libcdsb_map_update_int8_uint32 (vtype_map* x, vtype_int8 key, vtype_uint32 value) Nonnull__(1);
extern bool libcdsb_map_update_int8_uint64 (vtype_map* x, vtype_int8 key, vtype_uint64 value) Nonnull__(1);
extern bool libcdsb_map_update_int8_float (vtype_map* x, vtype_int8 key, vtype_float value) Nonnull__(1);
extern bool libcdsb_map_update_int8_double (vtype_map* x, vtype_int8 key, vtype_double value) Nonnull__(1);
extern bool libcdsb_map_update_int8_ldouble(vtype_map* x, vtype_int8 key, vtype_ldouble value) Nonnull__(1);
extern bool libcdsb_map_update_int16_pointer(vtype_map* x, vtype_int16 key, const void* value) Nonnull__(1);
extern bool libcdsb_map_update_int16_cstring(vtype_map* x, vtype_int16 key, const char* value) Nonnull__(1,3);
extern bool libcdsb_map_update_int16_string (vtype_map* x, vtype_int16 key, const vtype_string* value) Nonnull__(1,3);
extern bool libcdsb_map_update_int16_array (vtype_map* x, vtype_int16 key, const vtype_array* value) Nonnull__(1,3);
extern bool libcdsb_map_update_int16_list (vtype_map* x, vtype_int16 key, const vtype_list* value) Nonnull__(1,3);
extern bool libcdsb_map_update_int16_map (vtype_map* x, vtype_int16 key, const vtype_map* value) Nonnull__(1,3);
extern bool libcdsb_map_update_int16_vset (vtype_map* x, vtype_int16 key, const vtype_set* value) Nonnull__(1,3);
extern bool libcdsb_map_update_int16_dict (vtype_map* x, vtype_int16 key, const vtype_dict* value) Nonnull__(1,3);
extern bool libcdsb_map_update_int16_boolean(vtype_map* x, vtype_int16 key, vtype_bool value) Nonnull__(1);
extern bool libcdsb_map_update_int16_int8 (vtype_map* x, vtype_int16 key, vtype_int8 value) Nonnull__(1);
extern bool libcdsb_map_update_int16_int16 (vtype_map* x, vtype_int16 key, vtype_int16 value) Nonnull__(1);
extern bool libcdsb_map_update_int16_int32 (vtype_map* x, vtype_int16 key, vtype_int32 value) Nonnull__(1);
extern bool libcdsb_map_update_int16_int64 (vtype_map* x, vtype_int16 key, vtype_int64 value) Nonnull__(1);
extern bool libcdsb_map_update_int16_uint8 (vtype_map* x, vtype_int16 key, vtype_uint8 value) Nonnull__(1);
extern bool libcdsb_map_update_int16_uint16 (vtype_map* x, vtype_int16 key, vtype_uint16 value) Nonnull__(1);
extern bool libcdsb_map_update_int16_uint32 (vtype_map* x, vtype_int16 key, vtype_uint32 value) Nonnull__(1);
extern bool libcdsb_map_update_int16_uint64 (vtype_map* x, vtype_int16 key, vtype_uint64 value) Nonnull__(1);
extern bool libcdsb_map_update_int16_float (vtype_map* x, vtype_int16 key, vtype_float value) Nonnull__(1);
extern bool libcdsb_map_update_int16_double (vtype_map* x, vtype_int16 key, vtype_double value) Nonnull__(1);
extern bool libcdsb_map_update_int16_ldouble(vtype_map* x, vtype_int16 key, vtype_ldouble value) Nonnull__(1);
extern bool libcdsb_map_update_int32_pointer(vtype_map* x, vtype_int32 key, const void* value) Nonnull__(1);
extern bool libcdsb_map_update_int32_cstring(vtype_map* x, vtype_int32 key, const char* value) Nonnull__(1,3);
extern bool libcdsb_map_update_int32_string (vtype_map* x, vtype_int32 key, const vtype_string* value) Nonnull__(1,3);
extern bool libcdsb_map_update_int32_array (vtype_map* x, vtype_int32 key, const vtype_array* value) Nonnull__(1,3);
extern bool libcdsb_map_update_int32_list (vtype_map* x, vtype_int32 key, const vtype_list* value) Nonnull__(1,3);
extern bool libcdsb_map_update_int32_map (vtype_map* x, vtype_int32 key, const vtype_map* value) Nonnull__(1,3);
extern bool libcdsb_map_update_int32_vset (vtype_map* x, vtype_int32 key, const vtype_set* value) Nonnull__(1,3);
extern bool libcdsb_map_update_int32_dict (vtype_map* x, vtype_int32 key, const vtype_dict* value) Nonnull__(1,3);
extern bool libcdsb_map_update_int32_boolean(vtype_map* x, vtype_int32 key, vtype_bool value) Nonnull__(1);
extern bool libcdsb_map_update_int32_int8 (vtype_map* x, vtype_int32 key, vtype_int8 value) Nonnull__(1);
extern bool libcdsb_map_update_int32_int16 (vtype_map* x, vtype_int32 key, vtype_int16 value) Nonnull__(1);
extern bool libcdsb_map_update_int32_int32 (vtype_map* x, vtype_int32 key, vtype_int32 value) Nonnull__(1);
extern bool libcdsb_map_update_int32_int64 (vtype_map* x, vtype_int32 key, vtype_int64 value) Nonnull__(1);
extern bool libcdsb_map_update_int32_uint8 (vtype_map* x, vtype_int32 key, vtype_uint8 value) Nonnull__(1);
extern bool libcdsb_map_update_int32_uint16 (vtype_map* x, vtype_int32 key, vtype_uint16 value) Nonnull__(1);
extern bool libcdsb_map_update_int32_uint32 (vtype_map* x, vtype_int32 key, vtype_uint32 value) Nonnull__(1);
extern bool libcdsb_map_update_int32_uint64 (vtype_map* x, vtype_int32 key, vtype_uint64 value) Nonnull__(1);
extern bool libcdsb_map_update_int32_float (vtype_map* x, vtype_int32 key, vtype_float value) Nonnull__(1);
extern bool libcdsb_map_update_int32_double (vtype_map* x, vtype_int32 key, vtype_double value) Nonnull__(1);
extern bool libcdsb_map_update_int32_ldouble(vtype_map* x, vtype_int32 key, vtype_ldouble value) Nonnull__(1);
extern bool libcdsb_map_update_int64_pointer(vtype_map* x, vtype_int64 key, const void* value) Nonnull__(1);
extern bool libcdsb_map_update_int64_cstring(vtype_map* x, vtype_int64 key, const char* value) Nonnull__(1,3);
extern bool libcdsb_map_update_int64_string (vtype_map* x, vtype_int64 key, const vtype_string* value) Nonnull__(1,3);
extern bool libcdsb_map_update_int64_array (vtype_map* x, vtype_int64 key, const vtype_array* value) Nonnull__(1,3);
extern bool libcdsb_map_update_int64_list (vtype_map* x, vtype_int64 key, const vtype_list* value) Nonnull__(1,3);
extern bool libcdsb_map_update_int64_map (vtype_map* x, vtype_int64 key, const vtype_map* value) Nonnull__(1,3);
extern bool libcdsb_map_update_int64_vset (vtype_map* x, vtype_int64 key, const vtype_set* value) Nonnull__(1,3);
extern bool libcdsb_map_update_int64_dict (vtype_map* x, vtype_int64 key, const vtype_dict* value) Nonnull__(1,3);
extern bool libcdsb_map_update_int64_boolean(vtype_map* x, vtype_int64 key, vtype_bool value) Nonnull__(1);
extern bool libcdsb_map_update_int64_int8 (vtype_map* x, vtype_int64 key, vtype_int8 value) Nonnull__(1);
extern bool libcdsb_map_update_int64_int16 (vtype_map* x, vtype_int64 key, vtype_int16 value) Nonnull__(1);
extern bool libcdsb_map_update_int64_int32 (vtype_map* x, vtype_int64 key, vtype_int32 value) Nonnull__(1);
extern bool libcdsb_map_update_int64_int64 (vtype_map* x, vtype_int64 key, vtype_int64 value) Nonnull__(1);
extern bool libcdsb_map_update_int64_uint8 (vtype_map* x, vtype_int64 key, vtype_uint8 value) Nonnull__(1);
extern bool libcdsb_map_update_int64_uint16 (vtype_map* x, vtype_int64 key, vtype_uint16 value) Nonnull__(1);
extern bool libcdsb_map_update_int64_uint32 (vtype_map* x, vtype_int64 key, vtype_uint32 value) Nonnull__(1);
extern bool libcdsb_map_update_int64_uint64 (vtype_map* x, vtype_int64 key, vtype_uint64 value) Nonnull__(1);
extern bool libcdsb_map_update_int64_float (vtype_map* x, vtype_int64 key, vtype_float value) Nonnull__(1);
extern bool libcdsb_map_update_int64_double (vtype_map* x, vtype_int64 key, vtype_double value) Nonnull__(1);
extern bool libcdsb_map_update_int64_ldouble(vtype_map* x, vtype_int64 key, vtype_ldouble value) Nonnull__(1);
extern bool libcdsb_map_update_float_pointer(vtype_map* x, vtype_float key, const void* value) Nonnull__(1);
extern bool libcdsb_map_update_float_cstring(vtype_map* x, vtype_float key, const char* value) Nonnull__(1,3);
extern bool libcdsb_map_update_float_string (vtype_map* x, vtype_float key, const vtype_string* value) Nonnull__(1,3);
extern bool libcdsb_map_update_float_array (vtype_map* x, vtype_float key, const vtype_array* value) Nonnull__(1,3);
extern bool libcdsb_map_update_float_list (vtype_map* x, vtype_float key, const vtype_list* value) Nonnull__(1,3);
extern bool libcdsb_map_update_float_map (vtype_map* x, vtype_float key, const vtype_map* value) Nonnull__(1,3);
extern bool libcdsb_map_update_float_vset (vtype_map* x, vtype_float key, const vtype_set* value) Nonnull__(1,3);
extern bool libcdsb_map_update_float_dict (vtype_map* x, vtype_float key, const vtype_dict* value) Nonnull__(1,3);
extern bool libcdsb_map_update_float_boolean(vtype_map* x, vtype_float key, vtype_bool value) Nonnull__(1);
extern bool libcdsb_map_update_float_int8 (vtype_map* x, vtype_float key, vtype_int8 value) Nonnull__(1);
extern bool libcdsb_map_update_float_int16 (vtype_map* x, vtype_float key, vtype_int16 value) Nonnull__(1);
extern bool libcdsb_map_update_float_int32 (vtype_map* x, vtype_float key, vtype_int32 value) Nonnull__(1);
extern bool libcdsb_map_update_float_int64 (vtype_map* x, vtype_float key, vtype_int64 value) Nonnull__(1);
extern bool libcdsb_map_update_float_uint8 (vtype_map* x, vtype_float key, vtype_uint8 value) Nonnull__(1);
extern bool libcdsb_map_update_float_uint16 (vtype_map* x, vtype_float key, vtype_uint16 value) Nonnull__(1);
extern bool libcdsb_map_update_float_uint32 (vtype_map* x, vtype_float key, vtype_uint32 value) Nonnull__(1);
extern bool libcdsb_map_update_float_uint64 (vtype_map* x, vtype_float key, vtype_uint64 value) Nonnull__(1);
extern bool libcdsb_map_update_float_float (vtype_map* x, vtype_float key, vtype_float value) Nonnull__(1);
extern bool libcdsb_map_update_float_double (vtype_map* x, vtype_float key, vtype_double value) Nonnull__(1);
extern bool libcdsb_map_update_float_ldouble(vtype_map* x, vtype_float key, vtype_ldouble value) Nonnull__(1);
extern bool libcdsb_map_update_double_pointer(vtype_map* x, vtype_double key, const void* value) Nonnull__(1);
extern bool libcdsb_map_update_double_cstring(vtype_map* x, vtype_double key, const char* value) Nonnull__(1,3);
extern bool libcdsb_map_update_double_string (vtype_map* x, vtype_double key, const vtype_string* value) Nonnull__(1,3);
extern bool libcdsb_map_update_double_array (vtype_map* x, vtype_double key, const vtype_array* value) Nonnull__(1,3);
extern bool libcdsb_map_update_double_list (vtype_map* x, vtype_double key, const vtype_list* value) Nonnull__(1,3);
extern bool libcdsb_map_update_double_map (vtype_map* x, vtype_double key, const vtype_map* value) Nonnull__(1,3);
extern bool libcdsb_map_update_double_vset (vtype_map* x, vtype_double key, const vtype_set* value) Nonnull__(1,3);
extern bool libcdsb_map_update_double_dict (vtype_map* x, vtype_double key, const vtype_dict* value) Nonnull__(1,3);
extern bool libcdsb_map_update_double_boolean(vtype_map* x, vtype_double key, vtype_bool value) Nonnull__(1);
extern bool libcdsb_map_update_double_int8 (vtype_map* x, vtype_double key, vtype_int8 value) Nonnull__(1);
extern bool libcdsb_map_update_double_int16 (vtype_map* x, vtype_double key, vtype_int16 value) Nonnull__(1);
extern bool libcdsb_map_update_double_int32 (vtype_map* x, vtype_double key, vtype_int32 value) Nonnull__(1);
extern bool libcdsb_map_update_double_int64 (vtype_map* x, vtype_double key, vtype_int64 value) Nonnull__(1);
extern bool libcdsb_map_update_double_uint8 (vtype_map* x, vtype_double key, vtype_uint8 value) Nonnull__(1);
extern bool libcdsb_map_update_double_uint16 (vtype_map* x, vtype_double key, vtype_uint16 value) Nonnull__(1);
extern bool libcdsb_map_update_double_uint32 (vtype_map* x, vtype_double key, vtype_uint32 value) Nonnull__(1);
extern bool libcdsb_map_update_double_uint64 (vtype_map* x, vtype_double key, vtype_uint64 value) Nonnull__(1);
extern bool libcdsb_map_update_double_float (vtype_map* x, vtype_double key, vtype_float value) Nonnull__(1);
extern bool libcdsb_map_update_double_double (vtype_map* x, vtype_double key, vtype_double value) Nonnull__(1);
extern bool libcdsb_map_update_double_ldouble(vtype_map* x, vtype_double key, vtype_ldouble value) Nonnull__(1);
extern bool libcdsb_map_update_ldouble_pointer(vtype_map* x, vtype_ldouble key, const void* value) Nonnull__(1);
extern bool libcdsb_map_update_ldouble_cstring(vtype_map* x, vtype_ldouble key, const char* value) Nonnull__(1,3);
extern bool libcdsb_map_update_ldouble_string (vtype_map* x, vtype_ldouble key, const vtype_string* value) Nonnull__(1,3);
extern bool libcdsb_map_update_ldouble_array (vtype_map* x, vtype_ldouble key, const vtype_array* value) Nonnull__(1,3);
extern bool libcdsb_map_update_ldouble_list (vtype_map* x, vtype_ldouble key, const vtype_list* value) Nonnull__(1,3);
extern bool libcdsb_map_update_ldouble_map (vtype_map* x, vtype_ldouble key, const vtype_map* value) Nonnull__(1,3);
extern bool libcdsb_map_update_ldouble_vset (vtype_map* x, vtype_ldouble key, const vtype_set* value) Nonnull__(1,3);
extern bool libcdsb_map_update_ldouble_dict (vtype_map* x, vtype_ldouble key, const vtype_dict* value) Nonnull__(1,3);
extern bool libcdsb_map_update_ldouble_boolean(vtype_map* x, vtype_ldouble key, vtype_bool value) Nonnull__(1);
extern bool libcdsb_map_update_ldouble_int8 (vtype_map* x, vtype_ldouble key, vtype_int8 value) Nonnull__(1);
extern bool libcdsb_map_update_ldouble_int16 (vtype_map* x, vtype_ldouble key, vtype_int16 value) Nonnull__(1);
extern bool libcdsb_map_update_ldouble_int32 (vtype_map* x, vtype_ldouble key, vtype_int32 value) Nonnull__(1);
extern bool libcdsb_map_update_ldouble_int64 (vtype_map* x, vtype_ldouble key, vtype_int64 value) Nonnull__(1);
extern bool libcdsb_map_update_ldouble_uint8 (vtype_map* x, vtype_ldouble key, vtype_uint8 value) Nonnull__(1);
extern bool libcdsb_map_update_ldouble_uint16 (vtype_map* x, vtype_ldouble key, vtype_uint16 value) Nonnull__(1);
extern bool libcdsb_map_update_ldouble_uint32 (vtype_map* x, vtype_ldouble key, vtype_uint32 value) Nonnull__(1);
extern bool libcdsb_map_update_ldouble_uint64 (vtype_map* x, vtype_ldouble key, vtype_uint64 value) Nonnull__(1);
extern bool libcdsb_map_update_ldouble_float (vtype_map* x, vtype_ldouble key, vtype_float value) Nonnull__(1);
extern bool libcdsb_map_update_ldouble_double (vtype_map* x, vtype_ldouble key, vtype_double value) Nonnull__(1);
extern bool libcdsb_map_update_ldouble_ldouble(vtype_map* x, vtype_ldouble key, vtype_ldouble value) Nonnull__(1);
extern bool libcdsb_map_update (vtype_map* x, const void* key, vtype key_type, const void* value, vtype value_type) Nonnull__(1);
extern bool libcdsb_map_inject (vtype_map* x, const void* key, vtype key_type, const void* value, vtype value_type) Nonnull__(1);
extern int libcdsb_map_find (vtype_map* x, const void* key, vtype key_type, void* data, map_access_callback, bool cut) Nonnull__(1);
extern int libcdsb_map_foreach(vtype_map* x, void* data, map_access_callback, bool flush) Nonnull__(1,3);
#endif /* LIBCDSB_MAP_H */

View File

@ -69,102 +69,59 @@ typedef struct libcdsb_list vtype_list;
typedef struct libcdsb_dict vtype_dict;
typedef struct libcdsb_string vtype_string;
/* Get utf8 chars count in string */
extern size_t string_size(const vtype_string* x) Pure__ Warn_unused_result__ Nonnull__(1);
/* Get string size in bytes */
extern size_t string_nmemb(const vtype_string* x) Pure__ Warn_unused_result__ Nonnull__(1);
/* Get count of the array elements */
extern size_t array_size(const vtype_array* x) Pure__ Warn_unused_result__ Nonnull__(1);
/* Get array size in bytes */
extern size_t array_nmemb(const vtype_array* x) Pure__ Warn_unused_result__ Nonnull__(1);
/* Get count of the list elements */
extern size_t list_size(const vtype_list* x) Pure__ Warn_unused_result__ Nonnull__(1);
/* Get count of the map elements */
extern size_t map_size(const vtype_map* x) Pure__ Warn_unused_result__ Nonnull__(1);
/* Get count of the set elements */
extern size_t vset_size(const vtype_set* x) Pure__ Warn_unused_result__ Nonnull__(1);
/* Get count of the dict elements */
extern size_t dict_size(const vtype_dict* x) Pure__ Warn_unused_result__ Nonnull__(1);
/* Get count of the available nodes */
extern size_t dict_capacity(const vtype_dict* x) Pure__ Warn_unused_result__ Nonnull__(1);
/* Cpmpare 2 strings */
extern int string_compare(const vtype_string* s0, const vtype_string* s1) Pure__ Warn_unused_result__ Nonnull__(1,2);
/* Compare 2 arrays */
extern int array_compare(const vtype_array* s0, const vtype_array* s1) Pure__ Warn_unused_result__ Nonnull__(1,2);
/* Compare 2 lists */
extern int list_compare(const vtype_list* s0, const vtype_list* s1) Pure__ Warn_unused_result__ Nonnull__(1,2);
/* Compare 2 maps */
extern int map_compare(const vtype_map* s0, const vtype_map* s1) Pure__ Warn_unused_result__ Nonnull__(1,2);
/* Compare 2 sets */
extern int vset_compare(const vtype_set* s0, const vtype_set* s1) Pure__ Warn_unused_result__ Nonnull__(1,2);
/* Compare 2 dicts */
extern int dict_compare(const vtype_dict* s0, const vtype_dict* s1) Pure__ Warn_unused_result__ Nonnull__(1,2);
extern int array_compare (const vtype_array* s0, const vtype_array* s1) Pure__ Warn_unused_result__ Nonnull__(1,2);
extern int list_compare (const vtype_list* s0, const vtype_list* s1) Pure__ Warn_unused_result__ Nonnull__(1,2);
extern int map_compare (const vtype_map* s0, const vtype_map* s1) Pure__ Warn_unused_result__ Nonnull__(1,2);
extern int vset_compare (const vtype_set* s0, const vtype_set* s1) Pure__ Warn_unused_result__ Nonnull__(1,2);
extern int dict_compare (const vtype_dict* s0, const vtype_dict* s1) Pure__ Warn_unused_result__ Nonnull__(1,2);
/* Copy string to another */
extern vtype_string string_copy(const vtype_string* s) Pure__ Warn_unused_result__ Nonnull__(1);
/* Copy array to another */
extern vtype_array array_copy(const vtype_array* s) Pure__ Warn_unused_result__ Nonnull__(1);
/* Copy list to another */
extern vtype_list list_copy(const vtype_list* s) Pure__ Warn_unused_result__ Nonnull__(1);
/* Copy map to another */
extern vtype_map map_copy(const vtype_map* s) Pure__ Warn_unused_result__ Nonnull__(1);
/* Copy set to another */
extern vtype_set vset_copy(const vtype_set* s) Pure__ Warn_unused_result__ Nonnull__(1);
/* Copy set to another */
extern vtype_dict dict_copy(const vtype_dict* s) Pure__ Warn_unused_result__ Nonnull__(1);
extern vtype_string string_copy (const vtype_string* s) Pure__ Warn_unused_result__ Nonnull__(1);
extern vtype_array array_copy (const vtype_array* s) Pure__ Warn_unused_result__ Nonnull__(1);
extern vtype_list list_copy (const vtype_list* s) Pure__ Warn_unused_result__ Nonnull__(1);
extern vtype_map map_copy (const vtype_map* s) Pure__ Warn_unused_result__ Nonnull__(1);
extern vtype_set vset_copy (const vtype_set* s) Pure__ Warn_unused_result__ Nonnull__(1);
extern vtype_dict dict_copy (const vtype_dict* s) Pure__ Warn_unused_result__ Nonnull__(1);
#define map_copy_keys(s) vset_copy((vtype_set*)s)
/* Duplicate string memory block */
extern vtype_string* string_duplicate(const vtype_string* s) Warn_unused_result__ Nonnull__(1);
/* Duplicate array memory block */
extern vtype_array* array_duplicate(const vtype_array* s) Warn_unused_result__ Nonnull__(1);
/* Duplicate list memory block */
extern vtype_list* list_duplicate(const vtype_list* s) Warn_unused_result__ Nonnull__(1);
/* Duplicate map memory block */
extern vtype_map* map_duplicate(const vtype_map* s) Warn_unused_result__ Nonnull__(1);
/* Duplicate set memory block */
extern vtype_set* vset_duplicate(const vtype_set* s) Warn_unused_result__ Nonnull__(1);
/* Duplicate dict memory block */
extern vtype_dict* dict_duplicate(const vtype_dict* s) Warn_unused_result__ Nonnull__(1);
extern vtype_string* string_duplicate (const vtype_string* s) Warn_unused_result__ Nonnull__(1);
extern vtype_array* array_duplicate (const vtype_array* s) Warn_unused_result__ Nonnull__(1);
extern vtype_list* list_duplicate (const vtype_list* s) Warn_unused_result__ Nonnull__(1);
extern vtype_map* map_duplicate (const vtype_map* s) Warn_unused_result__ Nonnull__(1);
extern vtype_set* vset_duplicate (const vtype_set* s) Warn_unused_result__ Nonnull__(1);
extern vtype_dict* dict_duplicate (const vtype_dict* s) Warn_unused_result__ Nonnull__(1);
#define map_duplicate_keys(s) vset_duplicate((vtype_set*)s)
/* Copy string and store result to the memory block */
extern void string_copy_init(vtype_string* x, const vtype_string* s) Nonnull__(1,2);
/* Copy array and store result to the memory block */
extern void array_copy_init(vtype_array* x, const vtype_array* s) Nonnull__(1,2);
/* Copy list and store result to the memory block */
extern void list_copy_init(vtype_list* x, const vtype_list* s) Nonnull__(1,2);
/* Copy map and store result to the memory block */
extern void map_copy_init(vtype_map* x, const vtype_map* s) Nonnull__(1,2);
/* Copy set and store result to the memory block */
extern void vset_copy_init(vtype_set* x, const vtype_set* s) Nonnull__(1,2);
/* Copy dict and store result to the memory block */
extern void dict_copy_init(vtype_dict* x, const vtype_dict* s) Nonnull__(1,2);
extern void string_copy_init (vtype_string* x, const vtype_string* s) Nonnull__(1,2);
extern void array_copy_init (vtype_array* x, const vtype_array* s) Nonnull__(1,2);
extern void list_copy_init (vtype_list* x, const vtype_list* s) Nonnull__(1,2);
extern void map_copy_init (vtype_map* x, const vtype_map* s) Nonnull__(1,2);
extern void vset_copy_init (vtype_set* x, const vtype_set* s) Nonnull__(1,2);
extern void dict_copy_init (vtype_dict* x, const vtype_dict* s) Nonnull__(1,2);
#define map_copy_init_keys(x, s) vset_duplicate(x, (vtype_set*)s)
/* Free string resources */
extern void string_free(vtype_string* x);
/* Free array resources */
extern void array_free(vtype_array* x);
/* Free list resources */
extern void list_free(vtype_list* x);
/* Free map resources */
extern void map_free(vtype_map* x);
/* Free set resources */
extern void vset_free(vtype_set* x);
/* Free dict resources */
extern void dict_free(vtype_dict* x);
extern void array_free (vtype_array* x);
extern void list_free (vtype_list* x);
extern void map_free (vtype_map* x);
extern void vset_free (vtype_set* x);
extern void dict_free (vtype_dict* x);
/* Get hash of the string */
extern vtype_hash string_hash(const vtype_string* s) Pure__ Warn_unused_result__ Nonnull__(1);
/* Get hash of the array */
extern vtype_hash array_hash(const vtype_array* s) Pure__ Warn_unused_result__ Nonnull__(1);
/* Get hash of the list */
extern vtype_hash list_hash(const vtype_list* s) Pure__ Warn_unused_result__ Nonnull__(1);
/* Get hash of the map */
extern vtype_hash map_hash(const vtype_map* s) Pure__ Warn_unused_result__ Nonnull__(1);
/* Get hash of the set */
extern vtype_hash vset_hash(const vtype_set* s) Pure__ Warn_unused_result__ Nonnull__(1);
/* Get hash of the dict */
extern vtype_hash dict_hash(const vtype_dict* s) Pure__ Warn_unused_result__ Nonnull__(1);
extern vtype_hash array_hash (const vtype_array* s) Pure__ Warn_unused_result__ Nonnull__(1);
extern vtype_hash list_hash (const vtype_list* s) Pure__ Warn_unused_result__ Nonnull__(1);
extern vtype_hash map_hash (const vtype_map* s) Pure__ Warn_unused_result__ Nonnull__(1);
extern vtype_hash vset_hash (const vtype_set* s) Pure__ Warn_unused_result__ Nonnull__(1);
extern vtype_hash dict_hash (const vtype_dict* s) Pure__ Warn_unused_result__ Nonnull__(1);
#endif /* LIBCDSB_VTYPE_H */

View File

@ -2,6 +2,7 @@
/* Copyright © 2022 Gregory Lirent */
#include "include.h"
#include "assert.h"
#ifndef LIBCDSB_SRC_INTERNAL_VNODE_H
#define LIBCDSB_SRC_INTERNAL_VNODE_H
@ -24,6 +25,32 @@ extern vnode_t libcdsb_vnode_create_target(vtype target_type, const void* value,
extern void libcdsb_vnode_free(vnode_t* x, vtype type) Nonnull__(1);
extern void* libcdsb_vnode_peek(const vnode_t* x, vtype type) pure__ wur__ Nonnull__(1);
ainline(void vnode_attach(vnode_t* node, const void* value, vtype type)) {
if (type < VTYPE_STRING) {
*node = libcdsb_vnode_create(value, type);
} else if (sizeof(str_t) == sizeof(void*) && type == VTYPE_STRING) {
*node = *(char**)value;
} else {
*node = malloc(vtype_size(type));
memcpy(*node, value, vtype_size(type));
}
}
ainline(void vnode_tattach(vnode_t* node, vtype target_type, const void* value, vtype type)) {
if (type < VTYPE_STRING) {
*node = libcdsb_vnode_create_target(target_type, value, type);
} else {
type_assert(target_type, type);
if (sizeof(str_t) == sizeof(void*) && type == VTYPE_STRING) {
*node = *(char**)value;
} else {
*node = malloc(vtype_size(type));
memcpy(*node, value, vtype_size(type));
}
}
}
#define vnode_create libcdsb_vnode_create
#define vnode_tcreate libcdsb_vnode_create_target
#define vnode_peek libcdsb_vnode_peek

View File

@ -3,53 +3,6 @@
#include "include.h"
bool libcdsb_map_update(map_t* x, const void* k, vtype kt, const void* v, vtype vt) {
int cmp;
mnode_t* n;
mnode_t* p;
vnode_t kn;
n = x->root;
kn = vnode_tcreate(x->type, k, kt);
kt = x->type;
k = vnode_peek(&kn, kt);
if (!mnode_is_empty(n)) {
do {
p = n;
cmp = vtype_compare(k, kt, vnode_peek(&n->key, kt), kt);
if (cmp == 0) {
vnode_free(&n->key, x->type);
vnode_free(&n->value, n->type);
n->key = kn;
n->value = vnode_create(v, vt);
n->type = vt;
return true;
}
n = (cmp < 0) ? n->left : n->right;
} while (!mnode_is_empty(n));
n = mnode_create(kn, p, 1);
if (cmp < 0) p->left = n;
else p->right = n;
if (!mnode_is_root(p))
mnode_fixup(&x->root, n);
} else n = x->root = mnode_create(kn, mnode_empty, 0);
n->value = vnode_create(v, vt);
n->type = vt;
return false;
}
int libcdsb_map_find(map_t* x, const void* k, vtype t, void* _, map_access_callback callback, bool cut) {
mnode_t* c;
void *key;

View File

@ -1,163 +0,0 @@
/* This software is licensed by the MIT License, see LICENSE file */
/* Copyright © 2022 Gregory Lirent */
#include "include.h"
/*#####################################################################################################################*/
static inline int mnode_compare(const mnode_t* s0, const mnode_t* s1, vtype t) {
int c = vnode_compare_eq(&s0->key, &s1->key, t);
return !c ? vnode_compare(&s0->value, s0->type, &s1->value, s1->type) : c;
}
static inline hash_t mnode_hash(const mnode_t* s, vtype t) {
return vnode_hash(&s->key, t) + vnode_hash(&s->value, s->type) + t;
}
/*#####################################################################################################################*/
hash_t map_hash(const map_t* s) {
stack_t z;
mnode_t *c0, *c1;
hash_t hash, v;
if (mnode_is_empty(s->root))
return 0;
stack_init(&z);
stack_push(&z, s->root->left);
hash = 1;
if (!mnode_is_empty(c0 = stack_pop(&z))) {
do {
++hash;
if (!mnode_is_empty(c0->right)) stack_push(&z, c0->right);
if (!mnode_is_empty(c0->left)) stack_push(&z, c1 = c0->left);
} while (!is_null(c0 = stack_pop(&z)));
}
v = mnode_hash(c1, s->type);
stack_push(&z, s->root->right);
if (!mnode_is_empty(c0 = stack_pop(&z))) {
do {
++hash;
if (!mnode_is_empty(c0->right)) stack_push(&z, c1 = c0->right);
if (!mnode_is_empty(c0->left)) stack_push(&z, c0->left);
} while (!is_null(c0 = stack_pop(&z)));
}
v += mnode_hash(c1, s->type);
return (hash ^ v) + VTYPE_MAP;
}
/*#####################################################################################################################*/
void map_init(map_t* x, vtype t) {
x->root = mnode_empty;
x->type = t;
}
void map_free(map_t* x) {
mnode_t *t, *c;
c = x->root;
while (!mnode_is_empty(x->root)) {
if (!mnode_is_empty(c->left)) {
c = c->left;
} else if (!mnode_is_empty(c->right)) {
c = c->right;
} else if (!mnode_is_root(c)) {
vnode_free(&c->key, x->type);
vnode_free(&c->value, c->type);
t = c;
c = c->parent;
if (t == c->left) c->left = mnode_empty;
else c->right = mnode_empty;
free(t);
} else {
vnode_free(&c->key, x->type);
vnode_free(&c->value, c->type);
x->root = mnode_empty;
}
}
x->type = 0;
}
/*#####################################################################################################################*/
size_t map_size(const map_t* x) {
stack_t z;
size_t n;
rbnode_t* c;
stack_init(&z);
stack_push(&z, x->root);
n = 0;
if (!mnode_is_empty(x->root)) {
while ((c = stack_pop(&z))) {
++n;
if (!rbnode_is_empty(c->right)) stack_push(&z, c->right);
if (!rbnode_is_empty(c->left)) stack_push(&z, c->left);
}
}
return n;
}
/*#####################################################################################################################*/
int map_compare(const map_t* s0, const map_t* s1) {
stack_t z;
mnode_t *c0, *c1;
int cmp;
if (s0 == s1 || s0->root == s1->root)
return 0;
if (s0->type != s1->type)
return s0->type - s1->type;
stack_init(&z);
stack_push_many(&z, 2, (void*)s1, (void*)s0);
cmp = 0;
do {
c0 = stack_pop(&z);
c1 = stack_pop(&z);
if (mnode_is_empty(c0) || mnode_is_empty(c1)) {
if (c0 != c1) {
stack_flush(&z);
return mnode_is_empty(c0) ? -1 : 1;
}
} else if ((cmp = mnode_compare(c0, c1, s0->type))) {
if (c0->left == c1->right) { // == mnode_empty
cmp = mnode_compare(c0->right, c1, s0->type);
if (!cmp) cmp = mnode_compare(c0, c1->left, s0->type);
} else if (c0->right == c1->left) { // == mnode_empty
cmp = mnode_compare(c0, c1->right, s0->type);
if (!cmp) cmp = mnode_compare(c0->left, c1, s0->type);
}
if (cmp) {
stack_flush(&z);
return cmp;
}
} else stack_push_many(&z, 4, c1->right, c0->right, c1->left, c0->left);
} while (!is_null(z.value));
return 0;
}

56
src/map/comparison.c Normal file
View File

@ -0,0 +1,56 @@
/* This software is licensed by the MIT License, see LICENSE file */
/* Copyright © 2022 Gregory Lirent */
#include "include.h"
static inline int mnode_compare(const mnode_t* s0, const mnode_t* s1, vtype t) {
int c = vnode_compare_eq(&s0->key, &s1->key, t);
return !c ? vnode_compare(&s0->value, s0->type, &s1->value, s1->type) : c;
}
/*#####################################################################################################################*/
int map_compare(const map_t* s0, const map_t* s1) {
stack_t z;
mnode_t *c0, *c1;
int cmp;
if (s0 == s1 || s0->root == s1->root)
return 0;
if (s0->type != s1->type)
return s0->type - s1->type;
stack_init(&z);
stack_push_many(&z, 2, (void*)s1, (void*)s0);
cmp = 0;
do {
c0 = stack_pop(&z);
c1 = stack_pop(&z);
if (mnode_is_empty(c0) || mnode_is_empty(c1)) {
if (c0 != c1) {
stack_flush(&z);
return mnode_is_empty(c0) ? -1 : 1;
}
} else if ((cmp = mnode_compare(c0, c1, s0->type))) {
if (c0->left == c1->right) { // == mnode_empty
cmp = mnode_compare(c0->right, c1, s0->type);
if (!cmp) cmp = mnode_compare(c0, c1->left, s0->type);
} else if (c0->right == c1->left) { // == mnode_empty
cmp = mnode_compare(c0, c1->right, s0->type);
if (!cmp) cmp = mnode_compare(c0->left, c1, s0->type);
}
if (cmp) {
stack_flush(&z);
return cmp;
}
} else stack_push_many(&z, 4, c1->right, c0->right, c1->left, c0->left);
} while (!is_null(z.value));
return 0;
}

70
src/map/compute.c Normal file
View File

@ -0,0 +1,70 @@
/* This software is licensed by the MIT License, see LICENSE file */
/* Copyright © 2022 Gregory Lirent */
#include "include.h"
static inline hash_t mnode_hash(const mnode_t* s, vtype t) {
return vnode_hash(&s->key, t) + vnode_hash(&s->value, s->type) + t;
}
/*#####################################################################################################################*/
size_t map_size(const map_t* x) {
stack_t z;
size_t n;
rbnode_t* c;
stack_init(&z);
stack_push(&z, x->root);
n = 0;
if (!mnode_is_empty(x->root)) {
while ((c = stack_pop(&z))) {
++n;
if (!rbnode_is_empty(c->right)) stack_push(&z, c->right);
if (!rbnode_is_empty(c->left)) stack_push(&z, c->left);
}
}
return n;
}
hash_t map_hash(const map_t* s) {
stack_t z;
mnode_t *c0, *c1;
hash_t hash, v;
if (mnode_is_empty(s->root))
return 0;
stack_init(&z);
stack_push(&z, s->root->left);
hash = 1;
if (!mnode_is_empty(c0 = stack_pop(&z))) {
do {
++hash;
if (!mnode_is_empty(c0->right)) stack_push(&z, c0->right);
if (!mnode_is_empty(c0->left)) stack_push(&z, c1 = c0->left);
} while (!is_null(c0 = stack_pop(&z)));
}
v = mnode_hash(c1, s->type);
stack_push(&z, s->root->right);
if (!mnode_is_empty(c0 = stack_pop(&z))) {
do {
++hash;
if (!mnode_is_empty(c0->right)) stack_push(&z, c1 = c0->right);
if (!mnode_is_empty(c0->left)) stack_push(&z, c0->left);
} while (!is_null(c0 = stack_pop(&z)));
}
v += mnode_hash(c1, s->type);
return (hash ^ v) + VTYPE_MAP;
}

View File

@ -3,8 +3,6 @@
#include "include.h"
/*#####################################################################################################################*/
static inline mnode_t* mnode_duplicate(const mnode_t* s, mnode_t* p, const vtype t) {
mnode_t* x;

View File

@ -1,445 +0,0 @@
/* This software is licensed by the MIT License, see LICENSE file */
/* Copyright © 2022 Gregory Lirent */
#include "include.h"
int libcdsb_map_find_pointer(map_t* x, const void* k, void* _, map_access_callback cb, bool cut) { return libcdsb_map_find(x, &k, vtypeof(&k), _, cb, cut); }
int libcdsb_map_find_cstring(map_t* x, const char* k, void* _, map_access_callback cb, bool cut) { return libcdsb_map_find(x, &k, vtypeof(&k), _, cb, cut); }
int libcdsb_map_find_string (map_t* x, const str_t* k, void* _, map_access_callback cb, bool cut) { return libcdsb_map_find(x, k, vtypeof( k), _, cb, cut); }
int libcdsb_map_find_array (map_t* x, const arr_t* k, void* _, map_access_callback cb, bool cut) { return libcdsb_map_find(x, k, vtypeof( k), _, cb, cut); }
int libcdsb_map_find_list (map_t* x, const list_t* k, void* _, map_access_callback cb, bool cut) { return libcdsb_map_find(x, k, vtypeof( k), _, cb, cut); }
int libcdsb_map_find_map (map_t* x, const map_t* k, void* _, map_access_callback cb, bool cut) { return libcdsb_map_find(x, k, vtypeof( k), _, cb, cut); }
int libcdsb_map_find_vset (map_t* x, const set_t* k, void* _, map_access_callback cb, bool cut) { return libcdsb_map_find(x, k, vtypeof( k), _, cb, cut); }
int libcdsb_map_find_dict (map_t* x, const dict_t* k, void* _, map_access_callback cb, bool cut) { return libcdsb_map_find(x, k, vtypeof( k), _, cb, cut); }
int libcdsb_map_find_boolean(map_t* x, bool k, void* _, map_access_callback cb, bool cut) { return libcdsb_map_find(x, &k, vtypeof(&k), _, cb, cut); }
int libcdsb_map_find_int8 (map_t* x, s8_t k, void* _, map_access_callback cb, bool cut) { return libcdsb_map_find(x, &k, vtypeof(&k), _, cb, cut); }
int libcdsb_map_find_int16 (map_t* x, s16_t k, void* _, map_access_callback cb, bool cut) { return libcdsb_map_find(x, &k, vtypeof(&k), _, cb, cut); }
int libcdsb_map_find_int32 (map_t* x, s32_t k, void* _, map_access_callback cb, bool cut) { return libcdsb_map_find(x, &k, vtypeof(&k), _, cb, cut); }
int libcdsb_map_find_int64 (map_t* x, s64_t k, void* _, map_access_callback cb, bool cut) { return libcdsb_map_find(x, &k, vtypeof(&k), _, cb, cut); }
int libcdsb_map_find_uint8 (map_t* x, u8_t k, void* _, map_access_callback cb, bool cut) { return libcdsb_map_find(x, &k, vtypeof(&k), _, cb, cut); }
int libcdsb_map_find_uint16 (map_t* x, u16_t k, void* _, map_access_callback cb, bool cut) { return libcdsb_map_find(x, &k, vtypeof(&k), _, cb, cut); }
int libcdsb_map_find_uint32 (map_t* x, u32_t k, void* _, map_access_callback cb, bool cut) { return libcdsb_map_find(x, &k, vtypeof(&k), _, cb, cut); }
int libcdsb_map_find_uint64 (map_t* x, u64_t k, void* _, map_access_callback cb, bool cut) { return libcdsb_map_find(x, &k, vtypeof(&k), _, cb, cut); }
int libcdsb_map_find_float (map_t* x, fl_t k, void* _, map_access_callback cb, bool cut) { return libcdsb_map_find(x, &k, vtypeof(&k), _, cb, cut); }
int libcdsb_map_find_double (map_t* x, dbl_t k, void* _, map_access_callback cb, bool cut) { return libcdsb_map_find(x, &k, vtypeof(&k), _, cb, cut); }
int libcdsb_map_find_ldouble(map_t* x, ldbl_t k, void* _, map_access_callback cb, bool cut) { return libcdsb_map_find(x, &k, vtypeof(&k), _, cb, cut); }
bool libcdsb_map_update_pointer_pointer(map_t* x, const void* k, const void* v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_pointer_cstring(map_t* x, const void* k, const char* v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_pointer_string (map_t* x, const void* k, const str_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_pointer_array (map_t* x, const void* k, const arr_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_pointer_list (map_t* x, const void* k, const list_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_pointer_map (map_t* x, const void* k, const map_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_pointer_vset (map_t* x, const void* k, const set_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_pointer_dict (map_t* x, const void* k, const dict_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_pointer_boolean(map_t* x, const void* k, bool v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_pointer_int8 (map_t* x, const void* k, s8_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_pointer_int16 (map_t* x, const void* k, s16_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_pointer_int32 (map_t* x, const void* k, s32_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_pointer_int64 (map_t* x, const void* k, s64_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_pointer_uint8 (map_t* x, const void* k, u8_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_pointer_uint16 (map_t* x, const void* k, u16_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_pointer_uint32 (map_t* x, const void* k, u32_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_pointer_uint64 (map_t* x, const void* k, u64_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_pointer_float (map_t* x, const void* k, fl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_pointer_double (map_t* x, const void* k, dbl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_pointer_ldouble(map_t* x, const void* k, ldbl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_cstring_pointer(map_t* x, const char* k, const void* v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_cstring_cstring(map_t* x, const char* k, const char* v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_cstring_string (map_t* x, const char* k, const str_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_cstring_array (map_t* x, const char* k, const arr_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_cstring_list (map_t* x, const char* k, const list_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_cstring_map (map_t* x, const char* k, const map_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_cstring_vset (map_t* x, const char* k, const set_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_cstring_dict (map_t* x, const char* k, const dict_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_cstring_boolean(map_t* x, const char* k, bool v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_cstring_int8 (map_t* x, const char* k, s8_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_cstring_int16 (map_t* x, const char* k, s16_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_cstring_int32 (map_t* x, const char* k, s32_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_cstring_int64 (map_t* x, const char* k, s64_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_cstring_uint8 (map_t* x, const char* k, u8_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_cstring_uint16 (map_t* x, const char* k, u16_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_cstring_uint32 (map_t* x, const char* k, u32_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_cstring_uint64 (map_t* x, const char* k, u64_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_cstring_float (map_t* x, const char* k, fl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_cstring_double (map_t* x, const char* k, dbl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_cstring_ldouble(map_t* x, const char* k, ldbl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_string_pointer(map_t* x, const str_t* k, const void* v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_string_cstring(map_t* x, const str_t* k, const char* v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_string_string (map_t* x, const str_t* k, const str_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_string_array (map_t* x, const str_t* k, const arr_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_string_list (map_t* x, const str_t* k, const list_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_string_map (map_t* x, const str_t* k, const map_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_string_vset (map_t* x, const str_t* k, const set_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_string_dict (map_t* x, const str_t* k, const dict_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_string_boolean(map_t* x, const str_t* k, bool v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_string_int8 (map_t* x, const str_t* k, s8_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_string_int16 (map_t* x, const str_t* k, s16_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_string_int32 (map_t* x, const str_t* k, s32_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_string_int64 (map_t* x, const str_t* k, s64_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_string_uint8 (map_t* x, const str_t* k, u8_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_string_uint16 (map_t* x, const str_t* k, u16_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_string_uint32 (map_t* x, const str_t* k, u32_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_string_uint64 (map_t* x, const str_t* k, u64_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_string_float (map_t* x, const str_t* k, fl_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_string_double (map_t* x, const str_t* k, dbl_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_string_ldouble(map_t* x, const str_t* k, ldbl_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_array_pointer(map_t* x, const arr_t* k, const void* v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_array_cstring(map_t* x, const arr_t* k, const char* v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_array_string (map_t* x, const arr_t* k, const str_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_array_array (map_t* x, const arr_t* k, const arr_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_array_list (map_t* x, const arr_t* k, const list_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_array_map (map_t* x, const arr_t* k, const map_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_array_vset (map_t* x, const arr_t* k, const set_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_array_dict (map_t* x, const arr_t* k, const dict_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_array_boolean(map_t* x, const arr_t* k, bool v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_array_int8 (map_t* x, const arr_t* k, s8_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_array_int16 (map_t* x, const arr_t* k, s16_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_array_int32 (map_t* x, const arr_t* k, s32_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_array_int64 (map_t* x, const arr_t* k, s64_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_array_uint8 (map_t* x, const arr_t* k, u8_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_array_uint16 (map_t* x, const arr_t* k, u16_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_array_uint32 (map_t* x, const arr_t* k, u32_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_array_uint64 (map_t* x, const arr_t* k, u64_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_array_float (map_t* x, const arr_t* k, fl_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_array_double (map_t* x, const arr_t* k, dbl_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_array_ldouble(map_t* x, const arr_t* k, ldbl_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_list_pointer(map_t* x, const list_t* k, const void* v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_list_cstring(map_t* x, const list_t* k, const char* v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_list_string (map_t* x, const list_t* k, const str_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_list_array (map_t* x, const list_t* k, const arr_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_list_list (map_t* x, const list_t* k, const list_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_list_map (map_t* x, const list_t* k, const map_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_list_vset (map_t* x, const list_t* k, const set_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_list_dict (map_t* x, const list_t* k, const dict_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_list_boolean(map_t* x, const list_t* k, bool v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_list_int8 (map_t* x, const list_t* k, s8_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_list_int16 (map_t* x, const list_t* k, s16_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_list_int32 (map_t* x, const list_t* k, s32_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_list_int64 (map_t* x, const list_t* k, s64_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_list_uint8 (map_t* x, const list_t* k, u8_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_list_uint16 (map_t* x, const list_t* k, u16_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_list_uint32 (map_t* x, const list_t* k, u32_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_list_uint64 (map_t* x, const list_t* k, u64_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_list_float (map_t* x, const list_t* k, fl_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_list_double (map_t* x, const list_t* k, dbl_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_list_ldouble(map_t* x, const list_t* k, ldbl_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_map_pointer(map_t* x, const map_t* k, const void* v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_map_cstring(map_t* x, const map_t* k, const char* v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_map_string (map_t* x, const map_t* k, const str_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_map_array (map_t* x, const map_t* k, const arr_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_map_list (map_t* x, const map_t* k, const list_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_map_map (map_t* x, const map_t* k, const map_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_map_vset (map_t* x, const map_t* k, const set_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_map_dict (map_t* x, const map_t* k, const dict_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_map_boolean(map_t* x, const map_t* k, bool v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_map_int8 (map_t* x, const map_t* k, s8_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_map_int16 (map_t* x, const map_t* k, s16_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_map_int32 (map_t* x, const map_t* k, s32_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_map_int64 (map_t* x, const map_t* k, s64_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_map_uint8 (map_t* x, const map_t* k, u8_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_map_uint16 (map_t* x, const map_t* k, u16_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_map_uint32 (map_t* x, const map_t* k, u32_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_map_uint64 (map_t* x, const map_t* k, u64_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_map_float (map_t* x, const map_t* k, fl_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_map_double (map_t* x, const map_t* k, dbl_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_map_ldouble(map_t* x, const map_t* k, ldbl_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_vset_pointer(map_t* x, const set_t* k, const void* v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_vset_cstring(map_t* x, const set_t* k, const char* v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_vset_string (map_t* x, const set_t* k, const str_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_vset_array (map_t* x, const set_t* k, const arr_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_vset_list (map_t* x, const set_t* k, const list_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_vset_map (map_t* x, const set_t* k, const map_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_vset_vset (map_t* x, const set_t* k, const set_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_vset_dict (map_t* x, const set_t* k, const dict_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_vset_boolean(map_t* x, const set_t* k, bool v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_vset_int8 (map_t* x, const set_t* k, s8_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_vset_int16 (map_t* x, const set_t* k, s16_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_vset_int32 (map_t* x, const set_t* k, s32_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_vset_int64 (map_t* x, const set_t* k, s64_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_vset_uint8 (map_t* x, const set_t* k, u8_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_vset_uint16 (map_t* x, const set_t* k, u16_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_vset_uint32 (map_t* x, const set_t* k, u32_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_vset_uint64 (map_t* x, const set_t* k, u64_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_vset_float (map_t* x, const set_t* k, fl_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_vset_double (map_t* x, const set_t* k, dbl_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_vset_ldouble(map_t* x, const set_t* k, ldbl_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_dict_pointer(map_t* x, const dict_t* k, const void* v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_dict_cstring(map_t* x, const dict_t* k, const char* v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_dict_string (map_t* x, const dict_t* k, const str_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_dict_array (map_t* x, const dict_t* k, const arr_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_dict_list (map_t* x, const dict_t* k, const list_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_dict_map (map_t* x, const dict_t* k, const map_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_dict_vset (map_t* x, const dict_t* k, const set_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_dict_dict (map_t* x, const dict_t* k, const dict_t* v) { return libcdsb_map_update(x, k, vtypeof(k), v, vtypeof( v)); }
bool libcdsb_map_update_dict_boolean(map_t* x, const dict_t* k, bool v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_dict_int8 (map_t* x, const dict_t* k, s8_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_dict_int16 (map_t* x, const dict_t* k, s16_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_dict_int32 (map_t* x, const dict_t* k, s32_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_dict_int64 (map_t* x, const dict_t* k, s64_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_dict_uint8 (map_t* x, const dict_t* k, u8_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_dict_uint16 (map_t* x, const dict_t* k, u16_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_dict_uint32 (map_t* x, const dict_t* k, u32_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_dict_uint64 (map_t* x, const dict_t* k, u64_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_dict_float (map_t* x, const dict_t* k, fl_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_dict_double (map_t* x, const dict_t* k, dbl_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_dict_ldouble(map_t* x, const dict_t* k, ldbl_t v) { return libcdsb_map_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
bool libcdsb_map_update_boolean_pointer(map_t* x, const bool k, const void* v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_boolean_cstring(map_t* x, const bool k, const char* v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_boolean_string (map_t* x, const bool k, const str_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_boolean_array (map_t* x, const bool k, const arr_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_boolean_list (map_t* x, const bool k, const list_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_boolean_map (map_t* x, const bool k, const map_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_boolean_vset (map_t* x, const bool k, const set_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_boolean_dict (map_t* x, const bool k, const dict_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_boolean_boolean(map_t* x, const bool k, bool v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_boolean_int8 (map_t* x, const bool k, s8_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_boolean_int16 (map_t* x, const bool k, s16_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_boolean_int32 (map_t* x, const bool k, s32_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_boolean_int64 (map_t* x, const bool k, s64_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_boolean_uint8 (map_t* x, const bool k, u8_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_boolean_uint16 (map_t* x, const bool k, u16_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_boolean_uint32 (map_t* x, const bool k, u32_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_boolean_uint64 (map_t* x, const bool k, u64_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_boolean_float (map_t* x, const bool k, fl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_boolean_double (map_t* x, const bool k, dbl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_boolean_ldouble(map_t* x, const bool k, ldbl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int8_pointer(map_t* x, const s8_t k, const void* v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int8_cstring(map_t* x, const s8_t k, const char* v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int8_string (map_t* x, const s8_t k, const str_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_int8_array (map_t* x, const s8_t k, const arr_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_int8_list (map_t* x, const s8_t k, const list_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_int8_map (map_t* x, const s8_t k, const map_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_int8_vset (map_t* x, const s8_t k, const set_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_int8_dict (map_t* x, const s8_t k, const dict_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_int8_boolean(map_t* x, const s8_t k, bool v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int8_int8 (map_t* x, const s8_t k, s8_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int8_int16 (map_t* x, const s8_t k, s16_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int8_int32 (map_t* x, const s8_t k, s32_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int8_int64 (map_t* x, const s8_t k, s64_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int8_uint8 (map_t* x, const s8_t k, u8_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int8_uint16 (map_t* x, const s8_t k, u16_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int8_uint32 (map_t* x, const s8_t k, u32_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int8_uint64 (map_t* x, const s8_t k, u64_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int8_float (map_t* x, const s8_t k, fl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int8_double (map_t* x, const s8_t k, dbl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int8_ldouble(map_t* x, const s8_t k, ldbl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int16_pointer(map_t* x, const s16_t k, const void* v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int16_cstring(map_t* x, const s16_t k, const char* v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int16_string (map_t* x, const s16_t k, const str_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_int16_array (map_t* x, const s16_t k, const arr_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_int16_list (map_t* x, const s16_t k, const list_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_int16_map (map_t* x, const s16_t k, const map_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_int16_vset (map_t* x, const s16_t k, const set_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_int16_dict (map_t* x, const s16_t k, const dict_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_int16_boolean(map_t* x, const s16_t k, bool v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int16_int8 (map_t* x, const s16_t k, s8_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int16_int16 (map_t* x, const s16_t k, s16_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int16_int32 (map_t* x, const s16_t k, s32_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int16_int64 (map_t* x, const s16_t k, s64_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int16_uint8 (map_t* x, const s16_t k, u8_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int16_uint16 (map_t* x, const s16_t k, u16_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int16_uint32 (map_t* x, const s16_t k, u32_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int16_uint64 (map_t* x, const s16_t k, u64_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int16_float (map_t* x, const s16_t k, fl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int16_double (map_t* x, const s16_t k, dbl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int16_ldouble(map_t* x, const s16_t k, ldbl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int32_pointer(map_t* x, const s32_t k, const void* v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int32_cstring(map_t* x, const s32_t k, const char* v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int32_string (map_t* x, const s32_t k, const str_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_int32_array (map_t* x, const s32_t k, const arr_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_int32_list (map_t* x, const s32_t k, const list_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_int32_map (map_t* x, const s32_t k, const map_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_int32_vset (map_t* x, const s32_t k, const set_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_int32_dict (map_t* x, const s32_t k, const dict_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_int32_boolean(map_t* x, const s32_t k, bool v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int32_int8 (map_t* x, const s32_t k, s8_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int32_int16 (map_t* x, const s32_t k, s16_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int32_int32 (map_t* x, const s32_t k, s32_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int32_int64 (map_t* x, const s32_t k, s64_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int32_uint8 (map_t* x, const s32_t k, u8_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int32_uint16 (map_t* x, const s32_t k, u16_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int32_uint32 (map_t* x, const s32_t k, u32_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int32_uint64 (map_t* x, const s32_t k, u64_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int32_float (map_t* x, const s32_t k, fl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int32_double (map_t* x, const s32_t k, dbl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int32_ldouble(map_t* x, const s32_t k, ldbl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int64_pointer(map_t* x, const s64_t k, const void* v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int64_cstring(map_t* x, const s64_t k, const char* v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int64_string (map_t* x, const s64_t k, const str_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_int64_array (map_t* x, const s64_t k, const arr_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_int64_list (map_t* x, const s64_t k, const list_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_int64_map (map_t* x, const s64_t k, const map_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_int64_vset (map_t* x, const s64_t k, const set_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_int64_dict (map_t* x, const s64_t k, const dict_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_int64_boolean(map_t* x, const s64_t k, bool v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int64_int8 (map_t* x, const s64_t k, s8_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int64_int16 (map_t* x, const s64_t k, s16_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int64_int32 (map_t* x, const s64_t k, s32_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int64_int64 (map_t* x, const s64_t k, s64_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int64_uint8 (map_t* x, const s64_t k, u8_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int64_uint16 (map_t* x, const s64_t k, u16_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int64_uint32 (map_t* x, const s64_t k, u32_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int64_uint64 (map_t* x, const s64_t k, u64_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int64_float (map_t* x, const s64_t k, fl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int64_double (map_t* x, const s64_t k, dbl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_int64_ldouble(map_t* x, const s64_t k, ldbl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint8_pointer(map_t* x, const u8_t k, const void* v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint8_cstring(map_t* x, const u8_t k, const char* v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint8_string (map_t* x, const u8_t k, const str_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_uint8_array (map_t* x, const u8_t k, const arr_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_uint8_list (map_t* x, const u8_t k, const list_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_uint8_map (map_t* x, const u8_t k, const map_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_uint8_vset (map_t* x, const u8_t k, const set_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_uint8_dict (map_t* x, const u8_t k, const dict_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_uint8_boolean(map_t* x, const u8_t k, bool v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint8_int8 (map_t* x, const u8_t k, s8_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint8_int16 (map_t* x, const u8_t k, s16_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint8_int32 (map_t* x, const u8_t k, s32_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint8_int64 (map_t* x, const u8_t k, s64_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint8_uint8 (map_t* x, const u8_t k, u8_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint8_uint16 (map_t* x, const u8_t k, u16_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint8_uint32 (map_t* x, const u8_t k, u32_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint8_uint64 (map_t* x, const u8_t k, u64_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint8_float (map_t* x, const u8_t k, fl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint8_double (map_t* x, const u8_t k, dbl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint8_ldouble(map_t* x, const u8_t k, ldbl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint16_pointer(map_t* x, const u16_t k, const void* v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint16_cstring(map_t* x, const u16_t k, const char* v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint16_string (map_t* x, const u16_t k, const str_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_uint16_array (map_t* x, const u16_t k, const arr_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_uint16_list (map_t* x, const u16_t k, const list_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_uint16_map (map_t* x, const u16_t k, const map_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_uint16_vset (map_t* x, const u16_t k, const set_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_uint16_dict (map_t* x, const u16_t k, const dict_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_uint16_boolean(map_t* x, const u16_t k, bool v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint16_int8 (map_t* x, const u16_t k, s8_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint16_int16 (map_t* x, const u16_t k, s16_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint16_int32 (map_t* x, const u16_t k, s32_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint16_int64 (map_t* x, const u16_t k, s64_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint16_uint8 (map_t* x, const u16_t k, u8_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint16_uint16 (map_t* x, const u16_t k, u16_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint16_uint32 (map_t* x, const u16_t k, u32_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint16_uint64 (map_t* x, const u16_t k, u64_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint16_float (map_t* x, const u16_t k, fl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint16_double (map_t* x, const u16_t k, dbl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint16_ldouble(map_t* x, const u16_t k, ldbl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint32_pointer(map_t* x, const u32_t k, const void* v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint32_cstring(map_t* x, const u32_t k, const char* v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint32_string (map_t* x, const u32_t k, const str_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_uint32_array (map_t* x, const u32_t k, const arr_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_uint32_list (map_t* x, const u32_t k, const list_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_uint32_map (map_t* x, const u32_t k, const map_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_uint32_vset (map_t* x, const u32_t k, const set_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_uint32_dict (map_t* x, const u32_t k, const dict_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_uint32_boolean(map_t* x, const u32_t k, bool v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint32_int8 (map_t* x, const u32_t k, s8_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint32_int16 (map_t* x, const u32_t k, s16_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint32_int32 (map_t* x, const u32_t k, s32_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint32_int64 (map_t* x, const u32_t k, s64_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint32_uint8 (map_t* x, const u32_t k, u8_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint32_uint16 (map_t* x, const u32_t k, u16_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint32_uint32 (map_t* x, const u32_t k, u32_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint32_uint64 (map_t* x, const u32_t k, u64_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint32_float (map_t* x, const u32_t k, fl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint32_double (map_t* x, const u32_t k, dbl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint32_ldouble(map_t* x, const u32_t k, ldbl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint64_pointer(map_t* x, const u64_t k, const void* v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint64_cstring(map_t* x, const u64_t k, const char* v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint64_string (map_t* x, const u64_t k, const str_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_uint64_array (map_t* x, const u64_t k, const arr_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_uint64_list (map_t* x, const u64_t k, const list_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_uint64_map (map_t* x, const u64_t k, const map_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_uint64_vset (map_t* x, const u64_t k, const set_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_uint64_dict (map_t* x, const u64_t k, const dict_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_uint64_boolean(map_t* x, const u64_t k, bool v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint64_int8 (map_t* x, const u64_t k, s8_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint64_int16 (map_t* x, const u64_t k, s16_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint64_int32 (map_t* x, const u64_t k, s32_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint64_int64 (map_t* x, const u64_t k, s64_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint64_uint8 (map_t* x, const u64_t k, u8_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint64_uint16 (map_t* x, const u64_t k, u16_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint64_uint32 (map_t* x, const u64_t k, u32_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint64_uint64 (map_t* x, const u64_t k, u64_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint64_float (map_t* x, const u64_t k, fl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint64_double (map_t* x, const u64_t k, dbl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_uint64_ldouble(map_t* x, const u64_t k, ldbl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_float_pointer(map_t* x, const fl_t k, const void* v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_float_cstring(map_t* x, const fl_t k, const char* v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_float_string (map_t* x, const fl_t k, const str_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_float_array (map_t* x, const fl_t k, const arr_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_float_list (map_t* x, const fl_t k, const list_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_float_map (map_t* x, const fl_t k, const map_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_float_vset (map_t* x, const fl_t k, const set_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_float_dict (map_t* x, const fl_t k, const dict_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_float_boolean(map_t* x, const fl_t k, bool v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_float_int8 (map_t* x, const fl_t k, s8_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_float_int16 (map_t* x, const fl_t k, s16_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_float_int32 (map_t* x, const fl_t k, s32_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_float_int64 (map_t* x, const fl_t k, s64_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_float_uint8 (map_t* x, const fl_t k, u8_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_float_uint16 (map_t* x, const fl_t k, u16_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_float_uint32 (map_t* x, const fl_t k, u32_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_float_uint64 (map_t* x, const fl_t k, u64_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_float_float (map_t* x, const fl_t k, fl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_float_double (map_t* x, const fl_t k, dbl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_float_ldouble(map_t* x, const fl_t k, ldbl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_double_pointer(map_t* x, const dbl_t k, const void* v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_double_cstring(map_t* x, const dbl_t k, const char* v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_double_string (map_t* x, const dbl_t k, const str_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_double_array (map_t* x, const dbl_t k, const arr_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_double_list (map_t* x, const dbl_t k, const list_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_double_map (map_t* x, const dbl_t k, const map_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_double_vset (map_t* x, const dbl_t k, const set_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_double_dict (map_t* x, const dbl_t k, const dict_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_double_boolean(map_t* x, const dbl_t k, bool v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_double_int8 (map_t* x, const dbl_t k, s8_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_double_int16 (map_t* x, const dbl_t k, s16_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_double_int32 (map_t* x, const dbl_t k, s32_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_double_int64 (map_t* x, const dbl_t k, s64_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_double_uint8 (map_t* x, const dbl_t k, u8_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_double_uint16 (map_t* x, const dbl_t k, u16_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_double_uint32 (map_t* x, const dbl_t k, u32_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_double_uint64 (map_t* x, const dbl_t k, u64_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_double_float (map_t* x, const dbl_t k, fl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_double_double (map_t* x, const dbl_t k, dbl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_double_ldouble(map_t* x, const dbl_t k, ldbl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_ldouble_pointer(map_t* x, const ldbl_t k, const void* v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_ldouble_cstring(map_t* x, const ldbl_t k, const char* v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_ldouble_string (map_t* x, const ldbl_t k, const str_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_ldouble_array (map_t* x, const ldbl_t k, const arr_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_ldouble_list (map_t* x, const ldbl_t k, const list_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_ldouble_map (map_t* x, const ldbl_t k, const map_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_ldouble_vset (map_t* x, const ldbl_t k, const set_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_ldouble_dict (map_t* x, const ldbl_t k, const dict_t* v) { return libcdsb_map_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
bool libcdsb_map_update_ldouble_boolean(map_t* x, const ldbl_t k, bool v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_ldouble_int8 (map_t* x, const ldbl_t k, s8_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_ldouble_int16 (map_t* x, const ldbl_t k, s16_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_ldouble_int32 (map_t* x, const ldbl_t k, s32_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_ldouble_int64 (map_t* x, const ldbl_t k, s64_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_ldouble_uint8 (map_t* x, const ldbl_t k, u8_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_ldouble_uint16 (map_t* x, const ldbl_t k, u16_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_ldouble_uint32 (map_t* x, const ldbl_t k, u32_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_ldouble_uint64 (map_t* x, const ldbl_t k, u64_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_ldouble_float (map_t* x, const ldbl_t k, fl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_ldouble_double (map_t* x, const ldbl_t k, dbl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
bool libcdsb_map_update_ldouble_ldouble(map_t* x, const ldbl_t k, ldbl_t v) { return libcdsb_map_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }

View File

@ -1,7 +1,7 @@
/* This software is licensed by the MIT License, see LICENSE file */
/* Copyright © 2022 Gregory Lirent */
#include "../../include/extra/map.h"
#include "../../include/map.h"
#include "../__internal/assert.h"
#include "../__internal/rbtree.h"
@ -19,14 +19,13 @@ typedef struct libcdsb_map_node {
vnode_t value;
} mnode_t;
static_assert(offsetof(struct libcdsb_rbtree_node, left) == offsetof(struct libcdsb_map_node, left), "Implementation assert");
static_assert(offsetof(struct libcdsb_rbtree_node, right) == offsetof(struct libcdsb_map_node, right), "Implementation assert");
static_assert(offsetof(struct libcdsb_rbtree_node, parent) == offsetof(struct libcdsb_map_node, parent), "Implementation assert");
static_assert(offsetof(struct libcdsb_rbtree_node, left) == offsetof(struct libcdsb_map_node, left), "Implementation assert");
static_assert(offsetof(struct libcdsb_rbtree_node, right) == offsetof(struct libcdsb_map_node, right), "Implementation assert");
static_assert(offsetof(struct libcdsb_rbtree_node, parent) == offsetof(struct libcdsb_map_node, parent), "Implementation assert");
static_assert(offsetof(struct libcdsb_rbtree_node, colored) == offsetof(struct libcdsb_map_node, colored), "Implementation assert");
static_assert(offsetof(struct libcdsb_rbtree_node, value) == offsetof(struct libcdsb_map_node, key), "Implementation assert");
static_assert(offsetof(struct libcdsb_set, root) == offsetof(struct libcdsb_map, root), "Implementation assert");
static_assert(offsetof(struct libcdsb_set, type) == offsetof(struct libcdsb_map, type), "Implementation assert");
static_assert(offsetof(struct libcdsb_rbtree_node, value) == offsetof(struct libcdsb_map_node, key), "Implementation assert");
static_assert(offsetof(struct libcdsb_set, root) == offsetof(struct libcdsb_map, root), "Implementation assert");
static_assert(offsetof(struct libcdsb_set, type) == offsetof(struct libcdsb_map, type), "Implementation assert");
#define mnode_empty ((mnode_t*)LIBCDSB_RBTREE_NODE_EMPTY)
#define mnode_create(k, p, c) ((mnode_t*)libcdsb_rbtree_node_create(k, (rbnode_t*)p, c, sizeof(mnode_t)))

41
src/map/memory.c Normal file
View File

@ -0,0 +1,41 @@
/* This software is licensed by the MIT License, see LICENSE file */
/* Copyright © 2022 Gregory Lirent */
#include "include.h"
void map_init(map_t* x, vtype t) {
x->root = mnode_empty;
x->type = t;
}
void map_free(map_t* x) {
mnode_t *t, *c;
c = x->root;
while (!mnode_is_empty(x->root)) {
if (!mnode_is_empty(c->left)) {
c = c->left;
} else if (!mnode_is_empty(c->right)) {
c = c->right;
} else if (!mnode_is_root(c)) {
vnode_free(&c->key, x->type);
vnode_free(&c->value, c->type);
t = c;
c = c->parent;
if (t == c->left) c->left = mnode_empty;
else c->right = mnode_empty;
free(t);
} else {
vnode_free(&c->key, x->type);
vnode_free(&c->value, c->type);
x->root = mnode_empty;
}
}
x->type = 0;
}

88
src/map/modify.c Normal file
View File

@ -0,0 +1,88 @@
/* This software is licensed by the MIT License, see LICENSE file */
/* Copyright © 2022 Gregory Lirent */
#include "include.h"
bool libcdsb_map_update(map_t* x, const void* k, vtype kt, const void* v, vtype vt) {
int cmp;
mnode_t* n;
mnode_t* p;
if (!mnode_is_empty(n = x->root)) {
do {
p = n;
cmp = vtype_compare(k, kt, vnode_peek(&n->key, kt), kt);
if (cmp == 0) {
vnode_free(&n->value, n->type);
n->value = vnode_create(v, vt);
n->type = vt;
return true;
}
n = (cmp < 0) ? n->left : n->right;
} while (!mnode_is_empty(n));
n = mnode_create(nullptr, p, 1);
if (cmp < 0) p->left = n;
else p->right = n;
if (!mnode_is_root(p))
mnode_fixup(&x->root, n);
} else n = x->root = mnode_create(nullptr, mnode_empty, 0);
n->key = vnode_tcreate(x->type, k, kt);
n->value = vnode_create(v, vt);
n->type = vt;
return false;
}
bool libcdsb_map_inject(map_t* x, const void* k, vtype kt, const void* v, vtype vt) {
int cmp;
mnode_t* n;
mnode_t* p;
vnode_t kn;
vnode_tattach(&kn, x->type, k, kt);
n = x->root;
kt = x->type;
k = vnode_peek(&kn, kt);
if (!mnode_is_empty(n)) {
do {
p = n;
cmp = vtype_compare(k, kt, vnode_peek(&n->key, kt), kt);
if (cmp == 0) {
vnode_free(&n->key, x->type);
vnode_free(&n->value, n->type);
n->key = kn;
vnode_attach(&n->value, v, n->type = vt);
return true;
}
n = (cmp < 0) ? n->left : n->right;
} while (!mnode_is_empty(n));
n = mnode_create(kn, p, 1);
if (cmp < 0) p->left = n;
else p->right = n;
if (!mnode_is_root(p))
mnode_fixup(&x->root, n);
} else n = x->root = mnode_create(kn, mnode_empty, 0);
vnode_attach(&n->value, v, n->type = vt);
return false;
}

View File

@ -3,9 +3,9 @@
#include "../../../include/extra/string.h"
#include "../../../include/array.h"
#include "../../../include/extra/list.h"
#include "../../../include/extra/set.h"
#include "../../../include/extra/map.h"
#include "../../../include/list.h"
#include "../../../include/set.h"
#include "../../../include/map.h"
#include "../../../include/extra/dict.h"
#include "../../include/random.h"