Add base headers
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include <string.h>
|
||||
#include "../__attributes.h"
|
||||
|
||||
#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 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__;
|
||||
|
||||
#define strlen libcdsb_strlen
|
||||
#define strasciilen libcdsb_strasciilen
|
||||
|
||||
#define strdup libcdsb_strdup
|
||||
#define strndup libcdsb_strndup
|
||||
#define memndup libcdsb_memndup
|
||||
|
||||
#endif /* LIBCDSB_EXTRA_CSTRING_H */
|
||||
@@ -0,0 +1,20 @@
|
||||
/* This software is licensed by the MIT License, see LICENSE file */
|
||||
/* Copyright © 2022 Gregory Lirent */
|
||||
|
||||
#include <stddef.h>
|
||||
#include "../__attributes.h"
|
||||
|
||||
#ifndef LIBCDSB_EXTRA_MEMORY_H
|
||||
#define LIBCDSB_EXTRA_MEMORY_H
|
||||
|
||||
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__;
|
||||
|
||||
#define aligned_alloc libcdsb_aalloc
|
||||
#define malloc libcdsb_malloc
|
||||
#define calloc libcdsb_calloc
|
||||
#define realloc libcdsb_realloc
|
||||
|
||||
#endif /* LIBCDSB_EXTRA_MEMORY_H */
|
||||
Reference in New Issue
Block a user