aboutsummaryrefslogtreecommitdiff
path: root/include/util.h
blob: 0e2b289b85f11fe3f71b5d494f98ddeaf7033318 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef CERC_UTIL_H
#define CERC_UTIL_H
#include <stddef.h>

enum exit_status {
	/* EXIT_SUCCESS = 0 (defined in stdlib.h) */
	EXIT_USER = 1,
	EXIT_LEX = 2,
	EXIT_PARSE = 3,
	EXIT_CHECK = 4,
	EXIT_ABNORMAL = 255,
};

struct path {
	const char **segments;
	int segsz, seglen;
};

void *must_malloc(size_t size);
void *must_calloc(size_t nmemb, size_t size);
void *must_realloc(void *ptr, size_t size);

#endif