summaryrefslogtreecommitdiff
path: root/src/errors.c
blob: 014f859dc6dc40561f3ad3179ae4d221203fa134 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <aplwc.h>
#include <aplwc_internal.h>

static const char *errors[] = {
	[APLWC_OK] =
		"",
	[APLWC_NOT_IMPLEMENTED] =
		"Not yet implemented",
	[APLWC_MALLOC_FAILED] =
		"Could not allocate memory",
};

const char *
rc_to_string(AplwcRc rc)
{
	const char *str = NULL;
	if((rc > 0) && (rc < NELEM(errors)))
		str = errors[rc];
	return str;
}