diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/dktools/test-binenc.c |
Initial commit
Diffstat (limited to 'support/dktools/test-binenc.c')
-rw-r--r-- | support/dktools/test-binenc.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/support/dktools/test-binenc.c b/support/dktools/test-binenc.c new file mode 100644 index 0000000000..e5c3dfe101 --- /dev/null +++ b/support/dktools/test-binenc.c @@ -0,0 +1,45 @@ +/* + WARNING: This file was generated by dkct. + Changes you make here will be lost if dkct is run again! + You should modify the original source and run dkct on it. + Original source: test-binenc.ctr +*/ + +/** @file test-binenc.c The test-binenc module. +*/ + + +#line 1 "test-binenc.ctr" + + +#include "dk4conf.h" +#include <stdio.h> + + +#include "dk4binenc.h" + + +static char tbuf[9]; + + +static const unsigned char srcbuf[] = { + 0x01, 0x02, 0x0A, 0x0F, 0x20, 0x24, 0xFF +}; + +int main(void) +{ + int res; + + res = dk4binenc( + tbuf, sizeof(tbuf), srcbuf, sizeof(srcbuf), + DK4_BINARY_TO_TEXT_ENCODING_A85, + NULL + ); + if (0 < res) { + fputs(tbuf, stdout); + fputc('\n', stdout); + } else { + fputs("buffer to small\n", stdout); + } + return 0; +} |