summaryrefslogtreecommitdiff
path: root/comp/lucas-standen-NEA/code/global/util.h
blob: b10a1f4fe0968bd7f90beeef2995626d2568e2d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <errno.h>
#include <error.h>


// functions for user
void Die(); // brings down the program
void *CheckedMalloc(long size); // malloc checked with autofree
void *CheckedRealloc(void *out, long size); // realloc checked with autofree
int CheckedFree(void *ptr); // frees a pointer if it is in the array MEMptrs
void CheckedFreeALL(); // frees all pointers in the array MEMptrs

//checking functions, return NULL if the data is not of their type, else return the value.
I64 *isNum(char *str); 
Float *isFloat(char *str);
Char *isChar(char *str);