From f5d445afa10ed7ba03b0ea9a5274f11904220700 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 20 Aug 2026 18:51:01 +0000 Subject: Move aplwc-repl into its own directory, and likewise for the aplwc library FossilOrigin-Name: 7e6b710fae494fadfe06bed16ae10bdda0f377067cb9411ed2b8bfc682d2fcbc --- src/bin/main.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/bin/main.c (limited to 'src/bin') 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 +#include +#include + +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; +} -- cgit v1.2.3