author | Jens Alfke <jens@mooseyard.com> |
Sat May 31 11:26:17 2008 -0700 (2008-05-31) | |
changeset 12 | 66b870428f85 |
permissions | -rw-r--r-- |
jens@0 | 1 |
#include <stdio.h> |
jens@0 | 2 |
#include "mnemonic.h" |
jens@0 | 3 |
|
jens@0 | 4 |
main () |
jens@0 | 5 |
{ |
jens@0 | 6 |
char buf[0x90000]; |
jens@0 | 7 |
mn_byte outbuf[0x10000]; |
jens@0 | 8 |
int buflen; |
jens@0 | 9 |
int n; |
jens@0 | 10 |
|
jens@0 | 11 |
buflen = fread (buf, 1, sizeof buf - 1, stdin); |
jens@0 | 12 |
buf[buflen] = 0; |
jens@0 | 13 |
|
jens@0 | 14 |
n = mn_decode (buf, outbuf, sizeof outbuf); |
jens@0 | 15 |
if (n < 0) |
jens@0 | 16 |
fprintf (stderr, "mn_decode result %d\n", n); |
jens@0 | 17 |
else |
jens@0 | 18 |
fwrite (outbuf, 1, n, stdout); |
jens@0 | 19 |
|
jens@0 | 20 |
return 0; |
jens@0 | 21 |
} |