/* b is not needed for POSIX but harmless */
#define READ_MODE "rb"
#define WRITE_MODE "wb"
-extern void* xmalloc(size_t);
extern char* xstrdup(const char*);
extern void packed_to_token(long, char token[6]);
extern void newspeak(char*);
#include "linenoise/linenoise.h"
#include "newdb.h"
-void* xmalloc(size_t size)
-{
- void* ptr = malloc(size);
- if (ptr == NULL)
- {
- fprintf(stderr, "Out of memory!\n");
- exit(EXIT_FAILURE);
- }
- return(ptr);
-}
-
char* xstrdup(const char* s)
{
char* ptr = strdup(s);