Refactor headers
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include "../../include/__attributes.h"
|
||||
#include "../../include/bits/__attributes.h"
|
||||
|
||||
#define pure__ Pure__
|
||||
#define const__ __attribute__((const))
|
||||
|
||||
+24
-12
@@ -7,15 +7,11 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "../../include/vtype.h"
|
||||
#include "../../include/extra/memory.h"
|
||||
#include "../../include/extra/cstring.h"
|
||||
#include "../../include/extra/vtype.h"
|
||||
#include "__attributes.h"
|
||||
|
||||
#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)
|
||||
@@ -38,7 +34,6 @@ extern const size_t LIBCDSB_VTYPE_SIZES[19];
|
||||
|
||||
#define abs(v) _Generic((v), ldbl_t: fabsl, dbl_t: fabs, fl_t: fabsf)(v)
|
||||
|
||||
#include "__attributes.h"
|
||||
|
||||
typedef vtype_uint8 u8_t;
|
||||
typedef vtype_uint16 u16_t;
|
||||
@@ -64,20 +59,37 @@ typedef vtype_dict dict_t;
|
||||
typedef vtype_hash hash_t;
|
||||
|
||||
|
||||
extern const size_t LIBCDSB_VTYPE_SIZES[19];
|
||||
|
||||
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
|
||||
|
||||
#define vtype_compare libcdsb_vtype_compare_values
|
||||
#define vtype_compare_eq libcdsb_vtype_compare_values_eq
|
||||
|
||||
#define vtype_hash libcdsb_vtype_hash
|
||||
#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_push_many libcdsb_stack_push_many
|
||||
#define stack_pop libcdsb_stack_pop
|
||||
#define stack_flush libcdsb_stack_flush
|
||||
#define strlen libcdsb_strlen
|
||||
#define strasciilen libcdsb_strasciilen
|
||||
#define strdup libcdsb_strdup
|
||||
#define strndup libcdsb_strndup
|
||||
#define memndup libcdsb_memndup
|
||||
|
||||
#define vtype_stringify libcdsb_vtype_stringify
|
||||
#define vtype_name libcdsb_vtype_name
|
||||
#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),\
|
||||
const void**: VTYPE_POINTER, void**: VTYPE_POINTER, const void*: VTYPE_POINTER, void*: VTYPE_POINTER,\
|
||||
const char**: VTYPE_STRING, char**: VTYPE_STRING, const char*: VTYPE_STRING, char*: VTYPE_STRING,\
|
||||
|
||||
Reference in New Issue
Block a user