X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=util%2Fmarcdump.c;h=3b6163ca2002bba981d782deeba106b1746454d9;hb=d3263920e1450036b3add4b0a8c049136594afa1;hp=e0565932d6201a9d70b87e726a95cfed4c314a3e;hpb=626ee9b09c95c3585c432623c042872b0d1fea92;p=yaz-moved-to-github.git diff --git a/util/marcdump.c b/util/marcdump.c index e056593..3b6163c 100644 --- a/util/marcdump.c +++ b/util/marcdump.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2006, Index Data ApS * See the file LICENSE for details. * - * $Id: marcdump.c,v 1.36 2006-04-19 10:05:04 adam Exp $ + * $Id: marcdump.c,v 1.40 2006-07-06 10:17:55 adam Exp $ */ #define _FILE_OFFSET_BITS 64 @@ -11,7 +11,7 @@ #include #endif -#if HAVE_XML2 +#if YAZ_HAVE_XML2 #include #include @@ -54,7 +54,7 @@ static void usage(const char *prog) prog); } -#if HAVE_XML2 +#if YAZ_HAVE_XML2 static void marcdump_read_xml(yaz_marc_t mt, const char *fname) { xmlNodePtr ptr; @@ -105,7 +105,7 @@ static void dump(const char *fname, const char *from, const char *to, if (read_xml) { -#if HAVE_XML2 +#if YAZ_HAVE_XML2 marcdump_read_xml(mt, fname); #else return; @@ -129,9 +129,9 @@ static void dump(const char *fname, const char *from, const char *to, int marc_no = 0; for(;; marc_no++) { - int len; + size_t len; char *result = 0; - int rlen; + size_t rlen; size_t r; char buf[100001]; @@ -139,7 +139,8 @@ static void dump(const char *fname, const char *from, const char *to, if (r < 5) { if (r && print_offset && verbose) - printf ("\n", r); + printf ("\n", + (long) r); break; } while (*buf < '0' || *buf > '9') @@ -203,7 +204,9 @@ static void dump(const char *fname, const char *from, const char *to, fclose(sf); } } - r = yaz_marc_decode_buf (mt, buf, -1, &result, &rlen); + { int rlentmp = (int) rlen; + r = yaz_marc_decode_buf (mt, buf, -1, &result, &rlentmp); + rlen = (size_t) rlentmp; } if (r > 0 && result) { fwrite (result, rlen, 1, stdout); @@ -211,7 +214,7 @@ static void dump(const char *fname, const char *from, const char *to, if (r > 0 && cfile) { char *p = buf; - int i; + size_t i; if (count) fprintf (cfile, ","); fprintf (cfile, "\n"); @@ -282,7 +285,7 @@ int main (int argc, char **argv) cfile = fopen(arg, "w"); break; case 'x': -#if HAVE_XML2 +#if YAZ_HAVE_XML2 read_xml = 1; #else fprintf(stderr, "%s: -x not supported."