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 "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;
}
|