#define READ_MODE "rb"
#define WRITE_MODE "wb"
extern void* xmalloc(size_t size);
-extern char* xstrdup(const char*);
extern void packed_to_token(long, char token[]);
extern void token_to_packed(char token[], long*);
extern void vspeak(const char*, va_list);
return (ptr);
}
-char* xstrdup(const char* s)
-{
- char* ptr = strdup(s);
- if (ptr == NULL) {
- fprintf(stderr, "Out of memory!\n");
- exit(EXIT_FAILURE);
- }
- return (ptr);
-}
-
void packed_to_token(long packed, char token[6])
{
// Unpack and map back to ASCII.