x-alloc class function prototypes
This commit is contained in:
@@ -1,11 +1,25 @@
|
|||||||
#ifndef __NICKEL_XALLOC_H_
|
#ifndef __NICKEL_XALLOC_H_
|
||||||
#define __NICKEL_XALLOC_H_
|
#define __NICKEL_XALLOC_H_
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#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
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
32
src/nickel/xalloc.c
Normal file
32
src/nickel/xalloc.c
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
#include <sys/types.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#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) {
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user