mnemonicode-0.73/mndecode.c
changeset 0 d84d25d6cdbb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mnemonicode-0.73/mndecode.c	Sat Mar 08 21:04:41 2008 -0800
     1.3 @@ -0,0 +1,21 @@
     1.4 +#include <stdio.h>
     1.5 +#include "mnemonic.h"
     1.6 +
     1.7 +main ()
     1.8 +{
     1.9 +  char buf[0x90000];
    1.10 +  mn_byte outbuf[0x10000];
    1.11 +  int buflen;
    1.12 +  int n;
    1.13 +
    1.14 +  buflen = fread (buf, 1, sizeof buf - 1, stdin);
    1.15 +  buf[buflen] = 0;
    1.16 +
    1.17 +  n = mn_decode (buf, outbuf, sizeof outbuf);
    1.18 +  if (n < 0)
    1.19 +    fprintf (stderr, "mn_decode result %d\n", n);
    1.20 +  else 
    1.21 +    fwrite (outbuf, 1, n, stdout);
    1.22 +
    1.23 +  return 0;
    1.24 +}