From eab45f3f58a58106da5834d17fe59724f6da5189 Mon Sep 17 00:00:00 2001 From: Elaina Claus Date: Thu, 15 Jan 2026 12:51:29 -0500 Subject: [PATCH] x-alloc class function prototypes --- include/nickel/xalloc.h | 16 +++++++++++++++- src/nickel/xalloc.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 src/nickel/xalloc.c diff --git a/include/nickel/xalloc.h b/include/nickel/xalloc.h index 4149f78..563c383 100644 --- a/include/nickel/xalloc.h +++ b/include/nickel/xalloc.h @@ -1,11 +1,25 @@ #ifndef __NICKEL_XALLOC_H_ #define __NICKEL_XALLOC_H_ +#include +#include + +#include +#include +#include + #ifdef __cplusplus extern "C" { #endif -/* header contents */ +void* ni_xmalloc(size_t size); +void ni_free(void* ptr); + +void* ni_xcalloc(size_t nmemb,size_t size); +void* ni_xrealloc(void* ptr, size_t size); + +char* ni_xstrdup(const char *s); +char* ni_xstrndup(const char s[], size_t n); #ifdef __cplusplus } diff --git a/src/nickel/xalloc.c b/src/nickel/xalloc.c new file mode 100644 index 0000000..c48cba0 --- /dev/null +++ b/src/nickel/xalloc.c @@ -0,0 +1,32 @@ +#include +#include + +#include +#include +#include + +#include "nickel/xalloc.h" + +void* ni_xmalloc(size_t size) { + +} + +void ni_free(void* ptr) { + +} + +void* ni_xcalloc(size_t nmemb,size_t size) { + +} + +void* ni_xrealloc(void* ptr, size_t size) { + +} + +char* ni_xstrdup(const char *s) { + +} + +char* ni_xstrndup(const char s[], size_t n) { + +} \ No newline at end of file