/*
- * Copyright (C) 1995-2005, Index Data ApS
+ * Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: yaziconv.c,v 1.2 2005-01-15 19:47:15 adam Exp $
+ * $Id: yaziconv.c,v 1.9 2007-05-25 16:19:46 marc Exp $
*/
#if HAVE_CONFIG_H
#include <config.h>
#endif
+#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <ctype.h>
{
if (outbuf != outbuf0)
fwrite (outbuf0, 1, outbuf - outbuf0, stdout);
+ outbuf = outbuf0;
+ outbytesleft = CHUNK_OUT;
+ r = yaz_iconv (cd, 0, 0, &outbuf, &outbytesleft);
+ if (outbuf != outbuf0)
+ fwrite (outbuf0, 1, outbuf - outbuf0, stdout);
break;
}
inbytesleft = r;
}
if (verbose > 1)
{
- fprintf (stderr, "yaz_iconv: inbytesleft=%d outbytesleft=%d\n",
- inbytesleft, outbytesleft);
+ fprintf (stderr, "yaz_iconv: inbytesleft=%ld outbytesleft=%ld\n",
+ (long) inbytesleft, (long) outbytesleft);
}
r = yaz_iconv (cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
}
if (r == 0)
{
- fprintf (stderr, "invalid sequence\n");
+ fprintf (stderr, "invalid sequence due to missing input\n");
return ;
}
inbytesleft += r;
break;
default:
fprintf (stderr, "yaziconv: Usage\n"
- "siconv -f encoding -t encoding [-v] [file]\n");
+ "yaziconv -f encoding -t encoding [-v] [file]\n");
exit(1);
}
}
yaz_iconv_close (cd);
return 0;
}
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+