#include #include #include #include #include #include /** * Encode the values [5, 7, (2^128)-1] * * Should produce something like * * [0,12,0,11,0,38,0,1,0,4] */ int main(int argc, char *argv[]) { int out; if (argc < 2) { out = STDOUT_FILENO; } else { out = creat(argv[1], 0755); if (out == -1) { perror("foo"); return 1; } } blk128_t vals[] = { {0, 5}, {0, 7}, {UINT64_MAX, UINT64_MAX} }; sole_stream *strm = sole_encode_init(out); if (strm == NULL) { printf("Could not allocate sole_stream!\n\n"); printf("usage: %s\n", argv[0]); return 0; } sole_encode_blk128(strm, &vals[0]); sole_encode_blk128(strm, &vals[1]); sole_encode_blk128(strm, &vals[2]); sole_encode_end(strm); if (out != STDOUT_FILENO) close(out); return 0; }