From 350e6187ca61f23b88fd7744203fdb2a6ac70f36 Mon Sep 17 00:00:00 2001 From: Gregory Lirent Date: Sat, 4 Jun 2022 21:10:19 +0300 Subject: [PATCH] Update extra array symbols --- include/extra/array.h | 8 ++--- src/array/extra.c | 4 +-- src/array/generics.c | 76 +++++++++++++++++++++---------------------- 3 files changed, 42 insertions(+), 46 deletions(-) diff --git a/include/extra/array.h b/include/extra/array.h index 69b2bd6..9747897 100644 --- a/include/extra/array.h +++ b/include/extra/array.h @@ -6,11 +6,7 @@ #ifndef LIBCDSB_EXTRA_ARRAY_H #define LIBCDSB_EXTRA_ARRAY_H -#ifdef array_push -# undef array_push -#endif - -extern ssize_t array_find(const vtype_array* x, const void* value, vtype value_type); -extern ssize_t array_push( vtype_array* x, const void* value, vtype value_type); +extern ssize_t libcdsb_array_find(const vtype_array* x, const void* value, vtype value_type); +extern ssize_t libcdsb_array_push( vtype_array* x, const void* value, vtype value_type); #endif /* LIBCDSB_EXTRA_ARRAY_H */ diff --git a/src/array/extra.c b/src/array/extra.c index bf9027b..9a00c73 100644 --- a/src/array/extra.c +++ b/src/array/extra.c @@ -5,7 +5,7 @@ #include "../__internal/assert.h" #include "../__internal/vnode.h" -ssize_t array_find(const arr_t* x, const void* v, vtype vt) { +ssize_t libcdsb_array_find(const arr_t* x, const void* v, vtype vt) { int c; ssize_t index; @@ -38,7 +38,7 @@ ssize_t array_find(const arr_t* x, const void* v, vtype vt) { return -1; } -ssize_t array_push(arr_t* x, const void* v, vtype vt) { +ssize_t libcdsb_array_push(arr_t* x, const void* v, vtype vt) { ssize_t i = x->size; vnode_t n = vnode_tcreate(x->type, v, vt); diff --git a/src/array/generics.c b/src/array/generics.c index a78ead1..be0352a 100644 --- a/src/array/generics.c +++ b/src/array/generics.c @@ -3,42 +3,42 @@ #include "include.h" -ssize_t libcdsb_array_indexof_pointer(const arr_t* x, const void* v) { return array_find(x, &v, vtypeof(&v)); } -ssize_t libcdsb_array_indexof_string (const arr_t* x, const char* v) { return array_find(x, &v, vtypeof(&v)); } -ssize_t libcdsb_array_indexof_array (const arr_t* x, const str_t* v) { return array_find(x, v, vtypeof( v)); } -ssize_t libcdsb_array_indexof_list (const arr_t* x, const arr_t* v) { return array_find(x, v, vtypeof( v)); } -ssize_t libcdsb_array_indexof_map (const arr_t* x, const list_t* v) { return array_find(x, v, vtypeof( v)); } -ssize_t libcdsb_array_indexof_vset (const arr_t* x, const map_t* v) { return array_find(x, v, vtypeof( v)); } -ssize_t libcdsb_array_indexof_cstring(const arr_t* x, const set_t* v) { return array_find(x, v, vtypeof( v)); } -ssize_t libcdsb_array_indexof_boolean(const arr_t* x, _Bool v) { return array_find(x, &v, vtypeof(&v)); } -ssize_t libcdsb_array_indexof_int8 (const arr_t* x, s8_t v) { return array_find(x, &v, vtypeof(&v)); } -ssize_t libcdsb_array_indexof_int16 (const arr_t* x, s16_t v) { return array_find(x, &v, vtypeof(&v)); } -ssize_t libcdsb_array_indexof_int32 (const arr_t* x, s32_t v) { return array_find(x, &v, vtypeof(&v)); } -ssize_t libcdsb_array_indexof_int64 (const arr_t* x, s64_t v) { return array_find(x, &v, vtypeof(&v)); } -ssize_t libcdsb_array_indexof_uint8 (const arr_t* x, u8_t v) { return array_find(x, &v, vtypeof(&v)); } -ssize_t libcdsb_array_indexof_uint16 (const arr_t* x, u16_t v) { return array_find(x, &v, vtypeof(&v)); } -ssize_t libcdsb_array_indexof_uint32 (const arr_t* x, u32_t v) { return array_find(x, &v, vtypeof(&v)); } -ssize_t libcdsb_array_indexof_uint64 (const arr_t* x, u64_t v) { return array_find(x, &v, vtypeof(&v)); } -ssize_t libcdsb_array_indexof_float (const arr_t* x, fl_t v) { return array_find(x, &v, vtypeof(&v)); } -ssize_t libcdsb_array_indexof_double (const arr_t* x, dbl_t v) { return array_find(x, &v, vtypeof(&v)); } -ssize_t libcdsb_array_indexof_ldouble(const arr_t* x, ldbl_t v) { return array_find(x, &v, vtypeof(&v)); } +ssize_t libcdsb_array_indexof_pointer(const arr_t* x, const void* v) { return libcdsb_array_find(x, &v, vtypeof(&v)); } +ssize_t libcdsb_array_indexof_string (const arr_t* x, const char* v) { return libcdsb_array_find(x, &v, vtypeof(&v)); } +ssize_t libcdsb_array_indexof_array (const arr_t* x, const str_t* v) { return libcdsb_array_find(x, v, vtypeof( v)); } +ssize_t libcdsb_array_indexof_list (const arr_t* x, const arr_t* v) { return libcdsb_array_find(x, v, vtypeof( v)); } +ssize_t libcdsb_array_indexof_map (const arr_t* x, const list_t* v) { return libcdsb_array_find(x, v, vtypeof( v)); } +ssize_t libcdsb_array_indexof_vset (const arr_t* x, const map_t* v) { return libcdsb_array_find(x, v, vtypeof( v)); } +ssize_t libcdsb_array_indexof_cstring(const arr_t* x, const set_t* v) { return libcdsb_array_find(x, v, vtypeof( v)); } +ssize_t libcdsb_array_indexof_boolean(const arr_t* x, _Bool v) { return libcdsb_array_find(x, &v, vtypeof(&v)); } +ssize_t libcdsb_array_indexof_int8 (const arr_t* x, s8_t v) { return libcdsb_array_find(x, &v, vtypeof(&v)); } +ssize_t libcdsb_array_indexof_int16 (const arr_t* x, s16_t v) { return libcdsb_array_find(x, &v, vtypeof(&v)); } +ssize_t libcdsb_array_indexof_int32 (const arr_t* x, s32_t v) { return libcdsb_array_find(x, &v, vtypeof(&v)); } +ssize_t libcdsb_array_indexof_int64 (const arr_t* x, s64_t v) { return libcdsb_array_find(x, &v, vtypeof(&v)); } +ssize_t libcdsb_array_indexof_uint8 (const arr_t* x, u8_t v) { return libcdsb_array_find(x, &v, vtypeof(&v)); } +ssize_t libcdsb_array_indexof_uint16 (const arr_t* x, u16_t v) { return libcdsb_array_find(x, &v, vtypeof(&v)); } +ssize_t libcdsb_array_indexof_uint32 (const arr_t* x, u32_t v) { return libcdsb_array_find(x, &v, vtypeof(&v)); } +ssize_t libcdsb_array_indexof_uint64 (const arr_t* x, u64_t v) { return libcdsb_array_find(x, &v, vtypeof(&v)); } +ssize_t libcdsb_array_indexof_float (const arr_t* x, fl_t v) { return libcdsb_array_find(x, &v, vtypeof(&v)); } +ssize_t libcdsb_array_indexof_double (const arr_t* x, dbl_t v) { return libcdsb_array_find(x, &v, vtypeof(&v)); } +ssize_t libcdsb_array_indexof_ldouble(const arr_t* x, ldbl_t v) { return libcdsb_array_find(x, &v, vtypeof(&v)); } -void libcdsb_array_push_pointer(arr_t* x, const void* v) { array_push(x, &v, vtypeof(&v)); } -void libcdsb_array_push_cstring(arr_t* x, const char* v) { array_push(x, &v, vtypeof(&v)); } -void libcdsb_array_push_string (arr_t* x, const str_t* v) { array_push(x, v, vtypeof( v)); } -void libcdsb_array_push_array (arr_t* x, const arr_t* v) { array_push(x, v, vtypeof( v)); } -void libcdsb_array_push_list (arr_t* x, const list_t* v) { array_push(x, v, vtypeof( v)); } -void libcdsb_array_push_map (arr_t* x, const map_t* v) { array_push(x, v, vtypeof( v)); } -void libcdsb_array_push_vset (arr_t* x, const set_t* v) { array_push(x, v, vtypeof( v)); } -void libcdsb_array_push_boolean(arr_t* x, _Bool v) { array_push(x, &v, vtypeof(&v)); } -void libcdsb_array_push_int8 (arr_t* x, s8_t v) { array_push(x, &v, vtypeof(&v)); } -void libcdsb_array_push_int16 (arr_t* x, s16_t v) { array_push(x, &v, vtypeof(&v)); } -void libcdsb_array_push_int32 (arr_t* x, s32_t v) { array_push(x, &v, vtypeof(&v)); } -void libcdsb_array_push_int64 (arr_t* x, s64_t v) { array_push(x, &v, vtypeof(&v)); } -void libcdsb_array_push_uint8 (arr_t* x, u8_t v) { array_push(x, &v, vtypeof(&v)); } -void libcdsb_array_push_uint16 (arr_t* x, u16_t v) { array_push(x, &v, vtypeof(&v)); } -void libcdsb_array_push_uint32 (arr_t* x, u32_t v) { array_push(x, &v, vtypeof(&v)); } -void libcdsb_array_push_uint64 (arr_t* x, u64_t v) { array_push(x, &v, vtypeof(&v)); } -void libcdsb_array_push_float (arr_t* x, fl_t v) { array_push(x, &v, vtypeof(&v)); } -void libcdsb_array_push_double (arr_t* x, dbl_t v) { array_push(x, &v, vtypeof(&v)); } -void libcdsb_array_push_ldouble(arr_t* x, ldbl_t v) { array_push(x, &v, vtypeof(&v)); } +void libcdsb_array_push_pointer(arr_t* x, const void* v) { libcdsb_array_push(x, &v, vtypeof(&v)); } +void libcdsb_array_push_cstring(arr_t* x, const char* v) { libcdsb_array_push(x, &v, vtypeof(&v)); } +void libcdsb_array_push_string (arr_t* x, const str_t* v) { libcdsb_array_push(x, v, vtypeof( v)); } +void libcdsb_array_push_array (arr_t* x, const arr_t* v) { libcdsb_array_push(x, v, vtypeof( v)); } +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_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)); } +void libcdsb_array_push_int32 (arr_t* x, s32_t v) { libcdsb_array_push(x, &v, vtypeof(&v)); } +void libcdsb_array_push_int64 (arr_t* x, s64_t v) { libcdsb_array_push(x, &v, vtypeof(&v)); } +void libcdsb_array_push_uint8 (arr_t* x, u8_t v) { libcdsb_array_push(x, &v, vtypeof(&v)); } +void libcdsb_array_push_uint16 (arr_t* x, u16_t v) { libcdsb_array_push(x, &v, vtypeof(&v)); } +void libcdsb_array_push_uint32 (arr_t* x, u32_t v) { libcdsb_array_push(x, &v, vtypeof(&v)); } +void libcdsb_array_push_uint64 (arr_t* x, u64_t v) { libcdsb_array_push(x, &v, vtypeof(&v)); } +void libcdsb_array_push_float (arr_t* x, fl_t v) { libcdsb_array_push(x, &v, vtypeof(&v)); } +void libcdsb_array_push_double (arr_t* x, dbl_t v) { libcdsb_array_push(x, &v, vtypeof(&v)); } +void libcdsb_array_push_ldouble(arr_t* x, ldbl_t v) { libcdsb_array_push(x, &v, vtypeof(&v)); }