Merge branch 'develop' of lirent/libcdsb into master
This commit is contained in:
commit
2b108b28fa
7
Makefile
7
Makefile
@ -34,7 +34,8 @@ OBJECTS = $(call c_objects,./src/,)\
|
||||
$(call c_objects,./src/array/,array-)\
|
||||
$(call c_objects,./src/list/,list-)\
|
||||
$(call c_objects,./src/map/,map-)\
|
||||
$(call c_objects,./src/set/,set-)
|
||||
$(call c_objects,./src/set/,set-)\
|
||||
$(call c_objects,./src/dict/,dict-)
|
||||
|
||||
########################################################################################################################
|
||||
|
||||
@ -53,6 +54,8 @@ $(DEBUG_PATH)/obj/map-%.o: ./src/map/%.c | $(DEBUG_PATH)/obj/
|
||||
$(CC) $^ -o $@ $(CFLAGS)
|
||||
$(DEBUG_PATH)/obj/set-%.o: ./src/set/%.c | $(DEBUG_PATH)/obj/
|
||||
$(CC) $^ -o $@ $(CFLAGS)
|
||||
$(DEBUG_PATH)/obj/dict-%.o: ./src/dict/%.c | $(DEBUG_PATH)/obj/
|
||||
$(CC) $^ -o $@ $(CFLAGS)
|
||||
$(DEBUG_PATH)/obj/%.o: ./src/%.c | $(DEBUG_PATH)/obj/
|
||||
$(CC) $^ -o $@ $(CFLAGS)
|
||||
|
||||
@ -68,6 +71,8 @@ $(RELEASE_PATH)/obj/map-%.o: ./src/map/%.c | $(RELEASE_PATH)/obj/
|
||||
$(CC) $^ -o $@ $(CFLAGS)
|
||||
$(RELEASE_PATH)/obj/set-%.o: ./src/set/%.c | $(RELEASE_PATH)/obj/
|
||||
$(CC) $^ -o $@ $(CFLAGS)
|
||||
$(RELEASE_PATH)/obj/dict-%.o: ./src/dict/%.c | $(RELEASE_PATH)/obj/
|
||||
$(CC) $^ -o $@ $(CFLAGS)
|
||||
$(RELEASE_PATH)/obj/%.o: ./src/%.c | $(RELEASE_PATH)/obj/
|
||||
$(CC) $^ -o $@ $(CFLAGS)
|
||||
|
||||
|
40
examples/Makefile
Normal file
40
examples/Makefile
Normal file
@ -0,0 +1,40 @@
|
||||
# This software is licensed by the MIT License, see LICENSE file
|
||||
# Copyright © 2022 Gregory Lirent
|
||||
|
||||
########################################################################################################################
|
||||
|
||||
BUILD_PATH ?= ./bin
|
||||
|
||||
########################################################################################################################
|
||||
|
||||
CC = clang
|
||||
MKDIR = mkdir -p
|
||||
RMRF = rm -rf
|
||||
AR = ar crs
|
||||
CP = cp
|
||||
|
||||
########################################################################################################################
|
||||
|
||||
examples: modules
|
||||
examples: $(addprefix $(BUILD_PATH)/,$(notdir $(basename $(wildcard ./*.c))))
|
||||
|
||||
$(BUILD_PATH)/%: ./%.c | $(BUILD_PATH)/
|
||||
$(CC) $^ ../bin/release/libcdsb.a ../modules/libunic/bin/libunic.a -o $@ $(CFLAGS) -O2 -Wall
|
||||
|
||||
|
||||
$(BUILD_PATH)/:
|
||||
$(MKDIR) $@
|
||||
$(BUILD_PATH)/obj/: | $(BUILD_PATH)/
|
||||
$(MKDIR) $@
|
||||
|
||||
clean:
|
||||
$(RMRF) ./bin/
|
||||
cd ../ && $(MAKE) clean
|
||||
|
||||
########################################################################################################################
|
||||
|
||||
FORCE:
|
||||
modules: ../bin/release/libcdsb.a
|
||||
|
||||
../bin/release/libcdsb.a: FORCE
|
||||
cd ../ && $(MAKE) release
|
37
examples/array.c
Normal file
37
examples/array.c
Normal file
@ -0,0 +1,37 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include "../include/extra/array.h"
|
||||
|
||||
typedef vtype_array arr_t;
|
||||
|
||||
int print_value(void* value, ssize_t index, vtype type, void* data) {
|
||||
const char *n = data;
|
||||
vtype_int32 *v = value;
|
||||
|
||||
assert(type == VTYPE_INT32);
|
||||
|
||||
printf("%s %d (index: %ld)\n", n, *v, index);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
arr_t arr;
|
||||
|
||||
array_init(&arr, VTYPE_INT32);
|
||||
|
||||
for (size_t i = 0; i < 28; ++i) {
|
||||
array_push_back(&arr, i);
|
||||
}
|
||||
|
||||
array_get_by_index(&arr, 13, "Get value:", print_value);
|
||||
array_pop_by_index(&arr, 18, "Pop value:", print_value);
|
||||
|
||||
array_foreach(&arr, "Foreach loop:", print_value);
|
||||
|
||||
array_free(&arr);
|
||||
}
|
61
examples/dict.c
Normal file
61
examples/dict.c
Normal file
@ -0,0 +1,61 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "../include/extra/dict.h"
|
||||
|
||||
typedef vtype_dict dict_t;
|
||||
|
||||
int print_value(const void* key, vtype key_type, void* value, vtype value_type, void* data) {
|
||||
const char *n = data;
|
||||
|
||||
switch (key_type) {
|
||||
default: abort();
|
||||
|
||||
case VTYPE_INT32:
|
||||
printf("%s %d: ", n, *(vtype_int32*)key);
|
||||
break;
|
||||
case VTYPE_FLOAT:
|
||||
printf("%s %f: ", n, *(vtype_float*)key);
|
||||
break;
|
||||
}
|
||||
|
||||
switch (value_type) {
|
||||
default: abort();
|
||||
|
||||
case VTYPE_INT32:
|
||||
printf("%d\n", *(vtype_int32*)value);
|
||||
break;
|
||||
case VTYPE_FLOAT:
|
||||
printf("%f\n", *(vtype_float*)value);
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
dict_t dict;
|
||||
vtype_float fl = 0.0;
|
||||
|
||||
dict_init(&dict);
|
||||
|
||||
for (size_t i = 0; i < 28; ++i) {
|
||||
if (i%2) {
|
||||
dict_update(&dict, (vtype_float)fl, (vtype_int32)i);
|
||||
} else {
|
||||
dict_update(&dict, (vtype_int32)i, (vtype_float)fl);
|
||||
}
|
||||
fl += 0.05;
|
||||
}
|
||||
|
||||
dict_get(&dict, 14, "Get value:", print_value);
|
||||
dict_pop(&dict, 0.25, "Pop value:", print_value);
|
||||
|
||||
dict_foreach(&dict, "Foreach loop:", print_value);
|
||||
|
||||
dict_free(&dict);
|
||||
}
|
51
examples/list.c
Normal file
51
examples/list.c
Normal file
@ -0,0 +1,51 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "../include/extra/list.h"
|
||||
|
||||
typedef vtype_list list_t;
|
||||
|
||||
|
||||
int print_value(void* value, ssize_t index, vtype type, void* data) {
|
||||
const char *n = data;
|
||||
|
||||
switch (type) {
|
||||
default: abort();
|
||||
|
||||
case VTYPE_INT32:
|
||||
printf("%s %d (index: %ld)\n", n, *(vtype_int32*)value, index);
|
||||
break;
|
||||
case VTYPE_FLOAT:
|
||||
printf("%s %f (index: %ld)\n", n, *(vtype_float*)value, index);
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
list_t list;
|
||||
vtype_float fl = 0.0;
|
||||
|
||||
list_init(&list);
|
||||
|
||||
for (size_t i = 0; i < 28; ++i) {
|
||||
if (i%2) {
|
||||
list_push_back(&list, (vtype_int32)i);
|
||||
} else {
|
||||
list_push_back(&list, (vtype_float)fl);
|
||||
fl += 0.05;
|
||||
}
|
||||
}
|
||||
|
||||
list_get_by_index(&list, 13, "Get value:", print_value);
|
||||
list_pop_by_index(&list, 18, "Pop value:", print_value);
|
||||
|
||||
list_foreach(&list, "Foreach loop:", print_value);
|
||||
|
||||
list_free(&list);
|
||||
}
|
55
examples/map.c
Normal file
55
examples/map.c
Normal file
@ -0,0 +1,55 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "../include/extra/map.h"
|
||||
|
||||
typedef vtype_map map_t;
|
||||
|
||||
int print_value(const void* key, vtype key_type, void* value, vtype value_type, void* data) {
|
||||
const char *n = data;
|
||||
vtype_int32 *k = (void*)key;
|
||||
|
||||
assert(key_type == VTYPE_INT32);
|
||||
|
||||
printf("%s %d: ", n, *k);
|
||||
|
||||
switch (value_type) {
|
||||
default: abort();
|
||||
|
||||
case VTYPE_INT32:
|
||||
printf("%d\n", *(vtype_int32*)value);
|
||||
break;
|
||||
case VTYPE_FLOAT:
|
||||
printf("%f\n", *(vtype_float*)value);
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
map_t map;
|
||||
vtype_float fl = 0.0;
|
||||
|
||||
map_init(&map, VTYPE_INT32);
|
||||
|
||||
for (size_t i = 0; i < 28; ++i) {
|
||||
if (i%2) {
|
||||
map_update(&map, i, (vtype_int32)i);
|
||||
} else {
|
||||
map_update(&map, i, (vtype_float)fl);
|
||||
fl += 0.05;
|
||||
}
|
||||
}
|
||||
|
||||
map_get(&map, 13, "Get value:", print_value);
|
||||
map_pop(&map, 18, "Pop value:", print_value);
|
||||
|
||||
map_foreach(&map, "Foreach loop:", print_value);
|
||||
|
||||
map_free(&map);
|
||||
}
|
38
examples/set.c
Normal file
38
examples/set.c
Normal file
@ -0,0 +1,38 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include "../include/extra/set.h"
|
||||
|
||||
typedef vtype_set vset_t;
|
||||
|
||||
int print_value(const void* value, vtype type, void* data) {
|
||||
const char *n = data;
|
||||
vtype_int32 *v = (void*)value;
|
||||
|
||||
assert(type == VTYPE_INT32);
|
||||
|
||||
printf("%s %d\n", n, *v);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
vset_t set;
|
||||
|
||||
vset_init(&set, VTYPE_INT32);
|
||||
|
||||
for (size_t i = 0; i < 28; ++i) {
|
||||
vset_push(&set, i);
|
||||
}
|
||||
|
||||
vset_get(&set, 13, "Get value:", print_value);
|
||||
vset_pop(&set, 18, "Pop value:", print_value);
|
||||
|
||||
vset_foreach(&set, "Foreach loop:", print_value);
|
||||
|
||||
vset_free(&set);
|
||||
}
|
42
examples/string.c
Normal file
42
examples/string.c
Normal file
@ -0,0 +1,42 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "../include/extra/string.h"
|
||||
#include "../include/extra/array.h"
|
||||
|
||||
typedef vtype_string str_t;
|
||||
typedef vtype_array arr_t;
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
str_t str;
|
||||
|
||||
string_init(&str, "sed ut perspiciatis");
|
||||
|
||||
string_concat(&str, ", Unde omnis iste natus error sit voluptatem accusantium doloremque laudantium");
|
||||
string_concat(&str, ", Totam rem aperiam eaque ipsa");
|
||||
string_concat(&str, ", Quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt");
|
||||
string_concat(&str, ", Explicabo.");
|
||||
|
||||
string_capitalize(&str);
|
||||
|
||||
string_reverse(&str);
|
||||
|
||||
printf("%s\n", str.buffer);
|
||||
|
||||
arr_t parts = string_split(&str, ',', -1);
|
||||
|
||||
printf("%lu\n", array_size(&parts));
|
||||
|
||||
for (size_t i = 0; i < array_size(&parts); ++i) {
|
||||
str_t* value = array_at(&parts, i);
|
||||
|
||||
string_trim_spaces(value);
|
||||
|
||||
printf("%s (%lu)\n", value->buffer, string_nmemb(value));
|
||||
}
|
||||
|
||||
array_free(&parts);
|
||||
string_free(&str);
|
||||
}
|
@ -4,20 +4,9 @@
|
||||
#ifndef LIBCDSB_CORE_ATTRIBUTES_H
|
||||
#define LIBCDSB_CORE_ATTRIBUTES_H
|
||||
|
||||
#define LIBCDSB_nt__ __attribute__ ((nothrow))
|
||||
#define LIBCDSB_nn1__ __attribute__ ((nonnull (1)))
|
||||
#define LIBCDSB_nn2__ __attribute__ ((nonnull (2)))
|
||||
#define LIBCDSB_nn12__ __attribute__ ((nonnull (1,2)))
|
||||
#define LIBCDSB_nn123__ __attribute__ ((nonnull (1,2,3)))
|
||||
#define LIBCDSB_nn124__ __attribute__ ((nonnull (1,2,4)))
|
||||
#define LIBCDSB_nn13__ __attribute__ ((nonnull (1,3)))
|
||||
#define LIBCDSB_nn23__ __attribute__ ((nonnull (2,3)))
|
||||
#define LIBCDSB_nn23__ __attribute__ ((nonnull (2,3)))
|
||||
#define LIBCDSB_pure__ LIBCDSB_nt__ __attribute__ ((pure))
|
||||
#define LIBCDSB_wur__ __attribute__ ((warn_unused_result))
|
||||
|
||||
#define LIBCDSB_cmpattr__ LIBCDSB_pure__ LIBCDSB_nn12__
|
||||
#define LIBCDSB_cpyattr__ LIBCDSB_pure__ LIBCDSB_wur__ LIBCDSB_nn1__
|
||||
#define LIBCDSB_dupattr__ LIBCDSB_wur__ LIBCDSB_nn1__
|
||||
#define Pure__ __attribute__ ((pure))
|
||||
#define Always_inline__ __attribute__ ((always_inline))
|
||||
#define Warn_unused_result__ __attribute__ ((warn_unused_result))
|
||||
#define Nonnull__(...) __attribute__ ((nonnull (__VA_ARGS__)))
|
||||
|
||||
#endif /* LIBCDSB_CORE_ATTRIBUTES_H */
|
||||
|
@ -12,6 +12,7 @@
|
||||
vtype_list*: T ## _ ## f ## _list, const vtype_list*: T ## _ ## f ## _list,\
|
||||
vtype_map*: T ## _ ## f ## _map, const vtype_map*: T ## _ ## f ## _map,\
|
||||
vtype_set*: T ## _ ## f ## _vset, const vtype_set*: T ## _ ## f ## _vset,\
|
||||
vtype_dict*: T ## _ ## f ## _dict, const vtype_dict*: T ## _ ## f ## _dict,\
|
||||
vtype_bool: T ## _ ## f ## _boolean,\
|
||||
vtype_uint8: T ## _ ## f ## _uint8,\
|
||||
vtype_uint16: T ## _ ## f ## _uint16,\
|
||||
@ -34,6 +35,7 @@
|
||||
vtype_list*: _LIBCDSB_Generic(T, f ## _list, v), const vtype_list*: _LIBCDSB_Generic(T, f ## _list, v),\
|
||||
vtype_map*: _LIBCDSB_Generic(T, f ## _map, v), const vtype_map*: _LIBCDSB_Generic(T, f ## _map, v),\
|
||||
vtype_set*: _LIBCDSB_Generic(T, f ## _vset, v), const vtype_set*: _LIBCDSB_Generic(T, f ## _vset, v),\
|
||||
vtype_dict*: _LIBCDSB_Generic(T, f ## _dict, v), const vtype_dict*: _LIBCDSB_Generic(T, f ## _dict, v),\
|
||||
vtype_bool: _LIBCDSB_Generic(T, f ## _boolean, v),\
|
||||
vtype_uint8: _LIBCDSB_Generic(T, f ## _uint8, v),\
|
||||
vtype_uint16: _LIBCDSB_Generic(T, f ## _uint16, v),\
|
||||
@ -66,25 +68,4 @@
|
||||
short: _LIBCDSB_GenericS(T, f ## _char, d), unsigned short: _LIBCDSB_GenericS(T, f ## _char, d)\
|
||||
)
|
||||
|
||||
#define _LIBCDSB_GenericP(T, f, v) _Generic((v),\
|
||||
void**: T ## _ ## f ## _pointers, const void**: T ## _ ## f ## _pointers,\
|
||||
STRING_VIEW*: T ## _ ## f ## _strings, const STRING_VIEW*: T ## _ ## f ## _strings,\
|
||||
ARRAY*: T ## _ ## f ## _arrays, const ARRAY*: T ## _ ## f ## _arrays,\
|
||||
LIST*: T ## _ ## f ## _lists, const LIST*: T ## _ ## f ## _lists,\
|
||||
MAP*: T ## _ ## f ## _maps, const MAP*: T ## _ ## f ## _maps,\
|
||||
VSET*: T ## _ ## f ## _vsets, const VSET*: T ## _ ## f ## _vsets,\
|
||||
vtype_bool*: T ## _ ## f ## _booleans, const vtype_bool*: T ## _ ## f ## _booleans,\
|
||||
vtype_uint8*: T ## _ ## f ## _uint8s, const vtype_uint8*: T ## _ ## f ## _uint8s,\
|
||||
vtype_uint16*: T ## _ ## f ## _uint16s, const vtype_uint16*: T ## _ ## f ## _uint16s,\
|
||||
vtype_uint32*: T ## _ ## f ## _uint32s, const vtype_uint32*: T ## _ ## f ## _uint32s,\
|
||||
vtype_uint64*: T ## _ ## f ## _uint64s, const vtype_uint64*: T ## _ ## f ## _uint64s,\
|
||||
vtype_int8*: T ## _ ## f ## _int8s, const vtype_int8*: T ## _ ## f ## _int8s,\
|
||||
vtype_int16*: T ## _ ## f ## _int16s, const vtype_int16*: T ## _ ## f ## _int16s,\
|
||||
vtype_int32*: T ## _ ## f ## _int32s, const vtype_int32*: T ## _ ## f ## _int32s,\
|
||||
vtype_int64*: T ## _ ## f ## _int64s, const vtype_int64*: T ## _ ## f ## _int64s,\
|
||||
vtype_float*: T ## _ ## f ## _floats, const vtype_float*: T ## _ ## f ## _floats,\
|
||||
vtype_double*: T ## _ ## f ## _doubles, const vtype_double*: T ## _ ## f ## _doubles,\
|
||||
vtype_ldouble*: T ## _ ## f ## _ldoubles, const vtype_ldouble*: T ## _ ## f ## _ldoubles\
|
||||
)
|
||||
|
||||
#endif /* LIBCDSB_CORE_GENERICS_H */
|
||||
|
130
include/array.h
130
include/array.h
@ -11,18 +11,17 @@
|
||||
|
||||
typedef int (*array_access_callback)(void* value, ssize_t index, vtype type, void* data);
|
||||
|
||||
extern void array_init(vtype_array* x, vtype type) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern void array_init (vtype_array* x, vtype type) Nonnull__(1);
|
||||
extern void* array_at (const vtype_array* s, ssize_t index) Nonnull__(1);
|
||||
extern size_t array_slice(vtype_array* x, vtype_array* src, ssize_t index, size_t count, bool cut) Nonnull__(1);
|
||||
|
||||
extern void* array_at(const vtype_array* s, ssize_t index) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern size_t array_slice(vtype_array* x, vtype_array* src, ssize_t index, size_t count, _Bool cut) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
|
||||
extern void array_sort (vtype_array* x) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern void array_reverse(vtype_array* x) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern void array_sort (vtype_array* x) Nonnull__(1);
|
||||
extern void array_reverse(vtype_array* x) Nonnull__(1);
|
||||
|
||||
#define array_pop(x, value, data, callback) _LIBCDSB_Generic(libcdsb_array, find, value)(x, value, data, callback, 0, 1)
|
||||
#define array_find(x, value, data, callback) _LIBCDSB_Generic(libcdsb_array, find, value)(x, value, data, callback, 0, 0)
|
||||
#define array_rfind(x, value, data, callback) _LIBCDSB_Generic(libcdsb_array, find, value)(x, value, data, callback, 1, 0)
|
||||
#define list_countof(x, value) _LIBCDSB_Generic(libcdsb_array, count, value)(x, value)
|
||||
#define array_countof(x, value) _LIBCDSB_Generic(libcdsb_array, count, value)(x, value)
|
||||
#define array_remove(x, value) array_pop(x, value, 0, 0)
|
||||
#define in_array(x, value) (array_find(x, value, 0, 0) == 0)
|
||||
|
||||
@ -30,64 +29,67 @@ extern void array_reverse(vtype_array* x) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
extern void libcdsb_array_push_pointer(vtype_array* x, const void* value) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern void libcdsb_array_push_cstring(vtype_array* x, const char* value) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern void libcdsb_array_push_string (vtype_array* x, const vtype_string* value) LIBCDSB_nt__ LIBCDSB_nn12__;
|
||||
extern void libcdsb_array_push_array (vtype_array* x, const vtype_array* value) LIBCDSB_nt__ LIBCDSB_nn12__;
|
||||
extern void libcdsb_array_push_list (vtype_array* x, const vtype_list* value) LIBCDSB_nt__ LIBCDSB_nn12__;
|
||||
extern void libcdsb_array_push_map (vtype_array* x, const vtype_map* value) LIBCDSB_nt__ LIBCDSB_nn12__;
|
||||
extern void libcdsb_array_push_vset (vtype_array* x, const vtype_set* value) LIBCDSB_nt__ LIBCDSB_nn12__;
|
||||
extern void libcdsb_array_push_boolean(vtype_array* x, vtype_bool value) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern void libcdsb_array_push_uint8 (vtype_array* x, vtype_uint8 value) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern void libcdsb_array_push_uint16 (vtype_array* x, vtype_uint16 value) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern void libcdsb_array_push_uint32 (vtype_array* x, vtype_uint32 value) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern void libcdsb_array_push_uint64 (vtype_array* x, vtype_uint64 value) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern void libcdsb_array_push_int8 (vtype_array* x, vtype_int8 value) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern void libcdsb_array_push_int16 (vtype_array* x, vtype_int16 value) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern void libcdsb_array_push_int32 (vtype_array* x, vtype_int32 value) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern void libcdsb_array_push_int64 (vtype_array* x, vtype_int64 value) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern void libcdsb_array_push_float (vtype_array* x, vtype_float value) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern void libcdsb_array_push_double (vtype_array* x, vtype_double value) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern void libcdsb_array_push_ldouble(vtype_array* x, vtype_ldouble value) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern void libcdsb_array_push_pointer(vtype_array* x, const void* value) Nonnull__(1);
|
||||
extern void libcdsb_array_push_cstring(vtype_array* x, const char* value) Nonnull__(1,2);
|
||||
extern void libcdsb_array_push_string (vtype_array* x, const vtype_string* value) Nonnull__(1,2);
|
||||
extern void libcdsb_array_push_array (vtype_array* x, const vtype_array* value) Nonnull__(1,2);
|
||||
extern void libcdsb_array_push_list (vtype_array* x, const vtype_list* value) Nonnull__(1,2);
|
||||
extern void libcdsb_array_push_map (vtype_array* x, const vtype_map* value) Nonnull__(1,2);
|
||||
extern void libcdsb_array_push_vset (vtype_array* x, const vtype_set* value) Nonnull__(1,2);
|
||||
extern void libcdsb_array_push_dict (vtype_array* x, const vtype_dict* value) Nonnull__(1,2);
|
||||
extern void libcdsb_array_push_boolean(vtype_array* x, vtype_bool value) Nonnull__(1);
|
||||
extern void libcdsb_array_push_uint8 (vtype_array* x, vtype_uint8 value) Nonnull__(1);
|
||||
extern void libcdsb_array_push_uint16 (vtype_array* x, vtype_uint16 value) Nonnull__(1);
|
||||
extern void libcdsb_array_push_uint32 (vtype_array* x, vtype_uint32 value) Nonnull__(1);
|
||||
extern void libcdsb_array_push_uint64 (vtype_array* x, vtype_uint64 value) Nonnull__(1);
|
||||
extern void libcdsb_array_push_int8 (vtype_array* x, vtype_int8 value) Nonnull__(1);
|
||||
extern void libcdsb_array_push_int16 (vtype_array* x, vtype_int16 value) Nonnull__(1);
|
||||
extern void libcdsb_array_push_int32 (vtype_array* x, vtype_int32 value) Nonnull__(1);
|
||||
extern void libcdsb_array_push_int64 (vtype_array* x, vtype_int64 value) Nonnull__(1);
|
||||
extern void libcdsb_array_push_float (vtype_array* x, vtype_float value) Nonnull__(1);
|
||||
extern void libcdsb_array_push_double (vtype_array* x, vtype_double value) Nonnull__(1);
|
||||
extern void libcdsb_array_push_ldouble(vtype_array* x, vtype_ldouble value) Nonnull__(1);
|
||||
|
||||
extern size_t libcdsb_array_count_pointer(const vtype_array* s, const void* value);
|
||||
extern size_t libcdsb_array_count_cstring(const vtype_array* s, const char* value);
|
||||
extern size_t libcdsb_array_count_string (const vtype_array* s, const vtype_string* value);
|
||||
extern size_t libcdsb_array_count_array (const vtype_array* s, const vtype_array* value);
|
||||
extern size_t libcdsb_array_count_list (const vtype_array* s, const vtype_list* value);
|
||||
extern size_t libcdsb_array_count_map (const vtype_array* s, const vtype_map* value);
|
||||
extern size_t libcdsb_array_count_vset (const vtype_array* s, const vtype_set* value);
|
||||
extern size_t libcdsb_array_count_boolean(const vtype_array* s, vtype_bool value);
|
||||
extern size_t libcdsb_array_count_int8 (const vtype_array* s, vtype_int8 value);
|
||||
extern size_t libcdsb_array_count_int16 (const vtype_array* s, vtype_int16 value);
|
||||
extern size_t libcdsb_array_count_int32 (const vtype_array* s, vtype_int32 value);
|
||||
extern size_t libcdsb_array_count_int64 (const vtype_array* s, vtype_int64 value);
|
||||
extern size_t libcdsb_array_count_uint8 (const vtype_array* s, vtype_uint8 value);
|
||||
extern size_t libcdsb_array_count_uint16 (const vtype_array* s, vtype_uint16 value);
|
||||
extern size_t libcdsb_array_count_uint32 (const vtype_array* s, vtype_uint32 value);
|
||||
extern size_t libcdsb_array_count_uint64 (const vtype_array* s, vtype_uint64 value);
|
||||
extern size_t libcdsb_array_count_float (const vtype_array* s, vtype_float value);
|
||||
extern size_t libcdsb_array_count_double (const vtype_array* s, vtype_double value);
|
||||
extern size_t libcdsb_array_count_ldouble(const vtype_array* s, vtype_ldouble value);
|
||||
extern size_t libcdsb_array_count_pointer(const vtype_array* s, const void* value) Nonnull__(1);
|
||||
extern size_t libcdsb_array_count_cstring(const vtype_array* s, const char* value) Nonnull__(1,2);
|
||||
extern size_t libcdsb_array_count_string (const vtype_array* s, const vtype_string* value) Nonnull__(1,2);
|
||||
extern size_t libcdsb_array_count_array (const vtype_array* s, const vtype_array* value) Nonnull__(1,2);
|
||||
extern size_t libcdsb_array_count_list (const vtype_array* s, const vtype_list* value) Nonnull__(1,2);
|
||||
extern size_t libcdsb_array_count_map (const vtype_array* s, const vtype_map* value) Nonnull__(1,2);
|
||||
extern size_t libcdsb_array_count_vset (const vtype_array* s, const vtype_set* value) Nonnull__(1,2);
|
||||
extern size_t libcdsb_array_count_dict (const vtype_array* s, const vtype_dict* value) Nonnull__(1,2);
|
||||
extern size_t libcdsb_array_count_boolean(const vtype_array* s, vtype_bool value) Nonnull__(1);
|
||||
extern size_t libcdsb_array_count_int8 (const vtype_array* s, vtype_int8 value) Nonnull__(1);
|
||||
extern size_t libcdsb_array_count_int16 (const vtype_array* s, vtype_int16 value) Nonnull__(1);
|
||||
extern size_t libcdsb_array_count_int32 (const vtype_array* s, vtype_int32 value) Nonnull__(1);
|
||||
extern size_t libcdsb_array_count_int64 (const vtype_array* s, vtype_int64 value) Nonnull__(1);
|
||||
extern size_t libcdsb_array_count_uint8 (const vtype_array* s, vtype_uint8 value) Nonnull__(1);
|
||||
extern size_t libcdsb_array_count_uint16 (const vtype_array* s, vtype_uint16 value) Nonnull__(1);
|
||||
extern size_t libcdsb_array_count_uint32 (const vtype_array* s, vtype_uint32 value) Nonnull__(1);
|
||||
extern size_t libcdsb_array_count_uint64 (const vtype_array* s, vtype_uint64 value) Nonnull__(1);
|
||||
extern size_t libcdsb_array_count_float (const vtype_array* s, vtype_float value) Nonnull__(1);
|
||||
extern size_t libcdsb_array_count_double (const vtype_array* s, vtype_double value) Nonnull__(1);
|
||||
extern size_t libcdsb_array_count_ldouble(const vtype_array* s, vtype_ldouble value) Nonnull__(1);
|
||||
|
||||
extern int libcdsb_array_find_pointer(vtype_array* x, const void* value, void* data, array_access_callback, bool reverse, bool cut) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern int libcdsb_array_find_string (vtype_array* x, const char* value, void* data, array_access_callback, bool reverse, bool cut) LIBCDSB_nt__ LIBCDSB_nn12__;
|
||||
extern int libcdsb_array_find_array (vtype_array* x, const vtype_string* value, void* data, array_access_callback, bool reverse, bool cut) LIBCDSB_nt__ LIBCDSB_nn12__;
|
||||
extern int libcdsb_array_find_list (vtype_array* x, const vtype_array* value, void* data, array_access_callback, bool reverse, bool cut) LIBCDSB_nt__ LIBCDSB_nn12__;
|
||||
extern int libcdsb_array_find_map (vtype_array* x, const vtype_list* value, void* data, array_access_callback, bool reverse, bool cut) LIBCDSB_nt__ LIBCDSB_nn12__;
|
||||
extern int libcdsb_array_find_vset (vtype_array* x, const vtype_map* value, void* data, array_access_callback, bool reverse, bool cut) LIBCDSB_nt__ LIBCDSB_nn12__;
|
||||
extern int libcdsb_array_find_cstring(vtype_array* x, const vtype_set* value, void* data, array_access_callback, bool reverse, bool cut) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern int libcdsb_array_find_boolean(vtype_array* x, vtype_bool value, void* data, array_access_callback, bool reverse, bool cut) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern int libcdsb_array_find_uint8 (vtype_array* x, vtype_uint8 value, void* data, array_access_callback, bool reverse, bool cut) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern int libcdsb_array_find_uint16 (vtype_array* x, vtype_uint16 value, void* data, array_access_callback, bool reverse, bool cut) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern int libcdsb_array_find_uint32 (vtype_array* x, vtype_uint32 value, void* data, array_access_callback, bool reverse, bool cut) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern int libcdsb_array_find_uint64 (vtype_array* x, vtype_uint64 value, void* data, array_access_callback, bool reverse, bool cut) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern int libcdsb_array_find_int8 (vtype_array* x, vtype_int8 value, void* data, array_access_callback, bool reverse, bool cut) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern int libcdsb_array_find_int16 (vtype_array* x, vtype_int16 value, void* data, array_access_callback, bool reverse, bool cut) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern int libcdsb_array_find_int32 (vtype_array* x, vtype_int32 value, void* data, array_access_callback, bool reverse, bool cut) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern int libcdsb_array_find_int64 (vtype_array* x, vtype_int64 value, void* data, array_access_callback, bool reverse, bool cut) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern int libcdsb_array_find_float (vtype_array* x, vtype_float value, void* data, array_access_callback, bool reverse, bool cut) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern int libcdsb_array_find_double (vtype_array* x, vtype_double value, void* data, array_access_callback, bool reverse, bool cut) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern int libcdsb_array_find_ldouble(vtype_array* x, vtype_ldouble value, void* data, array_access_callback, bool reverse, bool cut) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern int libcdsb_array_find_pointer(vtype_array* x, const void* value, void* data, array_access_callback, bool reverse, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_array_find_cstring(vtype_array* x, const char* value, void* data, array_access_callback, bool reverse, bool cut) Nonnull__(1,2);
|
||||
extern int libcdsb_array_find_string (vtype_array* x, const vtype_string* value, void* data, array_access_callback, bool reverse, bool cut) Nonnull__(1,2);
|
||||
extern int libcdsb_array_find_array (vtype_array* x, const vtype_array* value, void* data, array_access_callback, bool reverse, bool cut) Nonnull__(1,2);
|
||||
extern int libcdsb_array_find_list (vtype_array* x, const vtype_list* value, void* data, array_access_callback, bool reverse, bool cut) Nonnull__(1,2);
|
||||
extern int libcdsb_array_find_map (vtype_array* x, const vtype_map* value, void* data, array_access_callback, bool reverse, bool cut) Nonnull__(1,2);
|
||||
extern int libcdsb_array_find_vset (vtype_array* x, const vtype_set* value, void* data, array_access_callback, bool reverse, bool cut) Nonnull__(1,2);
|
||||
extern int libcdsb_array_find_dict (vtype_array* x, const vtype_dict* value, void* data, array_access_callback, bool reverse, bool cut) Nonnull__(1,2);
|
||||
extern int libcdsb_array_find_boolean(vtype_array* x, vtype_bool value, void* data, array_access_callback, bool reverse, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_array_find_uint8 (vtype_array* x, vtype_uint8 value, void* data, array_access_callback, bool reverse, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_array_find_uint16 (vtype_array* x, vtype_uint16 value, void* data, array_access_callback, bool reverse, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_array_find_uint32 (vtype_array* x, vtype_uint32 value, void* data, array_access_callback, bool reverse, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_array_find_uint64 (vtype_array* x, vtype_uint64 value, void* data, array_access_callback, bool reverse, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_array_find_int8 (vtype_array* x, vtype_int8 value, void* data, array_access_callback, bool reverse, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_array_find_int16 (vtype_array* x, vtype_int16 value, void* data, array_access_callback, bool reverse, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_array_find_int32 (vtype_array* x, vtype_int32 value, void* data, array_access_callback, bool reverse, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_array_find_int64 (vtype_array* x, vtype_int64 value, void* data, array_access_callback, bool reverse, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_array_find_float (vtype_array* x, vtype_float value, void* data, array_access_callback, bool reverse, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_array_find_double (vtype_array* x, vtype_double value, void* data, array_access_callback, bool reverse, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_array_find_ldouble(vtype_array* x, vtype_ldouble value, void* data, array_access_callback, bool reverse, bool cut) Nonnull__(1);
|
||||
|
||||
#endif /* LIBCDSB_ARRAY_H */
|
||||
|
466
include/dict.h
Normal file
466
include/dict.h
Normal file
@ -0,0 +1,466 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "__generics.h"
|
||||
#include "vtype.h"
|
||||
|
||||
#ifndef LIBCDSB_DICT_H
|
||||
#define LIBCDSB_DICT_H
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
typedef int (*dict_access_callback)(const void* key, vtype key_type, void* value, vtype value_type, void* data);
|
||||
|
||||
extern void dict_init(vtype_dict* x) Nonnull__(1);
|
||||
|
||||
#define dict_pop(x, key, data, callback) _LIBCDSB_Generic (libcdsb_dict, get_by, key)(x, key, data, callback, 1)
|
||||
#define dict_get(x, key, data, callback) _LIBCDSB_Generic (libcdsb_dict, get_by, key)(x, key, data, callback, 0)
|
||||
#define dict_update(x, key, value) _LIBCDSB_Generic2(libcdsb_dict, update, key, value)(x, key, value)
|
||||
#define dict_remove(x, key) dict_pop(x, key, 0, 0)
|
||||
|
||||
#define in_dict(x, key) (dict_get(&x, key, 0, 0) == 0)
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
extern int libcdsb_dict_get_by_pointer(vtype_dict* x, const void* key, void* data, dict_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_dict_get_by_cstring(vtype_dict* x, const char* key, void* data, dict_access_callback, bool cut) Nonnull__(1,2);
|
||||
extern int libcdsb_dict_get_by_string (vtype_dict* x, const vtype_string* key, void* data, dict_access_callback, bool cut) Nonnull__(1,2);
|
||||
extern int libcdsb_dict_get_by_array (vtype_dict* x, const vtype_array* key, void* data, dict_access_callback, bool cut) Nonnull__(1,2);
|
||||
extern int libcdsb_dict_get_by_list (vtype_dict* x, const vtype_list* key, void* data, dict_access_callback, bool cut) Nonnull__(1,2);
|
||||
extern int libcdsb_dict_get_by_map (vtype_dict* x, const vtype_map* key, void* data, dict_access_callback, bool cut) Nonnull__(1,2);
|
||||
extern int libcdsb_dict_get_by_vset (vtype_dict* x, const vtype_set* key, void* data, dict_access_callback, bool cut) Nonnull__(1,2);
|
||||
extern int libcdsb_dict_get_by_dict (vtype_dict* x, const vtype_dict* key, void* data, dict_access_callback, bool cut) Nonnull__(1,2);
|
||||
extern int libcdsb_dict_get_by_boolean(vtype_dict* x, vtype_bool key, void* data, dict_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_dict_get_by_int8 (vtype_dict* x, vtype_int8 key, void* data, dict_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_dict_get_by_int16 (vtype_dict* x, vtype_int16 key, void* data, dict_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_dict_get_by_int32 (vtype_dict* x, vtype_int32 key, void* data, dict_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_dict_get_by_int64 (vtype_dict* x, vtype_int64 key, void* data, dict_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_dict_get_by_uint8 (vtype_dict* x, vtype_uint8 key, void* data, dict_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_dict_get_by_uint16 (vtype_dict* x, vtype_uint16 key, void* data, dict_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_dict_get_by_uint32 (vtype_dict* x, vtype_uint32 key, void* data, dict_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_dict_get_by_uint64 (vtype_dict* x, vtype_uint64 key, void* data, dict_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_dict_get_by_float (vtype_dict* x, vtype_float key, void* data, dict_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_dict_get_by_double (vtype_dict* x, vtype_double key, void* data, dict_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_dict_get_by_ldouble(vtype_dict* x, vtype_ldouble key, void* data, dict_access_callback, bool cut) Nonnull__(1);
|
||||
|
||||
extern bool libcdsb_dict_update_pointer_pointer(vtype_dict* x, const void* key, const void* value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_pointer_cstring(vtype_dict* x, const void* key, const char* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_pointer_string (vtype_dict* x, const void* key, const vtype_string* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_pointer_array (vtype_dict* x, const void* key, const vtype_array* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_pointer_list (vtype_dict* x, const void* key, const vtype_list* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_pointer_map (vtype_dict* x, const void* key, const vtype_map* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_pointer_vset (vtype_dict* x, const void* key, const vtype_set* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_pointer_dict (vtype_dict* x, const void* key, const vtype_dict* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_pointer_boolean(vtype_dict* x, const void* key, vtype_bool value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_pointer_int8 (vtype_dict* x, const void* key, vtype_int8 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_pointer_int16 (vtype_dict* x, const void* key, vtype_int16 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_pointer_int32 (vtype_dict* x, const void* key, vtype_int32 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_pointer_int64 (vtype_dict* x, const void* key, vtype_int64 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_pointer_uint8 (vtype_dict* x, const void* key, vtype_uint8 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_pointer_uint16 (vtype_dict* x, const void* key, vtype_uint16 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_pointer_uint32 (vtype_dict* x, const void* key, vtype_uint32 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_pointer_uint64 (vtype_dict* x, const void* key, vtype_uint64 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_pointer_float (vtype_dict* x, const void* key, vtype_float value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_pointer_double (vtype_dict* x, const void* key, vtype_double value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_pointer_ldouble(vtype_dict* x, const void* key, vtype_ldouble value) Nonnull__(1);
|
||||
|
||||
extern bool libcdsb_dict_update_cstring_pointer(vtype_dict* x, const char* key, const void* value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_cstring_cstring(vtype_dict* x, const char* key, const char* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_cstring_string (vtype_dict* x, const char* key, const vtype_string* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_cstring_array (vtype_dict* x, const char* key, const vtype_array* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_cstring_list (vtype_dict* x, const char* key, const vtype_list* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_cstring_map (vtype_dict* x, const char* key, const vtype_map* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_cstring_vset (vtype_dict* x, const char* key, const vtype_set* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_cstring_dict (vtype_dict* x, const char* key, const vtype_dict* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_cstring_boolean(vtype_dict* x, const char* key, vtype_bool value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_cstring_int8 (vtype_dict* x, const char* key, vtype_int8 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_cstring_int16 (vtype_dict* x, const char* key, vtype_int16 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_cstring_int32 (vtype_dict* x, const char* key, vtype_int32 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_cstring_int64 (vtype_dict* x, const char* key, vtype_int64 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_cstring_uint8 (vtype_dict* x, const char* key, vtype_uint8 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_cstring_uint16 (vtype_dict* x, const char* key, vtype_uint16 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_cstring_uint32 (vtype_dict* x, const char* key, vtype_uint32 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_cstring_uint64 (vtype_dict* x, const char* key, vtype_uint64 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_cstring_float (vtype_dict* x, const char* key, vtype_float value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_cstring_double (vtype_dict* x, const char* key, vtype_double value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_cstring_ldouble(vtype_dict* x, const char* key, vtype_ldouble value) Nonnull__(1,2);
|
||||
|
||||
extern bool libcdsb_dict_update_string_pointer(vtype_dict* x, const vtype_string* key, const void* value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_string_cstring(vtype_dict* x, const vtype_string* key, const char* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_string_string (vtype_dict* x, const vtype_string* key, const vtype_string* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_string_array (vtype_dict* x, const vtype_string* key, const vtype_array* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_string_list (vtype_dict* x, const vtype_string* key, const vtype_list* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_string_map (vtype_dict* x, const vtype_string* key, const vtype_map* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_string_vset (vtype_dict* x, const vtype_string* key, const vtype_set* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_string_dict (vtype_dict* x, const vtype_string* key, const vtype_dict* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_string_boolean(vtype_dict* x, const vtype_string* key, vtype_bool value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_string_int8 (vtype_dict* x, const vtype_string* key, vtype_int8 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_string_int16 (vtype_dict* x, const vtype_string* key, vtype_int16 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_string_int32 (vtype_dict* x, const vtype_string* key, vtype_int32 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_string_int64 (vtype_dict* x, const vtype_string* key, vtype_int64 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_string_uint8 (vtype_dict* x, const vtype_string* key, vtype_uint8 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_string_uint16 (vtype_dict* x, const vtype_string* key, vtype_uint16 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_string_uint32 (vtype_dict* x, const vtype_string* key, vtype_uint32 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_string_uint64 (vtype_dict* x, const vtype_string* key, vtype_uint64 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_string_float (vtype_dict* x, const vtype_string* key, vtype_float value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_string_double (vtype_dict* x, const vtype_string* key, vtype_double value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_string_ldouble(vtype_dict* x, const vtype_string* key, vtype_ldouble value) Nonnull__(1,2);
|
||||
|
||||
extern bool libcdsb_dict_update_array_pointer(vtype_dict* x, const vtype_array* key, const void* value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_array_cstring(vtype_dict* x, const vtype_array* key, const char* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_array_string (vtype_dict* x, const vtype_array* key, const vtype_string* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_array_array (vtype_dict* x, const vtype_array* key, const vtype_array* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_array_list (vtype_dict* x, const vtype_array* key, const vtype_list* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_array_map (vtype_dict* x, const vtype_array* key, const vtype_map* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_array_vset (vtype_dict* x, const vtype_array* key, const vtype_set* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_array_dict (vtype_dict* x, const vtype_array* key, const vtype_dict* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_array_boolean(vtype_dict* x, const vtype_array* key, vtype_bool value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_array_int8 (vtype_dict* x, const vtype_array* key, vtype_int8 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_array_int16 (vtype_dict* x, const vtype_array* key, vtype_int16 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_array_int32 (vtype_dict* x, const vtype_array* key, vtype_int32 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_array_int64 (vtype_dict* x, const vtype_array* key, vtype_int64 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_array_uint8 (vtype_dict* x, const vtype_array* key, vtype_uint8 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_array_uint16 (vtype_dict* x, const vtype_array* key, vtype_uint16 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_array_uint32 (vtype_dict* x, const vtype_array* key, vtype_uint32 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_array_uint64 (vtype_dict* x, const vtype_array* key, vtype_uint64 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_array_float (vtype_dict* x, const vtype_array* key, vtype_float value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_array_double (vtype_dict* x, const vtype_array* key, vtype_double value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_array_ldouble(vtype_dict* x, const vtype_array* key, vtype_ldouble value) Nonnull__(1,2);
|
||||
|
||||
extern bool libcdsb_dict_update_list_pointer(vtype_dict* x, const vtype_list* key, const void* value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_list_cstring(vtype_dict* x, const vtype_list* key, const char* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_list_string (vtype_dict* x, const vtype_list* key, const vtype_string* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_list_array (vtype_dict* x, const vtype_list* key, const vtype_array* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_list_list (vtype_dict* x, const vtype_list* key, const vtype_list* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_list_map (vtype_dict* x, const vtype_list* key, const vtype_map* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_list_vset (vtype_dict* x, const vtype_list* key, const vtype_set* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_list_dict (vtype_dict* x, const vtype_list* key, const vtype_dict* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_list_boolean(vtype_dict* x, const vtype_list* key, vtype_bool value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_list_int8 (vtype_dict* x, const vtype_list* key, vtype_int8 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_list_int16 (vtype_dict* x, const vtype_list* key, vtype_int16 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_list_int32 (vtype_dict* x, const vtype_list* key, vtype_int32 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_list_int64 (vtype_dict* x, const vtype_list* key, vtype_int64 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_list_uint8 (vtype_dict* x, const vtype_list* key, vtype_uint8 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_list_uint16 (vtype_dict* x, const vtype_list* key, vtype_uint16 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_list_uint32 (vtype_dict* x, const vtype_list* key, vtype_uint32 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_list_uint64 (vtype_dict* x, const vtype_list* key, vtype_uint64 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_list_float (vtype_dict* x, const vtype_list* key, vtype_float value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_list_double (vtype_dict* x, const vtype_list* key, vtype_double value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_list_ldouble(vtype_dict* x, const vtype_list* key, vtype_ldouble value) Nonnull__(1,2);
|
||||
|
||||
extern bool libcdsb_dict_update_map_pointer(vtype_dict* x, const vtype_map* key, const void* value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_map_cstring(vtype_dict* x, const vtype_map* key, const char* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_map_string (vtype_dict* x, const vtype_map* key, const vtype_string* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_map_array (vtype_dict* x, const vtype_map* key, const vtype_array* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_map_list (vtype_dict* x, const vtype_map* key, const vtype_list* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_map_map (vtype_dict* x, const vtype_map* key, const vtype_map* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_map_vset (vtype_dict* x, const vtype_map* key, const vtype_set* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_map_dict (vtype_dict* x, const vtype_map* key, const vtype_dict* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_map_boolean(vtype_dict* x, const vtype_map* key, vtype_bool value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_map_int8 (vtype_dict* x, const vtype_map* key, vtype_int8 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_map_int16 (vtype_dict* x, const vtype_map* key, vtype_int16 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_map_int32 (vtype_dict* x, const vtype_map* key, vtype_int32 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_map_int64 (vtype_dict* x, const vtype_map* key, vtype_int64 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_map_uint8 (vtype_dict* x, const vtype_map* key, vtype_uint8 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_map_uint16 (vtype_dict* x, const vtype_map* key, vtype_uint16 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_map_uint32 (vtype_dict* x, const vtype_map* key, vtype_uint32 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_map_uint64 (vtype_dict* x, const vtype_map* key, vtype_uint64 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_map_float (vtype_dict* x, const vtype_map* key, vtype_float value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_map_double (vtype_dict* x, const vtype_map* key, vtype_double value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_map_ldouble(vtype_dict* x, const vtype_map* key, vtype_ldouble value) Nonnull__(1,2);
|
||||
|
||||
extern bool libcdsb_dict_update_vset_pointer(vtype_dict* x, const vtype_set* key, const void* value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_vset_cstring(vtype_dict* x, const vtype_set* key, const char* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_vset_string (vtype_dict* x, const vtype_set* key, const vtype_string* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_vset_array (vtype_dict* x, const vtype_set* key, const vtype_array* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_vset_list (vtype_dict* x, const vtype_set* key, const vtype_list* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_vset_map (vtype_dict* x, const vtype_set* key, const vtype_map* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_vset_vset (vtype_dict* x, const vtype_set* key, const vtype_set* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_vset_dict (vtype_dict* x, const vtype_set* key, const vtype_dict* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_vset_boolean(vtype_dict* x, const vtype_set* key, vtype_bool value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_vset_int8 (vtype_dict* x, const vtype_set* key, vtype_int8 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_vset_int16 (vtype_dict* x, const vtype_set* key, vtype_int16 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_vset_int32 (vtype_dict* x, const vtype_set* key, vtype_int32 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_vset_int64 (vtype_dict* x, const vtype_set* key, vtype_int64 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_vset_uint8 (vtype_dict* x, const vtype_set* key, vtype_uint8 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_vset_uint16 (vtype_dict* x, const vtype_set* key, vtype_uint16 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_vset_uint32 (vtype_dict* x, const vtype_set* key, vtype_uint32 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_vset_uint64 (vtype_dict* x, const vtype_set* key, vtype_uint64 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_vset_float (vtype_dict* x, const vtype_set* key, vtype_float value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_vset_double (vtype_dict* x, const vtype_set* key, vtype_double value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_vset_ldouble(vtype_dict* x, const vtype_set* key, vtype_ldouble value) Nonnull__(1,2);
|
||||
|
||||
extern bool libcdsb_dict_update_dict_pointer(vtype_dict* x, const vtype_dict* key, const void* value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_dict_cstring(vtype_dict* x, const vtype_dict* key, const char* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_dict_string (vtype_dict* x, const vtype_dict* key, const vtype_string* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_dict_array (vtype_dict* x, const vtype_dict* key, const vtype_array* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_dict_list (vtype_dict* x, const vtype_dict* key, const vtype_list* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_dict_map (vtype_dict* x, const vtype_dict* key, const vtype_map* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_dict_vset (vtype_dict* x, const vtype_dict* key, const vtype_set* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_dict_dict (vtype_dict* x, const vtype_dict* key, const vtype_dict* value) Nonnull__(1,2,3);
|
||||
extern bool libcdsb_dict_update_dict_boolean(vtype_dict* x, const vtype_dict* key, vtype_bool value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_dict_int8 (vtype_dict* x, const vtype_dict* key, vtype_int8 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_dict_int16 (vtype_dict* x, const vtype_dict* key, vtype_int16 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_dict_int32 (vtype_dict* x, const vtype_dict* key, vtype_int32 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_dict_int64 (vtype_dict* x, const vtype_dict* key, vtype_int64 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_dict_uint8 (vtype_dict* x, const vtype_dict* key, vtype_uint8 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_dict_uint16 (vtype_dict* x, const vtype_dict* key, vtype_uint16 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_dict_uint32 (vtype_dict* x, const vtype_dict* key, vtype_uint32 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_dict_uint64 (vtype_dict* x, const vtype_dict* key, vtype_uint64 value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_dict_float (vtype_dict* x, const vtype_dict* key, vtype_float value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_dict_double (vtype_dict* x, const vtype_dict* key, vtype_double value) Nonnull__(1,2);
|
||||
extern bool libcdsb_dict_update_dict_ldouble(vtype_dict* x, const vtype_dict* key, vtype_ldouble value) Nonnull__(1,2);
|
||||
|
||||
extern bool libcdsb_dict_update_boolean_pointer(vtype_dict* x, vtype_bool key, const void* value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_boolean_cstring(vtype_dict* x, vtype_bool key, const char* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_boolean_string (vtype_dict* x, vtype_bool key, const vtype_string* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_boolean_array (vtype_dict* x, vtype_bool key, const vtype_array* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_boolean_list (vtype_dict* x, vtype_bool key, const vtype_list* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_boolean_map (vtype_dict* x, vtype_bool key, const vtype_map* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_boolean_vset (vtype_dict* x, vtype_bool key, const vtype_set* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_boolean_dict (vtype_dict* x, vtype_bool key, const vtype_dict* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_boolean_boolean(vtype_dict* x, vtype_bool key, vtype_bool value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_boolean_int8 (vtype_dict* x, vtype_bool key, vtype_int8 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_boolean_int16 (vtype_dict* x, vtype_bool key, vtype_int16 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_boolean_int32 (vtype_dict* x, vtype_bool key, vtype_int32 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_boolean_int64 (vtype_dict* x, vtype_bool key, vtype_int64 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_boolean_uint8 (vtype_dict* x, vtype_bool key, vtype_uint8 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_boolean_uint16 (vtype_dict* x, vtype_bool key, vtype_uint16 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_boolean_uint32 (vtype_dict* x, vtype_bool key, vtype_uint32 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_boolean_uint64 (vtype_dict* x, vtype_bool key, vtype_uint64 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_boolean_float (vtype_dict* x, vtype_bool key, vtype_float value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_boolean_double (vtype_dict* x, vtype_bool key, vtype_double value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_boolean_ldouble(vtype_dict* x, vtype_bool key, vtype_ldouble value) Nonnull__(1);
|
||||
|
||||
extern bool libcdsb_dict_update_uint8_pointer(vtype_dict* x, vtype_uint8 key, const void* value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint8_cstring(vtype_dict* x, vtype_uint8 key, const char* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_uint8_string (vtype_dict* x, vtype_uint8 key, const vtype_string* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_uint8_array (vtype_dict* x, vtype_uint8 key, const vtype_array* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_uint8_list (vtype_dict* x, vtype_uint8 key, const vtype_list* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_uint8_map (vtype_dict* x, vtype_uint8 key, const vtype_map* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_uint8_vset (vtype_dict* x, vtype_uint8 key, const vtype_set* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_uint8_dict (vtype_dict* x, vtype_uint8 key, const vtype_dict* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_uint8_boolean(vtype_dict* x, vtype_uint8 key, vtype_bool value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint8_int8 (vtype_dict* x, vtype_uint8 key, vtype_int8 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint8_int16 (vtype_dict* x, vtype_uint8 key, vtype_int16 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint8_int32 (vtype_dict* x, vtype_uint8 key, vtype_int32 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint8_int64 (vtype_dict* x, vtype_uint8 key, vtype_int64 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint8_uint8 (vtype_dict* x, vtype_uint8 key, vtype_uint8 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint8_uint16 (vtype_dict* x, vtype_uint8 key, vtype_uint16 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint8_uint32 (vtype_dict* x, vtype_uint8 key, vtype_uint32 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint8_uint64 (vtype_dict* x, vtype_uint8 key, vtype_uint64 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint8_float (vtype_dict* x, vtype_uint8 key, vtype_float value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint8_double (vtype_dict* x, vtype_uint8 key, vtype_double value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint8_ldouble(vtype_dict* x, vtype_uint8 key, vtype_ldouble value) Nonnull__(1);
|
||||
|
||||
extern bool libcdsb_dict_update_uint16_pointer(vtype_dict* x, vtype_uint16 key, const void* value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint16_cstring(vtype_dict* x, vtype_uint16 key, const char* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_uint16_string (vtype_dict* x, vtype_uint16 key, const vtype_string* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_uint16_array (vtype_dict* x, vtype_uint16 key, const vtype_array* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_uint16_list (vtype_dict* x, vtype_uint16 key, const vtype_list* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_uint16_map (vtype_dict* x, vtype_uint16 key, const vtype_map* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_uint16_vset (vtype_dict* x, vtype_uint16 key, const vtype_set* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_uint16_dict (vtype_dict* x, vtype_uint16 key, const vtype_dict* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_uint16_boolean(vtype_dict* x, vtype_uint16 key, vtype_bool value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint16_int8 (vtype_dict* x, vtype_uint16 key, vtype_int8 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint16_int16 (vtype_dict* x, vtype_uint16 key, vtype_int16 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint16_int32 (vtype_dict* x, vtype_uint16 key, vtype_int32 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint16_int64 (vtype_dict* x, vtype_uint16 key, vtype_int64 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint16_uint8 (vtype_dict* x, vtype_uint16 key, vtype_uint8 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint16_uint16 (vtype_dict* x, vtype_uint16 key, vtype_uint16 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint16_uint32 (vtype_dict* x, vtype_uint16 key, vtype_uint32 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint16_uint64 (vtype_dict* x, vtype_uint16 key, vtype_uint64 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint16_float (vtype_dict* x, vtype_uint16 key, vtype_float value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint16_double (vtype_dict* x, vtype_uint16 key, vtype_double value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint16_ldouble(vtype_dict* x, vtype_uint16 key, vtype_ldouble value) Nonnull__(1);
|
||||
|
||||
extern bool libcdsb_dict_update_uint32_pointer(vtype_dict* x, vtype_uint32 key, const void* value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint32_cstring(vtype_dict* x, vtype_uint32 key, const char* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_uint32_string (vtype_dict* x, vtype_uint32 key, const vtype_string* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_uint32_array (vtype_dict* x, vtype_uint32 key, const vtype_array* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_uint32_list (vtype_dict* x, vtype_uint32 key, const vtype_list* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_uint32_map (vtype_dict* x, vtype_uint32 key, const vtype_map* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_uint32_vset (vtype_dict* x, vtype_uint32 key, const vtype_set* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_uint32_dict (vtype_dict* x, vtype_uint32 key, const vtype_dict* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_uint32_boolean(vtype_dict* x, vtype_uint32 key, vtype_bool value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint32_int8 (vtype_dict* x, vtype_uint32 key, vtype_int8 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint32_int16 (vtype_dict* x, vtype_uint32 key, vtype_int16 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint32_int32 (vtype_dict* x, vtype_uint32 key, vtype_int32 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint32_int64 (vtype_dict* x, vtype_uint32 key, vtype_int64 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint32_uint8 (vtype_dict* x, vtype_uint32 key, vtype_uint8 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint32_uint16 (vtype_dict* x, vtype_uint32 key, vtype_uint16 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint32_uint32 (vtype_dict* x, vtype_uint32 key, vtype_uint32 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint32_uint64 (vtype_dict* x, vtype_uint32 key, vtype_uint64 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint32_float (vtype_dict* x, vtype_uint32 key, vtype_float value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint32_double (vtype_dict* x, vtype_uint32 key, vtype_double value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint32_ldouble(vtype_dict* x, vtype_uint32 key, vtype_ldouble value) Nonnull__(1);
|
||||
|
||||
extern bool libcdsb_dict_update_uint64_pointer(vtype_dict* x, vtype_uint64 key, const void* value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint64_cstring(vtype_dict* x, vtype_uint64 key, const char* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_uint64_string (vtype_dict* x, vtype_uint64 key, const vtype_string* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_uint64_array (vtype_dict* x, vtype_uint64 key, const vtype_array* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_uint64_list (vtype_dict* x, vtype_uint64 key, const vtype_list* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_uint64_map (vtype_dict* x, vtype_uint64 key, const vtype_map* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_uint64_vset (vtype_dict* x, vtype_uint64 key, const vtype_set* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_uint64_dict (vtype_dict* x, vtype_uint64 key, const vtype_dict* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_uint64_boolean(vtype_dict* x, vtype_uint64 key, vtype_bool value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint64_int8 (vtype_dict* x, vtype_uint64 key, vtype_int8 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint64_int16 (vtype_dict* x, vtype_uint64 key, vtype_int16 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint64_int32 (vtype_dict* x, vtype_uint64 key, vtype_int32 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint64_int64 (vtype_dict* x, vtype_uint64 key, vtype_int64 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint64_uint8 (vtype_dict* x, vtype_uint64 key, vtype_uint8 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint64_uint16 (vtype_dict* x, vtype_uint64 key, vtype_uint16 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint64_uint32 (vtype_dict* x, vtype_uint64 key, vtype_uint32 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint64_uint64 (vtype_dict* x, vtype_uint64 key, vtype_uint64 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint64_float (vtype_dict* x, vtype_uint64 key, vtype_float value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint64_double (vtype_dict* x, vtype_uint64 key, vtype_double value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_uint64_ldouble(vtype_dict* x, vtype_uint64 key, vtype_ldouble value) Nonnull__(1);
|
||||
|
||||
extern bool libcdsb_dict_update_int8_pointer(vtype_dict* x, vtype_int8 key, const void* value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int8_cstring(vtype_dict* x, vtype_int8 key, const char* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_int8_string (vtype_dict* x, vtype_int8 key, const vtype_string* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_int8_array (vtype_dict* x, vtype_int8 key, const vtype_array* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_int8_list (vtype_dict* x, vtype_int8 key, const vtype_list* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_int8_map (vtype_dict* x, vtype_int8 key, const vtype_map* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_int8_vset (vtype_dict* x, vtype_int8 key, const vtype_set* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_int8_dict (vtype_dict* x, vtype_int8 key, const vtype_dict* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_int8_boolean(vtype_dict* x, vtype_int8 key, vtype_bool value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int8_int8 (vtype_dict* x, vtype_int8 key, vtype_int8 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int8_int16 (vtype_dict* x, vtype_int8 key, vtype_int16 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int8_int32 (vtype_dict* x, vtype_int8 key, vtype_int32 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int8_int64 (vtype_dict* x, vtype_int8 key, vtype_int64 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int8_uint8 (vtype_dict* x, vtype_int8 key, vtype_uint8 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int8_uint16 (vtype_dict* x, vtype_int8 key, vtype_uint16 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int8_uint32 (vtype_dict* x, vtype_int8 key, vtype_uint32 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int8_uint64 (vtype_dict* x, vtype_int8 key, vtype_uint64 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int8_float (vtype_dict* x, vtype_int8 key, vtype_float value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int8_double (vtype_dict* x, vtype_int8 key, vtype_double value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int8_ldouble(vtype_dict* x, vtype_int8 key, vtype_ldouble value) Nonnull__(1);
|
||||
|
||||
extern bool libcdsb_dict_update_int16_pointer(vtype_dict* x, vtype_int16 key, const void* value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int16_cstring(vtype_dict* x, vtype_int16 key, const char* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_int16_string (vtype_dict* x, vtype_int16 key, const vtype_string* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_int16_array (vtype_dict* x, vtype_int16 key, const vtype_array* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_int16_list (vtype_dict* x, vtype_int16 key, const vtype_list* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_int16_map (vtype_dict* x, vtype_int16 key, const vtype_map* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_int16_vset (vtype_dict* x, vtype_int16 key, const vtype_set* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_int16_dict (vtype_dict* x, vtype_int16 key, const vtype_dict* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_int16_boolean(vtype_dict* x, vtype_int16 key, vtype_bool value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int16_int8 (vtype_dict* x, vtype_int16 key, vtype_int8 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int16_int16 (vtype_dict* x, vtype_int16 key, vtype_int16 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int16_int32 (vtype_dict* x, vtype_int16 key, vtype_int32 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int16_int64 (vtype_dict* x, vtype_int16 key, vtype_int64 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int16_uint8 (vtype_dict* x, vtype_int16 key, vtype_uint8 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int16_uint16 (vtype_dict* x, vtype_int16 key, vtype_uint16 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int16_uint32 (vtype_dict* x, vtype_int16 key, vtype_uint32 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int16_uint64 (vtype_dict* x, vtype_int16 key, vtype_uint64 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int16_float (vtype_dict* x, vtype_int16 key, vtype_float value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int16_double (vtype_dict* x, vtype_int16 key, vtype_double value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int16_ldouble(vtype_dict* x, vtype_int16 key, vtype_ldouble value) Nonnull__(1);
|
||||
|
||||
extern bool libcdsb_dict_update_int32_pointer(vtype_dict* x, vtype_int32 key, const void* value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int32_cstring(vtype_dict* x, vtype_int32 key, const char* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_int32_string (vtype_dict* x, vtype_int32 key, const vtype_string* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_int32_array (vtype_dict* x, vtype_int32 key, const vtype_array* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_int32_list (vtype_dict* x, vtype_int32 key, const vtype_list* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_int32_map (vtype_dict* x, vtype_int32 key, const vtype_map* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_int32_vset (vtype_dict* x, vtype_int32 key, const vtype_set* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_int32_dict (vtype_dict* x, vtype_int32 key, const vtype_dict* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_int32_boolean(vtype_dict* x, vtype_int32 key, vtype_bool value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int32_int8 (vtype_dict* x, vtype_int32 key, vtype_int8 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int32_int16 (vtype_dict* x, vtype_int32 key, vtype_int16 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int32_int32 (vtype_dict* x, vtype_int32 key, vtype_int32 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int32_int64 (vtype_dict* x, vtype_int32 key, vtype_int64 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int32_uint8 (vtype_dict* x, vtype_int32 key, vtype_uint8 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int32_uint16 (vtype_dict* x, vtype_int32 key, vtype_uint16 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int32_uint32 (vtype_dict* x, vtype_int32 key, vtype_uint32 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int32_uint64 (vtype_dict* x, vtype_int32 key, vtype_uint64 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int32_float (vtype_dict* x, vtype_int32 key, vtype_float value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int32_double (vtype_dict* x, vtype_int32 key, vtype_double value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int32_ldouble(vtype_dict* x, vtype_int32 key, vtype_ldouble value) Nonnull__(1);
|
||||
|
||||
extern bool libcdsb_dict_update_int64_pointer(vtype_dict* x, vtype_int64 key, const void* value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int64_cstring(vtype_dict* x, vtype_int64 key, const char* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_int64_string (vtype_dict* x, vtype_int64 key, const vtype_string* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_int64_array (vtype_dict* x, vtype_int64 key, const vtype_array* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_int64_list (vtype_dict* x, vtype_int64 key, const vtype_list* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_int64_map (vtype_dict* x, vtype_int64 key, const vtype_map* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_int64_vset (vtype_dict* x, vtype_int64 key, const vtype_set* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_int64_dict (vtype_dict* x, vtype_int64 key, const vtype_dict* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_int64_boolean(vtype_dict* x, vtype_int64 key, vtype_bool value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int64_int8 (vtype_dict* x, vtype_int64 key, vtype_int8 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int64_int16 (vtype_dict* x, vtype_int64 key, vtype_int16 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int64_int32 (vtype_dict* x, vtype_int64 key, vtype_int32 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int64_int64 (vtype_dict* x, vtype_int64 key, vtype_int64 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int64_uint8 (vtype_dict* x, vtype_int64 key, vtype_uint8 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int64_uint16 (vtype_dict* x, vtype_int64 key, vtype_uint16 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int64_uint32 (vtype_dict* x, vtype_int64 key, vtype_uint32 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int64_uint64 (vtype_dict* x, vtype_int64 key, vtype_uint64 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int64_float (vtype_dict* x, vtype_int64 key, vtype_float value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int64_double (vtype_dict* x, vtype_int64 key, vtype_double value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_int64_ldouble(vtype_dict* x, vtype_int64 key, vtype_ldouble value) Nonnull__(1);
|
||||
|
||||
extern bool libcdsb_dict_update_float_pointer(vtype_dict* x, vtype_float key, const void* value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_float_cstring(vtype_dict* x, vtype_float key, const char* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_float_string (vtype_dict* x, vtype_float key, const vtype_string* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_float_array (vtype_dict* x, vtype_float key, const vtype_array* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_float_list (vtype_dict* x, vtype_float key, const vtype_list* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_float_map (vtype_dict* x, vtype_float key, const vtype_map* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_float_vset (vtype_dict* x, vtype_float key, const vtype_set* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_float_dict (vtype_dict* x, vtype_float key, const vtype_dict* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_float_boolean(vtype_dict* x, vtype_float key, vtype_bool value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_float_int8 (vtype_dict* x, vtype_float key, vtype_int8 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_float_int16 (vtype_dict* x, vtype_float key, vtype_int16 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_float_int32 (vtype_dict* x, vtype_float key, vtype_int32 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_float_int64 (vtype_dict* x, vtype_float key, vtype_int64 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_float_uint8 (vtype_dict* x, vtype_float key, vtype_uint8 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_float_uint16 (vtype_dict* x, vtype_float key, vtype_uint16 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_float_uint32 (vtype_dict* x, vtype_float key, vtype_uint32 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_float_uint64 (vtype_dict* x, vtype_float key, vtype_uint64 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_float_float (vtype_dict* x, vtype_float key, vtype_float value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_float_double (vtype_dict* x, vtype_float key, vtype_double value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_float_ldouble(vtype_dict* x, vtype_float key, vtype_ldouble value) Nonnull__(1);
|
||||
|
||||
extern bool libcdsb_dict_update_double_pointer(vtype_dict* x, vtype_double key, const void* value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_double_cstring(vtype_dict* x, vtype_double key, const char* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_double_string (vtype_dict* x, vtype_double key, const vtype_string* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_double_array (vtype_dict* x, vtype_double key, const vtype_array* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_double_list (vtype_dict* x, vtype_double key, const vtype_list* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_double_map (vtype_dict* x, vtype_double key, const vtype_map* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_double_vset (vtype_dict* x, vtype_double key, const vtype_set* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_double_dict (vtype_dict* x, vtype_double key, const vtype_dict* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_double_boolean(vtype_dict* x, vtype_double key, vtype_bool value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_double_int8 (vtype_dict* x, vtype_double key, vtype_int8 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_double_int16 (vtype_dict* x, vtype_double key, vtype_int16 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_double_int32 (vtype_dict* x, vtype_double key, vtype_int32 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_double_int64 (vtype_dict* x, vtype_double key, vtype_int64 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_double_uint8 (vtype_dict* x, vtype_double key, vtype_uint8 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_double_uint16 (vtype_dict* x, vtype_double key, vtype_uint16 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_double_uint32 (vtype_dict* x, vtype_double key, vtype_uint32 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_double_uint64 (vtype_dict* x, vtype_double key, vtype_uint64 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_double_float (vtype_dict* x, vtype_double key, vtype_float value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_double_double (vtype_dict* x, vtype_double key, vtype_double value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_double_ldouble(vtype_dict* x, vtype_double key, vtype_ldouble value) Nonnull__(1);
|
||||
|
||||
extern bool libcdsb_dict_update_ldouble_pointer(vtype_dict* x, vtype_ldouble key, const void* value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_ldouble_cstring(vtype_dict* x, vtype_ldouble key, const char* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_ldouble_string (vtype_dict* x, vtype_ldouble key, const vtype_string* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_ldouble_array (vtype_dict* x, vtype_ldouble key, const vtype_array* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_ldouble_list (vtype_dict* x, vtype_ldouble key, const vtype_list* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_ldouble_map (vtype_dict* x, vtype_ldouble key, const vtype_map* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_ldouble_vset (vtype_dict* x, vtype_ldouble key, const vtype_set* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_ldouble_dict (vtype_dict* x, vtype_ldouble key, const vtype_dict* value) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_update_ldouble_boolean(vtype_dict* x, vtype_ldouble key, vtype_bool value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_ldouble_int8 (vtype_dict* x, vtype_ldouble key, vtype_int8 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_ldouble_int16 (vtype_dict* x, vtype_ldouble key, vtype_int16 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_ldouble_int32 (vtype_dict* x, vtype_ldouble key, vtype_int32 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_ldouble_int64 (vtype_dict* x, vtype_ldouble key, vtype_int64 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_ldouble_uint8 (vtype_dict* x, vtype_ldouble key, vtype_uint8 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_ldouble_uint16 (vtype_dict* x, vtype_ldouble key, vtype_uint16 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_ldouble_uint32 (vtype_dict* x, vtype_ldouble key, vtype_uint32 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_ldouble_uint64 (vtype_dict* x, vtype_ldouble key, vtype_uint64 value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_ldouble_float (vtype_dict* x, vtype_ldouble key, vtype_float value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_ldouble_double (vtype_dict* x, vtype_ldouble key, vtype_double value) Nonnull__(1);
|
||||
extern bool libcdsb_dict_update_ldouble_ldouble(vtype_dict* x, vtype_ldouble key, vtype_ldouble value) Nonnull__(1);
|
||||
|
||||
#endif /* LIBCDSB_DICT_H */
|
@ -12,12 +12,10 @@
|
||||
|
||||
#define array_foreach(x, data, callback) libcdsb_array_foreach(x, data, callback, 0)
|
||||
|
||||
extern ssize_t libcdsb_array_push(vtype_array* x, const void* value, vtype value_type) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
|
||||
extern size_t libcdsb_array_count(const vtype_array* s, const void* value, vtype type) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
|
||||
extern int libcdsb_array_find (vtype_array* x, const void* value, vtype type, void* data, array_access_callback, bool reverse, bool cut) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern int libcdsb_array_get (vtype_array* x, ssize_t index, void* data, array_access_callback, bool cut) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern int libcdsb_array_foreach(vtype_array* x, void* data, array_access_callback, bool flush) LIBCDSB_nt__ LIBCDSB_nn13__;
|
||||
extern ssize_t libcdsb_array_push (vtype_array* x, const void* value, vtype value_type) Nonnull__(1);
|
||||
extern size_t libcdsb_array_count (const vtype_array* s, const void* value, vtype type) Pure__ Warn_unused_result__ Nonnull__(1);
|
||||
extern int libcdsb_array_find (vtype_array* x, const void* value, vtype type, void* data, array_access_callback, bool reverse, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_array_get (vtype_array* x, ssize_t index, void* data, array_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_array_foreach(vtype_array* x, void* data, array_access_callback, bool flush) Nonnull__(1,3);
|
||||
|
||||
#endif /* LIBCDSB_EXTRA_ARRAY_H */
|
||||
|
@ -7,12 +7,12 @@
|
||||
#ifndef LIBCDSB_EXTRA_CSTRING_H
|
||||
#define LIBCDSB_EXTRA_CSTRING_H
|
||||
|
||||
extern size_t libcdsb_strlen (const char* s) LIBCDSB_pure__ LIBCDSB_nn1__;
|
||||
extern size_t libcdsb_strasciilen(const char* s) LIBCDSB_pure__ LIBCDSB_nn1__;
|
||||
extern size_t libcdsb_strlen (const char* s) Pure__ Warn_unused_result__ Nonnull__(1);
|
||||
extern size_t libcdsb_strasciilen(const char* s) Pure__ Warn_unused_result__ Nonnull__(1);
|
||||
|
||||
extern char* libcdsb_strdup (const char* s) LIBCDSB_nt__ LIBCDSB_wur__ LIBCDSB_nn1__;
|
||||
extern char* libcdsb_strndup(const char* s, size_t n) LIBCDSB_nt__ LIBCDSB_wur__ LIBCDSB_nn1__;
|
||||
extern void* libcdsb_memndup(const void* m, size_t n) LIBCDSB_nt__ LIBCDSB_wur__ LIBCDSB_nn1__;
|
||||
extern char* libcdsb_strdup (const char* s) Warn_unused_result__ Nonnull__(1);
|
||||
extern char* libcdsb_strndup(const char* s, size_t n) Warn_unused_result__ Nonnull__(1);
|
||||
extern void* libcdsb_memndup(const void* m, size_t n) Warn_unused_result__ Nonnull__(1);
|
||||
|
||||
#define strlen libcdsb_strlen
|
||||
#define strasciilen libcdsb_strasciilen
|
||||
|
29
include/extra/dict.h
Normal file
29
include/extra/dict.h
Normal file
@ -0,0 +1,29 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../dict.h"
|
||||
|
||||
#ifndef LIBCDSB_EXTRA_DICT_H
|
||||
#define LIBCDSB_EXTRA_DICT_H
|
||||
|
||||
#define dict_foreach(x, data, callback) libcdsb_dict_foreach(x, data, callback, 0)
|
||||
|
||||
extern bool libcdsb_dict_update (vtype_dict* x, const void* key, vtype key_type, const void* value, vtype value_type) Nonnull__(1);
|
||||
extern int libcdsb_dict_find (vtype_dict* x, const void* key, vtype key_type, void* data, dict_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_dict_foreach (vtype_dict* x, void* data, dict_access_callback, bool flush) Nonnull__(1,3);
|
||||
extern bool libcdsb_dict_shrink_to_fit(vtype_dict* x) Nonnull__(1);
|
||||
|
||||
#endif /* LIBCDSB_EXTRA_DICT_H */
|
||||
|
||||
#if defined(LIBCDSB_LIST_H) && !defined(LIBCDSB_EXTRA_DICT_H_EXT)
|
||||
#define LIBCDSB_EXTRA_DICT_H_EXT
|
||||
|
||||
#define dict_copy_keys libcdsb_dict_copy_keys
|
||||
#define dict_duplicate_keys libcdsb_dict_duplicate_keys
|
||||
#define dict_init_keys libcdsb_dict_init_keys
|
||||
|
||||
extern vtype_list libcdsb_dict_copy_keys (const vtype_dict* s) Nonnull__(1);
|
||||
extern vtype_list* libcdsb_dict_duplicate_keys(const vtype_dict* s) Nonnull__(1);
|
||||
extern void libcdsb_dict_init_keys (vtype_list* x, const vtype_dict* s) Nonnull__(1,2);
|
||||
|
||||
#endif /* LIBCDSB_EXTRA_DICT_H_EXT */
|
@ -12,12 +12,11 @@
|
||||
|
||||
#define list_foreach(x, data, callback) libcdsb_list_foreach(x, data, callback, 0)
|
||||
|
||||
extern bool libcdsb_list_update(vtype_list* x, ssize_t index, const void* value, vtype type, int ins_direction) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern bool libcdsb_list_update(vtype_list* x, ssize_t index, const void* value, vtype type, int ins_direction) Nonnull__(1);
|
||||
extern size_t libcdsb_list_count(const vtype_list* s, const void* value, vtype type) Pure__ Warn_unused_result__ Nonnull__(1);
|
||||
|
||||
extern size_t libcdsb_list_count(const vtype_list* s, const void* value, vtype type) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
|
||||
extern int libcdsb_list_find (vtype_list* x, const void* value, vtype type, void* data, list_access_callback, bool reverse, bool cut) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern int libcdsb_list_get (vtype_list* x, ssize_t index, void* data, list_access_callback, bool cut) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern int libcdsb_list_foreach(vtype_list* x, void* data, list_access_callback, bool flush) LIBCDSB_nt__ LIBCDSB_nn13__;
|
||||
extern int libcdsb_list_find (vtype_list* x, const void* value, vtype type, void* data, list_access_callback, bool reverse, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_list_get (vtype_list* x, ssize_t index, void* data, list_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_list_foreach(vtype_list* x, void* data, list_access_callback, bool flush) Nonnull__(1,3);
|
||||
|
||||
#endif /* LIBCDSB_EXTRA_LIST_H */
|
||||
|
@ -8,10 +8,9 @@
|
||||
|
||||
#define map_foreach(x, data, callback) libcdsb_map_foreach(x, data, callback, 0)
|
||||
|
||||
extern bool libcdsb_map_update(vtype_map* x, const void* k, vtype kt, const void* v, vtype vt) LIBCDSB_nt__ LIBCDSB_nn124__;
|
||||
|
||||
extern int libcdsb_map_find (vtype_map* x, const void* key, vtype key_type, void* data, map_access_callback, bool cut) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern int libcdsb_map_foreach(vtype_map* x, void* data, map_access_callback, bool flush) LIBCDSB_nt__ LIBCDSB_nn13__;
|
||||
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 */
|
||||
|
||||
|
@ -12,24 +12,29 @@ typedef struct libcdsb_stack_node {
|
||||
void* value;
|
||||
} stack_t;
|
||||
|
||||
extern void libcdsb_stack_init (stack_t* stack);
|
||||
extern void libcdsb_stack_push (stack_t* stack, void* value);
|
||||
extern void* libcdsb_stack_pop (stack_t* stack);
|
||||
extern void libcdsb_stack_flush(stack_t* stack);
|
||||
extern void libcdsb_stack_init (stack_t* stack) Nonnull__(1);
|
||||
extern void libcdsb_stack_push (stack_t* stack, void* value) Nonnull__(1);
|
||||
extern void libcdsb_stack_push_many(stack_t* stack, size_t n, ...) Nonnull__(1);
|
||||
extern void* libcdsb_stack_pop (stack_t* stack) Nonnull__(1);
|
||||
extern void libcdsb_stack_flush (stack_t* stack) Nonnull__(1);
|
||||
|
||||
extern void* libcdsb_aalloc (size_t a, size_t n) LIBCDSB_nt__ LIBCDSB_wur__;
|
||||
extern void* libcdsb_malloc (size_t n) LIBCDSB_nt__ LIBCDSB_wur__;
|
||||
extern void* libcdsb_calloc (size_t n, size_t c) LIBCDSB_nt__ LIBCDSB_wur__;
|
||||
extern void* libcdsb_realloc(void *p, size_t n) LIBCDSB_nt__ LIBCDSB_wur__;
|
||||
extern void* libcdsb_aalloc (size_t a, size_t n) Warn_unused_result__;
|
||||
extern void* libcdsb_malloc (size_t n) Warn_unused_result__;
|
||||
extern void* libcdsb_calloc (size_t n, size_t c) Warn_unused_result__;
|
||||
extern void* libcdsb_realloc(void *p, size_t n) Warn_unused_result__;
|
||||
|
||||
extern void libcdsb_free(void* s);
|
||||
|
||||
#define aligned_alloc libcdsb_aalloc
|
||||
#define malloc libcdsb_malloc
|
||||
#define calloc libcdsb_calloc
|
||||
#define realloc libcdsb_realloc
|
||||
#define free libcdsb_free
|
||||
|
||||
#define stack_init libcdsb_stack_init
|
||||
#define stack_push libcdsb_stack_push
|
||||
#define stack_pop libcdsb_stack_pop
|
||||
#define stack_flush libcdsb_stack_flush
|
||||
#define stack_init libcdsb_stack_init
|
||||
#define stack_push libcdsb_stack_push
|
||||
#define stack_push_many libcdsb_stack_push_many
|
||||
#define stack_pop libcdsb_stack_pop
|
||||
#define stack_flush libcdsb_stack_flush
|
||||
|
||||
#endif /* LIBCDSB_EXTRA_MEMORY_H */
|
||||
|
@ -8,9 +8,8 @@
|
||||
|
||||
#define vset_foreach(x, data, callback) libcdsb_vset_foreach(x, data, callback, 0)
|
||||
|
||||
extern bool libcdsb_vset_insert(vtype_set* x, const void* value, vtype type) LIBCDSB_nt__ LIBCDSB_nn12__;
|
||||
|
||||
extern int libcdsb_vset_find (vtype_set* x, const void* value, vtype type, void* data, vset_access_callback, bool cut) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern int libcdsb_vset_foreach(vtype_set* x, void* data, vset_access_callback, bool flush) LIBCDSB_nt__ LIBCDSB_nn13__;
|
||||
extern bool libcdsb_vset_insert (vtype_set* x, const void* value, vtype type) Nonnull__(1);
|
||||
extern int libcdsb_vset_find (vtype_set* x, const void* value, vtype type, void* data, vset_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_vset_foreach(vtype_set* x, void* data, vset_access_callback, bool flush) Nonnull__(1,3);
|
||||
|
||||
#endif /* LIBCDSB_EXTRA_SET_H */
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
#define string_split(x, sep, maxn) _LIBCDSB_GenericS(libcdsb_string, split, sep)(x, sep, maxn)
|
||||
#define string_split(s, sep, maxn) _LIBCDSB_GenericS(libcdsb_string, split, sep)(s, sep, maxn)
|
||||
#define string_case_compare string_compare_case_insensitive
|
||||
|
||||
#define string_replace_r(x, src, dest, maxn) _LIBCDSB_GenericS2(libcdsb_string, replace_r, src, dest)(x, src, dest, maxn)
|
||||
@ -17,38 +17,38 @@
|
||||
#define string_ltrim(x, arg) _LIBCDSB_GenericS(libcdsb_string, trim, arg)(x, arg, -1)
|
||||
#define string_rtrim(x, arg) _LIBCDSB_GenericS(libcdsb_string, trim, arg)(x, arg, 1)
|
||||
|
||||
extern size_t string_to_lower (vtype_string* x) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern size_t string_to_upper (vtype_string* x) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern size_t string_capitalize(vtype_string* x) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern size_t string_to_lower (vtype_string* x) Nonnull__(1);
|
||||
extern size_t string_to_upper (vtype_string* x) Nonnull__(1);
|
||||
extern size_t string_capitalize(vtype_string* x) Nonnull__(1);
|
||||
|
||||
extern size_t string_reverse (vtype_string* x) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern size_t string_reverse (vtype_string* x) Nonnull__(1);
|
||||
|
||||
extern size_t string_align_center(vtype_string* x, size_t padsize, int padchr) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern size_t string_align_right (vtype_string* x, size_t padsize, int padchr) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern size_t string_align_left (vtype_string* x, size_t padsize, int padchr) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern size_t string_align_center(vtype_string* x, size_t padsize, int padchr) Nonnull__(1);
|
||||
extern size_t string_align_right (vtype_string* x, size_t padsize, int padchr) Nonnull__(1);
|
||||
extern size_t string_align_left (vtype_string* x, size_t padsize, int padchr) Nonnull__(1);
|
||||
|
||||
extern int string_compare_case_insensitive(const vtype_string* s0, const vtype_string* s1) LIBCDSB_cmpattr__;
|
||||
|
||||
extern void libcdsb_string_replace(vtype_string* x, char* dest, size_t dest_nmemb, const char* src, size_t nmemb);
|
||||
extern void libcdsb_string_replace(vtype_string* x, char* dest, size_t dest_nmemb, const char* src, size_t nmemb) Nonnull__(1,2);
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
inline vtype_array libcdsb_string_split_string (const vtype_string* x, const vtype_string* sep, size_t maxn) __attribute__((always_inline));
|
||||
extern vtype_array libcdsb_string_split_cstring(const vtype_string* string, const char* sep, size_t maxn) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern vtype_array libcdsb_string_split_char (const vtype_string* string, int chr, size_t maxn) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern int string_compare_case_insensitive(const vtype_string* s0, const vtype_string* s1) Pure__ Warn_unused_result__ Nonnull__(1,2);
|
||||
|
||||
inline void libcdsb_string_trim_string (vtype_string* x, const vtype_string* s, int direction) __attribute__((always_inline));
|
||||
extern void libcdsb_string_trim_cstring(vtype_string* x, const char* s, int direction) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern void libcdsb_string_trim_char (vtype_string* x, int sc, int direction) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
inline vtype_array libcdsb_string_split_string (const vtype_string* s, const vtype_string* sep, size_t maxn) Nonnull__(1) Always_inline__;
|
||||
extern vtype_array libcdsb_string_split_cstring(const vtype_string* s, const char* sep, size_t maxn) Nonnull__(1);
|
||||
extern vtype_array libcdsb_string_split_char (const vtype_string* s, int chr, size_t maxn) Nonnull__(1);
|
||||
|
||||
inline size_t libcdsb_string_replace_r_string_string (vtype_string*restrict x, const vtype_string*restrict src, const vtype_string*restrict dest, size_t maxn) __attribute__((always_inline));
|
||||
inline size_t libcdsb_string_replace_r_string_cstring (vtype_string*restrict x, const vtype_string*restrict src, const char*restrict dest, size_t maxn) __attribute__((always_inline));
|
||||
inline size_t libcdsb_string_replace_r_string_char (vtype_string*restrict x, const vtype_string*restrict src, int dest, size_t maxn) __attribute__((always_inline));
|
||||
inline size_t libcdsb_string_replace_r_cstring_string (vtype_string*restrict x, const char*restrict src, const vtype_string*restrict dest, size_t maxn) __attribute__((always_inline));
|
||||
extern size_t libcdsb_string_replace_r_cstring_cstring(vtype_string*restrict x, const char*restrict src, const char*restrict dest, size_t maxn) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern size_t libcdsb_string_replace_r_cstring_char (vtype_string*restrict x, const char*restrict src, int dest, size_t maxn) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
inline size_t libcdsb_string_replace_r_char_string (vtype_string*restrict x, int src, const vtype_string*restrict dest, size_t maxn) __attribute__((always_inline));
|
||||
extern size_t libcdsb_string_replace_r_char_cstring (vtype_string*restrict x, int src, const char*restrict dest, size_t maxn) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
inline void libcdsb_string_trim_string (vtype_string* x, const vtype_string* s, int direction) Nonnull__(1) Always_inline__;
|
||||
extern void libcdsb_string_trim_cstring(vtype_string* x, const char* s, int direction) Nonnull__(1);
|
||||
extern void libcdsb_string_trim_char (vtype_string* x, int sc, int direction) Nonnull__(1);
|
||||
|
||||
inline size_t libcdsb_string_replace_r_string_string (vtype_string*restrict x, const vtype_string*restrict src, const vtype_string*restrict dest, size_t maxn) Nonnull__(1) Always_inline__;
|
||||
inline size_t libcdsb_string_replace_r_string_cstring (vtype_string*restrict x, const vtype_string*restrict src, const char*restrict dest, size_t maxn) Nonnull__(1) Always_inline__;
|
||||
inline size_t libcdsb_string_replace_r_string_char (vtype_string*restrict x, const vtype_string*restrict src, int dest, size_t maxn) Nonnull__(1) Always_inline__;
|
||||
inline size_t libcdsb_string_replace_r_cstring_string (vtype_string*restrict x, const char*restrict src, const vtype_string*restrict dest, size_t maxn) Nonnull__(1) Always_inline__;
|
||||
extern size_t libcdsb_string_replace_r_cstring_cstring(vtype_string*restrict x, const char*restrict src, const char*restrict dest, size_t maxn) Nonnull__(1);
|
||||
extern size_t libcdsb_string_replace_r_cstring_char (vtype_string*restrict x, const char*restrict src, int dest, size_t maxn) Nonnull__(1);
|
||||
inline size_t libcdsb_string_replace_r_char_string (vtype_string*restrict x, int src, const vtype_string*restrict dest, size_t maxn) Nonnull__(1) Always_inline__;
|
||||
extern size_t libcdsb_string_replace_r_char_cstring (vtype_string*restrict x, int src, const char*restrict dest, size_t maxn) Nonnull__(1);
|
||||
#define libcdsb_string_replace_r_char_char libcdsb_string_replace_char_char
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
@ -6,9 +6,7 @@
|
||||
#ifndef LIBCDSB_EXTRA_VTYPE_H
|
||||
#define LIBCDSB_EXTRA_VTYPE_H
|
||||
|
||||
extern const size_t LIBCDSB_VTYPE_SIZES[18];
|
||||
|
||||
extern const char* libcdsb_vtype_name(vtype t);
|
||||
extern const char* libcdsb_vtype_stringify(const void* value, vtype t);
|
||||
extern const char* libcdsb_vtype_name(vtype t) Warn_unused_result__;
|
||||
extern const char* libcdsb_vtype_stringify(const void* value, vtype t) Warn_unused_result__;
|
||||
|
||||
#endif /* LIBCDSB_EXTRA_VTYPE_H */
|
||||
|
129
include/list.h
129
include/list.h
@ -11,13 +11,11 @@
|
||||
|
||||
typedef int (*list_access_callback)(void* value, ssize_t index, vtype type, void* data);
|
||||
|
||||
extern void list_init(vtype_list* x);
|
||||
extern void list_extend(vtype_list* x, const vtype_list* s);
|
||||
|
||||
extern size_t list_slice(vtype_list* x, vtype_list* src, ssize_t index, size_t count, _Bool cut) LIBCDSB_nt__ LIBCDSB_nn12__;
|
||||
|
||||
extern void list_sort(vtype_list* x);
|
||||
extern void list_reverse(vtype_list* x);
|
||||
extern void list_init (vtype_list* x) Nonnull__(1);
|
||||
extern void list_extend (vtype_list* x, const vtype_list* s) Nonnull__(1,2);
|
||||
extern size_t list_slice (vtype_list* x, vtype_list* src, ssize_t index, size_t count, bool cut) Nonnull__(1,2);
|
||||
extern void list_sort (vtype_list* x) Nonnull__(1);
|
||||
extern void list_reverse(vtype_list* x) Nonnull__(1);
|
||||
|
||||
#define list_pop(x, value, data, callback) _LIBCDSB_Generic(libcdsb_list, find, value)(x, value, data, callback, 0, 1)
|
||||
#define list_find(x, value, data, callback) _LIBCDSB_Generic(libcdsb_list, find, value)(x, value, data, callback, 0, 0)
|
||||
@ -33,64 +31,67 @@ extern void list_reverse(vtype_list* x);
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
extern int libcdsb_list_find_pointer(vtype_list* x, const void* value, void* data, list_access_callback, bool reverse, bool cut);
|
||||
extern int libcdsb_list_find_cstring(vtype_list* x, const char* value, void* data, list_access_callback, bool reverse, bool cut);
|
||||
extern int libcdsb_list_find_string (vtype_list* x, const vtype_string* value, void* data, list_access_callback, bool reverse, bool cut);
|
||||
extern int libcdsb_list_find_array (vtype_list* x, const vtype_array* value, void* data, list_access_callback, bool reverse, bool cut);
|
||||
extern int libcdsb_list_find_list (vtype_list* x, const vtype_list* value, void* data, list_access_callback, bool reverse, bool cut);
|
||||
extern int libcdsb_list_find_map (vtype_list* x, const vtype_map* value, void* data, list_access_callback, bool reverse, bool cut);
|
||||
extern int libcdsb_list_find_vset (vtype_list* x, const vtype_set* value, void* data, list_access_callback, bool reverse, bool cut);
|
||||
extern int libcdsb_list_find_boolean(vtype_list* x, vtype_bool value, void* data, list_access_callback, bool reverse, bool cut);
|
||||
extern int libcdsb_list_find_int8 (vtype_list* x, vtype_int8 value, void* data, list_access_callback, bool reverse, bool cut);
|
||||
extern int libcdsb_list_find_int16 (vtype_list* x, vtype_int16 value, void* data, list_access_callback, bool reverse, bool cut);
|
||||
extern int libcdsb_list_find_int32 (vtype_list* x, vtype_int32 value, void* data, list_access_callback, bool reverse, bool cut);
|
||||
extern int libcdsb_list_find_int64 (vtype_list* x, vtype_int64 value, void* data, list_access_callback, bool reverse, bool cut);
|
||||
extern int libcdsb_list_find_uint8 (vtype_list* x, vtype_uint8 value, void* data, list_access_callback, bool reverse, bool cut);
|
||||
extern int libcdsb_list_find_uint16 (vtype_list* x, vtype_uint16 value, void* data, list_access_callback, bool reverse, bool cut);
|
||||
extern int libcdsb_list_find_uint32 (vtype_list* x, vtype_uint32 value, void* data, list_access_callback, bool reverse, bool cut);
|
||||
extern int libcdsb_list_find_uint64 (vtype_list* x, vtype_uint64 value, void* data, list_access_callback, bool reverse, bool cut);
|
||||
extern int libcdsb_list_find_float (vtype_list* x, vtype_float value, void* data, list_access_callback, bool reverse, bool cut);
|
||||
extern int libcdsb_list_find_double (vtype_list* x, vtype_double value, void* data, list_access_callback, bool reverse, bool cut);
|
||||
extern int libcdsb_list_find_ldouble(vtype_list* x, vtype_ldouble value, void* data, list_access_callback, bool reverse, bool cut);
|
||||
extern int libcdsb_list_find_pointer(vtype_list* x, const void* value, void* data, list_access_callback, bool reverse, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_list_find_cstring(vtype_list* x, const char* value, void* data, list_access_callback, bool reverse, bool cut) Nonnull__(1,2);
|
||||
extern int libcdsb_list_find_string (vtype_list* x, const vtype_string* value, void* data, list_access_callback, bool reverse, bool cut) Nonnull__(1,2);
|
||||
extern int libcdsb_list_find_array (vtype_list* x, const vtype_array* value, void* data, list_access_callback, bool reverse, bool cut) Nonnull__(1,2);
|
||||
extern int libcdsb_list_find_list (vtype_list* x, const vtype_list* value, void* data, list_access_callback, bool reverse, bool cut) Nonnull__(1,2);
|
||||
extern int libcdsb_list_find_map (vtype_list* x, const vtype_map* value, void* data, list_access_callback, bool reverse, bool cut) Nonnull__(1,2);
|
||||
extern int libcdsb_list_find_vset (vtype_list* x, const vtype_set* value, void* data, list_access_callback, bool reverse, bool cut) Nonnull__(1,2);
|
||||
extern int libcdsb_list_find_dict (vtype_list* x, const vtype_dict* value, void* data, list_access_callback, bool reverse, bool cut) Nonnull__(1,2);
|
||||
extern int libcdsb_list_find_boolean(vtype_list* x, vtype_bool value, void* data, list_access_callback, bool reverse, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_list_find_int8 (vtype_list* x, vtype_int8 value, void* data, list_access_callback, bool reverse, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_list_find_int16 (vtype_list* x, vtype_int16 value, void* data, list_access_callback, bool reverse, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_list_find_int32 (vtype_list* x, vtype_int32 value, void* data, list_access_callback, bool reverse, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_list_find_int64 (vtype_list* x, vtype_int64 value, void* data, list_access_callback, bool reverse, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_list_find_uint8 (vtype_list* x, vtype_uint8 value, void* data, list_access_callback, bool reverse, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_list_find_uint16 (vtype_list* x, vtype_uint16 value, void* data, list_access_callback, bool reverse, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_list_find_uint32 (vtype_list* x, vtype_uint32 value, void* data, list_access_callback, bool reverse, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_list_find_uint64 (vtype_list* x, vtype_uint64 value, void* data, list_access_callback, bool reverse, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_list_find_float (vtype_list* x, vtype_float value, void* data, list_access_callback, bool reverse, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_list_find_double (vtype_list* x, vtype_double value, void* data, list_access_callback, bool reverse, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_list_find_ldouble(vtype_list* x, vtype_ldouble value, void* data, list_access_callback, bool reverse, bool cut) Nonnull__(1);
|
||||
|
||||
extern size_t libcdsb_list_count_pointer(const vtype_list* s, const void* value);
|
||||
extern size_t libcdsb_list_count_cstring(const vtype_list* s, const char* value);
|
||||
extern size_t libcdsb_list_count_string (const vtype_list* s, const vtype_string* value);
|
||||
extern size_t libcdsb_list_count_array (const vtype_list* s, const vtype_array* value);
|
||||
extern size_t libcdsb_list_count_list (const vtype_list* s, const vtype_list* value);
|
||||
extern size_t libcdsb_list_count_map (const vtype_list* s, const vtype_map* value);
|
||||
extern size_t libcdsb_list_count_vset (const vtype_list* s, const vtype_set* value);
|
||||
extern size_t libcdsb_list_count_boolean(const vtype_list* s, vtype_bool value);
|
||||
extern size_t libcdsb_list_count_int8 (const vtype_list* s, vtype_int8 value);
|
||||
extern size_t libcdsb_list_count_int16 (const vtype_list* s, vtype_int16 value);
|
||||
extern size_t libcdsb_list_count_int32 (const vtype_list* s, vtype_int32 value);
|
||||
extern size_t libcdsb_list_count_int64 (const vtype_list* s, vtype_int64 value);
|
||||
extern size_t libcdsb_list_count_uint8 (const vtype_list* s, vtype_uint8 value);
|
||||
extern size_t libcdsb_list_count_uint16 (const vtype_list* s, vtype_uint16 value);
|
||||
extern size_t libcdsb_list_count_uint32 (const vtype_list* s, vtype_uint32 value);
|
||||
extern size_t libcdsb_list_count_uint64 (const vtype_list* s, vtype_uint64 value);
|
||||
extern size_t libcdsb_list_count_float (const vtype_list* s, vtype_float value);
|
||||
extern size_t libcdsb_list_count_double (const vtype_list* s, vtype_double value);
|
||||
extern size_t libcdsb_list_count_ldouble(const vtype_list* s, vtype_ldouble value);
|
||||
extern size_t libcdsb_list_count_pointer(const vtype_list* s, const void* value) Nonnull__(1);
|
||||
extern size_t libcdsb_list_count_cstring(const vtype_list* s, const char* value) Nonnull__(1,2);
|
||||
extern size_t libcdsb_list_count_string (const vtype_list* s, const vtype_string* value) Nonnull__(1,2);
|
||||
extern size_t libcdsb_list_count_array (const vtype_list* s, const vtype_array* value) Nonnull__(1,2);
|
||||
extern size_t libcdsb_list_count_list (const vtype_list* s, const vtype_list* value) Nonnull__(1,2);
|
||||
extern size_t libcdsb_list_count_map (const vtype_list* s, const vtype_map* value) Nonnull__(1,2);
|
||||
extern size_t libcdsb_list_count_vset (const vtype_list* s, const vtype_set* value) Nonnull__(1,2);
|
||||
extern size_t libcdsb_list_count_dict (const vtype_list* s, const vtype_dict* value) Nonnull__(1,2);
|
||||
extern size_t libcdsb_list_count_boolean(const vtype_list* s, vtype_bool value) Nonnull__(1);
|
||||
extern size_t libcdsb_list_count_int8 (const vtype_list* s, vtype_int8 value) Nonnull__(1);
|
||||
extern size_t libcdsb_list_count_int16 (const vtype_list* s, vtype_int16 value) Nonnull__(1);
|
||||
extern size_t libcdsb_list_count_int32 (const vtype_list* s, vtype_int32 value) Nonnull__(1);
|
||||
extern size_t libcdsb_list_count_int64 (const vtype_list* s, vtype_int64 value) Nonnull__(1);
|
||||
extern size_t libcdsb_list_count_uint8 (const vtype_list* s, vtype_uint8 value) Nonnull__(1);
|
||||
extern size_t libcdsb_list_count_uint16 (const vtype_list* s, vtype_uint16 value) Nonnull__(1);
|
||||
extern size_t libcdsb_list_count_uint32 (const vtype_list* s, vtype_uint32 value) Nonnull__(1);
|
||||
extern size_t libcdsb_list_count_uint64 (const vtype_list* s, vtype_uint64 value) Nonnull__(1);
|
||||
extern size_t libcdsb_list_count_float (const vtype_list* s, vtype_float value) Nonnull__(1);
|
||||
extern size_t libcdsb_list_count_double (const vtype_list* s, vtype_double value) Nonnull__(1);
|
||||
extern size_t libcdsb_list_count_ldouble(const vtype_list* s, vtype_ldouble value) Nonnull__(1);
|
||||
|
||||
extern bool libcdsb_list_update_pointer(vtype_list* x, ssize_t index, const void* value, int ins_direction);
|
||||
extern bool libcdsb_list_update_cstring(vtype_list* x, ssize_t index, const char* value, int ins_direction);
|
||||
extern bool libcdsb_list_update_string (vtype_list* x, ssize_t index, const vtype_string* value, int ins_direction);
|
||||
extern bool libcdsb_list_update_array (vtype_list* x, ssize_t index, const vtype_array* value, int ins_direction);
|
||||
extern bool libcdsb_list_update_list (vtype_list* x, ssize_t index, const vtype_list* value, int ins_direction);
|
||||
extern bool libcdsb_list_update_map (vtype_list* x, ssize_t index, const vtype_map* value, int ins_direction);
|
||||
extern bool libcdsb_list_update_vset (vtype_list* x, ssize_t index, const vtype_set* value, int ins_direction);
|
||||
extern bool libcdsb_list_update_boolean(vtype_list* x, ssize_t index, vtype_bool value, int ins_direction);
|
||||
extern bool libcdsb_list_update_int8 (vtype_list* x, ssize_t index, vtype_int8 value, int ins_direction);
|
||||
extern bool libcdsb_list_update_int16 (vtype_list* x, ssize_t index, vtype_int16 value, int ins_direction);
|
||||
extern bool libcdsb_list_update_int32 (vtype_list* x, ssize_t index, vtype_int32 value, int ins_direction);
|
||||
extern bool libcdsb_list_update_int64 (vtype_list* x, ssize_t index, vtype_int64 value, int ins_direction);
|
||||
extern bool libcdsb_list_update_uint8 (vtype_list* x, ssize_t index, vtype_uint8 value, int ins_direction);
|
||||
extern bool libcdsb_list_update_uint16 (vtype_list* x, ssize_t index, vtype_uint16 value, int ins_direction);
|
||||
extern bool libcdsb_list_update_uint32 (vtype_list* x, ssize_t index, vtype_uint32 value, int ins_direction);
|
||||
extern bool libcdsb_list_update_uint64 (vtype_list* x, ssize_t index, vtype_uint64 value, int ins_direction);
|
||||
extern bool libcdsb_list_update_float (vtype_list* x, ssize_t index, vtype_float value, int ins_direction);
|
||||
extern bool libcdsb_list_update_double (vtype_list* x, ssize_t index, vtype_double value, int ins_direction);
|
||||
extern bool libcdsb_list_update_ldouble(vtype_list* x, ssize_t index, vtype_ldouble value, int ins_direction);
|
||||
extern bool libcdsb_list_update_pointer(vtype_list* x, ssize_t index, const void* value, int ins_direction) Nonnull__(1);
|
||||
extern bool libcdsb_list_update_cstring(vtype_list* x, ssize_t index, const char* value, int ins_direction) Nonnull__(1,3);
|
||||
extern bool libcdsb_list_update_string (vtype_list* x, ssize_t index, const vtype_string* value, int ins_direction) Nonnull__(1,3);
|
||||
extern bool libcdsb_list_update_array (vtype_list* x, ssize_t index, const vtype_array* value, int ins_direction) Nonnull__(1,3);
|
||||
extern bool libcdsb_list_update_list (vtype_list* x, ssize_t index, const vtype_list* value, int ins_direction) Nonnull__(1,3);
|
||||
extern bool libcdsb_list_update_map (vtype_list* x, ssize_t index, const vtype_map* value, int ins_direction) Nonnull__(1,3);
|
||||
extern bool libcdsb_list_update_vset (vtype_list* x, ssize_t index, const vtype_set* value, int ins_direction) Nonnull__(1,3);
|
||||
extern bool libcdsb_list_update_dict (vtype_list* x, ssize_t index, const vtype_dict* value, int ins_direction) Nonnull__(1,3);
|
||||
extern bool libcdsb_list_update_boolean(vtype_list* x, ssize_t index, vtype_bool value, int ins_direction) Nonnull__(1);
|
||||
extern bool libcdsb_list_update_int8 (vtype_list* x, ssize_t index, vtype_int8 value, int ins_direction) Nonnull__(1);
|
||||
extern bool libcdsb_list_update_int16 (vtype_list* x, ssize_t index, vtype_int16 value, int ins_direction) Nonnull__(1);
|
||||
extern bool libcdsb_list_update_int32 (vtype_list* x, ssize_t index, vtype_int32 value, int ins_direction) Nonnull__(1);
|
||||
extern bool libcdsb_list_update_int64 (vtype_list* x, ssize_t index, vtype_int64 value, int ins_direction) Nonnull__(1);
|
||||
extern bool libcdsb_list_update_uint8 (vtype_list* x, ssize_t index, vtype_uint8 value, int ins_direction) Nonnull__(1);
|
||||
extern bool libcdsb_list_update_uint16 (vtype_list* x, ssize_t index, vtype_uint16 value, int ins_direction) Nonnull__(1);
|
||||
extern bool libcdsb_list_update_uint32 (vtype_list* x, ssize_t index, vtype_uint32 value, int ins_direction) Nonnull__(1);
|
||||
extern bool libcdsb_list_update_uint64 (vtype_list* x, ssize_t index, vtype_uint64 value, int ins_direction) Nonnull__(1);
|
||||
extern bool libcdsb_list_update_float (vtype_list* x, ssize_t index, vtype_float value, int ins_direction) Nonnull__(1);
|
||||
extern bool libcdsb_list_update_double (vtype_list* x, ssize_t index, vtype_double value, int ins_direction) Nonnull__(1);
|
||||
extern bool libcdsb_list_update_ldouble(vtype_list* x, ssize_t index, vtype_ldouble value, int ins_direction) Nonnull__(1);
|
||||
|
||||
#endif /* LIBCDSB_LIST_H */
|
||||
|
817
include/map.h
817
include/map.h
@ -7,413 +7,460 @@
|
||||
#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);
|
||||
extern void map_init(vtype_map* x, vtype key_type) Nonnull__(1);
|
||||
|
||||
#define map_pop(x, s, key) _LIBCDSB_Generic (libcdsb_map, find, key)(x, s, key, 1)
|
||||
#define map_get(x, s, key) _LIBCDSB_Generic (libcdsb_map, find, key)(x, s, key, 0)
|
||||
#define map_update(x, key, value) _LIBCDSB_Generic2(libcdsb_map, update, key, value)(x, key, value)
|
||||
#define map_remove(x, key) map_pop(0, x, key)
|
||||
#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)
|
||||
|
||||
extern int libcdsb_map_find_pointer(vtype_map* x, const void* key, void* data, map_access_callback, bool cut);
|
||||
extern int libcdsb_map_find_cstring(vtype_map* x, const char* key, void* data, map_access_callback, bool cut);
|
||||
extern int libcdsb_map_find_string (vtype_map* x, const vtype_string* key, void* data, map_access_callback, bool cut);
|
||||
extern int libcdsb_map_find_array (vtype_map* x, const vtype_array* key, void* data, map_access_callback, bool cut);
|
||||
extern int libcdsb_map_find_list (vtype_map* x, const vtype_list* key, void* data, map_access_callback, bool cut);
|
||||
extern int libcdsb_map_find_map (vtype_map* x, const vtype_map* key, void* data, map_access_callback, bool cut);
|
||||
extern int libcdsb_map_find_vset (vtype_map* x, const vtype_set* key, void* data, map_access_callback, bool cut);
|
||||
extern int libcdsb_map_find_boolean(vtype_map* x, vtype_bool key, void* data, map_access_callback, bool cut);
|
||||
extern int libcdsb_map_find_int8 (vtype_map* x, vtype_int8 key, void* data, map_access_callback, bool cut);
|
||||
extern int libcdsb_map_find_int16 (vtype_map* x, vtype_int16 key, void* data, map_access_callback, bool cut);
|
||||
extern int libcdsb_map_find_int32 (vtype_map* x, vtype_int32 key, void* data, map_access_callback, bool cut);
|
||||
extern int libcdsb_map_find_int64 (vtype_map* x, vtype_int64 key, void* data, map_access_callback, bool cut);
|
||||
extern int libcdsb_map_find_uint8 (vtype_map* x, vtype_uint8 key, void* data, map_access_callback, bool cut);
|
||||
extern int libcdsb_map_find_uint16 (vtype_map* x, vtype_uint16 key, void* data, map_access_callback, bool cut);
|
||||
extern int libcdsb_map_find_uint32 (vtype_map* x, vtype_uint32 key, void* data, map_access_callback, bool cut);
|
||||
extern int libcdsb_map_find_uint64 (vtype_map* x, vtype_uint64 key, void* data, map_access_callback, bool cut);
|
||||
extern int libcdsb_map_find_float (vtype_map* x, vtype_float key, void* data, map_access_callback, bool cut);
|
||||
extern int libcdsb_map_find_double (vtype_map* x, vtype_double key, void* data, map_access_callback, bool cut);
|
||||
extern int libcdsb_map_find_ldouble(vtype_map* x, vtype_ldouble key, void* data, map_access_callback, bool cut);
|
||||
#define in_map(x, key) (map_get(&x, key, 0, 0) == 0)
|
||||
|
||||
extern bool libcdsb_map_update_pointer_pointer(vtype_map* x, const void* key, const void* value);
|
||||
extern bool libcdsb_map_update_pointer_cstring(vtype_map* x, const void* key, const char* value);
|
||||
extern bool libcdsb_map_update_pointer_string (vtype_map* x, const void* key, const vtype_string* value);
|
||||
extern bool libcdsb_map_update_pointer_array (vtype_map* x, const void* key, const vtype_array* value);
|
||||
extern bool libcdsb_map_update_pointer_list (vtype_map* x, const void* key, const vtype_list* value);
|
||||
extern bool libcdsb_map_update_pointer_map (vtype_map* x, const void* key, const vtype_map* value);
|
||||
extern bool libcdsb_map_update_pointer_vset (vtype_map* x, const void* key, const vtype_set* value);
|
||||
extern bool libcdsb_map_update_pointer_boolean(vtype_map* x, const void* key, vtype_bool value);
|
||||
extern bool libcdsb_map_update_pointer_int8 (vtype_map* x, const void* key, vtype_int8 value);
|
||||
extern bool libcdsb_map_update_pointer_int16 (vtype_map* x, const void* key, vtype_int16 value);
|
||||
extern bool libcdsb_map_update_pointer_int32 (vtype_map* x, const void* key, vtype_int32 value);
|
||||
extern bool libcdsb_map_update_pointer_int64 (vtype_map* x, const void* key, vtype_int64 value);
|
||||
extern bool libcdsb_map_update_pointer_uint8 (vtype_map* x, const void* key, vtype_uint8 value);
|
||||
extern bool libcdsb_map_update_pointer_uint16 (vtype_map* x, const void* key, vtype_uint16 value);
|
||||
extern bool libcdsb_map_update_pointer_uint32 (vtype_map* x, const void* key, vtype_uint32 value);
|
||||
extern bool libcdsb_map_update_pointer_uint64 (vtype_map* x, const void* key, vtype_uint64 value);
|
||||
extern bool libcdsb_map_update_pointer_float (vtype_map* x, const void* key, vtype_float value);
|
||||
extern bool libcdsb_map_update_pointer_double (vtype_map* x, const void* key, vtype_double value);
|
||||
extern bool libcdsb_map_update_pointer_ldouble(vtype_map* x, const void* key, vtype_ldouble value);
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
extern bool libcdsb_map_update_string_pointer(vtype_map* x, const vtype_string* key, const void* value);
|
||||
extern bool libcdsb_map_update_string_cstring(vtype_map* x, const vtype_string* key, const char* value);
|
||||
extern bool libcdsb_map_update_string_string (vtype_map* x, const vtype_string* key, const vtype_string* value);
|
||||
extern bool libcdsb_map_update_string_array (vtype_map* x, const vtype_string* key, const vtype_array* value);
|
||||
extern bool libcdsb_map_update_string_list (vtype_map* x, const vtype_string* key, const vtype_list* value);
|
||||
extern bool libcdsb_map_update_string_map (vtype_map* x, const vtype_string* key, const vtype_map* value);
|
||||
extern bool libcdsb_map_update_string_vset (vtype_map* x, const vtype_string* key, const vtype_set* value);
|
||||
extern bool libcdsb_map_update_string_boolean(vtype_map* x, const vtype_string* key, vtype_bool value);
|
||||
extern bool libcdsb_map_update_string_int8 (vtype_map* x, const vtype_string* key, vtype_int8 value);
|
||||
extern bool libcdsb_map_update_string_int16 (vtype_map* x, const vtype_string* key, vtype_int16 value);
|
||||
extern bool libcdsb_map_update_string_int32 (vtype_map* x, const vtype_string* key, vtype_int32 value);
|
||||
extern bool libcdsb_map_update_string_int64 (vtype_map* x, const vtype_string* key, vtype_int64 value);
|
||||
extern bool libcdsb_map_update_string_uint8 (vtype_map* x, const vtype_string* key, vtype_uint8 value);
|
||||
extern bool libcdsb_map_update_string_uint16 (vtype_map* x, const vtype_string* key, vtype_uint16 value);
|
||||
extern bool libcdsb_map_update_string_uint32 (vtype_map* x, const vtype_string* key, vtype_uint32 value);
|
||||
extern bool libcdsb_map_update_string_uint64 (vtype_map* x, const vtype_string* key, vtype_uint64 value);
|
||||
extern bool libcdsb_map_update_string_float (vtype_map* x, const vtype_string* key, vtype_float value);
|
||||
extern bool libcdsb_map_update_string_double (vtype_map* x, const vtype_string* key, vtype_double value);
|
||||
extern bool libcdsb_map_update_string_ldouble(vtype_map* x, const vtype_string* key, vtype_ldouble value);
|
||||
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_array_pointer(vtype_map* x, const vtype_array* key, const void* value);
|
||||
extern bool libcdsb_map_update_array_cstring(vtype_map* x, const vtype_array* key, const char* value);
|
||||
extern bool libcdsb_map_update_array_string (vtype_map* x, const vtype_array* key, const vtype_string* value);
|
||||
extern bool libcdsb_map_update_array_array (vtype_map* x, const vtype_array* key, const vtype_array* value);
|
||||
extern bool libcdsb_map_update_array_list (vtype_map* x, const vtype_array* key, const vtype_list* value);
|
||||
extern bool libcdsb_map_update_array_map (vtype_map* x, const vtype_array* key, const vtype_map* value);
|
||||
extern bool libcdsb_map_update_array_vset (vtype_map* x, const vtype_array* key, const vtype_set* value);
|
||||
extern bool libcdsb_map_update_array_boolean(vtype_map* x, const vtype_array* key, vtype_bool value);
|
||||
extern bool libcdsb_map_update_array_int8 (vtype_map* x, const vtype_array* key, vtype_int8 value);
|
||||
extern bool libcdsb_map_update_array_int16 (vtype_map* x, const vtype_array* key, vtype_int16 value);
|
||||
extern bool libcdsb_map_update_array_int32 (vtype_map* x, const vtype_array* key, vtype_int32 value);
|
||||
extern bool libcdsb_map_update_array_int64 (vtype_map* x, const vtype_array* key, vtype_int64 value);
|
||||
extern bool libcdsb_map_update_array_uint8 (vtype_map* x, const vtype_array* key, vtype_uint8 value);
|
||||
extern bool libcdsb_map_update_array_uint16 (vtype_map* x, const vtype_array* key, vtype_uint16 value);
|
||||
extern bool libcdsb_map_update_array_uint32 (vtype_map* x, const vtype_array* key, vtype_uint32 value);
|
||||
extern bool libcdsb_map_update_array_uint64 (vtype_map* x, const vtype_array* key, vtype_uint64 value);
|
||||
extern bool libcdsb_map_update_array_float (vtype_map* x, const vtype_array* key, vtype_float value);
|
||||
extern bool libcdsb_map_update_array_double (vtype_map* x, const vtype_array* key, vtype_double value);
|
||||
extern bool libcdsb_map_update_array_ldouble(vtype_map* x, const vtype_array* key, vtype_ldouble value);
|
||||
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_list_pointer(vtype_map* x, const vtype_list* key, const void* value);
|
||||
extern bool libcdsb_map_update_list_cstring(vtype_map* x, const vtype_list* key, const char* value);
|
||||
extern bool libcdsb_map_update_list_string (vtype_map* x, const vtype_list* key, const vtype_string* value);
|
||||
extern bool libcdsb_map_update_list_array (vtype_map* x, const vtype_list* key, const vtype_array* value);
|
||||
extern bool libcdsb_map_update_list_list (vtype_map* x, const vtype_list* key, const vtype_list* value);
|
||||
extern bool libcdsb_map_update_list_map (vtype_map* x, const vtype_list* key, const vtype_map* value);
|
||||
extern bool libcdsb_map_update_list_vset (vtype_map* x, const vtype_list* key, const vtype_set* value);
|
||||
extern bool libcdsb_map_update_list_boolean(vtype_map* x, const vtype_list* key, vtype_bool value);
|
||||
extern bool libcdsb_map_update_list_int8 (vtype_map* x, const vtype_list* key, vtype_int8 value);
|
||||
extern bool libcdsb_map_update_list_int16 (vtype_map* x, const vtype_list* key, vtype_int16 value);
|
||||
extern bool libcdsb_map_update_list_int32 (vtype_map* x, const vtype_list* key, vtype_int32 value);
|
||||
extern bool libcdsb_map_update_list_int64 (vtype_map* x, const vtype_list* key, vtype_int64 value);
|
||||
extern bool libcdsb_map_update_list_uint8 (vtype_map* x, const vtype_list* key, vtype_uint8 value);
|
||||
extern bool libcdsb_map_update_list_uint16 (vtype_map* x, const vtype_list* key, vtype_uint16 value);
|
||||
extern bool libcdsb_map_update_list_uint32 (vtype_map* x, const vtype_list* key, vtype_uint32 value);
|
||||
extern bool libcdsb_map_update_list_uint64 (vtype_map* x, const vtype_list* key, vtype_uint64 value);
|
||||
extern bool libcdsb_map_update_list_float (vtype_map* x, const vtype_list* key, vtype_float value);
|
||||
extern bool libcdsb_map_update_list_double (vtype_map* x, const vtype_list* key, vtype_double value);
|
||||
extern bool libcdsb_map_update_list_ldouble(vtype_map* x, const vtype_list* key, vtype_ldouble value);
|
||||
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_map_pointer(vtype_map* x, const vtype_map* key, const void* value);
|
||||
extern bool libcdsb_map_update_map_cstring(vtype_map* x, const vtype_map* key, const char* value);
|
||||
extern bool libcdsb_map_update_map_string (vtype_map* x, const vtype_map* key, const vtype_string* value);
|
||||
extern bool libcdsb_map_update_map_array (vtype_map* x, const vtype_map* key, const vtype_array* value);
|
||||
extern bool libcdsb_map_update_map_list (vtype_map* x, const vtype_map* key, const vtype_list* value);
|
||||
extern bool libcdsb_map_update_map_map (vtype_map* x, const vtype_map* key, const vtype_map* value);
|
||||
extern bool libcdsb_map_update_map_vset (vtype_map* x, const vtype_map* key, const vtype_set* value);
|
||||
extern bool libcdsb_map_update_map_boolean(vtype_map* x, const vtype_map* key, vtype_bool value);
|
||||
extern bool libcdsb_map_update_map_int8 (vtype_map* x, const vtype_map* key, vtype_int8 value);
|
||||
extern bool libcdsb_map_update_map_int16 (vtype_map* x, const vtype_map* key, vtype_int16 value);
|
||||
extern bool libcdsb_map_update_map_int32 (vtype_map* x, const vtype_map* key, vtype_int32 value);
|
||||
extern bool libcdsb_map_update_map_int64 (vtype_map* x, const vtype_map* key, vtype_int64 value);
|
||||
extern bool libcdsb_map_update_map_uint8 (vtype_map* x, const vtype_map* key, vtype_uint8 value);
|
||||
extern bool libcdsb_map_update_map_uint16 (vtype_map* x, const vtype_map* key, vtype_uint16 value);
|
||||
extern bool libcdsb_map_update_map_uint32 (vtype_map* x, const vtype_map* key, vtype_uint32 value);
|
||||
extern bool libcdsb_map_update_map_uint64 (vtype_map* x, const vtype_map* key, vtype_uint64 value);
|
||||
extern bool libcdsb_map_update_map_float (vtype_map* x, const vtype_map* key, vtype_float value);
|
||||
extern bool libcdsb_map_update_map_double (vtype_map* x, const vtype_map* key, vtype_double value);
|
||||
extern bool libcdsb_map_update_map_ldouble(vtype_map* x, const vtype_map* key, vtype_ldouble value);
|
||||
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_vset_pointer(vtype_map* x, const vtype_set* key, const void* value);
|
||||
extern bool libcdsb_map_update_vset_cstring(vtype_map* x, const vtype_set* key, const char* value);
|
||||
extern bool libcdsb_map_update_vset_string (vtype_map* x, const vtype_set* key, const vtype_string* value);
|
||||
extern bool libcdsb_map_update_vset_array (vtype_map* x, const vtype_set* key, const vtype_array* value);
|
||||
extern bool libcdsb_map_update_vset_list (vtype_map* x, const vtype_set* key, const vtype_list* value);
|
||||
extern bool libcdsb_map_update_vset_map (vtype_map* x, const vtype_set* key, const vtype_map* value);
|
||||
extern bool libcdsb_map_update_vset_vset (vtype_map* x, const vtype_set* key, const vtype_set* value);
|
||||
extern bool libcdsb_map_update_vset_boolean(vtype_map* x, const vtype_set* key, vtype_bool value);
|
||||
extern bool libcdsb_map_update_vset_int8 (vtype_map* x, const vtype_set* key, vtype_int8 value);
|
||||
extern bool libcdsb_map_update_vset_int16 (vtype_map* x, const vtype_set* key, vtype_int16 value);
|
||||
extern bool libcdsb_map_update_vset_int32 (vtype_map* x, const vtype_set* key, vtype_int32 value);
|
||||
extern bool libcdsb_map_update_vset_int64 (vtype_map* x, const vtype_set* key, vtype_int64 value);
|
||||
extern bool libcdsb_map_update_vset_uint8 (vtype_map* x, const vtype_set* key, vtype_uint8 value);
|
||||
extern bool libcdsb_map_update_vset_uint16 (vtype_map* x, const vtype_set* key, vtype_uint16 value);
|
||||
extern bool libcdsb_map_update_vset_uint32 (vtype_map* x, const vtype_set* key, vtype_uint32 value);
|
||||
extern bool libcdsb_map_update_vset_uint64 (vtype_map* x, const vtype_set* key, vtype_uint64 value);
|
||||
extern bool libcdsb_map_update_vset_float (vtype_map* x, const vtype_set* key, vtype_float value);
|
||||
extern bool libcdsb_map_update_vset_double (vtype_map* x, const vtype_set* key, vtype_double value);
|
||||
extern bool libcdsb_map_update_vset_ldouble(vtype_map* x, const vtype_set* key, vtype_ldouble value);
|
||||
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_cstring_pointer(vtype_map* x, const char* key, const void* value);
|
||||
extern bool libcdsb_map_update_cstring_cstring(vtype_map* x, const char* key, const char* value);
|
||||
extern bool libcdsb_map_update_cstring_string (vtype_map* x, const char* key, const vtype_string* value);
|
||||
extern bool libcdsb_map_update_cstring_array (vtype_map* x, const char* key, const vtype_array* value);
|
||||
extern bool libcdsb_map_update_cstring_list (vtype_map* x, const char* key, const vtype_list* value);
|
||||
extern bool libcdsb_map_update_cstring_map (vtype_map* x, const char* key, const vtype_map* value);
|
||||
extern bool libcdsb_map_update_cstring_vset (vtype_map* x, const char* key, const vtype_set* value);
|
||||
extern bool libcdsb_map_update_cstring_boolean(vtype_map* x, const char* key, vtype_bool value);
|
||||
extern bool libcdsb_map_update_cstring_int8 (vtype_map* x, const char* key, vtype_int8 value);
|
||||
extern bool libcdsb_map_update_cstring_int16 (vtype_map* x, const char* key, vtype_int16 value);
|
||||
extern bool libcdsb_map_update_cstring_int32 (vtype_map* x, const char* key, vtype_int32 value);
|
||||
extern bool libcdsb_map_update_cstring_int64 (vtype_map* x, const char* key, vtype_int64 value);
|
||||
extern bool libcdsb_map_update_cstring_uint8 (vtype_map* x, const char* key, vtype_uint8 value);
|
||||
extern bool libcdsb_map_update_cstring_uint16 (vtype_map* x, const char* key, vtype_uint16 value);
|
||||
extern bool libcdsb_map_update_cstring_uint32 (vtype_map* x, const char* key, vtype_uint32 value);
|
||||
extern bool libcdsb_map_update_cstring_uint64 (vtype_map* x, const char* key, vtype_uint64 value);
|
||||
extern bool libcdsb_map_update_cstring_float (vtype_map* x, const char* key, vtype_float value);
|
||||
extern bool libcdsb_map_update_cstring_double (vtype_map* x, const char* key, vtype_double value);
|
||||
extern bool libcdsb_map_update_cstring_ldouble(vtype_map* x, const char* key, vtype_ldouble value);
|
||||
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_boolean_pointer(vtype_map* x, vtype_bool key, const void* value);
|
||||
extern bool libcdsb_map_update_boolean_cstring(vtype_map* x, vtype_bool key, const char* value);
|
||||
extern bool libcdsb_map_update_boolean_string (vtype_map* x, vtype_bool key, const vtype_string* value);
|
||||
extern bool libcdsb_map_update_boolean_array (vtype_map* x, vtype_bool key, const vtype_array* value);
|
||||
extern bool libcdsb_map_update_boolean_list (vtype_map* x, vtype_bool key, const vtype_list* value);
|
||||
extern bool libcdsb_map_update_boolean_map (vtype_map* x, vtype_bool key, const vtype_map* value);
|
||||
extern bool libcdsb_map_update_boolean_vset (vtype_map* x, vtype_bool key, const vtype_set* value);
|
||||
extern bool libcdsb_map_update_boolean_boolean(vtype_map* x, vtype_bool key, vtype_bool value);
|
||||
extern bool libcdsb_map_update_boolean_int8 (vtype_map* x, vtype_bool key, vtype_int8 value);
|
||||
extern bool libcdsb_map_update_boolean_int16 (vtype_map* x, vtype_bool key, vtype_int16 value);
|
||||
extern bool libcdsb_map_update_boolean_int32 (vtype_map* x, vtype_bool key, vtype_int32 value);
|
||||
extern bool libcdsb_map_update_boolean_int64 (vtype_map* x, vtype_bool key, vtype_int64 value);
|
||||
extern bool libcdsb_map_update_boolean_uint8 (vtype_map* x, vtype_bool key, vtype_uint8 value);
|
||||
extern bool libcdsb_map_update_boolean_uint16 (vtype_map* x, vtype_bool key, vtype_uint16 value);
|
||||
extern bool libcdsb_map_update_boolean_uint32 (vtype_map* x, vtype_bool key, vtype_uint32 value);
|
||||
extern bool libcdsb_map_update_boolean_uint64 (vtype_map* x, vtype_bool key, vtype_uint64 value);
|
||||
extern bool libcdsb_map_update_boolean_float (vtype_map* x, vtype_bool key, vtype_float value);
|
||||
extern bool libcdsb_map_update_boolean_double (vtype_map* x, vtype_bool key, vtype_double value);
|
||||
extern bool libcdsb_map_update_boolean_ldouble(vtype_map* x, vtype_bool key, vtype_ldouble value);
|
||||
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_uint8_pointer(vtype_map* x, vtype_uint8 key, const void* value);
|
||||
extern bool libcdsb_map_update_uint8_cstring(vtype_map* x, vtype_uint8 key, const char* value);
|
||||
extern bool libcdsb_map_update_uint8_string (vtype_map* x, vtype_uint8 key, const vtype_string* value);
|
||||
extern bool libcdsb_map_update_uint8_array (vtype_map* x, vtype_uint8 key, const vtype_array* value);
|
||||
extern bool libcdsb_map_update_uint8_list (vtype_map* x, vtype_uint8 key, const vtype_list* value);
|
||||
extern bool libcdsb_map_update_uint8_map (vtype_map* x, vtype_uint8 key, const vtype_map* value);
|
||||
extern bool libcdsb_map_update_uint8_vset (vtype_map* x, vtype_uint8 key, const vtype_set* value);
|
||||
extern bool libcdsb_map_update_uint8_boolean(vtype_map* x, vtype_uint8 key, vtype_bool value);
|
||||
extern bool libcdsb_map_update_uint8_int8 (vtype_map* x, vtype_uint8 key, vtype_int8 value);
|
||||
extern bool libcdsb_map_update_uint8_int16 (vtype_map* x, vtype_uint8 key, vtype_int16 value);
|
||||
extern bool libcdsb_map_update_uint8_int32 (vtype_map* x, vtype_uint8 key, vtype_int32 value);
|
||||
extern bool libcdsb_map_update_uint8_int64 (vtype_map* x, vtype_uint8 key, vtype_int64 value);
|
||||
extern bool libcdsb_map_update_uint8_uint8 (vtype_map* x, vtype_uint8 key, vtype_uint8 value);
|
||||
extern bool libcdsb_map_update_uint8_uint16 (vtype_map* x, vtype_uint8 key, vtype_uint16 value);
|
||||
extern bool libcdsb_map_update_uint8_uint32 (vtype_map* x, vtype_uint8 key, vtype_uint32 value);
|
||||
extern bool libcdsb_map_update_uint8_uint64 (vtype_map* x, vtype_uint8 key, vtype_uint64 value);
|
||||
extern bool libcdsb_map_update_uint8_float (vtype_map* x, vtype_uint8 key, vtype_float value);
|
||||
extern bool libcdsb_map_update_uint8_double (vtype_map* x, vtype_uint8 key, vtype_double value);
|
||||
extern bool libcdsb_map_update_uint8_ldouble(vtype_map* x, vtype_uint8 key, vtype_ldouble value);
|
||||
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_uint16_pointer(vtype_map* x, vtype_uint16 key, const void* value);
|
||||
extern bool libcdsb_map_update_uint16_cstring(vtype_map* x, vtype_uint16 key, const char* value);
|
||||
extern bool libcdsb_map_update_uint16_string (vtype_map* x, vtype_uint16 key, const vtype_string* value);
|
||||
extern bool libcdsb_map_update_uint16_array (vtype_map* x, vtype_uint16 key, const vtype_array* value);
|
||||
extern bool libcdsb_map_update_uint16_list (vtype_map* x, vtype_uint16 key, const vtype_list* value);
|
||||
extern bool libcdsb_map_update_uint16_map (vtype_map* x, vtype_uint16 key, const vtype_map* value);
|
||||
extern bool libcdsb_map_update_uint16_vset (vtype_map* x, vtype_uint16 key, const vtype_set* value);
|
||||
extern bool libcdsb_map_update_uint16_boolean(vtype_map* x, vtype_uint16 key, vtype_bool value);
|
||||
extern bool libcdsb_map_update_uint16_int8 (vtype_map* x, vtype_uint16 key, vtype_int8 value);
|
||||
extern bool libcdsb_map_update_uint16_int16 (vtype_map* x, vtype_uint16 key, vtype_int16 value);
|
||||
extern bool libcdsb_map_update_uint16_int32 (vtype_map* x, vtype_uint16 key, vtype_int32 value);
|
||||
extern bool libcdsb_map_update_uint16_int64 (vtype_map* x, vtype_uint16 key, vtype_int64 value);
|
||||
extern bool libcdsb_map_update_uint16_uint8 (vtype_map* x, vtype_uint16 key, vtype_uint8 value);
|
||||
extern bool libcdsb_map_update_uint16_uint16 (vtype_map* x, vtype_uint16 key, vtype_uint16 value);
|
||||
extern bool libcdsb_map_update_uint16_uint32 (vtype_map* x, vtype_uint16 key, vtype_uint32 value);
|
||||
extern bool libcdsb_map_update_uint16_uint64 (vtype_map* x, vtype_uint16 key, vtype_uint64 value);
|
||||
extern bool libcdsb_map_update_uint16_float (vtype_map* x, vtype_uint16 key, vtype_float value);
|
||||
extern bool libcdsb_map_update_uint16_double (vtype_map* x, vtype_uint16 key, vtype_double value);
|
||||
extern bool libcdsb_map_update_uint16_ldouble(vtype_map* x, vtype_uint16 key, vtype_ldouble value);
|
||||
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_uint32_pointer(vtype_map* x, vtype_uint32 key, const void* value);
|
||||
extern bool libcdsb_map_update_uint32_cstring(vtype_map* x, vtype_uint32 key, const char* value);
|
||||
extern bool libcdsb_map_update_uint32_string (vtype_map* x, vtype_uint32 key, const vtype_string* value);
|
||||
extern bool libcdsb_map_update_uint32_array (vtype_map* x, vtype_uint32 key, const vtype_array* value);
|
||||
extern bool libcdsb_map_update_uint32_list (vtype_map* x, vtype_uint32 key, const vtype_list* value);
|
||||
extern bool libcdsb_map_update_uint32_map (vtype_map* x, vtype_uint32 key, const vtype_map* value);
|
||||
extern bool libcdsb_map_update_uint32_vset (vtype_map* x, vtype_uint32 key, const vtype_set* value);
|
||||
extern bool libcdsb_map_update_uint32_boolean(vtype_map* x, vtype_uint32 key, vtype_bool value);
|
||||
extern bool libcdsb_map_update_uint32_int8 (vtype_map* x, vtype_uint32 key, vtype_int8 value);
|
||||
extern bool libcdsb_map_update_uint32_int16 (vtype_map* x, vtype_uint32 key, vtype_int16 value);
|
||||
extern bool libcdsb_map_update_uint32_int32 (vtype_map* x, vtype_uint32 key, vtype_int32 value);
|
||||
extern bool libcdsb_map_update_uint32_int64 (vtype_map* x, vtype_uint32 key, vtype_int64 value);
|
||||
extern bool libcdsb_map_update_uint32_uint8 (vtype_map* x, vtype_uint32 key, vtype_uint8 value);
|
||||
extern bool libcdsb_map_update_uint32_uint16 (vtype_map* x, vtype_uint32 key, vtype_uint16 value);
|
||||
extern bool libcdsb_map_update_uint32_uint32 (vtype_map* x, vtype_uint32 key, vtype_uint32 value);
|
||||
extern bool libcdsb_map_update_uint32_uint64 (vtype_map* x, vtype_uint32 key, vtype_uint64 value);
|
||||
extern bool libcdsb_map_update_uint32_float (vtype_map* x, vtype_uint32 key, vtype_float value);
|
||||
extern bool libcdsb_map_update_uint32_double (vtype_map* x, vtype_uint32 key, vtype_double value);
|
||||
extern bool libcdsb_map_update_uint32_ldouble(vtype_map* x, vtype_uint32 key, vtype_ldouble value);
|
||||
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_uint64_pointer(vtype_map* x, vtype_uint64 key, const void* value);
|
||||
extern bool libcdsb_map_update_uint64_cstring(vtype_map* x, vtype_uint64 key, const char* value);
|
||||
extern bool libcdsb_map_update_uint64_string (vtype_map* x, vtype_uint64 key, const vtype_string* value);
|
||||
extern bool libcdsb_map_update_uint64_array (vtype_map* x, vtype_uint64 key, const vtype_array* value);
|
||||
extern bool libcdsb_map_update_uint64_list (vtype_map* x, vtype_uint64 key, const vtype_list* value);
|
||||
extern bool libcdsb_map_update_uint64_map (vtype_map* x, vtype_uint64 key, const vtype_map* value);
|
||||
extern bool libcdsb_map_update_uint64_vset (vtype_map* x, vtype_uint64 key, const vtype_set* value);
|
||||
extern bool libcdsb_map_update_uint64_boolean(vtype_map* x, vtype_uint64 key, vtype_bool value);
|
||||
extern bool libcdsb_map_update_uint64_int8 (vtype_map* x, vtype_uint64 key, vtype_int8 value);
|
||||
extern bool libcdsb_map_update_uint64_int16 (vtype_map* x, vtype_uint64 key, vtype_int16 value);
|
||||
extern bool libcdsb_map_update_uint64_int32 (vtype_map* x, vtype_uint64 key, vtype_int32 value);
|
||||
extern bool libcdsb_map_update_uint64_int64 (vtype_map* x, vtype_uint64 key, vtype_int64 value);
|
||||
extern bool libcdsb_map_update_uint64_uint8 (vtype_map* x, vtype_uint64 key, vtype_uint8 value);
|
||||
extern bool libcdsb_map_update_uint64_uint16 (vtype_map* x, vtype_uint64 key, vtype_uint16 value);
|
||||
extern bool libcdsb_map_update_uint64_uint32 (vtype_map* x, vtype_uint64 key, vtype_uint32 value);
|
||||
extern bool libcdsb_map_update_uint64_uint64 (vtype_map* x, vtype_uint64 key, vtype_uint64 value);
|
||||
extern bool libcdsb_map_update_uint64_float (vtype_map* x, vtype_uint64 key, vtype_float value);
|
||||
extern bool libcdsb_map_update_uint64_double (vtype_map* x, vtype_uint64 key, vtype_double value);
|
||||
extern bool libcdsb_map_update_uint64_ldouble(vtype_map* x, vtype_uint64 key, vtype_ldouble value);
|
||||
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_int8_pointer(vtype_map* x, vtype_int8 key, const void* value);
|
||||
extern bool libcdsb_map_update_int8_cstring(vtype_map* x, vtype_int8 key, const char* value);
|
||||
extern bool libcdsb_map_update_int8_string (vtype_map* x, vtype_int8 key, const vtype_string* value);
|
||||
extern bool libcdsb_map_update_int8_array (vtype_map* x, vtype_int8 key, const vtype_array* value);
|
||||
extern bool libcdsb_map_update_int8_list (vtype_map* x, vtype_int8 key, const vtype_list* value);
|
||||
extern bool libcdsb_map_update_int8_map (vtype_map* x, vtype_int8 key, const vtype_map* value);
|
||||
extern bool libcdsb_map_update_int8_vset (vtype_map* x, vtype_int8 key, const vtype_set* value);
|
||||
extern bool libcdsb_map_update_int8_boolean(vtype_map* x, vtype_int8 key, vtype_bool value);
|
||||
extern bool libcdsb_map_update_int8_int8 (vtype_map* x, vtype_int8 key, vtype_int8 value);
|
||||
extern bool libcdsb_map_update_int8_int16 (vtype_map* x, vtype_int8 key, vtype_int16 value);
|
||||
extern bool libcdsb_map_update_int8_int32 (vtype_map* x, vtype_int8 key, vtype_int32 value);
|
||||
extern bool libcdsb_map_update_int8_int64 (vtype_map* x, vtype_int8 key, vtype_int64 value);
|
||||
extern bool libcdsb_map_update_int8_uint8 (vtype_map* x, vtype_int8 key, vtype_uint8 value);
|
||||
extern bool libcdsb_map_update_int8_uint16 (vtype_map* x, vtype_int8 key, vtype_uint16 value);
|
||||
extern bool libcdsb_map_update_int8_uint32 (vtype_map* x, vtype_int8 key, vtype_uint32 value);
|
||||
extern bool libcdsb_map_update_int8_uint64 (vtype_map* x, vtype_int8 key, vtype_uint64 value);
|
||||
extern bool libcdsb_map_update_int8_float (vtype_map* x, vtype_int8 key, vtype_float value);
|
||||
extern bool libcdsb_map_update_int8_double (vtype_map* x, vtype_int8 key, vtype_double value);
|
||||
extern bool libcdsb_map_update_int8_ldouble(vtype_map* x, vtype_int8 key, vtype_ldouble value);
|
||||
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_int16_pointer(vtype_map* x, vtype_int16 key, const void* value);
|
||||
extern bool libcdsb_map_update_int16_cstring(vtype_map* x, vtype_int16 key, const char* value);
|
||||
extern bool libcdsb_map_update_int16_string (vtype_map* x, vtype_int16 key, const vtype_string* value);
|
||||
extern bool libcdsb_map_update_int16_array (vtype_map* x, vtype_int16 key, const vtype_array* value);
|
||||
extern bool libcdsb_map_update_int16_list (vtype_map* x, vtype_int16 key, const vtype_list* value);
|
||||
extern bool libcdsb_map_update_int16_map (vtype_map* x, vtype_int16 key, const vtype_map* value);
|
||||
extern bool libcdsb_map_update_int16_vset (vtype_map* x, vtype_int16 key, const vtype_set* value);
|
||||
extern bool libcdsb_map_update_int16_boolean(vtype_map* x, vtype_int16 key, vtype_bool value);
|
||||
extern bool libcdsb_map_update_int16_int8 (vtype_map* x, vtype_int16 key, vtype_int8 value);
|
||||
extern bool libcdsb_map_update_int16_int16 (vtype_map* x, vtype_int16 key, vtype_int16 value);
|
||||
extern bool libcdsb_map_update_int16_int32 (vtype_map* x, vtype_int16 key, vtype_int32 value);
|
||||
extern bool libcdsb_map_update_int16_int64 (vtype_map* x, vtype_int16 key, vtype_int64 value);
|
||||
extern bool libcdsb_map_update_int16_uint8 (vtype_map* x, vtype_int16 key, vtype_uint8 value);
|
||||
extern bool libcdsb_map_update_int16_uint16 (vtype_map* x, vtype_int16 key, vtype_uint16 value);
|
||||
extern bool libcdsb_map_update_int16_uint32 (vtype_map* x, vtype_int16 key, vtype_uint32 value);
|
||||
extern bool libcdsb_map_update_int16_uint64 (vtype_map* x, vtype_int16 key, vtype_uint64 value);
|
||||
extern bool libcdsb_map_update_int16_float (vtype_map* x, vtype_int16 key, vtype_float value);
|
||||
extern bool libcdsb_map_update_int16_double (vtype_map* x, vtype_int16 key, vtype_double value);
|
||||
extern bool libcdsb_map_update_int16_ldouble(vtype_map* x, vtype_int16 key, vtype_ldouble value);
|
||||
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_int32_pointer(vtype_map* x, vtype_int32 key, const void* value);
|
||||
extern bool libcdsb_map_update_int32_cstring(vtype_map* x, vtype_int32 key, const char* value);
|
||||
extern bool libcdsb_map_update_int32_string (vtype_map* x, vtype_int32 key, const vtype_string* value);
|
||||
extern bool libcdsb_map_update_int32_array (vtype_map* x, vtype_int32 key, const vtype_array* value);
|
||||
extern bool libcdsb_map_update_int32_list (vtype_map* x, vtype_int32 key, const vtype_list* value);
|
||||
extern bool libcdsb_map_update_int32_map (vtype_map* x, vtype_int32 key, const vtype_map* value);
|
||||
extern bool libcdsb_map_update_int32_vset (vtype_map* x, vtype_int32 key, const vtype_set* value);
|
||||
extern bool libcdsb_map_update_int32_boolean(vtype_map* x, vtype_int32 key, vtype_bool value);
|
||||
extern bool libcdsb_map_update_int32_int8 (vtype_map* x, vtype_int32 key, vtype_int8 value);
|
||||
extern bool libcdsb_map_update_int32_int16 (vtype_map* x, vtype_int32 key, vtype_int16 value);
|
||||
extern bool libcdsb_map_update_int32_int32 (vtype_map* x, vtype_int32 key, vtype_int32 value);
|
||||
extern bool libcdsb_map_update_int32_int64 (vtype_map* x, vtype_int32 key, vtype_int64 value);
|
||||
extern bool libcdsb_map_update_int32_uint8 (vtype_map* x, vtype_int32 key, vtype_uint8 value);
|
||||
extern bool libcdsb_map_update_int32_uint16 (vtype_map* x, vtype_int32 key, vtype_uint16 value);
|
||||
extern bool libcdsb_map_update_int32_uint32 (vtype_map* x, vtype_int32 key, vtype_uint32 value);
|
||||
extern bool libcdsb_map_update_int32_uint64 (vtype_map* x, vtype_int32 key, vtype_uint64 value);
|
||||
extern bool libcdsb_map_update_int32_float (vtype_map* x, vtype_int32 key, vtype_float value);
|
||||
extern bool libcdsb_map_update_int32_double (vtype_map* x, vtype_int32 key, vtype_double value);
|
||||
extern bool libcdsb_map_update_int32_ldouble(vtype_map* x, vtype_int32 key, vtype_ldouble value);
|
||||
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_int64_pointer(vtype_map* x, vtype_int64 key, const void* value);
|
||||
extern bool libcdsb_map_update_int64_cstring(vtype_map* x, vtype_int64 key, const char* value);
|
||||
extern bool libcdsb_map_update_int64_string (vtype_map* x, vtype_int64 key, const vtype_string* value);
|
||||
extern bool libcdsb_map_update_int64_array (vtype_map* x, vtype_int64 key, const vtype_array* value);
|
||||
extern bool libcdsb_map_update_int64_list (vtype_map* x, vtype_int64 key, const vtype_list* value);
|
||||
extern bool libcdsb_map_update_int64_map (vtype_map* x, vtype_int64 key, const vtype_map* value);
|
||||
extern bool libcdsb_map_update_int64_vset (vtype_map* x, vtype_int64 key, const vtype_set* value);
|
||||
extern bool libcdsb_map_update_int64_boolean(vtype_map* x, vtype_int64 key, vtype_bool value);
|
||||
extern bool libcdsb_map_update_int64_int8 (vtype_map* x, vtype_int64 key, vtype_int8 value);
|
||||
extern bool libcdsb_map_update_int64_int16 (vtype_map* x, vtype_int64 key, vtype_int16 value);
|
||||
extern bool libcdsb_map_update_int64_int32 (vtype_map* x, vtype_int64 key, vtype_int32 value);
|
||||
extern bool libcdsb_map_update_int64_int64 (vtype_map* x, vtype_int64 key, vtype_int64 value);
|
||||
extern bool libcdsb_map_update_int64_uint8 (vtype_map* x, vtype_int64 key, vtype_uint8 value);
|
||||
extern bool libcdsb_map_update_int64_uint16 (vtype_map* x, vtype_int64 key, vtype_uint16 value);
|
||||
extern bool libcdsb_map_update_int64_uint32 (vtype_map* x, vtype_int64 key, vtype_uint32 value);
|
||||
extern bool libcdsb_map_update_int64_uint64 (vtype_map* x, vtype_int64 key, vtype_uint64 value);
|
||||
extern bool libcdsb_map_update_int64_float (vtype_map* x, vtype_int64 key, vtype_float value);
|
||||
extern bool libcdsb_map_update_int64_double (vtype_map* x, vtype_int64 key, vtype_double value);
|
||||
extern bool libcdsb_map_update_int64_ldouble(vtype_map* x, vtype_int64 key, vtype_ldouble value);
|
||||
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_float_pointer(vtype_map* x, vtype_float key, const void* value);
|
||||
extern bool libcdsb_map_update_float_cstring(vtype_map* x, vtype_float key, const char* value);
|
||||
extern bool libcdsb_map_update_float_string (vtype_map* x, vtype_float key, const vtype_string* value);
|
||||
extern bool libcdsb_map_update_float_array (vtype_map* x, vtype_float key, const vtype_array* value);
|
||||
extern bool libcdsb_map_update_float_list (vtype_map* x, vtype_float key, const vtype_list* value);
|
||||
extern bool libcdsb_map_update_float_map (vtype_map* x, vtype_float key, const vtype_map* value);
|
||||
extern bool libcdsb_map_update_float_vset (vtype_map* x, vtype_float key, const vtype_set* value);
|
||||
extern bool libcdsb_map_update_float_boolean(vtype_map* x, vtype_float key, vtype_bool value);
|
||||
extern bool libcdsb_map_update_float_int8 (vtype_map* x, vtype_float key, vtype_int8 value);
|
||||
extern bool libcdsb_map_update_float_int16 (vtype_map* x, vtype_float key, vtype_int16 value);
|
||||
extern bool libcdsb_map_update_float_int32 (vtype_map* x, vtype_float key, vtype_int32 value);
|
||||
extern bool libcdsb_map_update_float_int64 (vtype_map* x, vtype_float key, vtype_int64 value);
|
||||
extern bool libcdsb_map_update_float_uint8 (vtype_map* x, vtype_float key, vtype_uint8 value);
|
||||
extern bool libcdsb_map_update_float_uint16 (vtype_map* x, vtype_float key, vtype_uint16 value);
|
||||
extern bool libcdsb_map_update_float_uint32 (vtype_map* x, vtype_float key, vtype_uint32 value);
|
||||
extern bool libcdsb_map_update_float_uint64 (vtype_map* x, vtype_float key, vtype_uint64 value);
|
||||
extern bool libcdsb_map_update_float_float (vtype_map* x, vtype_float key, vtype_float value);
|
||||
extern bool libcdsb_map_update_float_double (vtype_map* x, vtype_float key, vtype_double value);
|
||||
extern bool libcdsb_map_update_float_ldouble(vtype_map* x, vtype_float key, vtype_ldouble value);
|
||||
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_double_pointer(vtype_map* x, vtype_double key, const void* value);
|
||||
extern bool libcdsb_map_update_double_cstring(vtype_map* x, vtype_double key, const char* value);
|
||||
extern bool libcdsb_map_update_double_string (vtype_map* x, vtype_double key, const vtype_string* value);
|
||||
extern bool libcdsb_map_update_double_array (vtype_map* x, vtype_double key, const vtype_array* value);
|
||||
extern bool libcdsb_map_update_double_list (vtype_map* x, vtype_double key, const vtype_list* value);
|
||||
extern bool libcdsb_map_update_double_map (vtype_map* x, vtype_double key, const vtype_map* value);
|
||||
extern bool libcdsb_map_update_double_vset (vtype_map* x, vtype_double key, const vtype_set* value);
|
||||
extern bool libcdsb_map_update_double_boolean(vtype_map* x, vtype_double key, vtype_bool value);
|
||||
extern bool libcdsb_map_update_double_int8 (vtype_map* x, vtype_double key, vtype_int8 value);
|
||||
extern bool libcdsb_map_update_double_int16 (vtype_map* x, vtype_double key, vtype_int16 value);
|
||||
extern bool libcdsb_map_update_double_int32 (vtype_map* x, vtype_double key, vtype_int32 value);
|
||||
extern bool libcdsb_map_update_double_int64 (vtype_map* x, vtype_double key, vtype_int64 value);
|
||||
extern bool libcdsb_map_update_double_uint8 (vtype_map* x, vtype_double key, vtype_uint8 value);
|
||||
extern bool libcdsb_map_update_double_uint16 (vtype_map* x, vtype_double key, vtype_uint16 value);
|
||||
extern bool libcdsb_map_update_double_uint32 (vtype_map* x, vtype_double key, vtype_uint32 value);
|
||||
extern bool libcdsb_map_update_double_uint64 (vtype_map* x, vtype_double key, vtype_uint64 value);
|
||||
extern bool libcdsb_map_update_double_float (vtype_map* x, vtype_double key, vtype_float value);
|
||||
extern bool libcdsb_map_update_double_double (vtype_map* x, vtype_double key, vtype_double value);
|
||||
extern bool libcdsb_map_update_double_ldouble(vtype_map* x, vtype_double key, vtype_ldouble value);
|
||||
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_ldouble_pointer(vtype_map* x, vtype_ldouble key, const void* value);
|
||||
extern bool libcdsb_map_update_ldouble_cstring(vtype_map* x, vtype_ldouble key, const char* value);
|
||||
extern bool libcdsb_map_update_ldouble_string (vtype_map* x, vtype_ldouble key, const vtype_string* value);
|
||||
extern bool libcdsb_map_update_ldouble_array (vtype_map* x, vtype_ldouble key, const vtype_array* value);
|
||||
extern bool libcdsb_map_update_ldouble_list (vtype_map* x, vtype_ldouble key, const vtype_list* value);
|
||||
extern bool libcdsb_map_update_ldouble_map (vtype_map* x, vtype_ldouble key, const vtype_map* value);
|
||||
extern bool libcdsb_map_update_ldouble_vset (vtype_map* x, vtype_ldouble key, const vtype_set* value);
|
||||
extern bool libcdsb_map_update_ldouble_boolean(vtype_map* x, vtype_ldouble key, vtype_bool value);
|
||||
extern bool libcdsb_map_update_ldouble_int8 (vtype_map* x, vtype_ldouble key, vtype_int8 value);
|
||||
extern bool libcdsb_map_update_ldouble_int16 (vtype_map* x, vtype_ldouble key, vtype_int16 value);
|
||||
extern bool libcdsb_map_update_ldouble_int32 (vtype_map* x, vtype_ldouble key, vtype_int32 value);
|
||||
extern bool libcdsb_map_update_ldouble_int64 (vtype_map* x, vtype_ldouble key, vtype_int64 value);
|
||||
extern bool libcdsb_map_update_ldouble_uint8 (vtype_map* x, vtype_ldouble key, vtype_uint8 value);
|
||||
extern bool libcdsb_map_update_ldouble_uint16 (vtype_map* x, vtype_ldouble key, vtype_uint16 value);
|
||||
extern bool libcdsb_map_update_ldouble_uint32 (vtype_map* x, vtype_ldouble key, vtype_uint32 value);
|
||||
extern bool libcdsb_map_update_ldouble_uint64 (vtype_map* x, vtype_ldouble key, vtype_uint64 value);
|
||||
extern bool libcdsb_map_update_ldouble_float (vtype_map* x, vtype_ldouble key, vtype_float value);
|
||||
extern bool libcdsb_map_update_ldouble_double (vtype_map* x, vtype_ldouble key, vtype_double value);
|
||||
extern bool libcdsb_map_update_ldouble_ldouble(vtype_map* x, vtype_ldouble key, vtype_ldouble value);
|
||||
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);
|
||||
|
||||
#endif /* LIBCDSB_MAP_H */
|
||||
|
@ -7,53 +7,61 @@
|
||||
#ifndef LIBCDSB_SET_H
|
||||
#define LIBCDSB_SET_H
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
typedef int (*vset_access_callback)(const void* value, vtype type, void* data);
|
||||
|
||||
extern void vset_init(vtype_set* x, vtype type);
|
||||
extern void vset_init(vtype_set* x, vtype type) Nonnull__(1);
|
||||
|
||||
#define vset_remove(x, value) _LIBCDSB_Generic (libcdsb_vset, touch, value)(x, value, 1)
|
||||
#define vset_push(x, value) _LIBCDSB_Generic (libcdsb_vset, push, value)(x, value)
|
||||
#define vset_pop(x, value, data, callback) _LIBCDSB_Generic (libcdsb_vset, find, value)(x, value, data, callback, 1)
|
||||
#define vset_get(x, value, data, callback) _LIBCDSB_Generic (libcdsb_vset, find, value)(x, value, data, callback, 0)
|
||||
#define vset_push(x, value) _LIBCDSB_Generic (libcdsb_vset, push, value)(x, value)
|
||||
#define vset_remove(x, value) vset_pop(x, value, 0, 0)
|
||||
|
||||
#define in_vset(x, value) _LIBCDSB_Generic (libcdsb_vset, touch, value)(x, value, 0)
|
||||
#define in_vset(x, value) (vset_get(&x, value, 0, 0) == 0)
|
||||
|
||||
extern bool libcdsb_vset_push_pointer(vtype_set* x, const void* value);
|
||||
extern bool libcdsb_vset_push_cstring(vtype_set* x, const char* value);
|
||||
extern bool libcdsb_vset_push_string (vtype_set* x, const vtype_string* value);
|
||||
extern bool libcdsb_vset_push_array (vtype_set* x, const vtype_array* value);
|
||||
extern bool libcdsb_vset_push_list (vtype_set* x, const vtype_list* value);
|
||||
extern bool libcdsb_vset_push_map (vtype_set* x, const vtype_map* value);
|
||||
extern bool libcdsb_vset_push_vset (vtype_set* x, const vtype_set* value);
|
||||
extern bool libcdsb_vset_push_boolean(vtype_set* x, vtype_bool value);
|
||||
extern bool libcdsb_vset_push_uint8 (vtype_set* x, vtype_uint8 value);
|
||||
extern bool libcdsb_vset_push_uint16 (vtype_set* x, vtype_uint16 value);
|
||||
extern bool libcdsb_vset_push_uint32 (vtype_set* x, vtype_uint32 value);
|
||||
extern bool libcdsb_vset_push_uint64 (vtype_set* x, vtype_uint64 value);
|
||||
extern bool libcdsb_vset_push_int8 (vtype_set* x, vtype_int8 value);
|
||||
extern bool libcdsb_vset_push_int16 (vtype_set* x, vtype_int16 value);
|
||||
extern bool libcdsb_vset_push_int32 (vtype_set* x, vtype_int32 value);
|
||||
extern bool libcdsb_vset_push_int64 (vtype_set* x, vtype_int64 value);
|
||||
extern bool libcdsb_vset_push_float (vtype_set* x, vtype_float value);
|
||||
extern bool libcdsb_vset_push_double (vtype_set* x, vtype_double value);
|
||||
extern bool libcdsb_vset_push_ldouble(vtype_set* x, vtype_ldouble value);
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
extern int libcdsb_vset_find_pointer(vtype_set* x, const void* value, void* data, vset_access_callback, bool cut);
|
||||
extern int libcdsb_vset_find_cstring(vtype_set* x, const char* value, void* data, vset_access_callback, bool cut);
|
||||
extern int libcdsb_vset_find_string (vtype_set* x, const vtype_string* value, void* data, vset_access_callback, bool cut);
|
||||
extern int libcdsb_vset_find_array (vtype_set* x, const vtype_array* value, void* data, vset_access_callback, bool cut);
|
||||
extern int libcdsb_vset_find_list (vtype_set* x, const vtype_list* value, void* data, vset_access_callback, bool cut);
|
||||
extern int libcdsb_vset_find_map (vtype_set* x, const vtype_map* value, void* data, vset_access_callback, bool cut);
|
||||
extern int libcdsb_vset_find_vset (vtype_set* x, const vtype_set* value, void* data, vset_access_callback, bool cut);
|
||||
extern int libcdsb_vset_find_boolean(vtype_set* x, vtype_bool value, void* data, vset_access_callback, bool cut);
|
||||
extern int libcdsb_vset_find_uint8 (vtype_set* x, vtype_uint8 value, void* data, vset_access_callback, bool cut);
|
||||
extern int libcdsb_vset_find_uint16 (vtype_set* x, vtype_uint16 value, void* data, vset_access_callback, bool cut);
|
||||
extern int libcdsb_vset_find_uint32 (vtype_set* x, vtype_uint32 value, void* data, vset_access_callback, bool cut);
|
||||
extern int libcdsb_vset_find_uint64 (vtype_set* x, vtype_uint64 value, void* data, vset_access_callback, bool cut);
|
||||
extern int libcdsb_vset_find_int8 (vtype_set* x, vtype_int8 value, void* data, vset_access_callback, bool cut);
|
||||
extern int libcdsb_vset_find_int16 (vtype_set* x, vtype_int16 value, void* data, vset_access_callback, bool cut);
|
||||
extern int libcdsb_vset_find_int32 (vtype_set* x, vtype_int32 value, void* data, vset_access_callback, bool cut);
|
||||
extern int libcdsb_vset_find_int64 (vtype_set* x, vtype_int64 value, void* data, vset_access_callback, bool cut);
|
||||
extern int libcdsb_vset_find_float (vtype_set* x, vtype_float value, void* data, vset_access_callback, bool cut);
|
||||
extern int libcdsb_vset_find_double (vtype_set* x, vtype_double value, void* data, vset_access_callback, bool cut);
|
||||
extern int libcdsb_vset_find_ldouble(vtype_set* x, vtype_ldouble value, void* data, vset_access_callback, bool cut);
|
||||
extern bool libcdsb_vset_push_pointer(vtype_set* x, const void* value) Nonnull__(1);
|
||||
extern bool libcdsb_vset_push_cstring(vtype_set* x, const char* value) Nonnull__(1,2);
|
||||
extern bool libcdsb_vset_push_string (vtype_set* x, const vtype_string* value) Nonnull__(1,2);
|
||||
extern bool libcdsb_vset_push_array (vtype_set* x, const vtype_array* value) Nonnull__(1,2);
|
||||
extern bool libcdsb_vset_push_list (vtype_set* x, const vtype_list* value) Nonnull__(1,2);
|
||||
extern bool libcdsb_vset_push_map (vtype_set* x, const vtype_map* value) Nonnull__(1,2);
|
||||
extern bool libcdsb_vset_push_vset (vtype_set* x, const vtype_set* value) Nonnull__(1,2);
|
||||
extern bool libcdsb_vset_push_dict (vtype_set* x, const vtype_dict* value) Nonnull__(1,2);
|
||||
extern bool libcdsb_vset_push_boolean(vtype_set* x, vtype_bool value) Nonnull__(1);
|
||||
extern bool libcdsb_vset_push_uint8 (vtype_set* x, vtype_uint8 value) Nonnull__(1);
|
||||
extern bool libcdsb_vset_push_uint16 (vtype_set* x, vtype_uint16 value) Nonnull__(1);
|
||||
extern bool libcdsb_vset_push_uint32 (vtype_set* x, vtype_uint32 value) Nonnull__(1);
|
||||
extern bool libcdsb_vset_push_uint64 (vtype_set* x, vtype_uint64 value) Nonnull__(1);
|
||||
extern bool libcdsb_vset_push_int8 (vtype_set* x, vtype_int8 value) Nonnull__(1);
|
||||
extern bool libcdsb_vset_push_int16 (vtype_set* x, vtype_int16 value) Nonnull__(1);
|
||||
extern bool libcdsb_vset_push_int32 (vtype_set* x, vtype_int32 value) Nonnull__(1);
|
||||
extern bool libcdsb_vset_push_int64 (vtype_set* x, vtype_int64 value) Nonnull__(1);
|
||||
extern bool libcdsb_vset_push_float (vtype_set* x, vtype_float value) Nonnull__(1);
|
||||
extern bool libcdsb_vset_push_double (vtype_set* x, vtype_double value) Nonnull__(1);
|
||||
extern bool libcdsb_vset_push_ldouble(vtype_set* x, vtype_ldouble value) Nonnull__(1);
|
||||
|
||||
extern int libcdsb_vset_find_pointer(vtype_set* x, const void* value, void* data, vset_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_vset_find_cstring(vtype_set* x, const char* value, void* data, vset_access_callback, bool cut) Nonnull__(1,2);
|
||||
extern int libcdsb_vset_find_string (vtype_set* x, const vtype_string* value, void* data, vset_access_callback, bool cut) Nonnull__(1,2);
|
||||
extern int libcdsb_vset_find_array (vtype_set* x, const vtype_array* value, void* data, vset_access_callback, bool cut) Nonnull__(1,2);
|
||||
extern int libcdsb_vset_find_list (vtype_set* x, const vtype_list* value, void* data, vset_access_callback, bool cut) Nonnull__(1,2);
|
||||
extern int libcdsb_vset_find_map (vtype_set* x, const vtype_map* value, void* data, vset_access_callback, bool cut) Nonnull__(1,2);
|
||||
extern int libcdsb_vset_find_vset (vtype_set* x, const vtype_set* value, void* data, vset_access_callback, bool cut) Nonnull__(1,2);
|
||||
extern int libcdsb_vset_find_dict (vtype_set* x, const vtype_dict* value, void* data, vset_access_callback, bool cut) Nonnull__(1,2);
|
||||
extern int libcdsb_vset_find_boolean(vtype_set* x, vtype_bool value, void* data, vset_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_vset_find_uint8 (vtype_set* x, vtype_uint8 value, void* data, vset_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_vset_find_uint16 (vtype_set* x, vtype_uint16 value, void* data, vset_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_vset_find_uint32 (vtype_set* x, vtype_uint32 value, void* data, vset_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_vset_find_uint64 (vtype_set* x, vtype_uint64 value, void* data, vset_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_vset_find_int8 (vtype_set* x, vtype_int8 value, void* data, vset_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_vset_find_int16 (vtype_set* x, vtype_int16 value, void* data, vset_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_vset_find_int32 (vtype_set* x, vtype_int32 value, void* data, vset_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_vset_find_int64 (vtype_set* x, vtype_int64 value, void* data, vset_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_vset_find_float (vtype_set* x, vtype_float value, void* data, vset_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_vset_find_double (vtype_set* x, vtype_double value, void* data, vset_access_callback, bool cut) Nonnull__(1);
|
||||
extern int libcdsb_vset_find_ldouble(vtype_set* x, vtype_ldouble value, void* data, vset_access_callback, bool cut) Nonnull__(1);
|
||||
|
||||
#endif /* LIBCDSB_SET_H */
|
||||
|
@ -10,14 +10,14 @@
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
extern void string_init(vtype_string* x, const char* value) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern void string_init(vtype_string* x, const char* value) Nonnull__(1);
|
||||
|
||||
extern char* string_at(const vtype_string* s, ssize_t index) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern bool string_slice(vtype_string* x, vtype_string* s, ssize_t index, size_t nchars, bool cut) LIBCDSB_nt__ LIBCDSB_nn12__;
|
||||
extern char* string_at(const vtype_string* s, ssize_t index) Nonnull__(1);
|
||||
extern size_t string_slice(vtype_string* x, vtype_string* s, ssize_t index, size_t nchars, bool cut) Nonnull__(1,2);
|
||||
|
||||
#define string_indexof(s, arg) _LIBCDSB_GenericS(libcdsb_string, indexof, arg)(s, arg)
|
||||
#define string_count(s, arg) _LIBCDSB_GenericS(libcdsb_string, count, arg)(s, arg)
|
||||
#define string_concat(s, value) _LIBCDSB_GenericS(libcdsb_string, concat, value)(s, value)
|
||||
#define string_concat(x, value) _LIBCDSB_GenericS(libcdsb_string, concat, value)(x, value)
|
||||
|
||||
#define string_trim_spaces(x) libcdsb_string_trim_spaces(x, 0)
|
||||
#define string_ltrim_spaces(x) libcdsb_string_trim_spaces(x, -1)
|
||||
@ -27,29 +27,29 @@ extern bool string_slice(vtype_string* x, vtype_string* s, ssize_t index, size_t
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
inline ssize_t libcdsb_string_indexof_string (const vtype_string* s, const vtype_string* arg) __attribute__((always_inline));
|
||||
extern ssize_t libcdsb_string_indexof_cstring(const vtype_string* s, const char* arg) LIBCDSB_pure__ LIBCDSB_nn1__;
|
||||
extern ssize_t libcdsb_string_indexof_char (const vtype_string* s, int arg) LIBCDSB_pure__ LIBCDSB_nn1__;
|
||||
inline ssize_t libcdsb_string_indexof_string (const vtype_string* s, const vtype_string* arg) Pure__ Warn_unused_result__ Nonnull__(1) Always_inline__;
|
||||
extern ssize_t libcdsb_string_indexof_cstring(const vtype_string* s, const char* arg) Pure__ Warn_unused_result__ Nonnull__(1);
|
||||
extern ssize_t libcdsb_string_indexof_char (const vtype_string* s, int arg) Pure__ Warn_unused_result__ Nonnull__(1);
|
||||
|
||||
inline size_t libcdsb_string_count_string (const vtype_string* s, const vtype_string* arg) __attribute__((always_inline));
|
||||
extern size_t libcdsb_string_count_cstring(const vtype_string* s, const char* arg) LIBCDSB_pure__ LIBCDSB_nn1__;
|
||||
extern size_t libcdsb_string_count_char (const vtype_string* s, int arg) LIBCDSB_pure__ LIBCDSB_nn1__;
|
||||
inline size_t libcdsb_string_count_string (const vtype_string* s, const vtype_string* arg) Pure__ Warn_unused_result__ Nonnull__(1) Always_inline__;
|
||||
extern size_t libcdsb_string_count_cstring(const vtype_string* s, const char* arg) Pure__ Warn_unused_result__ Nonnull__(1);
|
||||
extern size_t libcdsb_string_count_char (const vtype_string* s, int arg) Pure__ Warn_unused_result__ Nonnull__(1);
|
||||
|
||||
inline bool libcdsb_string_concat_string (vtype_string* x, const vtype_string* value) __attribute__((always_inline));
|
||||
extern bool libcdsb_string_concat_cstring(vtype_string* x, const char* value) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern bool libcdsb_string_concat_char (vtype_string* x, int value) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
inline bool libcdsb_string_concat_string (vtype_string* x, const vtype_string* value) Nonnull__(1) Always_inline__;
|
||||
extern bool libcdsb_string_concat_cstring(vtype_string* x, const char* value) Nonnull__(1);
|
||||
extern bool libcdsb_string_concat_char (vtype_string* x, int value) Nonnull__(1);
|
||||
|
||||
extern void libcdsb_string_trim_spaces(vtype_string* x, int direction) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern void libcdsb_string_trim_spaces(vtype_string* x, int direction) Nonnull__(1);
|
||||
|
||||
inline size_t libcdsb_string_replace_string_string (vtype_string* x, const vtype_string* src, const vtype_string* dest, size_t maxn) __attribute__((always_inline));
|
||||
inline size_t libcdsb_string_replace_string_cstring (vtype_string* x, const vtype_string* src, const char* dest, size_t maxn) __attribute__((always_inline));
|
||||
inline size_t libcdsb_string_replace_string_char (vtype_string* x, const vtype_string* src, int dest, size_t maxn) __attribute__((always_inline));
|
||||
inline size_t libcdsb_string_replace_cstring_string (vtype_string* x, const char* src, const vtype_string* dest, size_t maxn) __attribute__((always_inline));
|
||||
extern size_t libcdsb_string_replace_cstring_cstring(vtype_string* x, const char* src, const char* dest, size_t maxn) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern size_t libcdsb_string_replace_cstring_char (vtype_string* x, const char* src, int dest, size_t maxn) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
inline size_t libcdsb_string_replace_char_string (vtype_string* x, int src, const vtype_string* dest, size_t maxn) __attribute__((always_inline));
|
||||
extern size_t libcdsb_string_replace_char_cstring (vtype_string* x, int src, const char* dest, size_t maxn) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
extern size_t libcdsb_string_replace_char_char (vtype_string* x, int src, int dest, size_t maxn) LIBCDSB_nt__ LIBCDSB_nn1__;
|
||||
inline size_t libcdsb_string_replace_string_string (vtype_string* x, const vtype_string* src, const vtype_string* dest, size_t maxn) Nonnull__(1) Always_inline__;
|
||||
inline size_t libcdsb_string_replace_string_cstring (vtype_string* x, const vtype_string* src, const char* dest, size_t maxn) Nonnull__(1) Always_inline__;
|
||||
inline size_t libcdsb_string_replace_string_char (vtype_string* x, const vtype_string* src, int dest, size_t maxn) Nonnull__(1) Always_inline__;
|
||||
inline size_t libcdsb_string_replace_cstring_string (vtype_string* x, const char* src, const vtype_string* dest, size_t maxn) Nonnull__(1) Always_inline__;
|
||||
extern size_t libcdsb_string_replace_cstring_cstring(vtype_string* x, const char* src, const char* dest, size_t maxn) Nonnull__(1);
|
||||
extern size_t libcdsb_string_replace_cstring_char (vtype_string* x, const char* src, int dest, size_t maxn) Nonnull__(1);
|
||||
inline size_t libcdsb_string_replace_char_string (vtype_string* x, int src, const vtype_string* dest, size_t maxn) Nonnull__(1) Always_inline__;
|
||||
extern size_t libcdsb_string_replace_char_cstring (vtype_string* x, int src, const char* dest, size_t maxn) Nonnull__(1);
|
||||
extern size_t libcdsb_string_replace_char_char (vtype_string* x, int src, int dest, size_t maxn) Nonnull__(1);
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
|
@ -30,8 +30,7 @@ typedef enum libcdsb_value_types {
|
||||
VTYPE_ARRAY = 15,
|
||||
VTYPE_LIST = 16,
|
||||
VTYPE_SET = 17,
|
||||
|
||||
LIBCDSB_VTYPE_TERMINATION, /* It must be at the end of the enum. Never be used */
|
||||
VTYPE_DICT = 18,
|
||||
} vtype;
|
||||
|
||||
|
||||
@ -42,6 +41,7 @@ struct libcdsb_map { struct libcdsb_map_node* root; vtype type; };
|
||||
struct libcdsb_set { struct libcdsb_rbtree_node* root; vtype type; };
|
||||
|
||||
struct libcdsb_list { struct libcdsb_list_node* last; struct libcdsb_list_node* first; };
|
||||
struct libcdsb_dict { struct libcdsb_dict_node** nodes; size_t capacity; size_t size; };
|
||||
|
||||
typedef void* vtype_pointer;
|
||||
typedef bool vtype_bool;
|
||||
@ -60,72 +60,86 @@ typedef float vtype_float;
|
||||
typedef double vtype_double;
|
||||
typedef long double vtype_ldouble;
|
||||
|
||||
typedef size_t vtype_hash;
|
||||
|
||||
typedef struct libcdsb_array vtype_array;
|
||||
typedef struct libcdsb_map vtype_map;
|
||||
typedef struct libcdsb_set vtype_set;
|
||||
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) LIBCDSB_pure__ LIBCDSB_nn1__;
|
||||
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) LIBCDSB_pure__ LIBCDSB_nn1__;
|
||||
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) LIBCDSB_pure__ LIBCDSB_nn1__;
|
||||
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) LIBCDSB_pure__ LIBCDSB_nn1__;
|
||||
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) LIBCDSB_pure__ LIBCDSB_nn1__;
|
||||
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) LIBCDSB_pure__ LIBCDSB_nn1__;
|
||||
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) LIBCDSB_pure__ LIBCDSB_nn1__;
|
||||
|
||||
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) LIBCDSB_cmpattr__;
|
||||
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) LIBCDSB_cmpattr__;
|
||||
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) LIBCDSB_cmpattr__;
|
||||
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) LIBCDSB_cmpattr__;
|
||||
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) LIBCDSB_cmpattr__;
|
||||
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);
|
||||
|
||||
/* Copy string to another */
|
||||
extern vtype_string string_copy(const vtype_string* s) LIBCDSB_cpyattr__;
|
||||
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) LIBCDSB_cpyattr__;
|
||||
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) LIBCDSB_cpyattr__;
|
||||
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) LIBCDSB_cpyattr__;
|
||||
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) LIBCDSB_cpyattr__;
|
||||
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);
|
||||
|
||||
/* Duplicate string memory block */
|
||||
extern vtype_string* string_duplicate(const vtype_string* s) LIBCDSB_dupattr__;
|
||||
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) LIBCDSB_dupattr__;
|
||||
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) LIBCDSB_dupattr__;
|
||||
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) LIBCDSB_dupattr__;
|
||||
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) LIBCDSB_dupattr__;
|
||||
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);
|
||||
|
||||
/* Copy string and store result to the memory block */
|
||||
extern void string_copy_init(vtype_string* x, const vtype_string* s) LIBCDSB_nn12__;
|
||||
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) LIBCDSB_nn12__;
|
||||
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) LIBCDSB_nn12__;
|
||||
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) LIBCDSB_nn12__;
|
||||
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) LIBCDSB_nn12__;
|
||||
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);
|
||||
|
||||
/* Free string resources */
|
||||
extern void string_free(vtype_string* x);
|
||||
@ -137,5 +151,20 @@ extern void list_free(vtype_list* x);
|
||||
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);
|
||||
|
||||
/* 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);
|
||||
|
||||
#endif /* LIBCDSB_VTYPE_H */
|
||||
|
@ -3,11 +3,10 @@
|
||||
|
||||
#include "../../include/__attributes.h"
|
||||
|
||||
#define throw__ HHTTPC_nt__
|
||||
#define pure__ HHTTPC_pure__
|
||||
#define const__ __attribute__((const)) HHTTPC_nt__
|
||||
#define leaf__ __attribute__((leaf)) HHTTPC_nt__
|
||||
#define wur__ HHTTPC_wur__
|
||||
#define inline__ __attribute__((always_inline))
|
||||
#define pure__ Pure__
|
||||
#define const__ __attribute__((const))
|
||||
#define leaf__ __attribute__((leaf))
|
||||
#define wur__ Warn_unused_result__
|
||||
#define inline__ Always_inline__
|
||||
|
||||
#define ainline(...) inline __VA_ARGS__ inline__; inline __VA_ARGS__
|
||||
|
@ -14,6 +14,8 @@
|
||||
#ifndef LIBCDSB_SRC_INTERNAL_INCLUDE
|
||||
#define LIBCDSB_SRC_INTERNAL_INCLUDE
|
||||
|
||||
extern const size_t LIBCDSB_VTYPE_SIZES[19];
|
||||
|
||||
#define is_x64 (sizeof(void*) == sizeof(vtype_uint64))
|
||||
#define is_big_endian (*((unsigned int*)"\0\0\0\1") < (unsigned int)0xffff)
|
||||
#define is_little_endian (!is_big_endian)
|
||||
@ -57,10 +59,14 @@ typedef vtype_array arr_t;
|
||||
typedef vtype_list list_t;
|
||||
typedef vtype_map map_t;
|
||||
typedef vtype_set set_t;
|
||||
typedef vtype_dict dict_t;
|
||||
|
||||
typedef vtype_hash hash_t;
|
||||
|
||||
|
||||
extern int libcdsb_vtype_compare_values(const void* s0, vtype t0, const void* s1, vtype t1);
|
||||
extern int libcdsb_vtype_compare_values_eq(const void* s0, const void* s1, vtype t);
|
||||
extern int libcdsb_vtype_compare_values (const void* s0, vtype t0, const void* s1, vtype t1) pure__ wur__;
|
||||
extern int libcdsb_vtype_compare_values_eq(const void* s0, const void* s1, vtype t) pure__ wur__;
|
||||
extern hash_t libcdsb_vtype_hash (const void* value, vtype type) pure__ wur__;
|
||||
|
||||
#define vtype_stringify libcdsb_vtype_stringify
|
||||
#define vtype_name libcdsb_vtype_name
|
||||
@ -68,6 +74,8 @@ extern int libcdsb_vtype_compare_values_eq(const void* s0, const void* s1, vtype
|
||||
#define vtype_compare libcdsb_vtype_compare_values
|
||||
#define vtype_compare_eq libcdsb_vtype_compare_values_eq
|
||||
|
||||
#define vtype_hash libcdsb_vtype_hash
|
||||
|
||||
#define vtype_size(type) (LIBCDSB_VTYPE_SIZES[type])
|
||||
|
||||
#define vtypeof(x) (vtype)(_Generic((x),\
|
||||
@ -78,6 +86,7 @@ extern int libcdsb_vtype_compare_values_eq(const void* s0, const void* s1, vtype
|
||||
const list_t*: VTYPE_LIST, list_t*: VTYPE_LIST, list_t: VTYPE_LIST,\
|
||||
const map_t*: VTYPE_MAP, map_t*: VTYPE_MAP, map_t: VTYPE_MAP,\
|
||||
const set_t*: VTYPE_SET, set_t*: VTYPE_SET, set_t: VTYPE_SET,\
|
||||
const dict_t*: VTYPE_DICT, dict_t*: VTYPE_DICT, dict_t: VTYPE_DICT,\
|
||||
const vtype_bool*: VTYPE_BOOLEAN, vtype_bool*: VTYPE_BOOLEAN, vtype_bool: VTYPE_BOOLEAN,\
|
||||
const vtype_uint8*: VTYPE_UINT8, vtype_uint8*: VTYPE_UINT8, vtype_uint8: VTYPE_UINT8,\
|
||||
const vtype_uint16*: VTYPE_UINT16, vtype_uint16*: VTYPE_UINT16, vtype_uint16: VTYPE_UINT16,\
|
||||
|
@ -17,9 +17,9 @@ typedef struct libcdsb_rbtree_node {
|
||||
|
||||
extern rbnode_t LIBCDSB_RBTREE_NODE_EMPTY[1];
|
||||
|
||||
extern void* libcdsb_rbtree_node_create(void* value, rbnode_t* parent, int colored, int size);
|
||||
extern void libcdsb_rbtree_node_fixup (rbnode_t** root, rbnode_t* node);
|
||||
extern rbnode_t* libcdsb_rbtree_node_delete(rbnode_t** root, rbnode_t* node);
|
||||
extern void* libcdsb_rbtree_node_create(void* value, rbnode_t* parent, int colored, int size) Nonnull__(1,2);
|
||||
extern void libcdsb_rbtree_node_fixup (rbnode_t** root, rbnode_t* node) Nonnull__(1,2);
|
||||
extern rbnode_t* libcdsb_rbtree_node_delete(rbnode_t** root, rbnode_t* node) Nonnull__(1,2);
|
||||
|
||||
#define rbnode_empty ((rbnode_t*)LIBCDSB_RBTREE_NODE_EMPTY)
|
||||
#define rbnode_create(v, p, c) ((rbnode_t*)libcdsb_rbtree_node_create(v, p, c, sizeof(rbnode_t)))
|
||||
|
@ -11,25 +11,27 @@
|
||||
typedef union {
|
||||
void* ptr; bool b;
|
||||
str_t s; arr_t a; list_t l;
|
||||
map_t m; set_t vs;
|
||||
map_t m; set_t vs; dict_t vd;
|
||||
u8_t u8; u16_t u16; u32_t u32; u64_t u64;
|
||||
fl_t f; dbl_t d; ldbl_t ld;
|
||||
} var_t;
|
||||
|
||||
typedef void* vnode_t;
|
||||
|
||||
extern vnode_t libcdsb_vnode_create(const void* value, vtype type);
|
||||
extern vnode_t libcdsb_vnode_create_target(vtype target_type, const void* value, vtype type);
|
||||
extern vnode_t libcdsb_vnode_create (const void* value, vtype type) wur__;
|
||||
extern vnode_t libcdsb_vnode_create_target(vtype target_type, const void* value, vtype type) wur__;
|
||||
|
||||
extern void libcdsb_vnode_free(vnode_t* x, vtype type);
|
||||
extern void* libcdsb_vnode_peek(const vnode_t* x, vtype type);
|
||||
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);
|
||||
|
||||
#define vnode_create libcdsb_vnode_create
|
||||
#define vnode_tcreate libcdsb_vnode_create_target
|
||||
#define vnode_peek libcdsb_vnode_peek
|
||||
#define vnode_free libcdsb_vnode_free
|
||||
|
||||
#define vnode_hash(vnode, type) vtype_hash(vnode_peek(vnode, type), type)
|
||||
#define vnode_compare(s0, t0, s1, t1) vtype_compare(vnode_peek(s0, t0), t0, vnode_peek(s1, t1), t1)
|
||||
#define vnode_compare_eq(s0, s1, t) vtype_compare_eq(vnode_peek(s0, t), vnode_peek(s1, t), t)
|
||||
#define vnode_duplicate(vnode, type) libcdsb_vnode_create(vnode_peek(vnode, type), type)
|
||||
#define vnode_tduplicate(target_type, vnode, type) libcdsb_vnode_create_target(target_type, vnode_peek(vnode, type), type)
|
||||
|
||||
|
@ -4,6 +4,66 @@
|
||||
#include "include.h"
|
||||
#include "../__internal/assert.h"
|
||||
|
||||
typedef void (*type_free)(void*);
|
||||
|
||||
static inline type_free get_type_free(vtype type) {
|
||||
switch (type) {
|
||||
default:
|
||||
#ifndef NDEBUG
|
||||
abort();
|
||||
#endif
|
||||
case VTYPE_STRING: return (void*)string_free;
|
||||
case VTYPE_ARRAY: return (void*) array_free;
|
||||
case VTYPE_LIST: return (void*) list_free;
|
||||
case VTYPE_MAP: return (void*) map_free;
|
||||
case VTYPE_SET: return (void*) vset_free;
|
||||
case VTYPE_DICT: return (void*) dict_free;
|
||||
}
|
||||
}
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
hash_t array_hash(const arr_t* s) {
|
||||
hash_t hash = 0;
|
||||
|
||||
if (s->size > 0)
|
||||
hash = vtype_hash(s->mem, s->type);
|
||||
|
||||
if (s->size > 1)
|
||||
hash += vtype_hash(array_internal_at(s, s->size - 1), s->type);
|
||||
|
||||
hash ^= s->size;
|
||||
|
||||
return hash + VTYPE_ARRAY;
|
||||
}
|
||||
|
||||
void array_init(arr_t* x, vtype t) {
|
||||
x->type = t;
|
||||
x->size = 0;
|
||||
x->mem = nullptr;
|
||||
}
|
||||
|
||||
void array_free(arr_t* x) {
|
||||
if (x->size && x->type >= VTYPE_STRING) {
|
||||
void* p = x->mem;
|
||||
type_free free_;
|
||||
|
||||
assert(!is_null(p));
|
||||
|
||||
free_ = get_type_free(x->type);
|
||||
|
||||
do {
|
||||
free_(p);
|
||||
p += vtype_size(x->type);
|
||||
} while (--x->size);
|
||||
}
|
||||
|
||||
free(x->mem);
|
||||
memset(x, 0, sizeof(*x));
|
||||
}
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
size_t array_size (const arr_t* x) {
|
||||
return x->size;
|
||||
}
|
||||
@ -17,40 +77,7 @@ void* array_at(const arr_t* x, ssize_t i) {
|
||||
return x->mem + i*vtype_size(x->type);
|
||||
}
|
||||
|
||||
void array_init(arr_t* x, vtype t) {
|
||||
x->type = t;
|
||||
x->size = 0;
|
||||
x->mem = nullptr;
|
||||
}
|
||||
|
||||
void array_free(arr_t* x) {
|
||||
if (x->size && x->type >= VTYPE_STRING) {
|
||||
void* p = x->mem;
|
||||
void (*free_)(void*);
|
||||
|
||||
assert(!is_null(p));
|
||||
|
||||
switch (x->type) {
|
||||
default:
|
||||
#ifndef NDEBUG
|
||||
abort();
|
||||
#endif
|
||||
case VTYPE_STRING: free_ = (void*)string_free; break;
|
||||
case VTYPE_ARRAY: free_ = (void*) array_free; break;
|
||||
case VTYPE_LIST: free_ = (void*) list_free; break;
|
||||
case VTYPE_MAP: free_ = (void*) map_free; break;
|
||||
case VTYPE_SET: free_ = (void*) vset_free; break;
|
||||
}
|
||||
|
||||
do {
|
||||
free_(p);
|
||||
p += vtype_size(x->type);
|
||||
} while (--x->size);
|
||||
}
|
||||
|
||||
free(x->mem);
|
||||
memset(x, 0, sizeof(*x));
|
||||
}
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
int array_compare(const arr_t* s0, const arr_t* s1) {
|
||||
|
||||
|
@ -4,6 +4,22 @@
|
||||
#include "include.h"
|
||||
#include "../__internal/assert.h"
|
||||
|
||||
typedef void (*type_initializer)(void*, const void*);
|
||||
|
||||
static inline type_initializer get_type_initializer(vtype type) {
|
||||
switch (type) {
|
||||
default:
|
||||
#ifndef NDEBUG
|
||||
abort();
|
||||
#endif
|
||||
case VTYPE_STRING: return (void*)string_copy_init;
|
||||
case VTYPE_ARRAY: return (void*) array_copy_init;
|
||||
case VTYPE_LIST: return (void*) list_copy_init;
|
||||
case VTYPE_MAP: return (void*) map_copy_init;
|
||||
case VTYPE_SET: return (void*) vset_copy_init;
|
||||
case VTYPE_DICT: return (void*) dict_copy_init;
|
||||
}
|
||||
}
|
||||
|
||||
arr_t array_copy(const arr_t* s) {
|
||||
arr_t x = { .mem = 0, .size = 0, .type = 0 };
|
||||
@ -14,19 +30,12 @@ arr_t array_copy(const arr_t* s) {
|
||||
|
||||
if (s->type >= VTYPE_STRING) {
|
||||
void *p, *v, *e;
|
||||
void (*init)(void*, const void*);
|
||||
type_initializer init;
|
||||
|
||||
x.mem = p = malloc(x.size*vtype_size(x.type));
|
||||
v = s->mem;
|
||||
e = array_end(&x);
|
||||
|
||||
switch (s->type) { default: abort();
|
||||
case VTYPE_STRING: init = (void*)string_copy_init; break;
|
||||
case VTYPE_ARRAY: init = (void*) array_copy_init; break;
|
||||
case VTYPE_LIST: init = (void*) list_copy_init; break;
|
||||
case VTYPE_MAP: init = (void*) map_copy_init; break;
|
||||
case VTYPE_SET: init = (void*) vset_copy_init; break;
|
||||
}
|
||||
init = get_type_initializer(s->type);
|
||||
|
||||
do {
|
||||
init(p, v);
|
||||
@ -50,19 +59,12 @@ arr_t* array_duplicate(const arr_t* s) {
|
||||
|
||||
if (s->type >= VTYPE_STRING) {
|
||||
void *p, *v, *e;
|
||||
void (*init)(void*, const void*);
|
||||
type_initializer init;
|
||||
|
||||
x->mem = p = malloc(x->size*vtype_size(x->type));
|
||||
v = s->mem;
|
||||
e = array_end(x);
|
||||
|
||||
switch (s->type) { default: abort();
|
||||
case VTYPE_STRING: init = (void*)string_copy_init; break;
|
||||
case VTYPE_ARRAY: init = (void*) array_copy_init; break;
|
||||
case VTYPE_LIST: init = (void*) list_copy_init; break;
|
||||
case VTYPE_MAP: init = (void*) map_copy_init; break;
|
||||
case VTYPE_SET: init = (void*) vset_copy_init; break;
|
||||
}
|
||||
init = get_type_initializer(s->type);
|
||||
|
||||
do {
|
||||
init(p, v);
|
||||
@ -84,19 +86,12 @@ void array_copy_init(arr_t* x, const arr_t* s) {
|
||||
|
||||
if (s->type >= VTYPE_STRING) {
|
||||
void *p, *v, *e;
|
||||
void (*init)(void*, const void*);
|
||||
type_initializer init;
|
||||
|
||||
x->mem = p = malloc(x->size*vtype_size(x->type));
|
||||
v = s->mem;
|
||||
e = array_end(x);
|
||||
|
||||
switch (s->type) { default: abort();
|
||||
case VTYPE_STRING: init = (void*)string_copy_init; break;
|
||||
case VTYPE_ARRAY: init = (void*) array_copy_init; break;
|
||||
case VTYPE_LIST: init = (void*) list_copy_init; break;
|
||||
case VTYPE_MAP: init = (void*) map_copy_init; break;
|
||||
case VTYPE_SET: init = (void*) vset_copy_init; break;
|
||||
}
|
||||
init = get_type_initializer(s->type);
|
||||
|
||||
do {
|
||||
init(p, v);
|
||||
@ -125,19 +120,12 @@ size_t array_slice(arr_t* x, arr_t* s, ssize_t i, size_t n, _Bool cut) {
|
||||
|
||||
if (!cut && s->type >= VTYPE_STRING) {
|
||||
void *p, *v, *e;
|
||||
void (*init)(void*, const void*);
|
||||
type_initializer init;
|
||||
|
||||
p = x->mem;
|
||||
v = array_internal_at(s, i);
|
||||
e = array_internal_at(x, n);
|
||||
|
||||
switch (s->type) { default: abort();
|
||||
case VTYPE_STRING: init = (void*)string_copy_init; break;
|
||||
case VTYPE_ARRAY: init = (void*) array_copy_init; break;
|
||||
case VTYPE_LIST: init = (void*) list_copy_init; break;
|
||||
case VTYPE_MAP: init = (void*) map_copy_init; break;
|
||||
case VTYPE_SET: init = (void*) vset_copy_init; break;
|
||||
}
|
||||
p = x->mem;
|
||||
v = array_internal_at(s, i);
|
||||
e = array_internal_at(x, n);
|
||||
init = get_type_initializer(s->type);
|
||||
|
||||
do {
|
||||
init(p, v);
|
||||
|
@ -4,12 +4,13 @@
|
||||
#include "include.h"
|
||||
|
||||
int libcdsb_array_find_pointer(arr_t* x, const void* v, void* _, array_access_callback cb, bool r, bool cut) { return libcdsb_array_find(x, &v, vtypeof(&v), _, cb, r, cut); }
|
||||
int libcdsb_array_find_string (arr_t* x, const char* v, void* _, array_access_callback cb, bool r, bool cut) { return libcdsb_array_find(x, &v, vtypeof(&v), _, cb, r, cut); }
|
||||
int libcdsb_array_find_array (arr_t* x, const str_t* v, void* _, array_access_callback cb, bool r, bool cut) { return libcdsb_array_find(x, v, vtypeof( v), _, cb, r, cut); }
|
||||
int libcdsb_array_find_list (arr_t* x, const arr_t* v, void* _, array_access_callback cb, bool r, bool cut) { return libcdsb_array_find(x, v, vtypeof( v), _, cb, r, cut); }
|
||||
int libcdsb_array_find_map (arr_t* x, const list_t* v, void* _, array_access_callback cb, bool r, bool cut) { return libcdsb_array_find(x, v, vtypeof( v), _, cb, r, cut); }
|
||||
int libcdsb_array_find_vset (arr_t* x, const map_t* v, void* _, array_access_callback cb, bool r, bool cut) { return libcdsb_array_find(x, v, vtypeof( v), _, cb, r, cut); }
|
||||
int libcdsb_array_find_cstring(arr_t* x, const set_t* v, void* _, array_access_callback cb, bool r, bool cut) { return libcdsb_array_find(x, v, vtypeof( v), _, cb, r, cut); }
|
||||
int libcdsb_array_find_cstring(arr_t* x, const char* v, void* _, array_access_callback cb, bool r, bool cut) { return libcdsb_array_find(x, &v, vtypeof(&v), _, cb, r, cut); }
|
||||
int libcdsb_array_find_string (arr_t* x, const str_t* v, void* _, array_access_callback cb, bool r, bool cut) { return libcdsb_array_find(x, v, vtypeof( v), _, cb, r, cut); }
|
||||
int libcdsb_array_find_array (arr_t* x, const arr_t* v, void* _, array_access_callback cb, bool r, bool cut) { return libcdsb_array_find(x, v, vtypeof( v), _, cb, r, cut); }
|
||||
int libcdsb_array_find_list (arr_t* x, const list_t* v, void* _, array_access_callback cb, bool r, bool cut) { return libcdsb_array_find(x, v, vtypeof( v), _, cb, r, cut); }
|
||||
int libcdsb_array_find_map (arr_t* x, const map_t* v, void* _, array_access_callback cb, bool r, bool cut) { return libcdsb_array_find(x, v, vtypeof( v), _, cb, r, cut); }
|
||||
int libcdsb_array_find_vset (arr_t* x, const set_t* v, void* _, array_access_callback cb, bool r, bool cut) { return libcdsb_array_find(x, v, vtypeof( v), _, cb, r, cut); }
|
||||
int libcdsb_array_find_dict (arr_t* x, const dict_t* v, void* _, array_access_callback cb, bool r, bool cut) { return libcdsb_array_find(x, v, vtypeof( v), _, cb, r, cut); }
|
||||
int libcdsb_array_find_boolean(arr_t* x, bool v, void* _, array_access_callback cb, bool r, bool cut) { return libcdsb_array_find(x, &v, vtypeof(&v), _, cb, r, cut); }
|
||||
int libcdsb_array_find_int8 (arr_t* x, s8_t v, void* _, array_access_callback cb, bool r, bool cut) { return libcdsb_array_find(x, &v, vtypeof(&v), _, cb, r, cut); }
|
||||
int libcdsb_array_find_int16 (arr_t* x, s16_t v, void* _, array_access_callback cb, bool r, bool cut) { return libcdsb_array_find(x, &v, vtypeof(&v), _, cb, r, cut); }
|
||||
@ -30,6 +31,7 @@ size_t libcdsb_array_count_array (const arr_t* x, const arr_t* v) { return lib
|
||||
size_t libcdsb_array_count_list (const arr_t* x, const list_t* v) { return libcdsb_array_count(x, v, vtypeof( v)); }
|
||||
size_t libcdsb_array_count_map (const arr_t* x, const map_t* v) { return libcdsb_array_count(x, v, vtypeof( v)); }
|
||||
size_t libcdsb_array_count_vset (const arr_t* x, const set_t* v) { return libcdsb_array_count(x, v, vtypeof( v)); }
|
||||
size_t libcdsb_array_count_dict (const arr_t* x, const dict_t* v) { return libcdsb_array_count(x, v, vtypeof( v)); }
|
||||
size_t libcdsb_array_count_boolean(const arr_t* x, bool v) { return libcdsb_array_count(x, &v, vtypeof(&v)); }
|
||||
size_t libcdsb_array_count_int8 (const arr_t* x, s8_t v) { return libcdsb_array_count(x, &v, vtypeof(&v)); }
|
||||
size_t libcdsb_array_count_int16 (const arr_t* x, s16_t v) { return libcdsb_array_count(x, &v, vtypeof(&v)); }
|
||||
@ -50,6 +52,7 @@ void libcdsb_array_push_array (arr_t* x, const arr_t* v) { libcdsb_array_push(
|
||||
void libcdsb_array_push_list (arr_t* x, const list_t* v) { libcdsb_array_push(x, v, vtypeof( v)); }
|
||||
void libcdsb_array_push_map (arr_t* x, const map_t* v) { libcdsb_array_push(x, v, vtypeof( v)); }
|
||||
void libcdsb_array_push_vset (arr_t* x, const set_t* v) { libcdsb_array_push(x, v, vtypeof( v)); }
|
||||
void libcdsb_array_push_dict (arr_t* x, const dict_t* v) { libcdsb_array_push(x, v, vtypeof( v)); }
|
||||
void libcdsb_array_push_boolean(arr_t* x, bool v) { libcdsb_array_push(x, &v, vtypeof(&v)); }
|
||||
void libcdsb_array_push_int8 (arr_t* x, s8_t v) { libcdsb_array_push(x, &v, vtypeof(&v)); }
|
||||
void libcdsb_array_push_int16 (arr_t* x, s16_t v) { libcdsb_array_push(x, &v, vtypeof(&v)); }
|
||||
|
111
src/dict/base.c
Normal file
111
src/dict/base.c
Normal file
@ -0,0 +1,111 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "include.h"
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
hash_t dict_hash(const dict_t* s) {
|
||||
dnode_t *min, *max;
|
||||
size_t i;
|
||||
dnode_t *c;
|
||||
hash_t hash;
|
||||
|
||||
if (!s->size)
|
||||
return 0;
|
||||
|
||||
min = max = nullptr;
|
||||
i = s->capacity;
|
||||
|
||||
while (i--) {
|
||||
c = s->nodes[i];
|
||||
|
||||
while (!is_null(c)) {
|
||||
if (is_null(min) || vnode_compare(&c->key, c->key_type, &min->key, min->key_type) < 0) min = c;
|
||||
if (is_null(max) || vnode_compare(&c->key, c->key_type, &max->key, max->key_type) > 0) max = c;
|
||||
|
||||
c = c->prev;
|
||||
}
|
||||
}
|
||||
|
||||
hash = vnode_hash(&min->key, min->key_type);
|
||||
|
||||
if (s->size > 0)
|
||||
hash += vnode_hash(&max->key, max->key_type);
|
||||
|
||||
return (hash ^ s->size) + VTYPE_DICT;
|
||||
}
|
||||
|
||||
|
||||
void dict_init(dict_t* x) {
|
||||
memset(x, 0, sizeof(*x));
|
||||
}
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
void dict_free(dict_t* x) {
|
||||
|
||||
while (x->capacity--) {
|
||||
while (!is_null(x->nodes[x->capacity])) {
|
||||
vnode_free(&x->nodes[x->capacity]->key, x->nodes[x->capacity]->key_type);
|
||||
vnode_free(&x->nodes[x->capacity]->value, x->nodes[x->capacity]->value_type);
|
||||
|
||||
x->nodes[x->capacity] = x->nodes[x->capacity]->prev;
|
||||
}
|
||||
}
|
||||
|
||||
free(x->nodes);
|
||||
memset(x, 0, sizeof(*x));
|
||||
}
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
size_t dict_size(const dict_t* x) {
|
||||
return x->size;
|
||||
}
|
||||
|
||||
size_t dict_capacity(const dict_t* x) {
|
||||
return x->capacity;
|
||||
}
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
int dict_compare(const dict_t* s0, const dict_t* s1) {
|
||||
dnode_t *c0, *c1;
|
||||
size_t i;
|
||||
int cmp;
|
||||
|
||||
if (s0 == s1)
|
||||
return 0;
|
||||
|
||||
if (s0->size != s1->size)
|
||||
return s0->size < s1->size ? -1 : 1;
|
||||
|
||||
i = s0->capacity;
|
||||
|
||||
while (i--) {
|
||||
c0 = s0->nodes[i];
|
||||
|
||||
while (!is_null(c0)) {
|
||||
|
||||
c1 = s1->nodes[vnode_hash(&c0->key, c0->key_type) % s1->capacity];
|
||||
cmp = -1;
|
||||
|
||||
while (!is_null(c1)) {
|
||||
if ((cmp = vnode_compare(&c0->key, c0->key_type, &c1->key, c1->key_type) == 0)) {
|
||||
|
||||
cmp = vnode_compare(&c0->value, c0->value_type, &c1->value, c1->value_type);
|
||||
break;
|
||||
}
|
||||
|
||||
c1 = c1->prev;
|
||||
}
|
||||
|
||||
if (cmp) return cmp;
|
||||
|
||||
c0 = c0->prev;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
82
src/dict/copy.c
Normal file
82
src/dict/copy.c
Normal file
@ -0,0 +1,82 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "include.h"
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
static inline dnode_t* dnode_duplicate(const dnode_t* s, dnode_t* p) {
|
||||
dnode_t* x = malloc(sizeof(*x));
|
||||
|
||||
x->prev = p;
|
||||
x->key = vnode_duplicate(&s->key, s->key_type);
|
||||
x->value = vnode_duplicate(&s->value, s->value_type);
|
||||
x->key_type = s->key_type;
|
||||
x->value_type = s->value_type;
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
dict_t dict_copy(const dict_t* s) {
|
||||
dict_t x;
|
||||
size_t i;
|
||||
dnode_t *n;
|
||||
|
||||
x.capacity = i = s->capacity;
|
||||
x.size = s->size;
|
||||
x.nodes = calloc(x.capacity, sizeof(*x.nodes));
|
||||
|
||||
while (i--) {
|
||||
n = s->nodes[i];
|
||||
|
||||
while (!is_null(n)) {
|
||||
x.nodes[i] = dnode_duplicate(n, x.nodes[i]);
|
||||
n = n->prev;
|
||||
}
|
||||
}
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
dict_t* dict_duplicate(const dict_t* s) {
|
||||
dict_t *x = malloc(sizeof(*x));
|
||||
size_t i;
|
||||
dnode_t *n;
|
||||
|
||||
x->capacity = i = s->capacity;
|
||||
x->size = s->size;
|
||||
x->nodes = calloc(x->capacity, sizeof(*x->nodes));
|
||||
|
||||
while (i--) {
|
||||
n = s->nodes[i];
|
||||
|
||||
while (!is_null(n)) {
|
||||
x->nodes[i] = dnode_duplicate(n, x->nodes[i]);
|
||||
n = n->prev;
|
||||
}
|
||||
}
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
void dict_copy_init(dict_t* x, const dict_t* s) {
|
||||
size_t i;
|
||||
dnode_t *n;
|
||||
|
||||
x->capacity = i = s->capacity;
|
||||
x->size = s->size;
|
||||
x->nodes = calloc(x->capacity, sizeof(*x->nodes));
|
||||
|
||||
while (i--) {
|
||||
n = s->nodes[i];
|
||||
|
||||
while (!is_null(n)) {
|
||||
x->nodes[i] = dnode_duplicate(n, x->nodes[i]);
|
||||
n = n->prev;
|
||||
}
|
||||
}
|
||||
}
|
236
src/dict/extra.c
Normal file
236
src/dict/extra.c
Normal file
@ -0,0 +1,236 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../../include/extra/list.h"
|
||||
#include "include.h"
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
static void dict_rehash(dict_t* s, size_t capacity) {
|
||||
dnode_t **nodes, *c, *n, **p;
|
||||
size_t i;
|
||||
|
||||
i = s->capacity;
|
||||
nodes = calloc(sizeof(*nodes), capacity);
|
||||
|
||||
while (i--) {
|
||||
c = s->nodes[i];
|
||||
|
||||
while (!is_null(c)) {
|
||||
p = nodes + (vnode_hash(&c->key, c->key_type) % capacity);
|
||||
n = c->prev;
|
||||
c->prev = *p;
|
||||
|
||||
*p = c;
|
||||
c = n;
|
||||
}
|
||||
}
|
||||
|
||||
free(s->nodes);
|
||||
s->nodes = nodes;
|
||||
s->capacity = capacity;
|
||||
}
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
bool libcdsb_dict_shrink_to_fit(dict_t* s) {
|
||||
|
||||
size_t capacity;
|
||||
|
||||
capacity = (s->size / CAPACITY_BLOCK) + 1;
|
||||
capacity *= CAPACITY_BLOCK;
|
||||
|
||||
while (((double)s->size / capacity) > 0.65)
|
||||
capacity += CAPACITY_BLOCK;
|
||||
|
||||
if (capacity >= s->capacity)
|
||||
return false;
|
||||
|
||||
dict_rehash(s, capacity);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool libcdsb_dict_update(dict_t* x, const void* k, vtype kt, const void* v, vtype vt) {
|
||||
dnode_t *c, **p;
|
||||
|
||||
if (!x->capacity || (double)x->size / x->capacity > REBUILD_POINT_MAX)
|
||||
dict_rehash(x, x->capacity + CAPACITY_BLOCK);
|
||||
|
||||
c = *(p = x->nodes + (vtype_hash(k, kt) % x->capacity));
|
||||
|
||||
while (!is_null(c)) {
|
||||
if (vtype_compare(k, kt, vnode_peek(&c->key, c->key_type), c->key_type) == 0) {
|
||||
vnode_free(&c->value, c->value_type);
|
||||
|
||||
c->value = vnode_create(v, vt);
|
||||
c->value_type = vt;
|
||||
|
||||
return true;
|
||||
} else c = c->prev;
|
||||
}
|
||||
|
||||
c = malloc(sizeof(*c));
|
||||
|
||||
c->prev = *p;
|
||||
c->key = vnode_create(k, kt);
|
||||
c->value = vnode_create(v, vt);
|
||||
c->key_type = kt;
|
||||
c->value_type = vt;
|
||||
|
||||
*p = c;
|
||||
++x->size;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
int libcdsb_dict_find(dict_t* x, const void* k, vtype t, void* dt, dict_access_callback callback, bool cut) {
|
||||
dnode_t *c, **p;
|
||||
int r;
|
||||
void* key;
|
||||
|
||||
if (x->capacity) {
|
||||
c = *(p = x->nodes + (vtype_hash(k, t) % x->capacity));
|
||||
|
||||
while (!is_null(c)) {
|
||||
key = vnode_peek(&c->key, c->key_type);
|
||||
if (vtype_compare(k, t, key, c->key_type) == 0) {
|
||||
r = (callback) ? callback(key, c->key_type, vnode_peek(&c->value, c->value_type), c->value_type, dt) : 0;
|
||||
|
||||
if (cut) {
|
||||
*p = c->prev;
|
||||
vnode_free(&c->key, c->key_type);
|
||||
vnode_free(&c->value, c->value_type);
|
||||
free(c);
|
||||
--x->size;
|
||||
}
|
||||
|
||||
return r;
|
||||
} else c = *(p = &c->prev);
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int libcdsb_dict_foreach(dict_t* x, void* dt, dict_access_callback callback, bool flush) {
|
||||
dnode_t *c;
|
||||
ssize_t i;
|
||||
int r;
|
||||
|
||||
r = 0;
|
||||
i = x->capacity;
|
||||
|
||||
while (i) {
|
||||
c = x->nodes[--i];
|
||||
|
||||
while (!is_null(c)) {
|
||||
r = callback(vnode_peek(&c->key, c->key_type), c->key_type,
|
||||
vnode_peek(&c->value, c->value_type), c->value_type, dt);
|
||||
|
||||
c = c->prev;
|
||||
|
||||
if (r) {
|
||||
if (!flush) goto end_;
|
||||
else goto flush_loop_;
|
||||
} else if (flush) {
|
||||
vnode_free(&x->nodes[i]->key, x->nodes[i]->key_type);
|
||||
vnode_free(&x->nodes[i]->value, x->nodes[i]->value_type);
|
||||
free(x->nodes[i]);
|
||||
|
||||
x->nodes[i] = c;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flush) {
|
||||
while (i) {
|
||||
--i;
|
||||
|
||||
while (!is_null(x->nodes[i])) { flush_loop_:
|
||||
vnode_free(&x->nodes[i]->key, x->nodes[i]->key_type);
|
||||
vnode_free(&x->nodes[i]->value, x->nodes[i]->value_type);
|
||||
|
||||
c = x->nodes[i]->prev;
|
||||
free(x->nodes[i]);
|
||||
|
||||
x->nodes[i] = c;
|
||||
}
|
||||
}
|
||||
|
||||
free(x->nodes);
|
||||
memset(x, 0, sizeof(*x));
|
||||
}
|
||||
|
||||
end_:
|
||||
return r;
|
||||
}
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
vtype_list libcdsb_dict_copy_keys(const vtype_dict* s) {
|
||||
vtype_list x;
|
||||
dnode_t *c;
|
||||
size_t i;
|
||||
|
||||
i = s->capacity;
|
||||
|
||||
list_init(&x);
|
||||
|
||||
while (i--) {
|
||||
c = s->nodes[i];
|
||||
|
||||
while (!is_null(c)) {
|
||||
libcdsb_list_update(&x, -1, vnode_peek(&c->key, c->key_type), c->key_type, 1);
|
||||
c = c->prev;
|
||||
}
|
||||
}
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
vtype_list* libcdsb_dict_duplicate_keys(const vtype_dict* s) {
|
||||
vtype_list* x;
|
||||
dnode_t *c;
|
||||
size_t i;
|
||||
|
||||
x = malloc(sizeof(*x));
|
||||
i = s->capacity;
|
||||
|
||||
list_init(x);
|
||||
|
||||
while (i--) {
|
||||
c = s->nodes[i];
|
||||
|
||||
while (!is_null(c)) {
|
||||
libcdsb_list_update(x, -1, vnode_peek(&c->key, c->key_type), c->key_type, 1);
|
||||
c = c->prev;
|
||||
}
|
||||
}
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
void libcdsb_dict_init_keys(vtype_list* x, const vtype_dict* s) {
|
||||
dnode_t *c;
|
||||
size_t i;
|
||||
|
||||
x = malloc(sizeof(*x));
|
||||
i = s->capacity;
|
||||
|
||||
list_init(x);
|
||||
|
||||
while (i--) {
|
||||
c = s->nodes[i];
|
||||
|
||||
while (!is_null(c)) {
|
||||
libcdsb_list_update(x, -1, vnode_peek(&c->key, c->key_type), c->key_type, 1);
|
||||
c = c->prev;
|
||||
}
|
||||
}
|
||||
}
|
445
src/dict/generics.c
Normal file
445
src/dict/generics.c
Normal file
@ -0,0 +1,445 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "include.h"
|
||||
|
||||
int libcdsb_dict_find_by_pointer(dict_t* x, const void* k, void* _, dict_access_callback cb, bool cut) { return libcdsb_dict_find(x, &k, vtypeof(&k), _, cb, cut); }
|
||||
int libcdsb_dict_find_by_cstring(dict_t* x, const char* k, void* _, dict_access_callback cb, bool cut) { return libcdsb_dict_find(x, &k, vtypeof(&k), _, cb, cut); }
|
||||
int libcdsb_dict_find_by_string (dict_t* x, const str_t* k, void* _, dict_access_callback cb, bool cut) { return libcdsb_dict_find(x, k, vtypeof( k), _, cb, cut); }
|
||||
int libcdsb_dict_find_by_array (dict_t* x, const arr_t* k, void* _, dict_access_callback cb, bool cut) { return libcdsb_dict_find(x, k, vtypeof( k), _, cb, cut); }
|
||||
int libcdsb_dict_find_by_list (dict_t* x, const list_t* k, void* _, dict_access_callback cb, bool cut) { return libcdsb_dict_find(x, k, vtypeof( k), _, cb, cut); }
|
||||
int libcdsb_dict_find_by_map (dict_t* x, const map_t* k, void* _, dict_access_callback cb, bool cut) { return libcdsb_dict_find(x, k, vtypeof( k), _, cb, cut); }
|
||||
int libcdsb_dict_find_by_vset (dict_t* x, const set_t* k, void* _, dict_access_callback cb, bool cut) { return libcdsb_dict_find(x, k, vtypeof( k), _, cb, cut); }
|
||||
int libcdsb_dict_find_by_dict (dict_t* x, const dict_t* k, void* _, dict_access_callback cb, bool cut) { return libcdsb_dict_find(x, k, vtypeof( k), _, cb, cut); }
|
||||
int libcdsb_dict_find_by_boolean(dict_t* x, bool k, void* _, dict_access_callback cb, bool cut) { return libcdsb_dict_find(x, &k, vtypeof(&k), _, cb, cut); }
|
||||
int libcdsb_dict_find_by_int8 (dict_t* x, s8_t k, void* _, dict_access_callback cb, bool cut) { return libcdsb_dict_find(x, &k, vtypeof(&k), _, cb, cut); }
|
||||
int libcdsb_dict_find_by_int16 (dict_t* x, s16_t k, void* _, dict_access_callback cb, bool cut) { return libcdsb_dict_find(x, &k, vtypeof(&k), _, cb, cut); }
|
||||
int libcdsb_dict_find_by_int32 (dict_t* x, s32_t k, void* _, dict_access_callback cb, bool cut) { return libcdsb_dict_find(x, &k, vtypeof(&k), _, cb, cut); }
|
||||
int libcdsb_dict_find_by_int64 (dict_t* x, s64_t k, void* _, dict_access_callback cb, bool cut) { return libcdsb_dict_find(x, &k, vtypeof(&k), _, cb, cut); }
|
||||
int libcdsb_dict_find_by_uint8 (dict_t* x, u8_t k, void* _, dict_access_callback cb, bool cut) { return libcdsb_dict_find(x, &k, vtypeof(&k), _, cb, cut); }
|
||||
int libcdsb_dict_find_by_uint16 (dict_t* x, u16_t k, void* _, dict_access_callback cb, bool cut) { return libcdsb_dict_find(x, &k, vtypeof(&k), _, cb, cut); }
|
||||
int libcdsb_dict_find_by_uint32 (dict_t* x, u32_t k, void* _, dict_access_callback cb, bool cut) { return libcdsb_dict_find(x, &k, vtypeof(&k), _, cb, cut); }
|
||||
int libcdsb_dict_find_by_uint64 (dict_t* x, u64_t k, void* _, dict_access_callback cb, bool cut) { return libcdsb_dict_find(x, &k, vtypeof(&k), _, cb, cut); }
|
||||
int libcdsb_dict_find_by_float (dict_t* x, fl_t k, void* _, dict_access_callback cb, bool cut) { return libcdsb_dict_find(x, &k, vtypeof(&k), _, cb, cut); }
|
||||
int libcdsb_dict_find_by_double (dict_t* x, dbl_t k, void* _, dict_access_callback cb, bool cut) { return libcdsb_dict_find(x, &k, vtypeof(&k), _, cb, cut); }
|
||||
int libcdsb_dict_find_by_ldouble(dict_t* x, ldbl_t k, void* _, dict_access_callback cb, bool cut) { return libcdsb_dict_find(x, &k, vtypeof(&k), _, cb, cut); }
|
||||
|
||||
bool libcdsb_dict_update_pointer_pointer(dict_t* x, const void* k, const void* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_pointer_cstring(dict_t* x, const void* k, const char* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_pointer_string (dict_t* x, const void* k, const str_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_pointer_array (dict_t* x, const void* k, const arr_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_pointer_list (dict_t* x, const void* k, const list_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_pointer_map (dict_t* x, const void* k, const map_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_pointer_vset (dict_t* x, const void* k, const set_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_pointer_dict (dict_t* x, const void* k, const dict_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_pointer_boolean(dict_t* x, const void* k, bool v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_pointer_int8 (dict_t* x, const void* k, s8_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_pointer_int16 (dict_t* x, const void* k, s16_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_pointer_int32 (dict_t* x, const void* k, s32_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_pointer_int64 (dict_t* x, const void* k, s64_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_pointer_uint8 (dict_t* x, const void* k, u8_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_pointer_uint16 (dict_t* x, const void* k, u16_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_pointer_uint32 (dict_t* x, const void* k, u32_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_pointer_uint64 (dict_t* x, const void* k, u64_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_pointer_float (dict_t* x, const void* k, fl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_pointer_double (dict_t* x, const void* k, dbl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_pointer_ldouble(dict_t* x, const void* k, ldbl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
|
||||
bool libcdsb_dict_update_cstring_pointer(dict_t* x, const char* k, const void* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_cstring_cstring(dict_t* x, const char* k, const char* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_cstring_string (dict_t* x, const char* k, const str_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_cstring_array (dict_t* x, const char* k, const arr_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_cstring_list (dict_t* x, const char* k, const list_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_cstring_map (dict_t* x, const char* k, const map_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_cstring_vset (dict_t* x, const char* k, const set_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_cstring_dict (dict_t* x, const char* k, const dict_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_cstring_boolean(dict_t* x, const char* k, bool v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_cstring_int8 (dict_t* x, const char* k, s8_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_cstring_int16 (dict_t* x, const char* k, s16_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_cstring_int32 (dict_t* x, const char* k, s32_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_cstring_int64 (dict_t* x, const char* k, s64_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_cstring_uint8 (dict_t* x, const char* k, u8_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_cstring_uint16 (dict_t* x, const char* k, u16_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_cstring_uint32 (dict_t* x, const char* k, u32_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_cstring_uint64 (dict_t* x, const char* k, u64_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_cstring_float (dict_t* x, const char* k, fl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_cstring_double (dict_t* x, const char* k, dbl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_cstring_ldouble(dict_t* x, const char* k, ldbl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
|
||||
bool libcdsb_dict_update_string_pointer(dict_t* x, const str_t* k, const void* v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_string_cstring(dict_t* x, const str_t* k, const char* v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_string_string (dict_t* x, const str_t* k, const str_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_string_array (dict_t* x, const str_t* k, const arr_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_string_list (dict_t* x, const str_t* k, const list_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_string_map (dict_t* x, const str_t* k, const map_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_string_vset (dict_t* x, const str_t* k, const set_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_string_dict (dict_t* x, const str_t* k, const dict_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_string_boolean(dict_t* x, const str_t* k, bool v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_string_int8 (dict_t* x, const str_t* k, s8_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_string_int16 (dict_t* x, const str_t* k, s16_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_string_int32 (dict_t* x, const str_t* k, s32_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_string_int64 (dict_t* x, const str_t* k, s64_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_string_uint8 (dict_t* x, const str_t* k, u8_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_string_uint16 (dict_t* x, const str_t* k, u16_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_string_uint32 (dict_t* x, const str_t* k, u32_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_string_uint64 (dict_t* x, const str_t* k, u64_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_string_float (dict_t* x, const str_t* k, fl_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_string_double (dict_t* x, const str_t* k, dbl_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_string_ldouble(dict_t* x, const str_t* k, ldbl_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
|
||||
bool libcdsb_dict_update_array_pointer(dict_t* x, const arr_t* k, const void* v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_array_cstring(dict_t* x, const arr_t* k, const char* v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_array_string (dict_t* x, const arr_t* k, const str_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_array_array (dict_t* x, const arr_t* k, const arr_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_array_list (dict_t* x, const arr_t* k, const list_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_array_map (dict_t* x, const arr_t* k, const map_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_array_vset (dict_t* x, const arr_t* k, const set_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_array_dict (dict_t* x, const arr_t* k, const dict_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_array_boolean(dict_t* x, const arr_t* k, bool v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_array_int8 (dict_t* x, const arr_t* k, s8_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_array_int16 (dict_t* x, const arr_t* k, s16_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_array_int32 (dict_t* x, const arr_t* k, s32_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_array_int64 (dict_t* x, const arr_t* k, s64_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_array_uint8 (dict_t* x, const arr_t* k, u8_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_array_uint16 (dict_t* x, const arr_t* k, u16_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_array_uint32 (dict_t* x, const arr_t* k, u32_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_array_uint64 (dict_t* x, const arr_t* k, u64_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_array_float (dict_t* x, const arr_t* k, fl_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_array_double (dict_t* x, const arr_t* k, dbl_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_array_ldouble(dict_t* x, const arr_t* k, ldbl_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
|
||||
bool libcdsb_dict_update_list_pointer(dict_t* x, const list_t* k, const void* v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_list_cstring(dict_t* x, const list_t* k, const char* v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_list_string (dict_t* x, const list_t* k, const str_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_list_array (dict_t* x, const list_t* k, const arr_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_list_list (dict_t* x, const list_t* k, const list_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_list_map (dict_t* x, const list_t* k, const map_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_list_vset (dict_t* x, const list_t* k, const set_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_list_dict (dict_t* x, const list_t* k, const dict_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_list_boolean(dict_t* x, const list_t* k, bool v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_list_int8 (dict_t* x, const list_t* k, s8_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_list_int16 (dict_t* x, const list_t* k, s16_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_list_int32 (dict_t* x, const list_t* k, s32_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_list_int64 (dict_t* x, const list_t* k, s64_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_list_uint8 (dict_t* x, const list_t* k, u8_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_list_uint16 (dict_t* x, const list_t* k, u16_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_list_uint32 (dict_t* x, const list_t* k, u32_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_list_uint64 (dict_t* x, const list_t* k, u64_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_list_float (dict_t* x, const list_t* k, fl_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_list_double (dict_t* x, const list_t* k, dbl_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_list_ldouble(dict_t* x, const list_t* k, ldbl_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
|
||||
bool libcdsb_dict_update_map_pointer(dict_t* x, const map_t* k, const void* v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_map_cstring(dict_t* x, const map_t* k, const char* v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_map_string (dict_t* x, const map_t* k, const str_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_map_array (dict_t* x, const map_t* k, const arr_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_map_list (dict_t* x, const map_t* k, const list_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_map_map (dict_t* x, const map_t* k, const map_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_map_vset (dict_t* x, const map_t* k, const set_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_map_dict (dict_t* x, const map_t* k, const dict_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_map_boolean(dict_t* x, const map_t* k, bool v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_map_int8 (dict_t* x, const map_t* k, s8_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_map_int16 (dict_t* x, const map_t* k, s16_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_map_int32 (dict_t* x, const map_t* k, s32_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_map_int64 (dict_t* x, const map_t* k, s64_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_map_uint8 (dict_t* x, const map_t* k, u8_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_map_uint16 (dict_t* x, const map_t* k, u16_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_map_uint32 (dict_t* x, const map_t* k, u32_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_map_uint64 (dict_t* x, const map_t* k, u64_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_map_float (dict_t* x, const map_t* k, fl_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_map_double (dict_t* x, const map_t* k, dbl_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_map_ldouble(dict_t* x, const map_t* k, ldbl_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
|
||||
bool libcdsb_dict_update_vset_pointer(dict_t* x, const set_t* k, const void* v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_vset_cstring(dict_t* x, const set_t* k, const char* v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_vset_string (dict_t* x, const set_t* k, const str_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_vset_array (dict_t* x, const set_t* k, const arr_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_vset_list (dict_t* x, const set_t* k, const list_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_vset_map (dict_t* x, const set_t* k, const map_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_vset_vset (dict_t* x, const set_t* k, const set_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_vset_dict (dict_t* x, const set_t* k, const dict_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_vset_boolean(dict_t* x, const set_t* k, bool v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_vset_int8 (dict_t* x, const set_t* k, s8_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_vset_int16 (dict_t* x, const set_t* k, s16_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_vset_int32 (dict_t* x, const set_t* k, s32_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_vset_int64 (dict_t* x, const set_t* k, s64_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_vset_uint8 (dict_t* x, const set_t* k, u8_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_vset_uint16 (dict_t* x, const set_t* k, u16_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_vset_uint32 (dict_t* x, const set_t* k, u32_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_vset_uint64 (dict_t* x, const set_t* k, u64_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_vset_float (dict_t* x, const set_t* k, fl_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_vset_double (dict_t* x, const set_t* k, dbl_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_vset_ldouble(dict_t* x, const set_t* k, ldbl_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
|
||||
bool libcdsb_dict_update_dict_pointer(dict_t* x, const dict_t* k, const void* v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_dict_cstring(dict_t* x, const dict_t* k, const char* v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_dict_string (dict_t* x, const dict_t* k, const str_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_dict_array (dict_t* x, const dict_t* k, const arr_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_dict_list (dict_t* x, const dict_t* k, const list_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_dict_map (dict_t* x, const dict_t* k, const map_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_dict_vset (dict_t* x, const dict_t* k, const set_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_dict_dict (dict_t* x, const dict_t* k, const dict_t* v) { return libcdsb_dict_update(x, k, vtypeof(k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_dict_boolean(dict_t* x, const dict_t* k, bool v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_dict_int8 (dict_t* x, const dict_t* k, s8_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_dict_int16 (dict_t* x, const dict_t* k, s16_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_dict_int32 (dict_t* x, const dict_t* k, s32_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_dict_int64 (dict_t* x, const dict_t* k, s64_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_dict_uint8 (dict_t* x, const dict_t* k, u8_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_dict_uint16 (dict_t* x, const dict_t* k, u16_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_dict_uint32 (dict_t* x, const dict_t* k, u32_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_dict_uint64 (dict_t* x, const dict_t* k, u64_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_dict_float (dict_t* x, const dict_t* k, fl_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_dict_double (dict_t* x, const dict_t* k, dbl_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_dict_ldouble(dict_t* x, const dict_t* k, ldbl_t v) { return libcdsb_dict_update(x, k, vtypeof(k), &v, vtypeof(&v)); }
|
||||
|
||||
bool libcdsb_dict_update_boolean_pointer(dict_t* x, bool k, const void* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_boolean_cstring(dict_t* x, bool k, const char* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_boolean_string (dict_t* x, bool k, const str_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_boolean_array (dict_t* x, bool k, const arr_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_boolean_list (dict_t* x, bool k, const list_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_boolean_map (dict_t* x, bool k, const map_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_boolean_vset (dict_t* x, bool k, const set_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_boolean_dict (dict_t* x, bool k, const dict_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_boolean_boolean(dict_t* x, bool k, bool v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_boolean_int8 (dict_t* x, bool k, s8_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_boolean_int16 (dict_t* x, bool k, s16_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_boolean_int32 (dict_t* x, bool k, s32_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_boolean_int64 (dict_t* x, bool k, s64_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_boolean_uint8 (dict_t* x, bool k, u8_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_boolean_uint16 (dict_t* x, bool k, u16_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_boolean_uint32 (dict_t* x, bool k, u32_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_boolean_uint64 (dict_t* x, bool k, u64_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_boolean_float (dict_t* x, bool k, fl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_boolean_double (dict_t* x, bool k, dbl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_boolean_ldouble(dict_t* x, bool k, ldbl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
|
||||
bool libcdsb_dict_update_uint8_pointer(dict_t* x, u8_t k, const void* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint8_cstring(dict_t* x, u8_t k, const char* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint8_string (dict_t* x, u8_t k, const str_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_uint8_array (dict_t* x, u8_t k, const arr_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_uint8_list (dict_t* x, u8_t k, const list_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_uint8_map (dict_t* x, u8_t k, const map_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_uint8_vset (dict_t* x, u8_t k, const set_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_uint8_dict (dict_t* x, u8_t k, const dict_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_uint8_boolean(dict_t* x, u8_t k, bool v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint8_int8 (dict_t* x, u8_t k, s8_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint8_int16 (dict_t* x, u8_t k, s16_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint8_int32 (dict_t* x, u8_t k, s32_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint8_int64 (dict_t* x, u8_t k, s64_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint8_uint8 (dict_t* x, u8_t k, u8_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint8_uint16 (dict_t* x, u8_t k, u16_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint8_uint32 (dict_t* x, u8_t k, u32_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint8_uint64 (dict_t* x, u8_t k, u64_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint8_float (dict_t* x, u8_t k, fl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint8_double (dict_t* x, u8_t k, dbl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint8_ldouble(dict_t* x, u8_t k, ldbl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
|
||||
bool libcdsb_dict_update_uint16_pointer(dict_t* x, u16_t k, const void* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint16_cstring(dict_t* x, u16_t k, const char* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint16_string (dict_t* x, u16_t k, const str_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_uint16_array (dict_t* x, u16_t k, const arr_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_uint16_list (dict_t* x, u16_t k, const list_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_uint16_map (dict_t* x, u16_t k, const map_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_uint16_vset (dict_t* x, u16_t k, const set_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_uint16_dict (dict_t* x, u16_t k, const dict_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_uint16_boolean(dict_t* x, u16_t k, bool v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint16_int8 (dict_t* x, u16_t k, s8_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint16_int16 (dict_t* x, u16_t k, s16_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint16_int32 (dict_t* x, u16_t k, s32_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint16_int64 (dict_t* x, u16_t k, s64_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint16_uint8 (dict_t* x, u16_t k, u8_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint16_uint16 (dict_t* x, u16_t k, u16_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint16_uint32 (dict_t* x, u16_t k, u32_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint16_uint64 (dict_t* x, u16_t k, u64_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint16_float (dict_t* x, u16_t k, fl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint16_double (dict_t* x, u16_t k, dbl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint16_ldouble(dict_t* x, u16_t k, ldbl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
|
||||
bool libcdsb_dict_update_uint32_pointer(dict_t* x, u32_t k, const void* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint32_cstring(dict_t* x, u32_t k, const char* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint32_string (dict_t* x, u32_t k, const str_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_uint32_array (dict_t* x, u32_t k, const arr_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_uint32_list (dict_t* x, u32_t k, const list_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_uint32_map (dict_t* x, u32_t k, const map_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_uint32_vset (dict_t* x, u32_t k, const set_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_uint32_dict (dict_t* x, u32_t k, const dict_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_uint32_boolean(dict_t* x, u32_t k, bool v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint32_int8 (dict_t* x, u32_t k, s8_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint32_int16 (dict_t* x, u32_t k, s16_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint32_int32 (dict_t* x, u32_t k, s32_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint32_int64 (dict_t* x, u32_t k, s64_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint32_uint8 (dict_t* x, u32_t k, u8_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint32_uint16 (dict_t* x, u32_t k, u16_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint32_uint32 (dict_t* x, u32_t k, u32_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint32_uint64 (dict_t* x, u32_t k, u64_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint32_float (dict_t* x, u32_t k, fl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint32_double (dict_t* x, u32_t k, dbl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint32_ldouble(dict_t* x, u32_t k, ldbl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
|
||||
bool libcdsb_dict_update_uint64_pointer(dict_t* x, u64_t k, const void* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint64_cstring(dict_t* x, u64_t k, const char* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint64_string (dict_t* x, u64_t k, const str_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_uint64_array (dict_t* x, u64_t k, const arr_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_uint64_list (dict_t* x, u64_t k, const list_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_uint64_map (dict_t* x, u64_t k, const map_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_uint64_vset (dict_t* x, u64_t k, const set_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_uint64_dict (dict_t* x, u64_t k, const dict_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_uint64_boolean(dict_t* x, u64_t k, bool v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint64_int8 (dict_t* x, u64_t k, s8_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint64_int16 (dict_t* x, u64_t k, s16_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint64_int32 (dict_t* x, u64_t k, s32_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint64_int64 (dict_t* x, u64_t k, s64_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint64_uint8 (dict_t* x, u64_t k, u8_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint64_uint16 (dict_t* x, u64_t k, u16_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint64_uint32 (dict_t* x, u64_t k, u32_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint64_uint64 (dict_t* x, u64_t k, u64_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint64_float (dict_t* x, u64_t k, fl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint64_double (dict_t* x, u64_t k, dbl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_uint64_ldouble(dict_t* x, u64_t k, ldbl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
|
||||
bool libcdsb_dict_update_int8_pointer(dict_t* x, s8_t k, const void* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int8_cstring(dict_t* x, s8_t k, const char* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int8_string (dict_t* x, s8_t k, const str_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_int8_array (dict_t* x, s8_t k, const arr_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_int8_list (dict_t* x, s8_t k, const list_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_int8_map (dict_t* x, s8_t k, const map_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_int8_vset (dict_t* x, s8_t k, const set_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_int8_dict (dict_t* x, s8_t k, const dict_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_int8_boolean(dict_t* x, s8_t k, bool v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int8_int8 (dict_t* x, s8_t k, s8_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int8_int16 (dict_t* x, s8_t k, s16_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int8_int32 (dict_t* x, s8_t k, s32_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int8_int64 (dict_t* x, s8_t k, s64_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int8_uint8 (dict_t* x, s8_t k, u8_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int8_uint16 (dict_t* x, s8_t k, u16_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int8_uint32 (dict_t* x, s8_t k, u32_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int8_uint64 (dict_t* x, s8_t k, u64_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int8_float (dict_t* x, s8_t k, fl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int8_double (dict_t* x, s8_t k, dbl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int8_ldouble(dict_t* x, s8_t k, ldbl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
|
||||
bool libcdsb_dict_update_int16_pointer(dict_t* x, s16_t k, const void* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int16_cstring(dict_t* x, s16_t k, const char* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int16_string (dict_t* x, s16_t k, const str_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_int16_array (dict_t* x, s16_t k, const arr_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_int16_list (dict_t* x, s16_t k, const list_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_int16_map (dict_t* x, s16_t k, const map_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_int16_vset (dict_t* x, s16_t k, const set_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_int16_dict (dict_t* x, s16_t k, const dict_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_int16_boolean(dict_t* x, s16_t k, bool v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int16_int8 (dict_t* x, s16_t k, s8_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int16_int16 (dict_t* x, s16_t k, s16_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int16_int32 (dict_t* x, s16_t k, s32_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int16_int64 (dict_t* x, s16_t k, s64_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int16_uint8 (dict_t* x, s16_t k, u8_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int16_uint16 (dict_t* x, s16_t k, u16_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int16_uint32 (dict_t* x, s16_t k, u32_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int16_uint64 (dict_t* x, s16_t k, u64_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int16_float (dict_t* x, s16_t k, fl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int16_double (dict_t* x, s16_t k, dbl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int16_ldouble(dict_t* x, s16_t k, ldbl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
|
||||
bool libcdsb_dict_update_int32_pointer(dict_t* x, s32_t k, const void* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int32_cstring(dict_t* x, s32_t k, const char* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int32_string (dict_t* x, s32_t k, const str_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_int32_array (dict_t* x, s32_t k, const arr_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_int32_list (dict_t* x, s32_t k, const list_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_int32_map (dict_t* x, s32_t k, const map_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_int32_vset (dict_t* x, s32_t k, const set_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_int32_dict (dict_t* x, s32_t k, const dict_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_int32_boolean(dict_t* x, s32_t k, bool v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int32_int8 (dict_t* x, s32_t k, s8_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int32_int16 (dict_t* x, s32_t k, s16_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int32_int32 (dict_t* x, s32_t k, s32_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int32_int64 (dict_t* x, s32_t k, s64_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int32_uint8 (dict_t* x, s32_t k, u8_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int32_uint16 (dict_t* x, s32_t k, u16_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int32_uint32 (dict_t* x, s32_t k, u32_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int32_uint64 (dict_t* x, s32_t k, u64_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int32_float (dict_t* x, s32_t k, fl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int32_double (dict_t* x, s32_t k, dbl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int32_ldouble(dict_t* x, s32_t k, ldbl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
|
||||
bool libcdsb_dict_update_int64_pointer(dict_t* x, s64_t k, const void* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int64_cstring(dict_t* x, s64_t k, const char* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int64_string (dict_t* x, s64_t k, const str_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_int64_array (dict_t* x, s64_t k, const arr_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_int64_list (dict_t* x, s64_t k, const list_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_int64_map (dict_t* x, s64_t k, const map_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_int64_vset (dict_t* x, s64_t k, const set_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_int64_dict (dict_t* x, s64_t k, const dict_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_int64_boolean(dict_t* x, s64_t k, bool v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int64_int8 (dict_t* x, s64_t k, s8_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int64_int16 (dict_t* x, s64_t k, s16_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int64_int32 (dict_t* x, s64_t k, s32_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int64_int64 (dict_t* x, s64_t k, s64_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int64_uint8 (dict_t* x, s64_t k, u8_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int64_uint16 (dict_t* x, s64_t k, u16_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int64_uint32 (dict_t* x, s64_t k, u32_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int64_uint64 (dict_t* x, s64_t k, u64_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int64_float (dict_t* x, s64_t k, fl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int64_double (dict_t* x, s64_t k, dbl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_int64_ldouble(dict_t* x, s64_t k, ldbl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
|
||||
bool libcdsb_dict_update_float_pointer(dict_t* x, fl_t k, const void* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_float_cstring(dict_t* x, fl_t k, const char* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_float_string (dict_t* x, fl_t k, const str_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_float_array (dict_t* x, fl_t k, const arr_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_float_list (dict_t* x, fl_t k, const list_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_float_map (dict_t* x, fl_t k, const map_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_float_vset (dict_t* x, fl_t k, const set_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_float_dict (dict_t* x, fl_t k, const dict_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_float_boolean(dict_t* x, fl_t k, bool v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_float_int8 (dict_t* x, fl_t k, s8_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_float_int16 (dict_t* x, fl_t k, s16_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_float_int32 (dict_t* x, fl_t k, s32_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_float_int64 (dict_t* x, fl_t k, s64_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_float_uint8 (dict_t* x, fl_t k, u8_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_float_uint16 (dict_t* x, fl_t k, u16_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_float_uint32 (dict_t* x, fl_t k, u32_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_float_uint64 (dict_t* x, fl_t k, u64_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_float_float (dict_t* x, fl_t k, fl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_float_double (dict_t* x, fl_t k, dbl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_float_ldouble(dict_t* x, fl_t k, ldbl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
|
||||
bool libcdsb_dict_update_double_pointer(dict_t* x, dbl_t k, const void* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_double_cstring(dict_t* x, dbl_t k, const char* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_double_string (dict_t* x, dbl_t k, const str_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_double_array (dict_t* x, dbl_t k, const arr_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_double_list (dict_t* x, dbl_t k, const list_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_double_map (dict_t* x, dbl_t k, const map_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_double_vset (dict_t* x, dbl_t k, const set_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_double_dict (dict_t* x, dbl_t k, const dict_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_double_boolean(dict_t* x, dbl_t k, bool v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_double_int8 (dict_t* x, dbl_t k, s8_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_double_int16 (dict_t* x, dbl_t k, s16_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_double_int32 (dict_t* x, dbl_t k, s32_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_double_int64 (dict_t* x, dbl_t k, s64_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_double_uint8 (dict_t* x, dbl_t k, u8_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_double_uint16 (dict_t* x, dbl_t k, u16_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_double_uint32 (dict_t* x, dbl_t k, u32_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_double_uint64 (dict_t* x, dbl_t k, u64_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_double_float (dict_t* x, dbl_t k, fl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_double_double (dict_t* x, dbl_t k, dbl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_double_ldouble(dict_t* x, dbl_t k, ldbl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
|
||||
bool libcdsb_dict_update_ldouble_pointer(dict_t* x, ldbl_t k, const void* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_ldouble_cstring(dict_t* x, ldbl_t k, const char* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_ldouble_string (dict_t* x, ldbl_t k, const str_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_ldouble_array (dict_t* x, ldbl_t k, const arr_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_ldouble_list (dict_t* x, ldbl_t k, const list_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_ldouble_map (dict_t* x, ldbl_t k, const map_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_ldouble_vset (dict_t* x, ldbl_t k, const set_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_ldouble_dict (dict_t* x, ldbl_t k, const dict_t* v) { return libcdsb_dict_update(x, &k, vtypeof(&k), v, vtypeof( v)); }
|
||||
bool libcdsb_dict_update_ldouble_boolean(dict_t* x, ldbl_t k, bool v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_ldouble_int8 (dict_t* x, ldbl_t k, s8_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_ldouble_int16 (dict_t* x, ldbl_t k, s16_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_ldouble_int32 (dict_t* x, ldbl_t k, s32_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_ldouble_int64 (dict_t* x, ldbl_t k, s64_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_ldouble_uint8 (dict_t* x, ldbl_t k, u8_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_ldouble_uint16 (dict_t* x, ldbl_t k, u16_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_ldouble_uint32 (dict_t* x, ldbl_t k, u32_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_ldouble_uint64 (dict_t* x, ldbl_t k, u64_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_ldouble_float (dict_t* x, ldbl_t k, fl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_ldouble_double (dict_t* x, ldbl_t k, dbl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
||||
bool libcdsb_dict_update_ldouble_ldouble(dict_t* x, ldbl_t k, ldbl_t v) { return libcdsb_dict_update(x, &k, vtypeof(&k), &v, vtypeof(&v)); }
|
30
src/dict/include.h
Normal file
30
src/dict/include.h
Normal file
@ -0,0 +1,30 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../../include/extra/dict.h"
|
||||
#include "../__internal/assert.h"
|
||||
#include "../__internal/rbtree.h"
|
||||
|
||||
#ifndef LIBCDSB_SRC_DICT_INCLUDE_H
|
||||
#define LIBCDSB_SRC_DICT_INCLUDE_H
|
||||
|
||||
#ifndef DICT_CAPACITY_BLOCK
|
||||
#define CAPACITY_BLOCK 100
|
||||
#else
|
||||
#define CAPACITY_BLOCK DICT_CAPACITY_BLOCK
|
||||
#endif
|
||||
#define REBUILD_POINT_MAX 0.65
|
||||
|
||||
|
||||
typedef struct libcdsb_dict_node {
|
||||
struct libcdsb_dict_node* prev;
|
||||
|
||||
vnode_t key;
|
||||
vnode_t value;
|
||||
|
||||
u16_t key_type;
|
||||
u16_t value_type;
|
||||
} dnode_t;
|
||||
|
||||
|
||||
#endif /* LIBCDSB_SRC_DICT_INCLUDE_H */
|
@ -8,6 +8,7 @@
|
||||
#undef malloc
|
||||
#undef realloc
|
||||
#undef calloc
|
||||
#undef free
|
||||
|
||||
void* libcdsb_aalloc(size_t a, size_t n) {
|
||||
void* x;
|
||||
@ -55,6 +56,9 @@ char* libcdsb_strdup(const char* s) {
|
||||
void* x;
|
||||
size_t n;
|
||||
|
||||
if (is_null(s))
|
||||
return nullptr;
|
||||
|
||||
if ((x = malloc(n = strlen(s) + 1)))
|
||||
return memcpy(x, s, n);
|
||||
abort();
|
||||
@ -70,3 +74,7 @@ char* libcdsb_strndup(const char* s, size_t n) {
|
||||
}
|
||||
abort();
|
||||
}
|
||||
|
||||
void libcdsb_free(void* s) {
|
||||
free(s);
|
||||
}
|
||||
|
@ -1,9 +1,11 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include "__internal/include.h"
|
||||
#undef malloc
|
||||
#undef free
|
||||
|
||||
void libcdsb_stack_init(stack_t* x) {
|
||||
memset(x, 0, sizeof(*x));
|
||||
@ -25,6 +27,31 @@ void libcdsb_stack_push(stack_t* x, void* value) {
|
||||
x->value = value;
|
||||
}
|
||||
|
||||
void libcdsb_stack_push_many(stack_t* x, size_t c, ...) {
|
||||
|
||||
va_list args;
|
||||
stack_t* n;
|
||||
va_start(args, c);
|
||||
|
||||
if (c) {
|
||||
if (!x->value) {
|
||||
x->value = va_arg(args, void*);
|
||||
--c;
|
||||
}
|
||||
|
||||
while (c--) {
|
||||
if (!(n = malloc(sizeof(*n))))
|
||||
abort();
|
||||
|
||||
n->prev = x->prev;
|
||||
n->value = x->value;
|
||||
x->prev = n;
|
||||
}
|
||||
}
|
||||
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
void* libcdsb_stack_pop(stack_t* x) {
|
||||
|
||||
stack_t* n;
|
||||
|
@ -5,6 +5,22 @@
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
hash_t list_hash(const list_t* s) {
|
||||
|
||||
hash_t hash = 0;
|
||||
|
||||
if (!is_null(s->first)) {
|
||||
hash = vnode_hash(&s->first->node, s->first->type);
|
||||
|
||||
if (s->first != s->last) {
|
||||
hash += vnode_hash(&s->first->node, s->first->type);
|
||||
hash ^= list_size(s);
|
||||
} else hash ^= 1;
|
||||
}
|
||||
|
||||
return hash + VTYPE_LIST;
|
||||
}
|
||||
|
||||
void list_init(list_t* x) {
|
||||
memset(x, 0, sizeof(*x));
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ int libcdsb_list_find_array (list_t* x, const arr_t* v, void* _, list_access_c
|
||||
int libcdsb_list_find_list (list_t* x, const list_t* v, void* _, list_access_callback cb, bool r, bool cut) { return libcdsb_list_find(x, v, vtypeof( v), _, cb, r, cut); }
|
||||
int libcdsb_list_find_map (list_t* x, const map_t* v, void* _, list_access_callback cb, bool r, bool cut) { return libcdsb_list_find(x, v, vtypeof( v), _, cb, r, cut); }
|
||||
int libcdsb_list_find_vset (list_t* x, const set_t* v, void* _, list_access_callback cb, bool r, bool cut) { return libcdsb_list_find(x, v, vtypeof( v), _, cb, r, cut); }
|
||||
int libcdsb_list_find_dict (list_t* x, const dict_t* v, void* _, list_access_callback cb, bool r, bool cut) { return libcdsb_list_find(x, v, vtypeof( v), _, cb, r, cut); }
|
||||
int libcdsb_list_find_boolean(list_t* x, bool v, void* _, list_access_callback cb, bool r, bool cut) { return libcdsb_list_find(x, &v, vtypeof(&v), _, cb, r, cut); }
|
||||
int libcdsb_list_find_int8 (list_t* x, s8_t v, void* _, list_access_callback cb, bool r, bool cut) { return libcdsb_list_find(x, &v, vtypeof(&v), _, cb, r, cut); }
|
||||
int libcdsb_list_find_int16 (list_t* x, s16_t v, void* _, list_access_callback cb, bool r, bool cut) { return libcdsb_list_find(x, &v, vtypeof(&v), _, cb, r, cut); }
|
||||
@ -30,6 +31,7 @@ size_t libcdsb_list_count_array (const list_t* s, const arr_t* v) { return lib
|
||||
size_t libcdsb_list_count_list (const list_t* s, const list_t* v) { return libcdsb_list_count((void*)s, v, vtypeof( v)); }
|
||||
size_t libcdsb_list_count_map (const list_t* s, const map_t* v) { return libcdsb_list_count((void*)s, v, vtypeof( v)); }
|
||||
size_t libcdsb_list_count_vset (const list_t* s, const set_t* v) { return libcdsb_list_count((void*)s, v, vtypeof( v)); }
|
||||
size_t libcdsb_list_count_dict (const list_t* s, const dict_t* v) { return libcdsb_list_count((void*)s, v, vtypeof( v)); }
|
||||
size_t libcdsb_list_count_boolean(const list_t* s, bool v) { return libcdsb_list_count((void*)s, &v, vtypeof(&v)); }
|
||||
size_t libcdsb_list_count_int8 (const list_t* s, s8_t v) { return libcdsb_list_count((void*)s, &v, vtypeof(&v)); }
|
||||
size_t libcdsb_list_count_int16 (const list_t* s, s16_t v) { return libcdsb_list_count((void*)s, &v, vtypeof(&v)); }
|
||||
@ -50,6 +52,7 @@ bool libcdsb_list_update_array (list_t* x, ssize_t i, const arr_t* v, int ins)
|
||||
bool libcdsb_list_update_list (list_t* x, ssize_t i, const list_t* v, int ins) { return libcdsb_list_update(x, i, v, vtypeof( v), ins); }
|
||||
bool libcdsb_list_update_map (list_t* x, ssize_t i, const map_t* v, int ins) { return libcdsb_list_update(x, i, v, vtypeof( v), ins); }
|
||||
bool libcdsb_list_update_vset (list_t* x, ssize_t i, const set_t* v, int ins) { return libcdsb_list_update(x, i, v, vtypeof( v), ins); }
|
||||
bool libcdsb_list_update_dict (list_t* x, ssize_t i, const dict_t* v, int ins) { return libcdsb_list_update(x, i, v, vtypeof( v), ins); }
|
||||
bool libcdsb_list_update_boolean(list_t* x, ssize_t i, bool v, int ins) { return libcdsb_list_update(x, i, &v, vtypeof(&v), ins); }
|
||||
bool libcdsb_list_update_int8 (list_t* x, ssize_t i, s8_t v, int ins) { return libcdsb_list_update(x, i, &v, vtypeof(&v), ins); }
|
||||
bool libcdsb_list_update_int16 (list_t* x, ssize_t i, s16_t v, int ins) { return libcdsb_list_update(x, i, &v, vtypeof(&v), ins); }
|
||||
|
@ -18,11 +18,12 @@ static inline void lnode_swap(lnode_t* s0, lnode_t* s1) {
|
||||
|
||||
|
||||
void list_sort(list_t* x) {
|
||||
stack_t z = { .prev = 0, .value = x->last};
|
||||
stack_t z;
|
||||
lnode_t *l;
|
||||
lnode_t *r;
|
||||
|
||||
stack_push(&z, x->first);
|
||||
stack_init(&z);
|
||||
stack_push_many(&z, 2, x->last, x->first);
|
||||
|
||||
while (z.value) {
|
||||
|
||||
|
127
src/map/base.c
127
src/map/base.c
@ -3,15 +3,67 @@
|
||||
|
||||
#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;
|
||||
mnode_t* c;
|
||||
mnode_t *t, *c;
|
||||
|
||||
c = x->root;
|
||||
|
||||
@ -41,39 +93,47 @@ void map_free(map_t* x) {
|
||||
x->type = 0;
|
||||
}
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
size_t map_size(const map_t* x) {
|
||||
stack_t z = { .prev = 0, .value = x->root };
|
||||
size_t n = 0;
|
||||
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->left))
|
||||
stack_push(&z, c->left);
|
||||
if (!rbnode_is_empty(c->right))
|
||||
stack_push(&z, c->right);
|
||||
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;
|
||||
|
||||
stack_t z = { .prev = 0, .value = 0 };
|
||||
vtype t = s0->type;
|
||||
int c = 0;
|
||||
if (s0 == s1 || s0->root == s1->root)
|
||||
return 0;
|
||||
if (s0->type != s1->type)
|
||||
return s0->type - s1->type;
|
||||
|
||||
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);
|
||||
|
||||
stack_push(&z, s1->root);
|
||||
stack_push(&z, s0->root);
|
||||
cmp = 0;
|
||||
|
||||
for (mnode_t *c0, *c1;!is_null(z.value);) {
|
||||
do {
|
||||
c0 = stack_pop(&z);
|
||||
c1 = stack_pop(&z);
|
||||
|
||||
@ -82,27 +142,22 @@ int map_compare(const map_t* s0, const map_t* s1) {
|
||||
stack_flush(&z);
|
||||
return mnode_is_empty(c0) ? -1 : 1;
|
||||
}
|
||||
} else if ((c = vnode_compare(c0->key, t, c1->key, t)) || (c = vnode_compare(c0->value, c0->type, c1->value, c1->type))) {
|
||||
if (c0->left == c1->right) {
|
||||
c = vnode_compare(c1->key, t, c0->right->key, t );
|
||||
if (!c) c = vnode_compare(c1->value, c1->type, c0->right->value, c0->type);
|
||||
if (!c) c = vnode_compare(c1->left->key, t, c0->key, t );
|
||||
if (!c) c = vnode_compare(c1->left->value, c1->type, c0->value, c0->type);
|
||||
} else if (c0->right == c1->left) {
|
||||
c = vnode_compare(c0->key, t, c1->right->key, t );
|
||||
if (!c) c = vnode_compare(c0->value, c0->type, c1->right->value, c1->type);
|
||||
if (!c) c = vnode_compare(c0->left->key, t, c1->key, t );
|
||||
if (!c) c = vnode_compare(c0->left->value, c0->type, c1->value, c1->type);
|
||||
} 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 (c) { stack_flush(&z); return c; }
|
||||
} else {
|
||||
stack_push(&z, c1->right);
|
||||
stack_push(&z, c0->right);
|
||||
stack_push(&z, c1->left);
|
||||
stack_push(&z, c0->left);
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
@ -3,14 +3,32 @@
|
||||
|
||||
#include "include.h"
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
static inline mnode_t* mnode_duplicate(const mnode_t* s, mnode_t* p, const vtype t) {
|
||||
mnode_t* x;
|
||||
|
||||
x = mnode_create(vnode_duplicate(&s->key, t), p, s->colored);
|
||||
x->type = s->type;
|
||||
x->value = vnode_duplicate(&s->value, s->type);
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
map_t map_copy(const map_t* s) {
|
||||
|
||||
map_t x = { .type = s->type };
|
||||
stack_t z = { .prev = 0, .value = s->root };
|
||||
vtype t = s->type;
|
||||
map_t x;
|
||||
stack_t z;
|
||||
|
||||
stack_init(&z);
|
||||
stack_push(&z, s->root);
|
||||
|
||||
x.type = s->type;
|
||||
|
||||
if (!mnode_is_empty(s->root)) {
|
||||
x.root = mnode_create(vnode_duplicate(&s->root->value, t), rbnode_empty, 0);
|
||||
x.root = mnode_duplicate(s->root, mnode_empty, s->type);
|
||||
stack_push(&z, x.root);
|
||||
|
||||
do {
|
||||
@ -18,21 +36,13 @@ map_t map_copy(const map_t* s) {
|
||||
mnode_t *p1 = stack_pop(&z);
|
||||
|
||||
if (!mnode_is_empty(p1->left)) {
|
||||
p0->left = mnode_create(vnode_duplicate(&p1->left->key, t), p0, p1->left->colored);
|
||||
p0->left->type = p1->left->type;
|
||||
p0->left->value = vnode_duplicate(&p1->left->value, p1->left->type);
|
||||
|
||||
stack_push(&z, p1->left);
|
||||
stack_push(&z, p0->left);
|
||||
p0->left = mnode_duplicate(p1->left, p0, s->type);
|
||||
stack_push_many(&z, 2, p1->left, p0->left);
|
||||
}
|
||||
|
||||
if (!mnode_is_empty(p1->right)) {
|
||||
p0->right = mnode_create(vnode_duplicate(&p1->right->key, t), p0, p1->right->colored);
|
||||
p0->right->type = p1->right->type;
|
||||
p0->right->value = vnode_duplicate(&p1->right->value, p1->right->type);
|
||||
|
||||
stack_push(&z, p1->right);
|
||||
stack_push(&z, p0->right);
|
||||
p0->right = mnode_duplicate(p1->right, p0, s->type);
|
||||
stack_push_many(&z, 2, p1->right, p0->right);
|
||||
}
|
||||
|
||||
} while (!is_null(z.value));
|
||||
@ -45,12 +55,17 @@ map_t map_copy(const map_t* s) {
|
||||
|
||||
map_t* map_duplicate(const map_t* s) {
|
||||
|
||||
map_t* x = malloc(sizeof(*x));
|
||||
stack_t z = { .prev = 0, .value = s->root };
|
||||
vtype t = x->type = s->type;
|
||||
map_t* x;
|
||||
stack_t z;
|
||||
|
||||
stack_init(&z);
|
||||
stack_push(&z, s->root);
|
||||
|
||||
x = malloc(sizeof(*x));
|
||||
x->type = s->type;
|
||||
|
||||
if (!mnode_is_empty(s->root)) {
|
||||
x->root = mnode_create(vnode_duplicate(&s->root->value, t), rbnode_empty, 0);
|
||||
x->root = mnode_duplicate(s->root, mnode_empty, s->type);
|
||||
stack_push(&z, x->root);
|
||||
|
||||
do {
|
||||
@ -58,21 +73,13 @@ map_t* map_duplicate(const map_t* s) {
|
||||
mnode_t *p1 = stack_pop(&z);
|
||||
|
||||
if (!mnode_is_empty(p1->left)) {
|
||||
p0->left = mnode_create(vnode_duplicate(&p1->left->key, t), p0, p1->left->colored);
|
||||
p0->left->type = p1->left->type;
|
||||
p0->left->value = vnode_duplicate(&p1->left->value, p1->left->type);
|
||||
|
||||
stack_push(&z, p1->left);
|
||||
stack_push(&z, p0->left);
|
||||
p0->left = mnode_duplicate(p1->left, p0, s->type);
|
||||
stack_push_many(&z, 2, p1->left, p0->left);
|
||||
}
|
||||
|
||||
if (!mnode_is_empty(p1->right)) {
|
||||
p0->right = mnode_create(vnode_duplicate(&p1->right->key, t), p0, p1->right->colored);
|
||||
p0->right->type = p1->right->type;
|
||||
p0->right->value = vnode_duplicate(&p1->right->value, p1->right->type);
|
||||
|
||||
stack_push(&z, p1->right);
|
||||
stack_push(&z, p0->right);
|
||||
p0->right = mnode_duplicate(p1->right, p0, s->type);
|
||||
stack_push_many(&z, 2, p1->right, p0->right);
|
||||
}
|
||||
|
||||
} while (!is_null(z.value));
|
||||
@ -85,11 +92,15 @@ map_t* map_duplicate(const map_t* s) {
|
||||
|
||||
void map_copy_init(map_t* x, const map_t* s) {
|
||||
|
||||
stack_t z = { .prev = 0, .value = s->root };
|
||||
vtype t = x->type = s->type;
|
||||
stack_t z;
|
||||
|
||||
stack_init(&z);
|
||||
stack_push(&z, s->root);
|
||||
|
||||
x->type = s->type;
|
||||
|
||||
if (!mnode_is_empty(s->root)) {
|
||||
x->root = mnode_create(vnode_duplicate(&s->root->value, t), rbnode_empty, 0);
|
||||
x->root = mnode_duplicate(s->root, mnode_empty, s->type);
|
||||
stack_push(&z, x->root);
|
||||
|
||||
do {
|
||||
@ -97,21 +108,13 @@ void map_copy_init(map_t* x, const map_t* s) {
|
||||
mnode_t *p1 = stack_pop(&z);
|
||||
|
||||
if (!mnode_is_empty(p1->left)) {
|
||||
p0->left = mnode_create(vnode_duplicate(&p1->left->key, t), p0, p1->left->colored);
|
||||
p0->left->type = p1->left->type;
|
||||
p0->left->value = vnode_duplicate(&p1->left->value, p1->left->type);
|
||||
|
||||
stack_push(&z, p1->left);
|
||||
stack_push(&z, p0->left);
|
||||
p0->left = mnode_duplicate(p1->left, p0, s->type);
|
||||
stack_push_many(&z, 2, p1->left, p0->left);
|
||||
}
|
||||
|
||||
if (!mnode_is_empty(p1->right)) {
|
||||
p0->right = mnode_create(vnode_duplicate(&p1->right->key, t), p0, p1->right->colored);
|
||||
p0->right->type = p1->right->type;
|
||||
p0->right->value = vnode_duplicate(&p1->right->value, p1->right->type);
|
||||
|
||||
stack_push(&z, p1->right);
|
||||
stack_push(&z, p0->right);
|
||||
p0->right = mnode_duplicate(p1->right, p0, s->type);
|
||||
stack_push_many(&z, 2, p1->right, p0->right);
|
||||
}
|
||||
|
||||
} while (!is_null(z.value));
|
||||
|
@ -20,7 +20,7 @@ bool libcdsb_map_update(map_t* x, const void* k, vtype kt, const void* v, vtype
|
||||
cmp = vtype_compare(k, kt, vnode_peek(&n->key, kt), kt);
|
||||
|
||||
if (cmp == 0) {
|
||||
vnode_free(&n->key, kt);
|
||||
vnode_free(&n->key, x->type);
|
||||
vnode_free(&n->value, n->type);
|
||||
|
||||
n->key = kn;
|
||||
@ -76,22 +76,26 @@ int libcdsb_map_find(map_t* x, const void* k, vtype t, void* _, map_access_callb
|
||||
}
|
||||
|
||||
return -1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
int libcdsb_map_foreach(map_t* x, void* dt, map_access_callback callback, bool flush) {
|
||||
stack_t z = { .prev = 0, .value = x->root };
|
||||
int r = 0;
|
||||
stack_t z;
|
||||
int r;
|
||||
mnode_t* c;
|
||||
|
||||
if (mnode_is_empty(x->root)) return 0;
|
||||
stack_init(&z);
|
||||
stack_push(&z, x->root);
|
||||
|
||||
r = 0;
|
||||
|
||||
if (mnode_is_empty(x->root))
|
||||
return 0;
|
||||
|
||||
while ((c = stack_pop(&z))) {
|
||||
if ((r = callback(vnode_peek(&c->key, x->type), x->type, vnode_peek(&c->value, c->type), c->type, dt)))
|
||||
break;
|
||||
|
||||
|
||||
if (!mnode_is_empty(c->right)) stack_push(&z, c->right);
|
||||
if (!mnode_is_empty(c->left)) stack_push(&z, c->left);
|
||||
|
||||
|
@ -10,6 +10,7 @@ int libcdsb_map_find_array (map_t* x, const arr_t* k, void* _, map_access_call
|
||||
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); }
|
||||
@ -23,13 +24,14 @@ int libcdsb_map_find_float (map_t* x, fl_t k, void* _, map_access_call
|
||||
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_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_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)); }
|
||||
@ -43,13 +45,14 @@ bool libcdsb_map_update_pointer_float (map_t* x, const void* k, fl_t 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_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_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)); }
|
||||
@ -63,13 +66,14 @@ bool libcdsb_map_update_cstring_float (map_t* x, const char* k, fl_t 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_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_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)); }
|
||||
@ -83,13 +87,14 @@ bool libcdsb_map_update_string_float (map_t* x, const str_t* k, fl_t 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_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_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)); }
|
||||
@ -103,13 +108,14 @@ bool libcdsb_map_update_array_float (map_t* x, const arr_t* k, fl_t 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_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_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)); }
|
||||
@ -123,13 +129,14 @@ bool libcdsb_map_update_list_float (map_t* x, const list_t* k, fl_t 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_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_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)); }
|
||||
@ -143,13 +150,14 @@ bool libcdsb_map_update_map_float (map_t* x, const map_t* k, fl_t 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_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_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)); }
|
||||
@ -163,13 +171,35 @@ bool libcdsb_map_update_vset_float (map_t* x, const set_t* k, fl_t 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_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_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_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)); }
|
||||
@ -183,13 +213,14 @@ bool libcdsb_map_update_boolean_float (map_t* x, const bool k, fl_t 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_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_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)); }
|
||||
@ -203,13 +234,14 @@ bool libcdsb_map_update_int8_float (map_t* x, const s8_t k, fl_t 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_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_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)); }
|
||||
@ -223,13 +255,14 @@ bool libcdsb_map_update_int16_float (map_t* x, const s16_t k, fl_t 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_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_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)); }
|
||||
@ -243,13 +276,14 @@ bool libcdsb_map_update_int32_float (map_t* x, const s32_t k, fl_t 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_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_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)); }
|
||||
@ -263,13 +297,14 @@ bool libcdsb_map_update_int64_float (map_t* x, const s64_t k, fl_t 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_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_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)); }
|
||||
@ -283,13 +318,14 @@ bool libcdsb_map_update_uint8_float (map_t* x, const u8_t k, fl_t 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_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_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)); }
|
||||
@ -303,13 +339,14 @@ bool libcdsb_map_update_uint16_float (map_t* x, const u16_t k, fl_t 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_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_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)); }
|
||||
@ -323,13 +360,14 @@ bool libcdsb_map_update_uint32_float (map_t* x, const u32_t k, fl_t 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_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_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)); }
|
||||
@ -343,13 +381,14 @@ bool libcdsb_map_update_uint64_float (map_t* x, const u64_t k, fl_t 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_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_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)); }
|
||||
@ -363,13 +402,14 @@ bool libcdsb_map_update_float_float (map_t* x, const fl_t k, fl_t 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_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_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)); }
|
||||
@ -383,13 +423,14 @@ bool libcdsb_map_update_double_float (map_t* x, const dbl_t k, fl_t 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_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_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)); }
|
||||
|
@ -28,7 +28,6 @@ static_assert(offsetof(struct libcdsb_rbtree_node, value) == offsetof(struct lib
|
||||
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)))
|
||||
#define mnode_fixup(r, n) libcdsb_rbtree_node_fixup((rbnode_t**)(r), (rbnode_t*)(n))
|
||||
|
120
src/set/base.c
120
src/set/base.c
@ -4,6 +4,57 @@
|
||||
#include "../../include/set.h"
|
||||
#include "../__internal/rbtree.h"
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
static inline int rbnode_compare(const rbnode_t* s0, const rbnode_t* s1, vtype t) {
|
||||
return vnode_compare(s0->value, t, s1->value, t);
|
||||
}
|
||||
|
||||
static inline hash_t rbnode_hash(const rbnode_t* s, vtype t) {
|
||||
return vnode_hash(&s->value, t);
|
||||
}
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
hash_t vset_hash(const set_t* s) {
|
||||
|
||||
stack_t z;
|
||||
rbnode_t *c0, *c1;
|
||||
hash_t hash, v;
|
||||
|
||||
if (rbnode_is_empty(s->root))
|
||||
return 0;
|
||||
|
||||
stack_init(&z);
|
||||
stack_push(&z, s->root->left);
|
||||
|
||||
hash = 1;
|
||||
|
||||
if (!rbnode_is_empty(c0 = stack_pop(&z))) {
|
||||
do {
|
||||
++hash;
|
||||
if (!rbnode_is_empty(c0->right)) stack_push(&z, c0->right);
|
||||
if (!rbnode_is_empty(c0->left)) stack_push(&z, c1 = c0->left);
|
||||
} while (!is_null(c0 = stack_pop(&z)));
|
||||
}
|
||||
|
||||
v = rbnode_hash(c1, s->type);
|
||||
stack_push(&z, s->root->right);
|
||||
|
||||
if (!rbnode_is_empty(c0 = stack_pop(&z))) {
|
||||
do {
|
||||
++hash;
|
||||
if (!rbnode_is_empty(c0->right)) stack_push(&z, c1 = c0->right);
|
||||
if (!rbnode_is_empty(c0->left)) stack_push(&z, c0->left);
|
||||
} while (!is_null(c0 = stack_pop(&z)));
|
||||
}
|
||||
|
||||
v += rbnode_hash(c1, s->type);
|
||||
|
||||
return (hash ^ v) + VTYPE_SET;
|
||||
}
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
void vset_init(set_t* x, vtype t) {
|
||||
x->root = rbnode_empty;
|
||||
@ -12,8 +63,7 @@ void vset_init(set_t* x, vtype t) {
|
||||
|
||||
|
||||
void vset_free(set_t* x) {
|
||||
rbnode_t* t;
|
||||
rbnode_t* c;
|
||||
rbnode_t *t, *c;
|
||||
|
||||
c = x->root;
|
||||
|
||||
@ -41,38 +91,47 @@ void vset_free(set_t* x) {
|
||||
x->type = 0;
|
||||
}
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
size_t vset_size(const set_t* x) {
|
||||
stack_t z = { .prev = 0, .value = x->root };
|
||||
size_t n = 0;
|
||||
stack_t z;
|
||||
size_t n;
|
||||
rbnode_t* c;
|
||||
|
||||
stack_init(&z);
|
||||
stack_push(&z, x->root);
|
||||
|
||||
n = 0;
|
||||
|
||||
if (!rbnode_is_empty(x->root)) {
|
||||
while ((c = stack_pop(&z))) {
|
||||
++n;
|
||||
if (!rbnode_is_empty(c->left))
|
||||
stack_push(&z, c->left);
|
||||
if (!rbnode_is_empty(c->right))
|
||||
stack_push(&z, c->right);
|
||||
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 vset_compare(const set_t* s0, const set_t* s1) {
|
||||
stack_t z = { .prev = 0, .value = 0 };
|
||||
vtype t = s0->type;
|
||||
int c = 0;
|
||||
stack_t z;
|
||||
rbnode_t *c0, *c1;
|
||||
int cmp;
|
||||
|
||||
if (s0 == s1 || s0->root == s1->root) return 0;
|
||||
if (s0->type != s1->type) return s0->type - s1->type;
|
||||
if (s0 == s1 || s0->root == s1->root)
|
||||
return 0;
|
||||
if (s0->type != s1->type)
|
||||
return s0->type - s1->type;
|
||||
|
||||
stack_push(&z, s1->root);
|
||||
stack_push(&z, s0->root);
|
||||
stack_init(&z);
|
||||
stack_push_many(&z, 2, (void*)s1, (void*)s0);
|
||||
|
||||
for (rbnode_t *c0, *c1;!is_null(z.value);) {
|
||||
cmp = 0;
|
||||
|
||||
do {
|
||||
c0 = stack_pop(&z);
|
||||
c1 = stack_pop(&z);
|
||||
|
||||
@ -81,23 +140,22 @@ int vset_compare(const set_t* s0, const set_t* s1) {
|
||||
stack_flush(&z);
|
||||
return rbnode_is_empty(c0) ? -1 : 1;
|
||||
}
|
||||
} else if ((c = vnode_compare(c0->value, t, c1->value, t))) {
|
||||
if (c0->left == c1->right) {
|
||||
c = vnode_compare(c1->value, t, c0->right->value, t);
|
||||
if (!c) c = vnode_compare(c1->left->value, t, c0->value, t);
|
||||
} else if (c0->right == c1->left) {
|
||||
c = vnode_compare(c0->value, t, c1->right->value, t);
|
||||
if (!c) c = vnode_compare(c0->left->value, t, c1->value, t);
|
||||
} else if ((cmp = rbnode_compare(c0, c1, s0->type))) {
|
||||
if (c0->left == c1->right) { // == rbnode_empty
|
||||
cmp = rbnode_compare(c0->right, c1, s0->type);
|
||||
if (!cmp) cmp = rbnode_compare(c0, c1->left, s0->type);
|
||||
} else if (c0->right == c1->left) { // == rbnode_empty
|
||||
cmp = rbnode_compare(c0, c1->right, s0->type);
|
||||
if (!cmp) cmp = rbnode_compare(c0->left, c1, s0->type);
|
||||
}
|
||||
|
||||
if (c) { stack_flush(&z); return c; }
|
||||
} else {
|
||||
stack_push(&z, c1->right);
|
||||
stack_push(&z, c0->right);
|
||||
stack_push(&z, c1->left);
|
||||
stack_push(&z, c0->left);
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
@ -6,12 +6,16 @@
|
||||
|
||||
set_t vset_copy(const set_t* s) {
|
||||
|
||||
set_t x = { .type = s->type };
|
||||
stack_t z = { .prev = 0, .value = s->root };
|
||||
vtype t = s->type;
|
||||
set_t x;
|
||||
stack_t z;
|
||||
|
||||
stack_init(&z);
|
||||
stack_push(&z, s->root);
|
||||
|
||||
x.type = s->type;
|
||||
|
||||
if (!rbnode_is_empty(s->root)) {
|
||||
x.root = rbnode_create(vnode_duplicate(&s->root->value, t), rbnode_empty, 0);
|
||||
x.root = rbnode_create(vnode_duplicate(&s->root->value, s->type), rbnode_empty, 0);
|
||||
stack_push(&z, x.root);
|
||||
|
||||
do {
|
||||
@ -19,15 +23,13 @@ set_t vset_copy(const set_t* s) {
|
||||
rbnode_t *p1 = stack_pop(&z);
|
||||
|
||||
if (!rbnode_is_empty(p1->left)) {
|
||||
p0->left = rbnode_create(vnode_duplicate(&p1->left->value, t), p0, p1->left->colored);
|
||||
stack_push(&z, p1->left);
|
||||
stack_push(&z, p0->left);
|
||||
p0->left = rbnode_create(vnode_duplicate(&p1->left->value, s->type), p0, p1->left->colored);
|
||||
stack_push_many(&z, 2, p1->left, p0->left);
|
||||
}
|
||||
|
||||
if (!rbnode_is_empty(p1->right)) {
|
||||
p0->right = rbnode_create(vnode_duplicate(&p1->right->value, t), p0, p1->right->colored);
|
||||
stack_push(&z, p1->right);
|
||||
stack_push(&z, p0->right);
|
||||
p0->right = rbnode_create(vnode_duplicate(&p1->right->value, s->type), p0, p1->right->colored);
|
||||
stack_push_many(&z, 2, p1->right, p0->right);
|
||||
}
|
||||
|
||||
} while (!is_null(z.value));
|
||||
@ -40,12 +42,17 @@ set_t vset_copy(const set_t* s) {
|
||||
|
||||
set_t* vset_duplicate(const set_t* s) {
|
||||
|
||||
set_t* x = malloc(sizeof(*x));
|
||||
stack_t z = { .prev = 0, .value = s->root };
|
||||
vtype t = x->type = s->type;
|
||||
set_t* x;
|
||||
stack_t z;
|
||||
|
||||
stack_init(&z);
|
||||
stack_push(&z, s->root);
|
||||
|
||||
x = malloc(sizeof(*x));
|
||||
x->type = s->type;
|
||||
|
||||
if (!rbnode_is_empty(s->root)) {
|
||||
x->root = rbnode_create(vnode_duplicate(&s->root->value, t), rbnode_empty, 0);
|
||||
x->root = rbnode_create(vnode_duplicate(&s->root->value, s->type), rbnode_empty, 0);
|
||||
stack_push(&z, x->root);
|
||||
|
||||
do {
|
||||
@ -53,15 +60,13 @@ set_t* vset_duplicate(const set_t* s) {
|
||||
rbnode_t *p1 = stack_pop(&z);
|
||||
|
||||
if (!rbnode_is_empty(p1->left)) {
|
||||
p0->left = rbnode_create(vnode_duplicate(&p1->left->value, t), p0, p1->left->colored);
|
||||
stack_push(&z, p1->left);
|
||||
stack_push(&z, p0->left);
|
||||
p0->left = rbnode_create(vnode_duplicate(&p1->left->value, s->type), p0, p1->left->colored);
|
||||
stack_push_many(&z, 2, p1->left, p0->left);
|
||||
}
|
||||
|
||||
if (!rbnode_is_empty(p1->right)) {
|
||||
p0->right = rbnode_create(vnode_duplicate(&p1->right->value, t), p0, p1->right->colored);
|
||||
stack_push(&z, p1->right);
|
||||
stack_push(&z, p0->right);
|
||||
p0->right = rbnode_create(vnode_duplicate(&p1->right->value, s->type), p0, p1->right->colored);
|
||||
stack_push_many(&z, 2, p1->right, p0->right);
|
||||
}
|
||||
|
||||
} while (!is_null(z.value));
|
||||
@ -74,11 +79,15 @@ set_t* vset_duplicate(const set_t* s) {
|
||||
|
||||
void vset_copy_init(set_t* x, const set_t* s) {
|
||||
|
||||
stack_t z = { .prev = 0, .value = s->root };
|
||||
vtype t = x->type = s->type;
|
||||
stack_t z;
|
||||
|
||||
stack_init(&z);
|
||||
stack_push(&z, s->root);
|
||||
|
||||
x->type = s->type;
|
||||
|
||||
if (!rbnode_is_empty(s->root)) {
|
||||
x->root = rbnode_create(vnode_duplicate(&s->root->value, t), rbnode_empty, 0);
|
||||
x->root = rbnode_create(vnode_duplicate(&s->root->value, s->type), rbnode_empty, 0);
|
||||
stack_push(&z, x->root);
|
||||
|
||||
do {
|
||||
@ -86,15 +95,13 @@ void vset_copy_init(set_t* x, const set_t* s) {
|
||||
rbnode_t *p1 = stack_pop(&z);
|
||||
|
||||
if (!rbnode_is_empty(p1->left)) {
|
||||
p0->left = rbnode_create(vnode_duplicate(&p1->left->value, t), p0, p1->left->colored);
|
||||
stack_push(&z, p1->left);
|
||||
stack_push(&z, p0->left);
|
||||
p0->left = rbnode_create(vnode_duplicate(&p1->left->value, s->type), p0, p1->left->colored);
|
||||
stack_push_many(&z, 2, p1->left, p0->left);
|
||||
}
|
||||
|
||||
if (!rbnode_is_empty(p1->right)) {
|
||||
p0->right = rbnode_create(vnode_duplicate(&p1->right->value, t), p0, p1->right->colored);
|
||||
stack_push(&z, p1->right);
|
||||
stack_push(&z, p0->right);
|
||||
p0->right = rbnode_create(vnode_duplicate(&p1->right->value, s->type), p0, p1->right->colored);
|
||||
stack_push_many(&z, 2, p1->right, p0->right);
|
||||
}
|
||||
|
||||
} while (!is_null(z.value));
|
||||
|
@ -71,11 +71,17 @@ int libcdsb_vset_find(vtype_set* x, const void* v, vtype t, void* _, vset_access
|
||||
|
||||
|
||||
int libcdsb_vset_foreach(set_t* x, void* data, vset_access_callback callback, bool flush) {
|
||||
stack_t z = { .prev = 0, .value = x->root };
|
||||
int r = 0;
|
||||
stack_t z;
|
||||
int r;
|
||||
rbnode_t* c;
|
||||
|
||||
if (rbnode_is_empty(x->root)) return 0;
|
||||
stack_init(&z);
|
||||
stack_push(&z, x->root);
|
||||
|
||||
r = 0;
|
||||
|
||||
if (rbnode_is_empty(x->root))
|
||||
return 0;
|
||||
|
||||
while ((c = stack_pop(&z))) {
|
||||
if ((r = callback(vnode_peek(&c->value, x->type), x->type, data)))
|
||||
|
@ -4,13 +4,14 @@
|
||||
#include "../../include/extra/set.h"
|
||||
#include "../__internal/include.h"
|
||||
|
||||
int libcdsb_vset_find_pointer(set_t* x, const void* v, void* _, vset_access_callback cb, bool cut) { return libcdsb_vset_find(x, &v, vtypeof(&v), _, cb, cut); }
|
||||
int libcdsb_vset_find_cstring(set_t* x, const char* v, void* _, vset_access_callback cb, bool cut) { return libcdsb_vset_find(x, &v, vtypeof(&v), _, cb, cut); }
|
||||
int libcdsb_vset_find_string (set_t* x, const str_t* v, void* _, vset_access_callback cb, bool cut) { return libcdsb_vset_find(x, v, vtypeof( v), _, cb, cut); }
|
||||
int libcdsb_vset_find_array (set_t* x, const arr_t* v, void* _, vset_access_callback cb, bool cut) { return libcdsb_vset_find(x, v, vtypeof( v), _, cb, cut); }
|
||||
int libcdsb_vset_find_pointer(set_t* x, const void* v, void* _, vset_access_callback cb, bool cut) { return libcdsb_vset_find(x, &v, vtypeof(&v), _, cb, cut); }
|
||||
int libcdsb_vset_find_cstring(set_t* x, const char* v, void* _, vset_access_callback cb, bool cut) { return libcdsb_vset_find(x, &v, vtypeof(&v), _, cb, cut); }
|
||||
int libcdsb_vset_find_string (set_t* x, const str_t* v, void* _, vset_access_callback cb, bool cut) { return libcdsb_vset_find(x, v, vtypeof( v), _, cb, cut); }
|
||||
int libcdsb_vset_find_array (set_t* x, const arr_t* v, void* _, vset_access_callback cb, bool cut) { return libcdsb_vset_find(x, v, vtypeof( v), _, cb, cut); }
|
||||
int libcdsb_vset_find_list (set_t* x, const list_t* v, void* _, vset_access_callback cb, bool cut) { return libcdsb_vset_find(x, v, vtypeof( v), _, cb, cut); }
|
||||
int libcdsb_vset_find_map (set_t* x, const map_t* v, void* _, vset_access_callback cb, bool cut) { return libcdsb_vset_find(x, v, vtypeof( v), _, cb, cut); }
|
||||
int libcdsb_vset_find_vset (set_t* x, const set_t* v, void* _, vset_access_callback cb, bool cut) { return libcdsb_vset_find(x, v, vtypeof( v), _, cb, cut); }
|
||||
int libcdsb_vset_find_map (set_t* x, const map_t* v, void* _, vset_access_callback cb, bool cut) { return libcdsb_vset_find(x, v, vtypeof( v), _, cb, cut); }
|
||||
int libcdsb_vset_find_vset (set_t* x, const set_t* v, void* _, vset_access_callback cb, bool cut) { return libcdsb_vset_find(x, v, vtypeof( v), _, cb, cut); }
|
||||
int libcdsb_vset_find_dict (set_t* x, const dict_t* v, void* _, vset_access_callback cb, bool cut) { return libcdsb_vset_find(x, v, vtypeof( v), _, cb, cut); }
|
||||
int libcdsb_vset_find_boolean(set_t* x, bool v, void* _, vset_access_callback cb, bool cut) { return libcdsb_vset_find(x, &v, vtypeof(&v), _, cb, cut); }
|
||||
int libcdsb_vset_find_int8 (set_t* x, s8_t v, void* _, vset_access_callback cb, bool cut) { return libcdsb_vset_find(x, &v, vtypeof(&v), _, cb, cut); }
|
||||
int libcdsb_vset_find_int16 (set_t* x, s16_t v, void* _, vset_access_callback cb, bool cut) { return libcdsb_vset_find(x, &v, vtypeof(&v), _, cb, cut); }
|
||||
@ -24,13 +25,14 @@ int libcdsb_vset_find_float (set_t* x, fl_t v, void* _, vset_access_ca
|
||||
int libcdsb_vset_find_double (set_t* x, dbl_t v, void* _, vset_access_callback cb, bool cut) { return libcdsb_vset_find(x, &v, vtypeof(&v), _, cb, cut); }
|
||||
int libcdsb_vset_find_ldouble(set_t* x, ldbl_t v, void* _, vset_access_callback cb, bool cut) { return libcdsb_vset_find(x, &v, vtypeof(&v), _, cb, cut); }
|
||||
|
||||
bool libcdsb_vset_push_pointer(set_t* x, const void* v) { return libcdsb_vset_insert(x, &v, vtypeof(&v)); }
|
||||
bool libcdsb_vset_push_cstring(set_t* x, const char* v) { return libcdsb_vset_insert(x, &v, vtypeof(&v)); }
|
||||
bool libcdsb_vset_push_string (set_t* x, const str_t* v) { return libcdsb_vset_insert(x, v, vtypeof( v)); }
|
||||
bool libcdsb_vset_push_array (set_t* x, const arr_t* v) { return libcdsb_vset_insert(x, v, vtypeof( v)); }
|
||||
bool libcdsb_vset_push_pointer(set_t* x, const void* v) { return libcdsb_vset_insert(x, &v, vtypeof(&v)); }
|
||||
bool libcdsb_vset_push_cstring(set_t* x, const char* v) { return libcdsb_vset_insert(x, &v, vtypeof(&v)); }
|
||||
bool libcdsb_vset_push_string (set_t* x, const str_t* v) { return libcdsb_vset_insert(x, v, vtypeof( v)); }
|
||||
bool libcdsb_vset_push_array (set_t* x, const arr_t* v) { return libcdsb_vset_insert(x, v, vtypeof( v)); }
|
||||
bool libcdsb_vset_push_list (set_t* x, const list_t* v) { return libcdsb_vset_insert(x, v, vtypeof( v)); }
|
||||
bool libcdsb_vset_push_map (set_t* x, const map_t* v) { return libcdsb_vset_insert(x, v, vtypeof( v)); }
|
||||
bool libcdsb_vset_push_vset (set_t* x, const set_t* v) { return libcdsb_vset_insert(x, v, vtypeof( v)); }
|
||||
bool libcdsb_vset_push_map (set_t* x, const map_t* v) { return libcdsb_vset_insert(x, v, vtypeof( v)); }
|
||||
bool libcdsb_vset_push_vset (set_t* x, const set_t* v) { return libcdsb_vset_insert(x, v, vtypeof( v)); }
|
||||
bool libcdsb_vset_push_dict (set_t* x, const dict_t* v) { return libcdsb_vset_insert(x, v, vtypeof( v)); }
|
||||
bool libcdsb_vset_push_boolean(set_t* x, bool v) { return libcdsb_vset_insert(x, &v, vtypeof(&v)); }
|
||||
bool libcdsb_vset_push_int8 (set_t* x, s8_t v) { return libcdsb_vset_insert(x, &v, vtypeof(&v)); }
|
||||
bool libcdsb_vset_push_int16 (set_t* x, s16_t v) { return libcdsb_vset_insert(x, &v, vtypeof(&v)); }
|
||||
|
@ -3,6 +3,22 @@
|
||||
|
||||
#include "include.h"
|
||||
|
||||
hash_t string_hash(const str_t* s) {
|
||||
hash_t hash = 0;
|
||||
size_t nmemb = string_nmemb(s);
|
||||
|
||||
if (nmemb > 0)
|
||||
hash = s->buffer[0];
|
||||
|
||||
if (nmemb > 1)
|
||||
hash += s->buffer[nmemb-1];
|
||||
|
||||
hash ^= nmemb;
|
||||
|
||||
return hash + VTYPE_STRING;
|
||||
}
|
||||
|
||||
|
||||
size_t string_nmemb(const str_t* s) {
|
||||
return (!is_null(s->buffer)) ? strlen(s->buffer) : 0;
|
||||
}
|
||||
|
@ -200,6 +200,8 @@ size_t string_reverse(str_t* x) {
|
||||
p = memcpy(p - cs, v, cs);
|
||||
v += cs;
|
||||
} else *(--p) = *(v++);
|
||||
|
||||
++n;
|
||||
}
|
||||
|
||||
free(x->buffer);
|
||||
|
@ -32,31 +32,34 @@ char* string_at(const str_t* s, ssize_t i) {
|
||||
}
|
||||
|
||||
|
||||
bool string_slice(str_t* x, str_t* s, ssize_t i, size_t c, bool cut) {
|
||||
size_t string_slice(str_t* x, str_t* s, ssize_t i, size_t c, bool cut) {
|
||||
char *e, *p, *v;
|
||||
size_t n = 0;
|
||||
|
||||
memset(x, 0, sizeof(*x));
|
||||
|
||||
if (!c) return true;
|
||||
if (!c) return n;
|
||||
|
||||
p = string_at(s, i);
|
||||
|
||||
if (is_null(p) || (e = p + strlen(p)) > p + c)
|
||||
return false;
|
||||
if (is_null(p))
|
||||
return n;
|
||||
|
||||
e = p + strlen(p);
|
||||
v = p;
|
||||
|
||||
do { v = next_char(v); } while (--c && v < e);
|
||||
while (c-- && v < e) {
|
||||
v = next_char(v);
|
||||
++n;
|
||||
}
|
||||
|
||||
if (!c) {
|
||||
x->buffer = strndup(p, v - p);
|
||||
x->buffer = strndup(p, v - p);
|
||||
|
||||
if (cut) {
|
||||
memmove(p, v, strlen(v) + 1);
|
||||
}
|
||||
if (cut) {
|
||||
memmove(p, v, strlen(v) + 1);
|
||||
}
|
||||
|
||||
return true;
|
||||
} else return false;
|
||||
return n;
|
||||
}
|
||||
|
||||
|
||||
|
11
src/vnode.c
11
src/vnode.c
@ -157,11 +157,11 @@ vnode_t libcdsb_vnode_create(const void* v, vtype t) {
|
||||
else _.ptr = memndup(v, sizeof(u64_t));
|
||||
break;
|
||||
|
||||
case VTYPE_FLOAT: if (is_permissible(fl_t)) _.ld = *(fl_t*)v;
|
||||
case VTYPE_FLOAT: if (is_permissible(fl_t)) _.f = *(fl_t*)v;
|
||||
else _.ptr = memndup(v, sizeof(fl_t));
|
||||
break;
|
||||
|
||||
case VTYPE_DOUBLE: if (is_permissible(dbl_t)) _.ld = *(dbl_t*)v;
|
||||
case VTYPE_DOUBLE: if (is_permissible(dbl_t)) _.d = *(dbl_t*)v;
|
||||
else _.ptr = memndup(v, sizeof(dbl_t));
|
||||
break;
|
||||
|
||||
@ -226,6 +226,7 @@ void* libcdsb_vnode_peek(const vnode_t* x, vtype t) {
|
||||
case VTYPE_ARRAY:
|
||||
case VTYPE_LIST:
|
||||
case VTYPE_SET:
|
||||
case VTYPE_DICT:
|
||||
pt_: return *x;
|
||||
}
|
||||
}
|
||||
@ -260,7 +261,8 @@ void libcdsb_vnode_free(vnode_t* x, vtype t) {
|
||||
case VTYPE_MAP: map_free(*x); goto pt_;
|
||||
case VTYPE_ARRAY: array_free(*x); goto pt_;
|
||||
case VTYPE_LIST: list_free(*x); goto pt_;
|
||||
case VTYPE_SET: vset_free(*x);
|
||||
case VTYPE_SET: vset_free(*x); goto pt_;
|
||||
case VTYPE_DICT: dict_free(*x);
|
||||
pt_: free(*x);
|
||||
break;
|
||||
}
|
||||
@ -304,6 +306,9 @@ vnode_t libcdsb_vnode_create_target(vtype xt, const void* v, vtype t) {
|
||||
|
||||
case VTYPE_SET: _.ptr = vset_duplicate(v);
|
||||
break;
|
||||
|
||||
case VTYPE_DICT: _.ptr = dict_duplicate(v);
|
||||
break;
|
||||
}
|
||||
|
||||
return _.ptr;
|
||||
|
@ -26,13 +26,13 @@ static _Thread_local char STRINGIFY_BUFFER[64];
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
|
||||
const size_t LIBCDSB_VTYPE_SIZES[18] = {
|
||||
const size_t LIBCDSB_VTYPE_SIZES[19] = {
|
||||
sizeof(void*), sizeof(bool),
|
||||
sizeof(u8_t), sizeof(u16_t), sizeof(u32_t), sizeof(u64_t),
|
||||
sizeof(s8_t), sizeof(s16_t), sizeof(s32_t), sizeof(s64_t),
|
||||
sizeof(fl_t), sizeof(dbl_t), sizeof(ldbl_t),
|
||||
sizeof(str_t), sizeof(map_t), sizeof(arr_t),
|
||||
sizeof(list_t), sizeof(set_t)
|
||||
sizeof(list_t), sizeof(set_t), sizeof(dict_t)
|
||||
};
|
||||
|
||||
|
||||
@ -59,6 +59,7 @@ const char* libcdsb_vtype_name(vtype t) {
|
||||
case VTYPE_ARRAY: return "VTYPE_ARRAY";
|
||||
case VTYPE_LIST: return "VTYPE_LIST";
|
||||
case VTYPE_SET: return "VTYPE_SET";
|
||||
case VTYPE_DICT: return "VTYPE_DICT";
|
||||
}
|
||||
}
|
||||
|
||||
|
72
src/vtype.c
72
src/vtype.c
@ -30,6 +30,35 @@ static ldbl_t normalize_value(const void* v, vtype t) {
|
||||
} else return abs(*(ldbl_t*)v) <= LDBL_EPSILON ? 0 : *(ldbl_t*)v;
|
||||
}
|
||||
|
||||
static hash_t ldouble_hash(ldbl_t s) {
|
||||
hash_t hash;
|
||||
|
||||
if (sizeof(hash_t) == sizeof(u64_t)) {
|
||||
if (is_little_endian) {
|
||||
hash = *((u64_t*)&s);
|
||||
hash ^= *((u16_t*)(((u64_t*)&s) + 1));
|
||||
} else {
|
||||
memcpy(&hash, ((char*)&s) + sizeof(u16_t), sizeof(u64_t));
|
||||
hash ^= *((u16_t*)&s);
|
||||
}
|
||||
} else {
|
||||
if (is_little_endian) {
|
||||
hash = *((u32_t*)&s) ^ *((u32_t*)&s + 1);
|
||||
hash ^= *((u16_t*)(((u32_t*)&s) + 2));
|
||||
} else {
|
||||
u32_t x;
|
||||
|
||||
memcpy(&hash, ((char*)&s) + sizeof(u16_t), sizeof(u32_t));
|
||||
memcpy(&x, ((char*)&s) + sizeof(u16_t) + sizeof(u32_t), sizeof(u32_t));
|
||||
|
||||
hash ^= x;
|
||||
hash ^= *((u16_t*)&s);
|
||||
}
|
||||
}
|
||||
|
||||
return hash;
|
||||
}
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
int libcdsb_vtype_compare_values(const void* s0, vtype t0, const void* s1, vtype t1) {
|
||||
@ -66,9 +95,9 @@ int libcdsb_vtype_compare_values_eq(const void* s0, const void* s1, vtype t) {
|
||||
case VTYPE_UINT8: return compare( u8_t, s0, s1);
|
||||
case VTYPE_UINT16: return compare(u16_t, s0, s1);
|
||||
case VTYPE_UINT32:
|
||||
u32_: return compare(u32_t, s0, s1);
|
||||
x86_ptr: return compare(u32_t, s0, s1);
|
||||
|
||||
case VTYPE_POINTER: if (sizeof(void*) != 8) goto u32_;
|
||||
case VTYPE_POINTER: if (!is_x64) goto x86_ptr;
|
||||
case VTYPE_UINT64: return compare(u64_t, s0, s1);
|
||||
|
||||
case VTYPE_LDOUBLE: return (abs(*(ldbl_t*)s0 - *(ldbl_t*)s1) <= LDBL_EPSILON) ? 0 : (*(ldbl_t*)s0 < *(ldbl_t*)s1 ? -1 : 1);
|
||||
@ -80,7 +109,46 @@ int libcdsb_vtype_compare_values_eq(const void* s0, const void* s1, vtype t) {
|
||||
case VTYPE_LIST: return list_compare(s0, s1);
|
||||
case VTYPE_MAP: return map_compare(s0, s1);
|
||||
case VTYPE_SET: return vset_compare(s0, s1);
|
||||
case VTYPE_DICT: return dict_compare(s0, s1);
|
||||
}
|
||||
|
||||
#undef compare
|
||||
}
|
||||
|
||||
/*#####################################################################################################################*/
|
||||
|
||||
hash_t libcdsb_vtype_hash(const void* v, vtype t) {
|
||||
|
||||
switch (t) { default: abort();
|
||||
|
||||
case VTYPE_BOOLEAN:
|
||||
case VTYPE_INT8:
|
||||
case VTYPE_UINT8: return (hash_t)(*(u8_t*)v);
|
||||
|
||||
case VTYPE_INT16:
|
||||
case VTYPE_UINT16: return (hash_t)(*(u16_t*)v);
|
||||
|
||||
case VTYPE_INT32:
|
||||
case VTYPE_UINT32:
|
||||
x86_ptr: return (hash_t)(*(u32_t*)v);
|
||||
|
||||
case VTYPE_POINTER: if (!is_x64) goto x86_ptr;
|
||||
case VTYPE_INT64:
|
||||
case VTYPE_UINT64: if (sizeof(hash_t) == sizeof(u64_t)) {
|
||||
return (hash_t)(*(u64_t*)v);
|
||||
} else {
|
||||
return (hash_t)(*(u32_t*)v) ^ (*((u32_t*)v + 1));
|
||||
}
|
||||
|
||||
case VTYPE_STRING: return string_hash(v);
|
||||
case VTYPE_ARRAY: return array_hash(v);
|
||||
case VTYPE_LIST: return list_hash(v);
|
||||
case VTYPE_MAP: return map_hash(v);
|
||||
case VTYPE_SET: return vset_hash(v);
|
||||
case VTYPE_DICT: return dict_hash(v);
|
||||
|
||||
case VTYPE_FLOAT: return ldouble_hash(*(fl_t*)v);
|
||||
case VTYPE_DOUBLE: return ldouble_hash(*(dbl_t*)v);
|
||||
case VTYPE_LDOUBLE: return ldouble_hash(*(ldbl_t*)v);
|
||||
}
|
||||
}
|
||||
|
106
tests/Makefile
Normal file
106
tests/Makefile
Normal file
@ -0,0 +1,106 @@
|
||||
# This software is licensed by the MIT License, see LICENSE file
|
||||
# Copyright © 2022 Gregory Lirent
|
||||
|
||||
########################################################################################################################
|
||||
|
||||
BUILD_PATH ?= ./bin
|
||||
|
||||
########################################################################################################################
|
||||
|
||||
CC = clang
|
||||
MKDIR = mkdir -p
|
||||
RMRF = rm -rf
|
||||
AR = ar crs
|
||||
CP = cp
|
||||
|
||||
$(BUILD_PATH)/obj/%.o: CFLAGS := $(CFLAGS) -Og -fPIC -c -g3 -Wall
|
||||
|
||||
########################################################################################################################
|
||||
|
||||
c_objects = $(addsuffix .o,$(addprefix $(2),$(notdir $(basename $(wildcard $(1)*.c)))))
|
||||
|
||||
OBJECTS_TESTS := $(addprefix $(BUILD_PATH)/obj/,$(call c_objects,./src/,))
|
||||
OBJECTS_BASE := $(addprefix ../bin/debug/obj/,$(call c_objects,../src/,))
|
||||
OBJECTS_STRING := $(addprefix ../bin/debug/obj/,$(call c_objects,../src/string/,string-))
|
||||
OBJECTS_ARRAY := $(addprefix ../bin/debug/obj/,$(call c_objects,../src/array/,array-))
|
||||
OBJECTS_LIST := $(addprefix ../bin/debug/obj/,$(call c_objects,../src/list/,list-))
|
||||
OBJECTS_MAP := $(addprefix ../bin/debug/obj/,$(call c_objects,../src/map/,map-))
|
||||
OBJECTS_SET := $(addprefix ../bin/debug/obj/,$(call c_objects,../src/set/,set-))
|
||||
OBJECTS_DICT := $(addprefix ../bin/debug/obj/,$(call c_objects,../src/dict/,dict-))
|
||||
|
||||
OBJECTS_GLOBAL := $(OBJECTS_TESTS) $(addprefix $(BUILD_PATH)/obj/,$(call c_objects,./src/global/src/,global-))
|
||||
|
||||
OBJECTS_STRING := $(OBJECTS_BASE) $(OBJECTS_TESTS) $(OBJECTS_STRING) $(addprefix $(BUILD_PATH)/obj/,$(call c_objects,./src/string/src/,string-))
|
||||
OBJECTS_ARRAY := $(OBJECTS_BASE) $(OBJECTS_TESTS) $(OBJECTS_ARRAY) $(addprefix $(BUILD_PATH)/obj/,$(call c_objects,./src/array/src/,array-))
|
||||
OBJECTS_LIST := $(OBJECTS_BASE) $(OBJECTS_TESTS) $(OBJECTS_LIST) $(addprefix $(BUILD_PATH)/obj/,$(call c_objects,./src/list/src/,list-))
|
||||
OBJECTS_MAP := $(OBJECTS_BASE) $(OBJECTS_TESTS) $(OBJECTS_MAP) $(addprefix $(BUILD_PATH)/obj/,$(call c_objects,./src/map/src/,map-))
|
||||
OBJECTS_SET := $(OBJECTS_BASE) $(OBJECTS_TESTS) $(OBJECTS_SET) $(addprefix $(BUILD_PATH)/obj/,$(call c_objects,./src/set/src/,set-))
|
||||
OBJECTS_DICT := $(OBJECTS_BASE) $(OBJECTS_TESTS) $(OBJECTS_DICT) $(addprefix $(BUILD_PATH)/obj/,$(call c_objects,./src/dict/src/,dict-))
|
||||
|
||||
########################################################################################################################
|
||||
|
||||
tests: modules
|
||||
tests: $(addprefix $(BUILD_PATH)/array-,$(notdir $(basename $(wildcard ./src/array/*.c))))
|
||||
tests: $(addprefix $(BUILD_PATH)/string-,$(notdir $(basename $(wildcard ./src/string/*.c))))
|
||||
tests: $(addprefix $(BUILD_PATH)/list-,$(notdir $(basename $(wildcard ./src/list/*.c))))
|
||||
tests: $(addprefix $(BUILD_PATH)/map-,$(notdir $(basename $(wildcard ./src/map/*.c))))
|
||||
tests: $(addprefix $(BUILD_PATH)/set-,$(notdir $(basename $(wildcard ./src/set/*.c))))
|
||||
tests: $(addprefix $(BUILD_PATH)/dict-,$(notdir $(basename $(wildcard ./src/dict/*.c))))
|
||||
tests: $(addprefix $(BUILD_PATH)/global-,$(notdir $(basename $(wildcard ./src/global/*.c))))
|
||||
|
||||
|
||||
########################################################################################################################
|
||||
|
||||
$(BUILD_PATH)/obj/%.o: ./src/%.c | $(BUILD_PATH)/obj/
|
||||
$(CC) $^ -o $@ $(CFLAGS)
|
||||
|
||||
$(BUILD_PATH)/obj/array-%.o: ./src/array/src/%.c | $(BUILD_PATH)/obj/
|
||||
$(CC) $^ -o $@ $(CFLAGS)
|
||||
$(BUILD_PATH)/obj/string-%.o: ./src/string/src/%.c | $(BUILD_PATH)/obj/
|
||||
$(CC) $^ -o $@ $(CFLAGS)
|
||||
$(BUILD_PATH)/obj/list-%.o: ./src/list/src/%.c | $(BUILD_PATH)/obj/
|
||||
$(CC) $^ -o $@ $(CFLAGS)
|
||||
$(BUILD_PATH)/obj/map-%.o: ./src/map/src/%.c | $(BUILD_PATH)/obj/
|
||||
$(CC) $^ -o $@ $(CFLAGS)
|
||||
$(BUILD_PATH)/obj/set-%.o: ./src/set/src/%.c | $(BUILD_PATH)/obj/
|
||||
$(CC) $^ -o $@ $(CFLAGS)
|
||||
$(BUILD_PATH)/obj/dict-%.o: ./src/dict/src/%.c | $(BUILD_PATH)/obj/
|
||||
$(CC) $^ -o $@ $(CFLAGS)
|
||||
$(BUILD_PATH)/obj/global-%.o: ./src/global/src/%.c | $(BUILD_PATH)/obj/
|
||||
$(CC) $^ -o $@ $(CFLAGS)
|
||||
|
||||
$(BUILD_PATH)/array-%: ./src/array/%.c $(OBJECTS_ARRAY) | $(BUILD_PATH)/
|
||||
$(CC) $^ -o $@ $(CFLAGS) -g3 -Wall
|
||||
$(BUILD_PATH)/string-%: ./src/string/%.c $(OBJECTS_STRING) | $(BUILD_PATH)/
|
||||
$(CC) $^ -o $@ ../modules/libunic/bin/libunic.a $(CFLAGS) -g3 -Wall
|
||||
$(BUILD_PATH)/list-%: ./src/list/%.c $(OBJECTS_LIST) | $(BUILD_PATH)/
|
||||
$(CC) $^ -o $@ $(CFLAGS) -g3 -Wall
|
||||
$(BUILD_PATH)/map-%: ./src/map/%.c $(OBJECTS_MAP) | $(BUILD_PATH)/
|
||||
$(CC) $^ -o $@ $(CFLAGS) -g3 -Wall
|
||||
$(BUILD_PATH)/set-%: ./src/set/%.c $(OBJECTS_SET) | $(BUILD_PATH)/
|
||||
$(CC) $^ -o $@ $(CFLAGS) -g3 -Wall
|
||||
$(BUILD_PATH)/dict-%: ./src/dict/%.c $(OBJECTS_DICT) | $(BUILD_PATH)/
|
||||
$(CC) $^ -o $@ $(CFLAGS) -g3 -Wall
|
||||
$(BUILD_PATH)/global-%: ./src/global/%.c $(OBJECTS_GLOBAL) | $(BUILD_PATH)/
|
||||
$(CC) $^ ../bin/debug/libcdsb.a ../modules/libunic/bin/libunic.a -o $@ $(CFLAGS) -g3 -Wall
|
||||
|
||||
########################################################################################################################
|
||||
|
||||
$(BUILD_PATH)/:
|
||||
$(MKDIR) $@
|
||||
$(BUILD_PATH)/obj/: | $(BUILD_PATH)/
|
||||
$(MKDIR) $@
|
||||
|
||||
########################################################################################################################
|
||||
|
||||
clean:
|
||||
$(RMRF) ./bin/
|
||||
cd ../ && $(MAKE) clean
|
||||
|
||||
########################################################################################################################
|
||||
|
||||
FORCE:
|
||||
modules: ../bin/debug/libcdsb.a
|
||||
|
||||
../bin/debug/libcdsb.a: FORCE
|
||||
cd ../ && CFLAGS=-DDICT_CAPACITY_BLOCK\=5 $(MAKE) debug
|
37
tests/include/random.h
Normal file
37
tests/include/random.h
Normal file
@ -0,0 +1,37 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../../include/vtype.h"
|
||||
#include "../../src/__internal/vnode.h"
|
||||
|
||||
#ifndef LIBCDSB_TESTS_RANDOM_H
|
||||
#define LIBCDSB_TESTS_RANDOM_H
|
||||
|
||||
typedef struct {
|
||||
var_t value[1];
|
||||
vtype type;
|
||||
} value_t;
|
||||
|
||||
extern int random_init(int argc, char** argv);
|
||||
|
||||
extern vtype_bool random_boolean();
|
||||
extern vtype_float random_float();
|
||||
extern vtype_double random_double();
|
||||
extern vtype_ldouble random_ldouble();
|
||||
|
||||
extern vtype_uint8 random_uint8();
|
||||
extern vtype_uint16 random_uint16();
|
||||
extern vtype_uint32 random_uint32();
|
||||
extern vtype_uint64 random_uint64();
|
||||
|
||||
extern vtype_int8 random_int8();
|
||||
extern vtype_int16 random_int16();
|
||||
extern vtype_int32 random_int32();
|
||||
extern vtype_int64 random_int64();
|
||||
|
||||
extern char random_ascii_char();
|
||||
extern unsigned int random_unicode_symbol();
|
||||
|
||||
extern value_t random_value();
|
||||
|
||||
#endif /* LIBCDSB_TESTS_RANDOM_H */
|
17
tests/include/test.h
Normal file
17
tests/include/test.h
Normal file
@ -0,0 +1,17 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "../../include/extra/vtype.h"
|
||||
|
||||
#ifndef LIBCDSB_TESTS_TEST_H
|
||||
#define LIBCDSB_TESTS_TEST_H
|
||||
|
||||
extern void put_separator(unsigned int hpos);
|
||||
extern void print_container_values_prefix(const char* name, const char* prefix, unsigned int hpos);
|
||||
extern void print_container_value(const ssize_t* index, const void* value, const vtype type, _Bool print_type, unsigned int hpos);
|
||||
extern void print_container_info(const char* name, const char* el_name, const vtype* type, ssize_t size, ssize_t nmemb, unsigned int hpos);
|
||||
|
||||
extern void test_init(int argc, char** argv);
|
||||
|
||||
#endif /* LIBCDSB_TESTS_TEST_H */
|
24
tests/include/time.h
Normal file
24
tests/include/time.h
Normal file
@ -0,0 +1,24 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../../include/vtype.h"
|
||||
|
||||
#ifndef LIBCDSB_TESTS_TIME_H
|
||||
#define LIBCDSB_TESTS_TIME_H
|
||||
|
||||
typedef struct timer {
|
||||
void* info;
|
||||
} TIMER;
|
||||
|
||||
|
||||
extern void timer_init (TIMER* timer);
|
||||
extern void timer_start(TIMER* timer);
|
||||
extern void timer_stop (TIMER* timer);
|
||||
extern void timer_free (TIMER* timer);
|
||||
|
||||
extern vtype_ldouble timer_value(TIMER* timer);
|
||||
|
||||
extern void psleep(unsigned long microsec);
|
||||
|
||||
|
||||
#endif /* LIBCDSB_TESTS_TIME_H */
|
23
tests/src/array/main.c
Normal file
23
tests/src/array/main.c
Normal file
@ -0,0 +1,23 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "plug.h"
|
||||
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
test_init(argc, argv);
|
||||
|
||||
arr_t x = { .mem = 0, .size = 0, .type = random_uint8()%(VTYPE_LDOUBLE + 1) };
|
||||
arr_t y = { .mem = 0, .size = 0, .type = x.type };
|
||||
|
||||
visual_push(&x, (random_uint8()%17) + 16);
|
||||
|
||||
visual_slice(&x, &y);
|
||||
visual_push2(&x, (random_uint8()%5) + 12, &y, (random_uint8()%5) + 12);
|
||||
|
||||
visual_sort2(&x, &y);
|
||||
visual_remove2(&x, &y);
|
||||
|
||||
array_free(&y);
|
||||
array_free(&y);
|
||||
}
|
24
tests/src/array/plug.h
Normal file
24
tests/src/array/plug.h
Normal file
@ -0,0 +1,24 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include <string.h>
|
||||
#include "../../../include/extra/vtype.h"
|
||||
#include "../../../include/extra/array.h"
|
||||
|
||||
#include "../../include/random.h"
|
||||
#include "../../include/test.h"
|
||||
#include "../../include/time.h"
|
||||
|
||||
extern void array_print(arr_t* x, const char* prefix, unsigned int hpos);
|
||||
extern void array_info(arr_t* x, unsigned int hpos);
|
||||
|
||||
extern void visual_push(arr_t* x, size_t n);
|
||||
extern void visual_sort(arr_t* x);
|
||||
extern void visual_remove(arr_t* x);
|
||||
extern void visual_push2(arr_t* x0, size_t n0, arr_t* x1, size_t n1);
|
||||
extern void visual_remove2(arr_t* x0, arr_t* x1);
|
||||
extern void visual_sort2(arr_t* x0, arr_t* x1);
|
||||
extern void visual_slice(arr_t* x, arr_t* s);
|
||||
|
||||
extern void array_push_random (arr_t* x, _Bool silent, unsigned int hpos);
|
||||
extern void array_remove_random(arr_t* x, _Bool silent, unsigned int hpos);
|
197
tests/src/array/src/io.c
Normal file
197
tests/src/array/src/io.c
Normal file
@ -0,0 +1,197 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../plug.h"
|
||||
|
||||
static int array_value_print(void* v, ssize_t i, vtype t, void* _) {
|
||||
print_container_value(&i, v, t, 1, *(unsigned int*)_);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void array_print(arr_t* x, const char* prefix, unsigned int hpos) {
|
||||
print_container_values_prefix("Array", prefix, hpos);
|
||||
array_foreach(x, &hpos, array_value_print);
|
||||
}
|
||||
|
||||
void array_info(arr_t* x, unsigned int hpos) {
|
||||
print_container_info("Array", "nodes", 0, array_size(x), -1, hpos);
|
||||
}
|
||||
|
||||
|
||||
void visual_push(arr_t* x, size_t n) {
|
||||
for (int i = 0; i < n; ++i) {
|
||||
fputs("\e[s", stdout);
|
||||
|
||||
array_push_random(x, 0, 0);
|
||||
|
||||
array_info(x, 0);
|
||||
array_print(x, 0, 0);
|
||||
|
||||
psleep(100000);
|
||||
fputs("\e[u\e[J", stdout);
|
||||
}
|
||||
}
|
||||
|
||||
void visual_sort(arr_t* x) {
|
||||
puts("\e[s\e[36mTry to sort array values:\e[m\n\n");
|
||||
put_separator(0);
|
||||
array_sort(x);
|
||||
array_info(x, 0);
|
||||
array_print(x, "sorted", 0);
|
||||
psleep(900000);
|
||||
fputs("\e[u\e[J", stdout);
|
||||
|
||||
puts("\e[s\e[36mTry to reverse array values:\e[m\n\n");
|
||||
put_separator(0);
|
||||
array_reverse(x);
|
||||
array_info(x, 0);
|
||||
array_print(x, "reversed", 0);
|
||||
psleep(900000);
|
||||
fputs("\e[u\e[J", stdout);
|
||||
}
|
||||
|
||||
void visual_remove(arr_t* x) {
|
||||
while (x->size) {
|
||||
fputs("\e[s", stdout);
|
||||
array_remove_random(x, 0, 0);
|
||||
array_info(x, 0);
|
||||
array_print(x, 0, 0);
|
||||
|
||||
psleep(100000);
|
||||
if (!0) fputs("\e[u\e[J", stdout);
|
||||
}
|
||||
}
|
||||
|
||||
void visual_push2(arr_t* x0, size_t n0, arr_t* x1, size_t n1) {
|
||||
|
||||
for (;n0 || n1;) {
|
||||
fputs("\e[s", stdout);
|
||||
if (n0) {
|
||||
array_push_random(x0, 0, 0);
|
||||
--n0;
|
||||
} else {
|
||||
puts("\n\n");
|
||||
put_separator(0);
|
||||
}
|
||||
|
||||
fputs("\e[u\e[s", stdout);
|
||||
|
||||
if (n1) {
|
||||
array_push_random(x1, 0, 60);
|
||||
--n1;
|
||||
} else {
|
||||
puts("\n\n");
|
||||
put_separator(60);
|
||||
}
|
||||
|
||||
array_info(x0, 0);
|
||||
array_print(x0, 0, 0);
|
||||
fputs("\e[u\e[s\e[4E", stdout);
|
||||
array_info(x1, 60);
|
||||
array_print(x1, 0, 60);
|
||||
psleep(100000);
|
||||
|
||||
fputs("\e[u\e[J", stdout);
|
||||
}
|
||||
}
|
||||
|
||||
void visual_remove2(arr_t* x0, arr_t* x1) {
|
||||
|
||||
for (;x0->size || x1->size;) {
|
||||
fputs("\e[s", stdout);
|
||||
|
||||
if (x0->size) {
|
||||
array_remove_random(x0, 0, 0);
|
||||
} else {
|
||||
puts("\n\n");
|
||||
put_separator(0);
|
||||
}
|
||||
|
||||
fputs("\e[u\e[s", stdout);
|
||||
|
||||
if (x1->size) {
|
||||
array_remove_random(x1, 0, 60);
|
||||
} else {
|
||||
puts("\n\n");
|
||||
put_separator(60);
|
||||
}
|
||||
|
||||
array_info(x0, 0);
|
||||
array_print(x0, 0, 0);
|
||||
fputs("\e[u\e[s\e[4E", stdout);
|
||||
array_info(x1, 60);
|
||||
array_print(x1, 0, 60);
|
||||
psleep(100000);
|
||||
|
||||
fputs("\e[u\e[J", stdout);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void visual_sort2(arr_t* x0, arr_t* x1) {
|
||||
printf("\e[s\e[36m%-60s%s\e[m\n\n","Try to sort array values:", "Try to sort array values:");
|
||||
printf("\e[32;1m%-60s%s\e[m\n", "SUCCESS", "SUCCESS");
|
||||
printf("\e[37;2m%-60s%s\e[m\n", "=== === === === === === === ===", "=== === === === === === === ===");
|
||||
|
||||
array_sort(x0);
|
||||
array_sort(x1);
|
||||
|
||||
array_info(x0, 0);
|
||||
array_print(x0, "sorted", 0);
|
||||
fputs("\e[u\e[s\e[4E", stdout);
|
||||
array_info(x1, 60);
|
||||
array_print(x1, "sorted", 60);
|
||||
|
||||
psleep(900000);
|
||||
fputs("\e[u\e[J", stdout);
|
||||
|
||||
printf("\e[s\e[36m%-60s%s\e[m\n\n","Try to reverse array values:", "Try to reverse array values:");
|
||||
printf("\e[32;1m%-60s%s\e[m\n", "SUCCESS", "SUCCESS");
|
||||
printf("\e[37;2m%-60s%s\e[m\n", "=== === === === === === === ===", "=== === === === === === === ===");
|
||||
|
||||
array_reverse(x0);
|
||||
array_reverse(x1);
|
||||
|
||||
array_info(x0, 0);
|
||||
array_print(x0, "reversed", 0);
|
||||
fputs("\e[u\e[s\e[4E", stdout);
|
||||
array_info(x1, 60);
|
||||
array_print(x1, "reversed", 60);
|
||||
|
||||
psleep(900000);
|
||||
fputs("\e[u\e[J", stdout);
|
||||
}
|
||||
|
||||
void visual_slice(arr_t* x, arr_t* s) {
|
||||
|
||||
size_t n = array_size(x);
|
||||
ssize_t i = random_uint64()%(n - 1);
|
||||
|
||||
n = n - (i + 1);
|
||||
|
||||
puts("\e[s\e[36mTry to slice array:\e[m\n\n");
|
||||
printf("\e[37;2m%-60s%s\e[m\n", "=== === === === === === === ===", "=== === === === === === === ===");
|
||||
|
||||
array_info(x, 0);
|
||||
array_print(x, "(src)", 0);
|
||||
fputs("\e[u\e[s\e[4E", stdout);
|
||||
array_info(s, 60);
|
||||
array_print(s, "(dest)", 60);
|
||||
|
||||
psleep(900000);
|
||||
|
||||
array_slice(s, x, i, n, 1);
|
||||
fputs("\e[u\e[s\e[2E\e[32;1mSUCCESS\e[m\e[J", stdout);
|
||||
|
||||
puts("");
|
||||
put_separator(0);
|
||||
|
||||
array_info(x, 0);
|
||||
array_print(x, "(src)", 0);
|
||||
fputs("\e[u\e[s\e[4E", stdout);
|
||||
array_info(s, 60);
|
||||
array_print(s, "(dest)", 60);
|
||||
psleep(900000);
|
||||
|
||||
fputs("\e[u\e[J", stdout);
|
||||
}
|
36
tests/src/array/src/plug.c
Normal file
36
tests/src/array/src/plug.c
Normal file
@ -0,0 +1,36 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include <string.h>
|
||||
#include "../../../../include/extra/vtype.h"
|
||||
#include "../../../include/random.h"
|
||||
|
||||
vtype_string* string_duplicate(const vtype_string* x) { return 0; }
|
||||
vtype_list* list_duplicate (const vtype_list* x) { return 0; }
|
||||
vtype_map* map_duplicate (const vtype_map* x) { return 0; }
|
||||
vtype_set* vset_duplicate (const vtype_set* x) { return 0; }
|
||||
vtype_dict* dict_duplicate (const vtype_dict* x) { return 0; }
|
||||
|
||||
void string_free(vtype_string* x) {}
|
||||
void list_free (vtype_list* x) {}
|
||||
void map_free (vtype_map* x) {}
|
||||
void vset_free (vtype_set* x) {}
|
||||
void dict_free (vtype_dict* x) {}
|
||||
|
||||
int string_compare(const vtype_string* s0, const vtype_string* s1) { return random_int8(); }
|
||||
int list_compare (const vtype_list* s0, const vtype_list* s1) { return random_int8(); }
|
||||
int map_compare (const vtype_map* s0, const vtype_map* s1) { return random_int8(); }
|
||||
int vset_compare (const vtype_set* s0, const vtype_set* s1) { return random_int8(); }
|
||||
int dict_compare (const vtype_dict* s0, const vtype_dict* s1) { return random_int8(); }
|
||||
|
||||
hash_t string_hash(const vtype_string* s) { return 0; }
|
||||
hash_t list_hash (const vtype_list* s) { return 0; }
|
||||
hash_t map_hash (const vtype_map* s) { return 0; }
|
||||
hash_t vset_hash (const vtype_set* s) { return 0; }
|
||||
hash_t dict_hash (const vtype_dict* s) { return 0; }
|
||||
|
||||
void string_copy_init(vtype_string* x, const vtype_string* s) { memset(x, 0, sizeof(*x)); }
|
||||
void list_copy_init (vtype_list* x, const vtype_list* s) { memset(x, 0, sizeof(*x)); }
|
||||
void map_copy_init (vtype_map* x, const vtype_map* s) { memset(x, 0, sizeof(*x)); }
|
||||
void vset_copy_init (vtype_set* x, const vtype_set* s) { memset(x, 0, sizeof(*x)); }
|
||||
void dict_copy_init (vtype_dict* x, const vtype_dict* s) { memset(x, 0, sizeof(*x)); }
|
83
tests/src/array/src/random.c
Normal file
83
tests/src/array/src/random.c
Normal file
@ -0,0 +1,83 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../plug.h"
|
||||
|
||||
static int remove_callback(void* v, ssize_t i, vtype t, void* _) {
|
||||
struct { arr_t* x; _Bool s; unsigned int p; } *x = _;
|
||||
if (!x->s) print_container_value(0, v, t, 1, x->p);
|
||||
|
||||
if (libcdsb_array_find(x->x, v, t, 0, 0, 1, 1))
|
||||
return -2;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int change_callback(void* v, ssize_t i, vtype t, void* _) {
|
||||
struct { value_t v; _Bool s; unsigned int p; } *x = _;
|
||||
|
||||
while (x->v.type != t) { x->v = random_value(); }
|
||||
|
||||
memcpy(v, &x->v, vtype_size(t));
|
||||
return 0;
|
||||
}
|
||||
|
||||
void array_push_random(arr_t* x, _Bool silent, unsigned int hpos) {
|
||||
|
||||
struct { value_t v; _Bool s; unsigned int p; } _ = { .v = random_value(), .s = silent, .p = hpos };
|
||||
_Bool r;
|
||||
|
||||
if (random_boolean()) {
|
||||
if (!silent) {
|
||||
printf("\e[%dG\e[36mTry to push value to back of the array:\e[m\n", hpos+1);
|
||||
}
|
||||
|
||||
r = libcdsb_array_push(x, _.v.value, _.v.type) >= 0;
|
||||
} else {
|
||||
ssize_t i = array_size(x);
|
||||
|
||||
i = random_uint64() % (i ? i : 1);
|
||||
i = random_boolean() ? ~i + 1 : i ;
|
||||
|
||||
if (!silent) {
|
||||
printf("\e[%dG\e[36mTry to change value in the array with index \e[32;1m%ld\e[36m:\e[m\n", hpos+1, i);
|
||||
}
|
||||
|
||||
r = array_get_by_index(x, i, &_, change_callback) == 0;
|
||||
}
|
||||
|
||||
if (!silent) {
|
||||
print_container_value(0, _.v.value, _.v.type, 1, hpos);
|
||||
printf("\e[%dG%s\n", hpos+1, r ? "\e[32;1mSUCCESS\e[m" : "\e[31;1mFAILURE\e[m");
|
||||
put_separator(hpos);
|
||||
}
|
||||
}
|
||||
|
||||
void array_remove_random(arr_t* x, _Bool silent, unsigned int hpos) {
|
||||
|
||||
size_t n = array_size(x);
|
||||
ssize_t i = random_uint64()%n;
|
||||
|
||||
if (random_boolean()) i = ~i + 1;
|
||||
|
||||
if (random_boolean()) {
|
||||
if (!silent) {
|
||||
printf("\e[%dG\e[36mTry to remove value from list by index:\e[m\n", hpos+1);
|
||||
print_container_value(0, &i, (sizeof(ssize_t) == 8) ? VTYPE_INT64 : VTYPE_INT32, 0, hpos);
|
||||
}
|
||||
switch (array_remove_by_index(x, i)) {
|
||||
case 0: if (!silent) printf("\e[%dG\e[32;1mSUCCESS\e[m\n", hpos+1); break;
|
||||
default: if (!silent) printf("\e[%dG\e[32;1mFAILURE\e[m\n", hpos+1); break;
|
||||
}
|
||||
} else {
|
||||
struct { arr_t* x; _Bool s; unsigned int p; } v = { .x = x, .s = silent, .p = hpos };
|
||||
|
||||
if (!silent) printf("\e[%dG\e[36mTry to remove value from list:\e[m\n", hpos+1);
|
||||
|
||||
switch (libcdsb_array_get(x, i, &v, remove_callback, 0)) {
|
||||
case 0: if (!silent) printf("\e[%dG\e[32;1mSUCCESS\e[m\n", hpos+1); break;
|
||||
default: if (!silent) printf("\e[%dG\e[32;1mFAILURE\e[m\n", hpos+1); break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!silent) put_separator(hpos);
|
||||
}
|
15
tests/src/dict/main.c
Normal file
15
tests/src/dict/main.c
Normal file
@ -0,0 +1,15 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "plug.h"
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
test_init(argc, argv);
|
||||
|
||||
dict_t x;
|
||||
|
||||
dict_init(&x);
|
||||
|
||||
visual_push(&x, random_uint8()%17 + 16);
|
||||
visual_remove(&x);
|
||||
}
|
17
tests/src/dict/plug.h
Normal file
17
tests/src/dict/plug.h
Normal file
@ -0,0 +1,17 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../../../include/extra/dict.h"
|
||||
|
||||
#include "../../include/random.h"
|
||||
#include "../../include/test.h"
|
||||
#include "../../include/time.h"
|
||||
|
||||
extern void dict_push_random(dict_t* x, bool silent, unsigned int hpos);
|
||||
extern void dict_remove_random(dict_t* x, bool silent, unsigned int hpos);
|
||||
|
||||
extern void dict_info(const dict_t* x, unsigned int hpos);
|
||||
extern void dict_print(dict_t* x, const char* prefix, unsigned int hpos);
|
||||
|
||||
extern void visual_push(dict_t* x, size_t n);
|
||||
extern void visual_remove(dict_t* x);
|
47
tests/src/dict/src/io.c
Normal file
47
tests/src/dict/src/io.c
Normal file
@ -0,0 +1,47 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../plug.h"
|
||||
|
||||
static int node_print_callback(const void* k, vtype kt, void* v, vtype vt, void* _) {
|
||||
print_container_value(0, k, kt, 0, *(unsigned int*)_);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void dict_print(dict_t* x, const char* prefix, unsigned int hpos) {
|
||||
print_container_values_prefix("Dict", prefix, 0);
|
||||
dict_foreach(x, &hpos, node_print_callback);
|
||||
put_separator(0);
|
||||
}
|
||||
|
||||
void dict_info(const dict_t* x, unsigned int hpos) {
|
||||
print_container_info("Dict", "nodes", 0, dict_size(x), -1, 0);
|
||||
put_separator(0);
|
||||
}
|
||||
|
||||
void visual_push(dict_t* x, size_t n) {
|
||||
while (n--) {
|
||||
fputs("\e[s", stdout);
|
||||
|
||||
dict_push_random(x, 0, 0);
|
||||
|
||||
dict_info(x, 0);
|
||||
dict_print(x, 0, 0);
|
||||
|
||||
psleep(100000);
|
||||
fputs("\e[u\e[J", stdout);
|
||||
}
|
||||
}
|
||||
|
||||
void visual_remove(dict_t* x) {
|
||||
while (x->size) {
|
||||
fputs("\e[s", stdout);
|
||||
dict_remove_random(x, 0, 0);
|
||||
|
||||
dict_info(x, 0);
|
||||
dict_print(x, 0, 0);
|
||||
|
||||
psleep(100000);
|
||||
fputs("\e[u\e[J", stdout);
|
||||
}
|
||||
}
|
29
tests/src/dict/src/plug.c
Normal file
29
tests/src/dict/src/plug.c
Normal file
@ -0,0 +1,29 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../../../../src/__internal/include.h"
|
||||
#include "../../../include/random.h"
|
||||
|
||||
vtype_string* string_duplicate(const vtype_string* x) { return 0; }
|
||||
vtype_array* array_duplicate (const vtype_array* x) { return 0; }
|
||||
vtype_list* list_duplicate (const vtype_list* x) { return 0; }
|
||||
vtype_map* map_duplicate (const vtype_map* x) { return 0; }
|
||||
vtype_set* vset_duplicate (const vtype_set* x) { return 0; }
|
||||
|
||||
void string_free(vtype_string* x) {}
|
||||
void array_free (vtype_array* x) {}
|
||||
void list_free (vtype_list* x) {}
|
||||
void map_free (vtype_map* x) {}
|
||||
void vset_free (vtype_set* x) {}
|
||||
|
||||
int string_compare(const vtype_string* s0, const vtype_string* s1) { return random_int8(); }
|
||||
int array_compare (const vtype_array* s0, const vtype_array* s1) { return random_int8(); }
|
||||
int list_compare (const vtype_list* s0, const vtype_list* s1) { return random_int8(); }
|
||||
int map_compare (const vtype_map* s0, const vtype_map* s1) { return random_int8(); }
|
||||
int vset_compare (const vtype_set* s0, const vtype_set* s1) { return random_int8(); }
|
||||
|
||||
hash_t string_hash(const vtype_string* s) { return 0; }
|
||||
hash_t array_hash (const vtype_array* s) { return 0; }
|
||||
hash_t list_hash (const vtype_list* s) { return 0; }
|
||||
hash_t map_hash (const vtype_map* s) { return 0; }
|
||||
hash_t vset_hash (const vtype_set* s) { return 0; }
|
53
tests/src/dict/src/random.c
Normal file
53
tests/src/dict/src/random.c
Normal file
@ -0,0 +1,53 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../plug.h"
|
||||
|
||||
static int remove_callback(const void* k, vtype kt, void* v, vtype vt, void* _) {
|
||||
struct { size_t n; dict_t* x; unsigned int hp; } *d = _;
|
||||
|
||||
if (!d->n--) {
|
||||
print_container_value(0, k, kt, 0, d->hp);
|
||||
|
||||
if (libcdsb_dict_find(d->x, k, kt, 0, 0, 1) == 0) {
|
||||
printf("\e[%dG\e[32;1mSUCCESS\e[m\n", d->hp+1);
|
||||
} else printf("\e[%dG\e[31;1mFAILURE\e[m\n", d->hp+1);
|
||||
|
||||
return -2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void dict_push_random(dict_t* x, _Bool silent, unsigned int hpos) {
|
||||
|
||||
value_t k = random_value();
|
||||
value_t v = random_value();
|
||||
|
||||
if (!silent) {
|
||||
printf("\e[%dG\e[36mUpdate value in dict with key:\e[m\n", hpos+1);
|
||||
print_container_value(0, k.value, k.type, 1, hpos);
|
||||
}
|
||||
|
||||
if (libcdsb_dict_update(x, k.value, k.type, v.value, v.type)) {
|
||||
if (!silent) printf("\e[%dG\e[33;1mCHANGE\e[m\n", hpos+1);
|
||||
} else if (!silent) printf("\e[%dG\e[32;1mINSERT\e[m\n", hpos+1);
|
||||
|
||||
if (!silent) put_separator(0);
|
||||
}
|
||||
|
||||
|
||||
void dict_remove_random(dict_t* x, _Bool silent, unsigned int hpos) {
|
||||
struct { size_t n; dict_t* x; unsigned int hp; } d = { .n = dict_size(x), .x = x, .hp = hpos };
|
||||
|
||||
if (!silent)
|
||||
printf("\e[%dG\e[36mTry to remove value from dict by key:\e[m\n", hpos+1);
|
||||
|
||||
if (d.n) {
|
||||
d.n = random_uint32()%d.n;
|
||||
dict_foreach(x, &d, remove_callback);
|
||||
} else if (!silent) {
|
||||
printf("\e[%dG\e[32;1m\nFAILURE\e[m\n", hpos+1);
|
||||
}
|
||||
|
||||
if (!silent) put_separator(hpos);
|
||||
}
|
34
tests/src/global/main.c
Normal file
34
tests/src/global/main.c
Normal file
@ -0,0 +1,34 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "plug.h"
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
test_init(argc, argv);
|
||||
|
||||
value_t x = random_container(0);
|
||||
|
||||
switch (x.type) {
|
||||
default: abort();
|
||||
case VTYPE_ARRAY:
|
||||
array_info((void*)x.value, 0);
|
||||
array_free((void*)x.value);
|
||||
return 0;
|
||||
case VTYPE_MAP:
|
||||
map_info((void*)x.value, 0);
|
||||
map_free((void*)x.value);
|
||||
return 0;
|
||||
case VTYPE_LIST:
|
||||
list_info((void*)x.value, 0);
|
||||
list_free((void*)x.value);
|
||||
return 0;
|
||||
case VTYPE_SET:
|
||||
vset_info((void*)x.value, 0);
|
||||
vset_free((void*)x.value);
|
||||
return 0;
|
||||
case VTYPE_DICT:
|
||||
dict_info((void*)x.value, 0);
|
||||
dict_free((void*)x.value);
|
||||
return 0;
|
||||
}
|
||||
}
|
23
tests/src/global/plug.h
Normal file
23
tests/src/global/plug.h
Normal file
@ -0,0 +1,23 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../../../include/extra/string.h"
|
||||
#include "../../../include/extra/array.h"
|
||||
#include "../../../include/extra/list.h"
|
||||
#include "../../../include/extra/set.h"
|
||||
#include "../../../include/extra/map.h"
|
||||
#include "../../../include/extra/dict.h"
|
||||
|
||||
#include "../../include/random.h"
|
||||
#include "../../include/test.h"
|
||||
#include "../../include/time.h"
|
||||
|
||||
extern value_t random_container(bool embd);
|
||||
extern value_t real_random_value(bool embd);
|
||||
|
||||
extern void array_info(arr_t* x, unsigned int hpos);
|
||||
extern void list_info (list_t* x, unsigned int hpos);
|
||||
extern void dict_info(const dict_t* x, unsigned int hpos);
|
||||
extern void map_info(const map_t* x, unsigned int hpos);
|
||||
extern void vset_info(const set_t* x, unsigned int hpos);
|
||||
extern void string_info(str_t* x);
|
33
tests/src/global/src/io.c
Normal file
33
tests/src/global/src/io.c
Normal file
@ -0,0 +1,33 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../plug.h"
|
||||
|
||||
void map_info(const map_t* x, unsigned int hpos) {
|
||||
print_container_info("Map", "nodes", &x->type, map_size(x), -1, 0);
|
||||
put_separator(0);
|
||||
}
|
||||
|
||||
void array_info(arr_t* x, unsigned int hpos) {
|
||||
print_container_info("Array", "nodes", 0, array_size(x), -1, hpos);
|
||||
}
|
||||
|
||||
|
||||
void dict_info(const dict_t* x, unsigned int hpos) {
|
||||
print_container_info("Dict", "nodes", 0, dict_size(x), -1, 0);
|
||||
put_separator(0);
|
||||
}
|
||||
|
||||
void list_info(list_t* x, unsigned int hpos) {
|
||||
print_container_info("List", "nodes", 0, list_size(x), -1, hpos);
|
||||
}
|
||||
|
||||
void vset_info(const set_t* x, unsigned int hpos) {
|
||||
print_container_info("Set", "nodes", &x->type, vset_size(x), -1, 0);
|
||||
put_separator(0);
|
||||
}
|
||||
|
||||
void string_info(str_t* x) {
|
||||
print_container_info("String", "utf8 chars", 0, string_size(x), string_nmemb(x), 0);
|
||||
put_separator(0);
|
||||
}
|
265
tests/src/global/src/random.c
Normal file
265
tests/src/global/src/random.c
Normal file
@ -0,0 +1,265 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../plug.h"
|
||||
|
||||
#define MAX_ELEMENTS 2000
|
||||
|
||||
static arr_t random_array(bool embd);
|
||||
static list_t random_list (bool embd);
|
||||
static set_t random_set (bool embd);
|
||||
static map_t random_map (bool embd);
|
||||
static dict_t random_dict (bool embd);
|
||||
|
||||
static str_t random_string() {
|
||||
str_t x;
|
||||
size_t n = random_uint16()%MAX_ELEMENTS;
|
||||
|
||||
string_init(&x, 0);
|
||||
|
||||
while (n--) {
|
||||
string_concat(&x, random_unicode_symbol());
|
||||
}
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
static value_t random_value2() {
|
||||
value_t v;
|
||||
switch (random_uint8()%14) {
|
||||
default:
|
||||
case 0: v.value[0].b = random_boolean(); v.type = VTYPE_BOOLEAN; break;
|
||||
case 1: v.value[0].u8 = random_uint8 (); v.type = VTYPE_UINT8; break;
|
||||
case 2: v.value[0].u16 = random_uint16 (); v.type = VTYPE_UINT16; break;
|
||||
case 3: v.value[0].u32 = random_uint32 (); v.type = VTYPE_UINT32; break;
|
||||
case 4: v.value[0].u64 = random_uint64 (); v.type = VTYPE_UINT64; break;
|
||||
case 5: v.value[0].u8 = random_int8 (); v.type = VTYPE_INT8; break;
|
||||
case 6: v.value[0].u16 = random_uint16 (); v.type = VTYPE_INT16; break;
|
||||
case 7: v.value[0].u32 = random_int32 (); v.type = VTYPE_INT32; break;
|
||||
case 8: v.value[0].u64 = random_int64 (); v.type = VTYPE_INT64; break;
|
||||
case 9: v.value[0].f = random_float (); v.type = VTYPE_FLOAT; break;
|
||||
case 10: v.value[0].d = random_double (); v.type = VTYPE_DOUBLE; break;
|
||||
case 11: v.value[0].ld = random_ldouble(); v.type = VTYPE_LDOUBLE; break;
|
||||
case 12: v.value[0].ptr = (void*)(uintptr_t)random_uint64(); v.type = VTYPE_POINTER; break;
|
||||
case 13: v.value[0].s = random_string(); v.type = VTYPE_STRING; break;
|
||||
}
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
static value_t random_value_by_type(vtype type, bool embd) {
|
||||
value_t v;
|
||||
switch ((v.type = type)) {
|
||||
default:
|
||||
case VTYPE_BOOLEAN: v.value[0].b = random_boolean(); break;
|
||||
case VTYPE_UINT8: v.value[0].u8 = random_uint8 (); break;
|
||||
case VTYPE_UINT16: v.value[0].u16 = random_uint16 (); break;
|
||||
case VTYPE_UINT32: v.value[0].u32 = random_uint32 (); break;
|
||||
case VTYPE_UINT64: v.value[0].u64 = random_uint64 (); break;
|
||||
case VTYPE_INT8: v.value[0].u8 = random_int8 (); break;
|
||||
case VTYPE_INT16: v.value[0].u16 = random_uint16 (); break;
|
||||
case VTYPE_INT32: v.value[0].u32 = random_int32 (); break;
|
||||
case VTYPE_INT64: v.value[0].u64 = random_int64 (); break;
|
||||
case VTYPE_FLOAT: v.value[0].f = random_float (); break;
|
||||
case VTYPE_DOUBLE: v.value[0].d = random_double (); break;
|
||||
case VTYPE_LDOUBLE: v.value[0].ld = random_ldouble(); break;
|
||||
case VTYPE_STRING: v.value[0].s = random_string(); break;
|
||||
case VTYPE_ARRAY: v.value[0].a = random_array(embd); break;
|
||||
case VTYPE_MAP: v.value[0].m = random_map (embd); break;
|
||||
case VTYPE_DICT: v.value[0].vd = random_dict (embd); break;
|
||||
case VTYPE_LIST: v.value[0].l = random_list (embd); break;
|
||||
case VTYPE_SET: v.value[0].vs = random_set (embd); break;
|
||||
case VTYPE_POINTER: v.value[0].ptr = (void*)(uintptr_t)random_uint64(); break;
|
||||
}
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
static arr_t random_array(bool embd) {
|
||||
arr_t x;
|
||||
size_t n = random_uint16()%((!embd)?MAX_ELEMENTS:100);
|
||||
value_t v = (!embd) ? random_value2() : real_random_value(1);
|
||||
|
||||
void (*callback)(void*);
|
||||
|
||||
switch (v.type) {
|
||||
default: callback = nullptr; break;
|
||||
case VTYPE_STRING: callback = (void*)string_free; break;
|
||||
case VTYPE_ARRAY: callback = (void*)array_free; break;
|
||||
case VTYPE_LIST: callback = (void*)list_free; break;
|
||||
case VTYPE_MAP: callback = (void*)map_free; break;
|
||||
case VTYPE_SET: callback = (void*)vset_free; break;
|
||||
case VTYPE_DICT: callback = (void*)dict_free; break;
|
||||
}
|
||||
|
||||
array_init(&x, v.type);
|
||||
|
||||
while(n--) {
|
||||
|
||||
libcdsb_array_push(&x, v.value, v.type);
|
||||
|
||||
if (callback) callback(v.value);
|
||||
|
||||
v = random_value_by_type(v.type, 1);
|
||||
}
|
||||
|
||||
if (callback) callback(v.value);
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
static set_t random_set(bool embd) {
|
||||
set_t x;
|
||||
size_t n = random_uint16()%((!embd)?MAX_ELEMENTS:100);
|
||||
value_t v = (!embd) ? random_value2() : real_random_value(1);
|
||||
|
||||
void (*callback)(void*);
|
||||
|
||||
switch (v.type) {
|
||||
default: callback = nullptr; break;
|
||||
case VTYPE_STRING: callback = (void*)string_free; break;
|
||||
case VTYPE_ARRAY: callback = (void*)array_free; break;
|
||||
case VTYPE_LIST: callback = (void*)list_free; break;
|
||||
case VTYPE_MAP: callback = (void*)map_free; break;
|
||||
case VTYPE_SET: callback = (void*)vset_free; break;
|
||||
case VTYPE_DICT: callback = (void*)dict_free; break;
|
||||
}
|
||||
|
||||
vset_init(&x, v.type);
|
||||
|
||||
while(n--) {
|
||||
|
||||
libcdsb_vset_insert(&x, v.value, v.type);
|
||||
|
||||
if (callback) callback(v.value);
|
||||
|
||||
v = random_value_by_type(v.type, 1);
|
||||
}
|
||||
|
||||
if (callback) callback(v.value);
|
||||
return x;
|
||||
}
|
||||
|
||||
static list_t random_list(bool embd) {
|
||||
list_t x;
|
||||
value_t v;
|
||||
size_t n = random_uint16()%((!embd)?MAX_ELEMENTS:100);
|
||||
|
||||
list_init(&x);
|
||||
|
||||
while(n--) {
|
||||
v = (!embd) ? random_value2() : real_random_value(1);
|
||||
libcdsb_list_update(&x, -1, v.value, v.type, 1);
|
||||
|
||||
switch (v.type) {
|
||||
default: break;
|
||||
case VTYPE_STRING: string_free((void*)v.value); break;
|
||||
case VTYPE_ARRAY: array_free ((void*)v.value); break;
|
||||
case VTYPE_LIST: list_free ((void*)v.value); break;
|
||||
case VTYPE_MAP: map_free ((void*)v.value); break;
|
||||
case VTYPE_SET: vset_free ((void*)v.value); break;
|
||||
case VTYPE_DICT: dict_free ((void*)v.value); break;
|
||||
}
|
||||
}
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
static map_t random_map(bool embd) {
|
||||
map_t x;
|
||||
size_t n = random_uint16()%((!embd)?MAX_ELEMENTS:100);
|
||||
value_t k = (!embd) ? random_value2() : real_random_value(1);
|
||||
|
||||
void (*callback)(void*);
|
||||
|
||||
switch (k.type) {
|
||||
default: callback = nullptr; break;
|
||||
case VTYPE_STRING: callback = (void*)string_free; break;
|
||||
case VTYPE_ARRAY: callback = (void*)array_free; break;
|
||||
case VTYPE_LIST: callback = (void*)list_free; break;
|
||||
case VTYPE_MAP: callback = (void*)map_free; break;
|
||||
case VTYPE_SET: callback = (void*)vset_free; break;
|
||||
case VTYPE_DICT: callback = (void*)dict_free; break;
|
||||
}
|
||||
|
||||
map_init(&x, k.type);
|
||||
|
||||
while(n--) {
|
||||
value_t v = (!embd) ? random_value2() : real_random_value(1);
|
||||
|
||||
libcdsb_map_update(&x, k.value, k.type, v.value, v.type);
|
||||
|
||||
if (callback) callback(k.value);
|
||||
|
||||
switch (v.type) {
|
||||
default: break;
|
||||
case VTYPE_STRING: string_free((void*)v.value); break;
|
||||
case VTYPE_ARRAY: array_free ((void*)v.value); break;
|
||||
case VTYPE_LIST: list_free ((void*)v.value); break;
|
||||
case VTYPE_MAP: map_free ((void*)v.value); break;
|
||||
case VTYPE_SET: vset_free ((void*)v.value); break;
|
||||
case VTYPE_DICT: dict_free ((void*)v.value); break;
|
||||
}
|
||||
|
||||
k = random_value_by_type(k.type, 1);
|
||||
}
|
||||
|
||||
if (callback) callback(k.value);
|
||||
return x;
|
||||
|
||||
}
|
||||
|
||||
static dict_t random_dict(bool embd) {
|
||||
dict_t x;
|
||||
value_t k, v;
|
||||
size_t n = random_uint16()%((!embd)?MAX_ELEMENTS:100);
|
||||
|
||||
dict_init(&x);
|
||||
|
||||
while(n--) {
|
||||
k = (!embd) ? random_value2() : real_random_value(1);
|
||||
v = (!embd) ? random_value2() : real_random_value(1);
|
||||
libcdsb_dict_update(&x, k.value, k.type, v.value, v.type);
|
||||
|
||||
switch (v.type) {
|
||||
default: break;
|
||||
case VTYPE_STRING: string_free((void*)v.value); break;
|
||||
case VTYPE_ARRAY: array_free ((void*)v.value); break;
|
||||
case VTYPE_LIST: list_free ((void*)v.value); break;
|
||||
case VTYPE_MAP: map_free ((void*)v.value); break;
|
||||
case VTYPE_SET: vset_free ((void*)v.value); break;
|
||||
case VTYPE_DICT: dict_free ((void*)v.value); break;
|
||||
}
|
||||
|
||||
switch (k.type) {
|
||||
default: break;
|
||||
case VTYPE_STRING: string_free((void*)k.value); break;
|
||||
case VTYPE_ARRAY: array_free ((void*)k.value); break;
|
||||
case VTYPE_LIST: list_free ((void*)k.value); break;
|
||||
case VTYPE_MAP: map_free ((void*)k.value); break;
|
||||
case VTYPE_SET: vset_free ((void*)k.value); break;
|
||||
case VTYPE_DICT: dict_free ((void*)k.value); break;
|
||||
}
|
||||
}
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
value_t random_container(bool embd) {
|
||||
value_t v;
|
||||
|
||||
switch (random_uint8()%5) {
|
||||
default:
|
||||
case 0: v.value[0].a = random_array(embd); v.type = VTYPE_ARRAY; break;
|
||||
case 1: v.value[0].m = random_map (embd); v.type = VTYPE_MAP; break;
|
||||
case 2: v.value[0].vd = random_dict (embd); v.type = VTYPE_DICT; break;
|
||||
case 3: v.value[0].l = random_list (embd); v.type = VTYPE_LIST; break;
|
||||
case 4: v.value[0].vs = random_set (embd); v.type = VTYPE_SET; break;
|
||||
}
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
value_t real_random_value(bool embd) {
|
||||
return random_boolean() ? random_value2() : random_container(embd);
|
||||
}
|
23
tests/src/list/main.c
Normal file
23
tests/src/list/main.c
Normal file
@ -0,0 +1,23 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "plug.h"
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
test_init(argc, argv);
|
||||
|
||||
list_t x = { .first = 0, .last = 0 };
|
||||
list_t y = { .first = 0, .last = 0 };
|
||||
|
||||
visual_push(&x, (random_uint8()%9) + 8);
|
||||
visual_slice(&x, &y);
|
||||
|
||||
visual_push2(&x, (random_uint8()%5) + 12, &y, (random_uint8()%3) + 6);
|
||||
visual_extend(&x, &y);
|
||||
|
||||
visual_sort2(&x, &y);
|
||||
visual_remove2(&x, &y);
|
||||
|
||||
list_free(&y);
|
||||
list_free(&y);
|
||||
}
|
26
tests/src/list/plug.h
Normal file
26
tests/src/list/plug.h
Normal file
@ -0,0 +1,26 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../../../include/extra/list.h"
|
||||
|
||||
#include "../../include/random.h"
|
||||
#include "../../include/test.h"
|
||||
#include "../../include/time.h"
|
||||
|
||||
#include "../../../src/__internal/vnode.h"
|
||||
|
||||
extern void list_print(list_t* x, const char* prefix, unsigned int hpos);
|
||||
extern void list_info (list_t* x, unsigned int hpos);
|
||||
|
||||
extern void list_push_random(list_t* x, _Bool silent, unsigned int hpos);
|
||||
extern void list_remove_random(list_t* x, _Bool silent, unsigned int hpos);
|
||||
|
||||
extern void visual_push(list_t* x, size_t n);
|
||||
extern void visual_sort(list_t* x);
|
||||
extern void visual_remove(list_t* x);
|
||||
|
||||
extern void visual_push2(list_t* x0, size_t n0, list_t* x1, size_t n1);
|
||||
extern void visual_remove2(list_t* x0, list_t* x1);
|
||||
extern void visual_sort2(list_t* x0, list_t* x1);
|
||||
extern void visual_extend(list_t* x, list_t* s);
|
||||
extern void visual_slice(list_t* x, list_t* s);
|
222
tests/src/list/src/io.c
Normal file
222
tests/src/list/src/io.c
Normal file
@ -0,0 +1,222 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../plug.h"
|
||||
|
||||
static int list_node_print(void* v, ssize_t i, vtype t, void* _) {
|
||||
print_container_value(&i, v, t, 1, *(unsigned int*)_);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void list_print(list_t* x, const char* prefix, unsigned int hpos) {
|
||||
print_container_values_prefix("List", prefix, hpos);
|
||||
list_foreach(x, &hpos, list_node_print);
|
||||
}
|
||||
|
||||
void list_info(list_t* x, unsigned int hpos) {
|
||||
print_container_info("List", "nodes", 0, list_size(x), -1, hpos);
|
||||
}
|
||||
|
||||
void visual_push(list_t* x, size_t n) {
|
||||
for (int i = 0; i < n; ++i) {
|
||||
fputs("\e[s", stdout);
|
||||
|
||||
list_push_random(x, 0, 0);
|
||||
|
||||
list_info(x, 0);
|
||||
list_print(x, 0, 0);
|
||||
|
||||
psleep(100000);
|
||||
fputs("\e[u\e[J", stdout);
|
||||
}
|
||||
}
|
||||
|
||||
void visual_sort(list_t* x) {
|
||||
puts("\e[s\e[36mTry to sort list values:\e[m\n\n");
|
||||
put_separator(0);
|
||||
list_sort(x);
|
||||
list_info(x, 0);
|
||||
list_print(x, "sorted", 0);
|
||||
psleep(900000);
|
||||
fputs("\e[u\e[J", stdout);
|
||||
|
||||
puts("\e[s\e[36mTry to reverse list values:\e[m\n\n");
|
||||
put_separator(0);
|
||||
list_reverse(x);
|
||||
list_info(x, 0);
|
||||
list_print(x, "reversed", 0);
|
||||
psleep(900000);
|
||||
fputs("\e[u\e[J", stdout);
|
||||
}
|
||||
|
||||
void visual_remove(list_t* x) {
|
||||
while (x->first) {
|
||||
fputs("\e[s", stdout);
|
||||
list_remove_random(x, 0, 0);
|
||||
list_info(x, 0);
|
||||
list_print(x, 0, 0);
|
||||
|
||||
psleep(100000);
|
||||
fputs("\e[u\e[J", stdout);
|
||||
}
|
||||
}
|
||||
|
||||
void visual_push2(list_t* x0, size_t n0, list_t* x1, size_t n1) {
|
||||
|
||||
for (;n0 || n1;) {
|
||||
fputs("\e[s", stdout);
|
||||
if (n0) {
|
||||
list_push_random(x0, 0, 0);
|
||||
--n0;
|
||||
} else {
|
||||
puts("\n\n");
|
||||
put_separator(0);
|
||||
}
|
||||
|
||||
fputs("\e[u\e[s", stdout);
|
||||
|
||||
if (n1) {
|
||||
list_push_random(x1, 0, 60);
|
||||
--n1;
|
||||
} else {
|
||||
puts("\n\n");
|
||||
put_separator(60);
|
||||
}
|
||||
|
||||
list_info(x0, 0);
|
||||
list_print(x0, 0, 0);
|
||||
fputs("\e[u\e[s\e[4E", stdout);
|
||||
list_info(x1, 60);
|
||||
list_print(x1, 0, 60);
|
||||
psleep(100000);
|
||||
|
||||
fputs("\e[u\e[J", stdout);
|
||||
}
|
||||
}
|
||||
|
||||
void visual_remove2(list_t* x0, list_t* x1) {
|
||||
|
||||
for (;x0->first || x1->first;) {
|
||||
fputs("\e[s", stdout);
|
||||
|
||||
if (x0->first) {
|
||||
list_remove_random(x0, 0, 0);
|
||||
} else {
|
||||
puts("\n\n");
|
||||
put_separator(0);
|
||||
}
|
||||
|
||||
fputs("\e[u\e[s", stdout);
|
||||
|
||||
if (x1->first) {
|
||||
list_remove_random(x1, 0, 60);
|
||||
} else {
|
||||
puts("\n\n");
|
||||
put_separator(60);
|
||||
}
|
||||
|
||||
list_info(x0, 0);
|
||||
list_print(x0, 0, 0);
|
||||
fputs("\e[u\e[s\e[4E", stdout);
|
||||
list_info(x1, 60);
|
||||
list_print(x1, 0, 60);
|
||||
psleep(100000);
|
||||
|
||||
fputs("\e[u\e[J", stdout);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void visual_sort2(list_t* x0, list_t* x1) {
|
||||
printf("\e[s\e[36m%-60s%s\e[m\n\n","Try to sort list values:", "Try to sort list values:");
|
||||
printf("\e[32;1m%-60s%s\e[m\n", "SUCCESS", "SUCCESS");
|
||||
printf("\e[37;2m%-60s%s\e[m\n", "=== === === === === === === ===", "=== === === === === === === ===");
|
||||
|
||||
list_sort(x0);
|
||||
list_sort(x1);
|
||||
|
||||
list_info(x0, 0);
|
||||
list_print(x0, "sorted", 0);
|
||||
fputs("\e[u\e[s\e[4E", stdout);
|
||||
list_info(x1, 60);
|
||||
list_print(x1, "sorted", 60);
|
||||
|
||||
psleep(900000);
|
||||
fputs("\e[u\e[J", stdout);
|
||||
|
||||
printf("\e[s\e[36m%-60s%s\e[m\n\n","Try to reverse list values:", "Try to reverse list values:");
|
||||
printf("\e[32;1m%-60s%s\e[m\n", "SUCCESS", "SUCCESS");
|
||||
printf("\e[37;2m%-60s%s\e[m\n", "=== === === === === === === ===", "=== === === === === === === ===");
|
||||
|
||||
list_reverse(x0);
|
||||
list_reverse(x1);
|
||||
|
||||
list_info(x0, 0);
|
||||
list_print(x0, "reversed", 0);
|
||||
fputs("\e[u\e[s\e[4E", stdout);
|
||||
list_info(x1, 60);
|
||||
list_print(x1, "reversed", 60);
|
||||
|
||||
psleep(900000);
|
||||
fputs("\e[u\e[J", stdout);
|
||||
}
|
||||
|
||||
void visual_extend(list_t* x, list_t* s) {
|
||||
|
||||
puts("\e[s\e[36mTry to extend list:\e[m\n\n");
|
||||
printf("\e[37;2m%-60s%s\e[m\n", "=== === === === === === === ===", "=== === === === === === === ===");
|
||||
|
||||
list_info(x, 0);
|
||||
list_print(x, "(dest)", 0);
|
||||
fputs("\e[u\e[s\e[4E", stdout);
|
||||
list_info(s, 60);
|
||||
list_print(s, "(src)", 60);
|
||||
|
||||
psleep(900000);
|
||||
fputs("\e[u\e[s\e[2E\e[32;1mSUCCESS\e[m\e[J", stdout);
|
||||
|
||||
list_extend(x, s);
|
||||
|
||||
puts("");
|
||||
put_separator(0);
|
||||
|
||||
list_info(x, 0);
|
||||
list_print(x, "(dest)", 0);
|
||||
psleep(900000);
|
||||
fputs("\e[u\e[J", stdout);
|
||||
}
|
||||
|
||||
|
||||
void visual_slice(list_t* x, list_t* s) {
|
||||
|
||||
size_t n = list_size(x);
|
||||
ssize_t i = random_uint64()%(n - 1);
|
||||
|
||||
n = n - (i + 1);
|
||||
|
||||
puts("\e[s\e[36mTry to slice list:\e[m\n\n");
|
||||
printf("\e[37;2m%-60s%s\e[m\n", "=== === === === === === === ===", "=== === === === === === === ===");
|
||||
|
||||
list_info(x, 0);
|
||||
list_print(x, "(src)", 0);
|
||||
fputs("\e[u\e[s\e[4E", stdout);
|
||||
list_info(s, 60);
|
||||
list_print(s, "(dest)", 60);
|
||||
|
||||
psleep(900000);
|
||||
|
||||
list_slice(s, x, i, n, 1);
|
||||
fputs("\e[u\e[s\e[2E\e[32;1mSUCCESS\e[m\e[J", stdout);
|
||||
|
||||
puts("");
|
||||
put_separator(0);
|
||||
|
||||
list_info(x, 0);
|
||||
list_print(x, "(src)", 0);
|
||||
fputs("\e[u\e[s\e[4E", stdout);
|
||||
list_info(s, 60);
|
||||
list_print(s, "(dest)", 60);
|
||||
psleep(900000);
|
||||
|
||||
fputs("\e[u\e[J", stdout);
|
||||
}
|
29
tests/src/list/src/plug.c
Normal file
29
tests/src/list/src/plug.c
Normal file
@ -0,0 +1,29 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../../../../src/__internal/include.h"
|
||||
#include "../../../include/random.h"
|
||||
|
||||
vtype_string* string_duplicate(const vtype_string* x) { return 0; }
|
||||
vtype_array* array_duplicate (const vtype_array* x) { return 0; }
|
||||
vtype_map* map_duplicate (const vtype_map* x) { return 0; }
|
||||
vtype_set* vset_duplicate (const vtype_set* x) { return 0; }
|
||||
vtype_dict* dict_duplicate (const vtype_dict* x) { return 0; }
|
||||
|
||||
void string_free(vtype_string* x) {}
|
||||
void array_free (vtype_array* x) {}
|
||||
void map_free (vtype_map* x) {}
|
||||
void vset_free (vtype_set* x) {}
|
||||
void dict_free (vtype_dict* x) {}
|
||||
|
||||
int string_compare(const vtype_string* s0, const vtype_string* s1) { return random_int8(); }
|
||||
int array_compare (const vtype_array* s0, const vtype_array* s1) { return random_int8(); }
|
||||
int map_compare (const vtype_map* s0, const vtype_map* s1) { return random_int8(); }
|
||||
int vset_compare (const vtype_set* s0, const vtype_set* s1) { return random_int8(); }
|
||||
int dict_compare (const vtype_dict* s0, const vtype_dict* s1) { return random_int8(); }
|
||||
|
||||
hash_t string_hash(const vtype_string* s) { return 0; }
|
||||
hash_t array_hash (const vtype_array* s) { return 0; }
|
||||
hash_t map_hash (const vtype_map* s) { return 0; }
|
||||
hash_t vset_hash (const vtype_set* s) { return 0; }
|
||||
hash_t dict_hash (const vtype_dict* s) { return 0; }
|
82
tests/src/list/src/random.c
Normal file
82
tests/src/list/src/random.c
Normal file
@ -0,0 +1,82 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../plug.h"
|
||||
|
||||
static int remove_callback(void* v, ssize_t i, vtype t, void* _) {
|
||||
struct { list_t* x; _Bool s; unsigned int p; } *x = _;
|
||||
if (!x->s) {
|
||||
print_container_value(0, v, t, 1, x->p);
|
||||
}
|
||||
|
||||
if (libcdsb_list_find(x->x, v, t, 0, 0, 1, 1)) {
|
||||
return -2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void list_push_random(list_t* x, _Bool silent, unsigned int hpos) {
|
||||
|
||||
value_t v = random_value();
|
||||
_Bool r;
|
||||
|
||||
if (random_boolean()) {
|
||||
if (!silent) {
|
||||
printf("\e[%dG\e[36mTry to push value to back of the list:\e[m\n", hpos+1);
|
||||
}
|
||||
r = libcdsb_list_update(x, -1, v.value, v.type, 1);
|
||||
} else if (random_boolean()) {
|
||||
if (!silent) {
|
||||
printf("\e[%dG\e[36mTry to push value to front of the list:\e[m\n", hpos+1);
|
||||
}
|
||||
r = libcdsb_list_update(x, -1, v.value, v.type, 1);
|
||||
} else {
|
||||
ssize_t i = list_size(x);
|
||||
i = random_uint64()% (i ? i : 1);
|
||||
if (random_boolean()) i = ~i + 1;
|
||||
|
||||
if (!silent) {
|
||||
printf("\e[%dG\e[36mTry to change value with index \e[32;1m%ld\e[36m in the list:\e[m\n", hpos+1, i);
|
||||
}
|
||||
|
||||
r = libcdsb_list_update(x, i, v.value, v.type, 0);
|
||||
}
|
||||
|
||||
if (!silent) {
|
||||
print_container_value(0, v.value, v.type, 1, hpos);
|
||||
printf("\e[%dG%s\n", hpos+1, r ? "\e[32;1mSUCCESS\e[m" : "\e[31;1mFAILURE\e[m");
|
||||
put_separator(hpos);
|
||||
}
|
||||
}
|
||||
|
||||
void list_remove_random(list_t* x, _Bool silent, unsigned int hpos) {
|
||||
|
||||
size_t n = list_size(x);
|
||||
ssize_t i = random_uint64()%n;
|
||||
|
||||
if (random_boolean()) i = ~i + 1;
|
||||
|
||||
if (random_boolean()) {
|
||||
if (!silent) {
|
||||
printf("\e[%dG\e[36mTry to remove value from list by index:\e[m\n", hpos+1);
|
||||
print_container_value(0, &i, (sizeof(ssize_t) == 8) ? VTYPE_INT64 : VTYPE_INT32, 0, hpos);
|
||||
}
|
||||
switch (list_remove_by_index(x, i)) {
|
||||
case 0: if (!silent) printf("\e[%dG\e[32;1mSUCCESS\e[m\n", hpos+1); break;
|
||||
default: if (!silent) printf("\e[%dG\e[32;1mFAILURE\e[m\n", hpos+1); break;
|
||||
}
|
||||
} else {
|
||||
struct { list_t* x; _Bool s; unsigned int p; } v = { .x = x, .s = silent, .p = hpos };
|
||||
|
||||
if (!silent) printf("\e[%dG\e[36mTry to remove value from list:\e[m\n", hpos+1);
|
||||
|
||||
switch (libcdsb_list_get(x, i, &v, remove_callback, 0)) {
|
||||
case 0: if (!silent) printf("\e[%dG\e[32;1mSUCCESS\e[m\n", hpos+1); break;
|
||||
default: if (!silent) printf("\e[%dG\e[32;1mFAILURE\e[m\n", hpos+1); break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!silent) put_separator(hpos);
|
||||
}
|
15
tests/src/map/main.c
Normal file
15
tests/src/map/main.c
Normal file
@ -0,0 +1,15 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "plug.h"
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
test_init(argc, argv);
|
||||
|
||||
map_t x;
|
||||
|
||||
map_init(&x, random_uint8()%VTYPE_LDOUBLE + 1);
|
||||
|
||||
visual_push(&x, random_uint8()%17 + 16);
|
||||
visual_remove(&x);
|
||||
}
|
18
tests/src/map/plug.h
Normal file
18
tests/src/map/plug.h
Normal file
@ -0,0 +1,18 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../../../src/map/include.h"
|
||||
|
||||
#include "../../include/random.h"
|
||||
#include "../../include/test.h"
|
||||
#include "../../include/time.h"
|
||||
|
||||
extern void map_push_random(map_t* x, _Bool silent, unsigned int hpos);
|
||||
extern void map_remove_random(map_t* x, _Bool silent, unsigned int hpos);
|
||||
|
||||
extern void map_info(const map_t* x, unsigned int hpos);
|
||||
extern void map_print(map_t* x, const char* prefix, unsigned int hpos);
|
||||
extern void map_rbtree_print(map_t *x, const char* prefix, unsigned int hpos);
|
||||
|
||||
extern void visual_push(map_t* x, size_t n);
|
||||
extern void visual_remove(map_t* x);
|
84
tests/src/map/src/io.c
Normal file
84
tests/src/map/src/io.c
Normal file
@ -0,0 +1,84 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../plug.h"
|
||||
|
||||
static int node_print_callback(const void* k, vtype kt, void* v, vtype vt, void* _) {
|
||||
print_container_value(0, k, kt, 0, *(unsigned int*)_);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void rbtree_print(const mnode_t* s, vtype t, const char* ind, bool br, unsigned int hpos) {
|
||||
if (!ind) {
|
||||
ind = "\e[36m";
|
||||
br = 1;
|
||||
}
|
||||
|
||||
size_t n = strlen(ind);
|
||||
char x[n + 10];
|
||||
|
||||
if (mnode_is_empty(s)) return;
|
||||
|
||||
memcpy(x, ind, n);
|
||||
memcpy(x + n, " \0 ", 9);
|
||||
|
||||
printf("\e[%dG%s", hpos+1, ind);
|
||||
|
||||
if (br) {
|
||||
fputs("\e[m\e[36;1mR\e[m\e[36m────\e[m", stdout);
|
||||
} else {
|
||||
fputs("\e[m\e[36;1mL\e[m\e[36m────\e[m", stdout);
|
||||
memcpy(x + n, "│", 3);
|
||||
x[n + 5] = ' ';
|
||||
}
|
||||
|
||||
fputs((s->colored) ? "\e[31;1m" : "\e[37m", stdout);
|
||||
printf("%s\e[m \e[36m:\e[m ", vnode_stringify(&s->key, t));
|
||||
printf("\e[31m%s\e[m", vnode_stringify(&s->value, s->type));
|
||||
printf(" \e[36m(\e[m\e[32;1m%s\e[m\e[36m)\e[m\n", vtype_name(s->type));
|
||||
|
||||
rbtree_print(s->left, t, x, false, hpos);
|
||||
rbtree_print(s->right, t, x, true, hpos);
|
||||
}
|
||||
|
||||
void map_print(map_t* x, const char* prefix, unsigned int hpos) {
|
||||
print_container_values_prefix("Map", prefix, 0);
|
||||
map_foreach(x, &hpos, node_print_callback);
|
||||
put_separator(0);
|
||||
}
|
||||
|
||||
void map_info(const map_t* x, unsigned int hpos) {
|
||||
print_container_info("Map", "nodes", &x->type, map_size(x), -1, 0);
|
||||
put_separator(0);
|
||||
}
|
||||
|
||||
void map_rbtree_print(map_t *x, const char* prefix, unsigned int hpos) {
|
||||
print_container_values_prefix("Map", prefix, 0);
|
||||
rbtree_print(x->root, x->type, 0, 0, hpos);
|
||||
}
|
||||
|
||||
|
||||
void visual_push(map_t* x, size_t n) {
|
||||
while (n--) {
|
||||
fputs("\e[s", stdout);
|
||||
|
||||
map_push_random(x, 0, 0);
|
||||
|
||||
map_info(x, 0);
|
||||
map_rbtree_print(x, 0, 0);
|
||||
|
||||
psleep(100000);
|
||||
fputs("\e[u\e[J", stdout);
|
||||
}
|
||||
}
|
||||
|
||||
void visual_remove(map_t* x) {
|
||||
while (!mnode_is_empty(x->root)) {
|
||||
fputs("\e[s", stdout);
|
||||
map_remove_random(x, 0, 0);
|
||||
map_info(x, 0);
|
||||
map_rbtree_print(x, 0, 0);
|
||||
psleep(100000);
|
||||
fputs("\e[u\e[J", stdout);
|
||||
}
|
||||
}
|
29
tests/src/map/src/plug.c
Normal file
29
tests/src/map/src/plug.c
Normal file
@ -0,0 +1,29 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../../../../src/__internal/include.h"
|
||||
#include "../../../include/random.h"
|
||||
|
||||
vtype_string* string_duplicate(const vtype_string* x) { return 0; }
|
||||
vtype_array* array_duplicate (const vtype_array* x) { return 0; }
|
||||
vtype_list* list_duplicate (const vtype_list* x) { return 0; }
|
||||
vtype_set* vset_duplicate (const vtype_set* x) { return 0; }
|
||||
vtype_dict* dict_duplicate (const vtype_dict* x) { return 0; }
|
||||
|
||||
void string_free(vtype_string* x) {}
|
||||
void array_free (vtype_array* x) {}
|
||||
void list_free (vtype_list* x) {}
|
||||
void vset_free (vtype_set* x) {}
|
||||
void dict_free (vtype_dict* x) {}
|
||||
|
||||
int string_compare(const vtype_string* s0, const vtype_string* s1) { return random_int8(); }
|
||||
int array_compare (const vtype_array* s0, const vtype_array* s1) { return random_int8(); }
|
||||
int list_compare (const vtype_list* s0, const vtype_list* s1) { return random_int8(); }
|
||||
int vset_compare (const vtype_set* s0, const vtype_set* s1) { return random_int8(); }
|
||||
int dict_compare (const vtype_dict* s0, const vtype_dict* s1) { return random_int8(); }
|
||||
|
||||
hash_t string_hash(const vtype_string* s) { return 0; }
|
||||
hash_t array_hash (const vtype_array* s) { return 0; }
|
||||
hash_t list_hash (const vtype_list* s) { return 0; }
|
||||
hash_t vset_hash (const vtype_set* s) { return 0; }
|
||||
hash_t dict_hash (const vtype_dict* s) { return 0; }
|
53
tests/src/map/src/random.c
Normal file
53
tests/src/map/src/random.c
Normal file
@ -0,0 +1,53 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../plug.h"
|
||||
|
||||
static int remove_callback(const void* k, vtype kt, void* v, vtype vt, void* _) {
|
||||
struct { size_t n; map_t* x; unsigned int hp; } *d = _;
|
||||
|
||||
if (!d->n--) {
|
||||
print_container_value(0, k, kt, 0, d->hp);
|
||||
|
||||
if (libcdsb_map_find(d->x, k, kt, 0, 0, 1) == 0) {
|
||||
printf("\e[%dG\e[32;1mSUCCESS\e[m\n", d->hp+1);
|
||||
} else printf("\e[%dG\e[31;1mFAILURE\e[m\n", d->hp+1);
|
||||
|
||||
return -2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void map_push_random(map_t* x, _Bool silent, unsigned int hpos) {
|
||||
|
||||
value_t k = random_value();
|
||||
value_t v = random_value();
|
||||
|
||||
if (!silent) {
|
||||
printf("\e[%dG\e[36mUpdate value in map (\e[m\e[32;1m%s\e[m\e[36m) with key:\e[m\n", hpos+1, vtype_name(x->type));
|
||||
print_container_value(0, k.value, k.type, 1, hpos);
|
||||
}
|
||||
|
||||
if (libcdsb_map_update(x, k.value, k.type, v.value, v.type)) {
|
||||
if (!silent) printf("\e[%dG\e[33;1mCHANGE\e[m\n", hpos+1);
|
||||
} else if (!silent) printf("\e[%dG\e[32;1mINSERT\e[m\n", hpos+1);
|
||||
|
||||
if (!silent) put_separator(0);
|
||||
}
|
||||
|
||||
|
||||
void map_remove_random(map_t* x, _Bool silent, unsigned int hpos) {
|
||||
struct { size_t n; map_t* x; unsigned int hp; } d = { .n = map_size(x), .x = x, .hp = hpos };
|
||||
|
||||
if (!silent)
|
||||
printf("\e[%dG\e[36mTry to remove value from map (\e[m\e[32;1m%s\e[m\e[36m) by key:\e[m\n", hpos+1, libcdsb_vtype_name(x->type));
|
||||
|
||||
if (d.n) {
|
||||
d.n = random_uint32()%d.n;
|
||||
map_foreach(x, &d, remove_callback);
|
||||
} else if (!silent) {
|
||||
printf("\e[%dG\e[32;1m\nFAILURE\e[m\n", hpos+1);
|
||||
}
|
||||
|
||||
if (!silent) put_separator(hpos);
|
||||
}
|
133
tests/src/random.c
Normal file
133
tests/src/random.c
Normal file
@ -0,0 +1,133 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include <time.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "../include/test.h"
|
||||
#include "../include/random.h"
|
||||
|
||||
|
||||
static void init(unsigned int seed) {
|
||||
if (!seed) seed = time(0);
|
||||
printf("\e[36mRandom module initialized with seed: \e[m\e[32m%u\n\e[m", seed);
|
||||
put_separator(0);
|
||||
srand(seed);
|
||||
}
|
||||
|
||||
int random_init(int argc, char** argv) {
|
||||
if (argc < 2) {
|
||||
init(0);
|
||||
} else init(atol(argv[1]));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
vtype_bool random_boolean() {
|
||||
return rand()&1;
|
||||
}
|
||||
|
||||
vtype_float random_float() {
|
||||
if (rand()&1) {
|
||||
return ((vtype_float)random_uint16() / (vtype_float)random_int16()) * -1;
|
||||
}
|
||||
return (vtype_float)random_uint16() / (vtype_float)random_int16();
|
||||
}
|
||||
|
||||
vtype_double random_double() {
|
||||
if (rand()&1) {
|
||||
return ((vtype_double)random_uint32() / (vtype_double)random_int32()) * -1;
|
||||
}
|
||||
return (vtype_double)random_uint32() / (vtype_double)random_int32();
|
||||
}
|
||||
|
||||
vtype_ldouble random_ldouble() {
|
||||
if (rand()&1) {
|
||||
return ((vtype_ldouble)random_uint64() / (vtype_ldouble)random_int64()) * -1;
|
||||
}
|
||||
return (vtype_ldouble)random_uint64() / (vtype_ldouble)random_int64();
|
||||
}
|
||||
|
||||
vtype_int8 random_int8() {
|
||||
return random_uint8();
|
||||
}
|
||||
|
||||
vtype_int16 random_int16() {
|
||||
return random_uint16();
|
||||
}
|
||||
|
||||
vtype_int32 random_int32() {
|
||||
return rand() | ((rand()&1) << 31);
|
||||
}
|
||||
|
||||
vtype_uint8 random_uint8() {
|
||||
return rand() % 0x100;
|
||||
}
|
||||
|
||||
vtype_uint16 random_uint16() {
|
||||
return rand() % 0x10000;
|
||||
}
|
||||
|
||||
vtype_uint32 random_uint32() {
|
||||
return (rand()<<1) | (rand()&1);
|
||||
}
|
||||
|
||||
vtype_uint64 random_uint64() {
|
||||
return random_int32() * random_int32();
|
||||
}
|
||||
|
||||
vtype_int64 random_int64() {
|
||||
return random_uint32() * random_uint32();
|
||||
}
|
||||
|
||||
char random_ascii_char() {
|
||||
return (rand()%0x5f) + 0x20;
|
||||
}
|
||||
|
||||
unsigned int random_unicode_symbol() {
|
||||
switch (rand()%20) {
|
||||
default:
|
||||
case 0: return (random_uint16()%0x005f) + 0x000020;
|
||||
case 1: return (random_uint16()%0x020f) + 0x0000a1;
|
||||
case 2: return (random_uint16()%0x01a8) + 0x000388;
|
||||
case 3: return (random_uint16()%0x0026) + 0x000531;
|
||||
case 4: return (random_uint16()%0x002a) + 0x000560;
|
||||
case 5: return (random_uint16()%0x00c6) + 0x001000;
|
||||
case 6: return (random_uint16()%0x0030) + 0x0010d0;
|
||||
case 7: return (random_uint16()%0x029d) + 0x001400;
|
||||
case 8: return (random_uint16()%0x0058) + 0x0016a0;
|
||||
case 9: return (random_uint16()%0x0074) + 0x001b80;
|
||||
case 10: return (random_uint16()%0x00f4) + 0x001d00;
|
||||
case 11: return (random_uint16()%0x0115) + 0x001e00;
|
||||
case 12: return (random_uint16()%0x008b) + 0x002100;
|
||||
case 13: return (random_uint16()%0x0297) + 0x002190;
|
||||
case 14: return (random_uint16()%0x0714) + 0x002460;
|
||||
case 15: return (random_uint16()%0x00b7) + 0x00a640;
|
||||
case 16: return (random_uint16()%0x0074) + 0x00a8e0;
|
||||
case 17: return (random_uint16()%0x009e) + 0x010400;
|
||||
case 18: return (random_uint16()%0x0137) + 0x010600;
|
||||
case 19: return (random_uint16()%0x03d8) + 0x01f300;
|
||||
}
|
||||
}
|
||||
|
||||
value_t random_value() {
|
||||
value_t v;
|
||||
switch (random_uint8()%13) {
|
||||
default:
|
||||
case 0: v.value[0].b = random_boolean(); v.type = VTYPE_BOOLEAN; break;
|
||||
case 1: v.value[0].u8 = random_uint8 (); v.type = VTYPE_UINT8; break;
|
||||
case 2: v.value[0].u16 = random_uint16 (); v.type = VTYPE_UINT16; break;
|
||||
case 3: v.value[0].u32 = random_uint32 (); v.type = VTYPE_UINT32; break;
|
||||
case 4: v.value[0].u64 = random_uint64 (); v.type = VTYPE_UINT64; break;
|
||||
case 5: v.value[0].u8 = random_int8 (); v.type = VTYPE_INT8; break;
|
||||
case 6: v.value[0].u16 = random_int16 (); v.type = VTYPE_INT16; break;
|
||||
case 7: v.value[0].u32 = random_int32 (); v.type = VTYPE_INT32; break;
|
||||
case 8: v.value[0].u64 = random_int64 (); v.type = VTYPE_INT64; break;
|
||||
case 9: v.value[0].f = random_float (); v.type = VTYPE_FLOAT; break;
|
||||
case 10: v.value[0].d = random_double (); v.type = VTYPE_DOUBLE; break;
|
||||
case 11: v.value[0].ld = random_ldouble(); v.type = VTYPE_LDOUBLE; break;
|
||||
case 12: v.value[0].ptr = (void*)(uintptr_t)random_uint64(); v.type = VTYPE_POINTER; break;
|
||||
}
|
||||
|
||||
return v;
|
||||
}
|
15
tests/src/set/main.c
Normal file
15
tests/src/set/main.c
Normal file
@ -0,0 +1,15 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "plug.h"
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
test_init(argc, argv);
|
||||
|
||||
set_t x;
|
||||
|
||||
vset_init(&x, random_uint8()%VTYPE_LDOUBLE + 1);
|
||||
|
||||
visual_push(&x, random_uint8()%17 + 16);
|
||||
visual_remove(&x);
|
||||
}
|
18
tests/src/set/plug.h
Normal file
18
tests/src/set/plug.h
Normal file
@ -0,0 +1,18 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../../../include/extra/set.h"
|
||||
#include "../../../src/__internal/rbtree.h"
|
||||
|
||||
#include "../../include/random.h"
|
||||
#include "../../include/test.h"
|
||||
#include "../../include/time.h"
|
||||
|
||||
extern void vset_push_random(set_t* x, _Bool silent, unsigned int hpos);
|
||||
extern void vset_remove_random(set_t* x, _Bool silent, unsigned int hpos);
|
||||
|
||||
extern void vset_print(set_t* x, const char* prefix, unsigned int hpos);
|
||||
extern void vset_info(const set_t* x, unsigned int hpos);
|
||||
extern void vset_rbtree_print(set_t *x, const char* prefix, unsigned int hpos);
|
||||
extern void visual_push(set_t* x, size_t n);
|
||||
extern void visual_remove(set_t* x);
|
82
tests/src/set/src/io.c
Normal file
82
tests/src/set/src/io.c
Normal file
@ -0,0 +1,82 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../plug.h"
|
||||
|
||||
|
||||
static int node_print_callback(const void* v, vtype t, void* _) {
|
||||
print_container_value(0, v, t, 0, *(unsigned int*)_);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void rbtree_print(const rbnode_t* s, vtype t, const char* ind, bool br, unsigned int hpos) {
|
||||
if (!ind) {
|
||||
ind = "\e[36m";
|
||||
br = 1;
|
||||
}
|
||||
|
||||
size_t n = strlen(ind);
|
||||
char x[n + 10];
|
||||
|
||||
if (rbnode_is_empty(s)) return;
|
||||
|
||||
memcpy(x, ind, n);
|
||||
memcpy(x + n, " \0 ", 9);
|
||||
|
||||
printf("\e[%dG%s", hpos+1, ind);
|
||||
|
||||
if (br) {
|
||||
fputs("\e[m\e[36;1mR\e[m\e[36m────\e[m", stdout);
|
||||
} else {
|
||||
fputs("\e[m\e[36;1mL\e[m\e[36m────\e[m", stdout);
|
||||
memcpy(x + n, "│", 3);
|
||||
x[n + 5] = ' ';
|
||||
}
|
||||
|
||||
fputs((s->colored) ? "\e[31;1m" : "\e[37m", stdout);
|
||||
printf("%s\e[m \e[36m\e[m\n", vnode_stringify(&s->value, t));
|
||||
|
||||
rbtree_print(s->left, t, x, false, hpos);
|
||||
rbtree_print(s->right, t, x, true, hpos);
|
||||
}
|
||||
|
||||
void vset_print(set_t* x, const char* prefix, unsigned int hpos) {
|
||||
print_container_values_prefix("Set", prefix, 0);
|
||||
vset_foreach(x, &hpos, node_print_callback);
|
||||
put_separator(0);
|
||||
}
|
||||
|
||||
void vset_info(const set_t* x, unsigned int hpos) {
|
||||
print_container_info("Set", "nodes", &x->type, vset_size(x), -1, 0);
|
||||
put_separator(0);
|
||||
}
|
||||
|
||||
void vset_rbtree_print(set_t *x, const char* prefix, unsigned int hpos) {
|
||||
print_container_values_prefix("Set", prefix, 0);
|
||||
rbtree_print(x->root, x->type, 0, 0, hpos);
|
||||
}
|
||||
|
||||
void visual_push(set_t* x, size_t n) {
|
||||
while (n--) {
|
||||
fputs("\e[s", stdout);
|
||||
|
||||
vset_push_random(x, 0, 0);
|
||||
|
||||
vset_info(x, 0);
|
||||
vset_rbtree_print(x, 0, 0);
|
||||
|
||||
psleep(100000);
|
||||
fputs("\e[u\e[J", stdout);
|
||||
}
|
||||
}
|
||||
|
||||
void visual_remove(set_t* x) {
|
||||
while (!rbnode_is_empty(x->root)) {
|
||||
fputs("\e[s", stdout);
|
||||
vset_remove_random(x, 0, 0);
|
||||
vset_info(x, 0);
|
||||
vset_rbtree_print(x, 0, 0);
|
||||
psleep(100000);
|
||||
fputs("\e[u\e[J", stdout);
|
||||
}
|
||||
}
|
29
tests/src/set/src/plug.c
Normal file
29
tests/src/set/src/plug.c
Normal file
@ -0,0 +1,29 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../../../../src/__internal/include.h"
|
||||
#include "../../../include/random.h"
|
||||
|
||||
vtype_string* string_duplicate(const vtype_string* x) { return 0; }
|
||||
vtype_array* array_duplicate (const vtype_array* x) { return 0; }
|
||||
vtype_list* list_duplicate (const vtype_list* x) { return 0; }
|
||||
vtype_map* map_duplicate (const vtype_map* x) { return 0; }
|
||||
vtype_dict* dict_duplicate (const vtype_dict* x) { return 0; }
|
||||
|
||||
void string_free(vtype_string* x) {}
|
||||
void array_free (vtype_array* x) {}
|
||||
void list_free (vtype_list* x) {}
|
||||
void map_free (vtype_map* x) {}
|
||||
void dict_free (vtype_dict* x) {}
|
||||
|
||||
int string_compare(const vtype_string* s0, const vtype_string* s1) { return random_int8(); }
|
||||
int array_compare (const vtype_array* s0, const vtype_array* s1) { return random_int8(); }
|
||||
int list_compare (const vtype_list* s0, const vtype_list* s1) { return random_int8(); }
|
||||
int map_compare (const vtype_map* s0, const vtype_map* s1) { return random_int8(); }
|
||||
int dict_compare (const vtype_dict* s0, const vtype_dict* s1) { return random_int8(); }
|
||||
|
||||
hash_t string_hash(const vtype_string* s) { return 0; }
|
||||
hash_t array_hash (const vtype_array* s) { return 0; }
|
||||
hash_t list_hash (const vtype_list* s) { return 0; }
|
||||
hash_t map_hash (const vtype_map* s) { return 0; }
|
||||
hash_t dict_hash (const vtype_dict* s) { return 0; }
|
52
tests/src/set/src/random.c
Normal file
52
tests/src/set/src/random.c
Normal file
@ -0,0 +1,52 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../plug.h"
|
||||
|
||||
static int remove_callback(const void* v, vtype t, void* _) {
|
||||
struct { size_t n; set_t* x; unsigned int hp; } *d = _;
|
||||
|
||||
if (!d->n--) {
|
||||
print_container_value(0, v, t, 0, d->hp);
|
||||
|
||||
if (libcdsb_vset_find(d->x, v, t, 0, 0, 1) == 0) {
|
||||
printf("\e[%dG\e[32;1mSUCCESS\e[m\n", d->hp+1);
|
||||
} else printf("\e[%dG\e[31;1mFAILURE\e[m\n", d->hp+1);
|
||||
|
||||
return -2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void vset_push_random(set_t* x, _Bool silent, unsigned int hpos) {
|
||||
|
||||
value_t v = random_value();
|
||||
|
||||
if (!silent) {
|
||||
printf("\e[%dG\e[36mUpdate value in set (\e[m\e[32;1m%s\e[m\e[36m):\e[m\n", hpos+1, vtype_name(x->type));
|
||||
print_container_value(0, v.value, v.type, 1, hpos);
|
||||
}
|
||||
|
||||
if (libcdsb_vset_insert(x, v.value, v.type)) {
|
||||
if (!silent) printf("\e[%dG\e[32;1mSUCCESS\e[m\n", hpos+1);
|
||||
} else if (!silent) printf("\e[%dG\e[31;1mFAILURE\e[m\n", hpos+1);
|
||||
|
||||
if (!silent) put_separator(0);
|
||||
}
|
||||
|
||||
|
||||
void vset_remove_random(set_t* x, _Bool silent, unsigned int hpos) {
|
||||
struct { size_t n; set_t* x; unsigned int hp; } d = { .n = vset_size(x), .x = x, .hp = hpos };
|
||||
|
||||
if (!silent)
|
||||
printf("\e[%dG\e[36mTry to remove value from set (\e[m\e[32;1m%s\e[m\e[36m):\e[m\n", hpos+1, libcdsb_vtype_name(x->type));
|
||||
|
||||
if (d.n) {
|
||||
d.n = random_uint32()%d.n;
|
||||
vset_foreach(x, &d, remove_callback);
|
||||
} else if (!silent) {
|
||||
printf("\e[%dG\e[32;1m\nFAILURE\e[m\n", hpos+1);
|
||||
}
|
||||
|
||||
if (!silent) put_separator(hpos);
|
||||
}
|
77
tests/src/string/main.c
Normal file
77
tests/src/string/main.c
Normal file
@ -0,0 +1,77 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "plug.h"
|
||||
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
test_init(argc, argv);
|
||||
str_t x, y;
|
||||
int c = random_unicode_symbol();
|
||||
|
||||
fputs("\e[s", stdout);
|
||||
x = string_random(30);
|
||||
string_print(&x, "(part 1)");
|
||||
|
||||
string_concat(&x, '\n');
|
||||
string_concat_random(&x, 30);
|
||||
|
||||
{
|
||||
char* repl = random_utf8_cstring(30);
|
||||
void* hack = string_at(&x, 31);
|
||||
string_print((void*)&hack, "(part 2)");
|
||||
string_print((void*)&repl, "(part 2 replaced)");
|
||||
string_replace(&x, hack, repl, -1);
|
||||
free(repl);
|
||||
}
|
||||
|
||||
string_info(&x);
|
||||
string_print(&x, "concatenated");
|
||||
|
||||
do {
|
||||
string_replace_random(&x, 12);
|
||||
} while (string_size(&x) == string_nmemb(&x));
|
||||
|
||||
y = string_copy(&x);
|
||||
|
||||
string_to_lower(&x);
|
||||
string_to_upper(&y);
|
||||
|
||||
visual_compare(&x, &y);
|
||||
visual_case_compare(&x, &y);
|
||||
|
||||
string_reverse(&y);
|
||||
string_capitalize(&y);
|
||||
|
||||
string_print(&y, "reversed & capitalized");
|
||||
|
||||
string_free(&x);
|
||||
string_free(&y);
|
||||
|
||||
psleep(900000);
|
||||
|
||||
fputs("\e[u\e[J", stdout);
|
||||
|
||||
x = string_random(12);
|
||||
|
||||
string_align_center(&x, 30, 0);
|
||||
string_info(&x);
|
||||
string_print(&x, 0);
|
||||
|
||||
string_trim_spaces(&x);
|
||||
string_info(&x);
|
||||
string_print(&x, "trimmed");
|
||||
|
||||
put_separator(0);
|
||||
string_align_center(&x, 30, c);
|
||||
string_info(&x);
|
||||
string_print(&x, 0);
|
||||
|
||||
string_trim(&x, c);
|
||||
string_info(&x);
|
||||
string_print(&x, "trimmed");
|
||||
|
||||
psleep(900000);
|
||||
|
||||
string_free(&x);
|
||||
}
|
22
tests/src/string/plug.h
Normal file
22
tests/src/string/plug.h
Normal file
@ -0,0 +1,22 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "../../../modules/libunic/include.h"
|
||||
#include "../../../include/extra/string.h"
|
||||
|
||||
#include "../../include/random.h"
|
||||
#include "../../include/test.h"
|
||||
#include "../../include/time.h"
|
||||
|
||||
extern char* random_ascii_cstring(size_t size);
|
||||
extern char* random_utf8_cstring(size_t size);
|
||||
extern void string_concat_random(str_t* x, unsigned int n);
|
||||
extern void string_replace_random(str_t* x, unsigned int n);
|
||||
|
||||
extern void string_info(str_t* x);
|
||||
extern void string_print(const str_t* x, const char* prefix);
|
||||
extern str_t string_random(unsigned int n);
|
||||
|
||||
extern void visual_compare(const str_t* s0, const str_t* s1);
|
||||
extern void visual_case_compare(const str_t* s0, const str_t* s1);
|
48
tests/src/string/src/io.c
Normal file
48
tests/src/string/src/io.c
Normal file
@ -0,0 +1,48 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../plug.h"
|
||||
|
||||
void string_info(str_t* x) {
|
||||
print_container_info("String", "utf8 chars", 0, string_size(x), string_nmemb(x), 0);
|
||||
put_separator(0);
|
||||
}
|
||||
|
||||
void string_print(const str_t* x, const char* prefix) {
|
||||
if (prefix) {
|
||||
printf("\e[36m%s %s content:\e[m\n", "String", prefix);
|
||||
} else printf("\e[36m%s content:\e[m\n", "String");
|
||||
|
||||
printf("\e[33m\"%s\"\e[m\n", x->buffer);
|
||||
put_separator(0);
|
||||
}
|
||||
|
||||
str_t string_random(unsigned int n) {
|
||||
str_t x;
|
||||
|
||||
if (random_boolean()) {
|
||||
x.buffer = random_utf8_cstring(n);
|
||||
} else x.buffer = random_ascii_cstring(n);
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
void visual_compare(const str_t* s0, const str_t* s1) {
|
||||
int c = string_compare(s0, s1);
|
||||
char* m;
|
||||
if (c == 0) m = "==";
|
||||
else m = (c < 0) ? "<" : ">";
|
||||
|
||||
puts("\e[36mStrings comparsion:\e[m\n");
|
||||
printf("\e[33m\"%s\"\e[m \e[31m%s\e[m \e[33m\"%s\"\e[m\n", s0->buffer, m, s1->buffer);
|
||||
}
|
||||
|
||||
void visual_case_compare(const str_t* s0, const str_t* s1) {
|
||||
int c = string_case_compare(s0, s1);
|
||||
char* m;
|
||||
if (c == 0) m = "==";
|
||||
else m = (c < 0) ? "<" : ">";
|
||||
|
||||
puts("\e[36mStrings case insensitive comparsion:\e[m\n");
|
||||
printf("\e[33m\"%s\"\e[m \e[31m%s\e[m \e[33m\"%s\"\e[m\n", s0->buffer, m, s1->buffer);
|
||||
}
|
29
tests/src/string/src/plug.c
Normal file
29
tests/src/string/src/plug.c
Normal file
@ -0,0 +1,29 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../../../../src/__internal/include.h"
|
||||
#include "../../../include/random.h"
|
||||
|
||||
vtype_array* array_duplicate (const vtype_array* x) { return 0; }
|
||||
vtype_list* list_duplicate (const vtype_list* x) { return 0; }
|
||||
vtype_map* map_duplicate (const vtype_map* x) { return 0; }
|
||||
vtype_set* vset_duplicate (const vtype_set* x) { return 0; }
|
||||
vtype_dict* dict_duplicate (const vtype_dict* x) { return 0; }
|
||||
|
||||
void array_free (vtype_array* x) {}
|
||||
void list_free (vtype_list* x) {}
|
||||
void map_free (vtype_map* x) {}
|
||||
void vset_free (vtype_set* x) {}
|
||||
void dict_free (vtype_dict* x) {}
|
||||
|
||||
int array_compare (const vtype_array* s0, const vtype_array* s1) { return random_int8(); }
|
||||
int list_compare (const vtype_list* s0, const vtype_list* s1) { return random_int8(); }
|
||||
int map_compare (const vtype_map* s0, const vtype_map* s1) { return random_int8(); }
|
||||
int vset_compare (const vtype_set* s0, const vtype_set* s1) { return random_int8(); }
|
||||
int dict_compare (const vtype_dict* s0, const vtype_dict* s1) { return random_int8(); }
|
||||
|
||||
hash_t array_hash (const vtype_array* s) { return 0; }
|
||||
hash_t list_hash (const vtype_list* s) { return 0; }
|
||||
hash_t map_hash (const vtype_map* s) { return 0; }
|
||||
hash_t vset_hash (const vtype_set* s) { return 0; }
|
||||
hash_t dict_hash (const vtype_dict* s) { return 0; }
|
51
tests/src/string/src/random.c
Normal file
51
tests/src/string/src/random.c
Normal file
@ -0,0 +1,51 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../plug.h"
|
||||
|
||||
char* random_ascii_cstring(size_t size) {
|
||||
char* v = malloc(size + 1);
|
||||
char* p = v;
|
||||
|
||||
while (size--) {
|
||||
*(p++) = random_ascii_char();
|
||||
}
|
||||
*p = 0;
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
char* random_utf8_cstring(size_t size) {
|
||||
char* v = malloc(size * 4 + 1);
|
||||
char* p = v;
|
||||
|
||||
while (size--) {
|
||||
p = tochar_unicode(p, random_unicode_symbol());
|
||||
}
|
||||
|
||||
*p = 0;
|
||||
return v;
|
||||
}
|
||||
|
||||
void string_concat_random(str_t* x, unsigned int n) {
|
||||
char* v;
|
||||
|
||||
if (random_boolean()) {
|
||||
v = random_utf8_cstring(n);
|
||||
} else v = random_ascii_cstring(n);
|
||||
|
||||
string_concat(x, v);
|
||||
free(v);
|
||||
}
|
||||
|
||||
void string_replace_random(str_t* x, unsigned int n) {
|
||||
char* v;
|
||||
|
||||
if (random_boolean()) {
|
||||
v = random_utf8_cstring(n);
|
||||
} else v = random_ascii_cstring(n);
|
||||
|
||||
string_replace(x, x, v, -1);
|
||||
|
||||
free(v);
|
||||
}
|
103
tests/src/test.c
Normal file
103
tests/src/test.c
Normal file
@ -0,0 +1,103 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include "../include/test.h"
|
||||
#include "../include/time.h"
|
||||
#include "../include/random.h"
|
||||
|
||||
static TIMER GLOBAL_TIMER;
|
||||
static const char* TEST_NAME = 0;
|
||||
|
||||
static void test_uload() __attribute__((destructor));
|
||||
|
||||
static void test_uload() {
|
||||
if (TEST_NAME) {
|
||||
timer_stop(&GLOBAL_TIMER);
|
||||
puts("");
|
||||
put_separator(0);
|
||||
printf("\e[36mTest \"\e[m\e[32;1m%s\e[m\e[36m\" is end.\nExecusion time: \e[m\e[32m%.6Lf sec\e[m\n", TEST_NAME, timer_value(&GLOBAL_TIMER));
|
||||
put_separator(0);
|
||||
timer_free(&GLOBAL_TIMER);
|
||||
}
|
||||
}
|
||||
|
||||
void test_init(int argc, char** argv) {
|
||||
timer_init(&GLOBAL_TIMER);
|
||||
timer_start(&GLOBAL_TIMER);
|
||||
|
||||
TEST_NAME = strrchr(argv[0], '/') ? strrchr(argv[0], '/') + 1 : argv[0];
|
||||
|
||||
put_separator(0);
|
||||
printf("\e[H\e[J\e[36mTest \"\e[m\e[32;1m%s\e[m\e[36m\" is loaded\e[m\n", TEST_NAME);
|
||||
put_separator(0);
|
||||
|
||||
random_init(argc, argv);
|
||||
|
||||
puts("");
|
||||
}
|
||||
|
||||
void hp_printf(unsigned int hpos, const char* format, ...) {
|
||||
va_list args;
|
||||
|
||||
va_start(args, format);
|
||||
vprintf(format, args);
|
||||
|
||||
printf("\e[%dG", hpos+1);
|
||||
|
||||
vprintf(format, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
|
||||
void put_separator(unsigned int hpos) {
|
||||
printf("\e[%dG\e[37;2m=== === === === === === === ===\e[m\n", hpos+1);
|
||||
}
|
||||
|
||||
void print_container_values_prefix(const char* name, const char* prefix, unsigned int hpos) {
|
||||
if (prefix) {
|
||||
printf("\e[%dG\e[36m%s %s values:\e[m\n", hpos+1, name, prefix);
|
||||
} else {
|
||||
printf("\e[%dG\e[36m%s values:\e[m\n", hpos+1, name);
|
||||
}
|
||||
}
|
||||
|
||||
void print_container_value(const ssize_t* index, const void* value, const vtype type, _Bool print_type, unsigned int hpos) {
|
||||
if (index) {
|
||||
printf("\e[%dG\e[32;1m%5ld: \e[m", hpos+1, *index);
|
||||
} else {
|
||||
printf("\e[%dG ", hpos+1);
|
||||
}
|
||||
|
||||
printf("\e[31m%24s\e[m", libcdsb_vtype_stringify(value, type));
|
||||
|
||||
if (print_type) {
|
||||
printf(" \e[36m(\e[m\e[32;1m%s\e[m\e[36m)\e[m", libcdsb_vtype_name(type));
|
||||
}
|
||||
|
||||
puts("");
|
||||
}
|
||||
|
||||
void print_container_info(const char* name, const char* el_name, const vtype* type, ssize_t size, ssize_t nmemb, unsigned int hpos) {
|
||||
if (!el_name) el_name = "elements";
|
||||
|
||||
if (type) {
|
||||
printf("\e[%dG\e[36m%s initialized with type `\e[m\e[32;1m%s\e[m\e[36m`\n", hpos+1, name, libcdsb_vtype_name(*type));
|
||||
}
|
||||
|
||||
if (size >= 0 || nmemb >= 0) {
|
||||
printf("\e[%dG\e[36m%s consists of \e[m", hpos+1, name);
|
||||
}
|
||||
|
||||
if (size >= 0) {
|
||||
printf("\e[32m%ld\e[m \e[36m%s", size, el_name);
|
||||
|
||||
if (nmemb >= 0) {
|
||||
printf(" (\e[m\e[32m%ld bytes\e[m\e[36m)\e[m\n", nmemb);
|
||||
} else puts("\e[m");
|
||||
|
||||
} else if (nmemb >= 0) {
|
||||
printf("\e[32m%ld bytes\e[m\n", nmemb);
|
||||
}
|
||||
}
|
122
tests/src/time.c
Normal file
122
tests/src/time.c
Normal file
@ -0,0 +1,122 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifndef __USE_MISC
|
||||
#define __USE_MISC
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
#include <sys/resource.h>
|
||||
#include <sys/times.h>
|
||||
#include "../include/time.h"
|
||||
|
||||
typedef struct timer_internal {
|
||||
struct rusage begin;
|
||||
struct rusage end;
|
||||
struct rusage br;
|
||||
unsigned long offset;
|
||||
struct {
|
||||
int isbr:1;
|
||||
int isend:1;
|
||||
};
|
||||
} TIMER_INFO;
|
||||
|
||||
|
||||
void timer_init(TIMER* timer) {
|
||||
TIMER_INFO *t;
|
||||
if (!(t = timer->info = malloc(sizeof(TIMER_INFO))))
|
||||
abort();
|
||||
memset(t, 0, sizeof(*t));
|
||||
}
|
||||
|
||||
void timer_start(TIMER* timer) {
|
||||
TIMER_INFO *t = timer->info;
|
||||
|
||||
if (t->isend)
|
||||
return;
|
||||
|
||||
if (t->isbr) {
|
||||
struct rusage br;
|
||||
|
||||
if (getrusage(RUSAGE_SELF, &br) < 0)
|
||||
abort();
|
||||
|
||||
t->offset += br.ru_utime.tv_sec * 1000000 - t->br.ru_utime.tv_sec * 1000000;
|
||||
t->offset -= t->br.ru_utime.tv_usec;
|
||||
t->offset += br.ru_utime.tv_usec;
|
||||
|
||||
memset(&t->br, 0, sizeof(t->br));
|
||||
t->isbr = 0;
|
||||
} else if (getrusage(RUSAGE_SELF, &t->begin) < 0)
|
||||
abort();
|
||||
}
|
||||
|
||||
void timer_pause (TIMER* timer) {
|
||||
TIMER_INFO *t = timer->info;
|
||||
|
||||
if (t->isend)
|
||||
return;
|
||||
|
||||
if (!t->isbr) {
|
||||
if (getrusage(RUSAGE_SELF, &t->br) < 0)
|
||||
abort();
|
||||
|
||||
t->isbr = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void timer_stop (TIMER* timer) {
|
||||
TIMER_INFO *t = timer->info;
|
||||
|
||||
if (t->isend)
|
||||
return;
|
||||
|
||||
if (getrusage(RUSAGE_SELF, &t->end) < 0)
|
||||
abort();
|
||||
|
||||
if (t->isbr) {
|
||||
t->offset += t->end.ru_utime.tv_sec * 1000000 - t->br.ru_utime.tv_sec * 1000000;
|
||||
t->offset -= t->br.ru_utime.tv_usec;
|
||||
t->offset += t->end.ru_utime.tv_usec;
|
||||
|
||||
memset(&t->br, 0, sizeof(t->br));
|
||||
t->isbr = 0;
|
||||
}
|
||||
|
||||
t->isend = 1;
|
||||
}
|
||||
|
||||
void timer_free (TIMER* timer) {
|
||||
free(timer->info);
|
||||
}
|
||||
|
||||
vtype_ldouble timer_value(TIMER* timer) {
|
||||
static char empty[sizeof(struct rusage)] = { 0 };
|
||||
|
||||
TIMER_INFO *t = timer->info;
|
||||
|
||||
struct rusage _;
|
||||
struct rusage *end;
|
||||
vtype_ldouble value;
|
||||
|
||||
if (memcmp(&t->begin, empty, sizeof(struct rusage)) == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!t->isend) {
|
||||
if (getrusage(RUSAGE_SELF, end = &_) < 0)
|
||||
abort();
|
||||
} else end = &t->end;
|
||||
|
||||
value = end->ru_utime.tv_sec * 1000000 - t->begin.ru_utime.tv_sec * 1000000;
|
||||
value -= t->begin.ru_utime.tv_usec;
|
||||
value += end->ru_utime.tv_usec;
|
||||
value -= t->offset;
|
||||
|
||||
return value / 1000000;
|
||||
}
|
||||
|
||||
void psleep(unsigned long microsec) {
|
||||
usleep(microsec);
|
||||
}
|
Loading…
Reference in New Issue
Block a user