25 lines
519 B
C
25 lines
519 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <errno.h>
|
|
|
|
#include <skipstone/message.h>
|
|
|
|
int main(int argc, char **argv) {
|
|
uint8_t buf[6] = "\x5KMFDM",
|
|
str[SKIPSTONE_MESSAGE_MAX_STRLEN];
|
|
|
|
if (skipstone_message_unpack(buf, sizeof(buf), "z", str) < 0) {
|
|
fprintf(stderr, "%s: %s: %s\n",
|
|
argv[0], "skipstone_message_unpack()", strerror(errno));
|
|
|
|
goto message_unpack;
|
|
}
|
|
|
|
printf("%s\n", str);
|
|
|
|
return 0;
|
|
|
|
error_message_unpack:
|
|
return 1;
|
|
}
|