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.ctr |
Initial commit
Diffstat (limited to 'support/dktools/test-binenc.ctr')
-rw-r--r-- | support/dktools/test-binenc.ctr | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/support/dktools/test-binenc.ctr b/support/dktools/test-binenc.ctr new file mode 100644 index 0000000000..0a995eb792 --- /dev/null +++ b/support/dktools/test-binenc.ctr @@ -0,0 +1,33 @@ + + +#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; +} |