summaryrefslogtreecommitdiff
path: root/src/main.c
blob: 25382480e7b6e603eab2409a4101d62e987a59a2 (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
24
25
26
27
28
29
30
31
32
33
#include <stdio.h>
#include <stdlib.h>
#include <aplwc.h>

int
main(void)
{
	struct aplwc *aplwc;
	uint8_t *data;
	int ret;

	data = malloc(APLWC_MIN_MEM);
	if(data == NULL){
		fprintf(stderr, "Couldn't allocate memory\n");
		return 1;
	}

	ret = aplwc_new(&aplwc, data, APLWC_MIN_MEM);
	if(ret){
		fprintf(stderr, "Couldn't create new aplwc instance: %s\n", aplwc_errstr(aplwc));
		return 1;
	}

	ret = aplwc_destroy(aplwc);
	if(ret){
		fprintf(stderr, "Couldn't destroy the aplwc instance: %s\n", aplwc_errstr(aplwc));
		return 1;
	}

	free(data);

	return 0;
}