diff options
Diffstat (limited to 'src/bin')
| -rw-r--r-- | src/bin/main.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/bin/main.c b/src/bin/main.c new file mode 100644 index 0000000..2538248 --- /dev/null +++ b/src/bin/main.c @@ -0,0 +1,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; +} |