projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cql2pqf: allow PQF queries from stdin
[yaz-moved-to-github.git]
/
util
/
yaz-record-conv.c
diff --git
a/util/yaz-record-conv.c
b/util/yaz-record-conv.c
index
4f943b6
..
eb3a478
100644
(file)
--- a/
util/yaz-record-conv.c
+++ b/
util/yaz-record-conv.c
@@
-1,5
+1,5
@@
/* This file is part of the YAZ toolkit.
/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2010 Index Data
+ * Copyright (C) 1995-2013 Index Data
* See the file LICENSE for details.
*/
* See the file LICENSE for details.
*/
@@
-7,6
+7,7
@@
#include <config.h>
#endif
#include <config.h>
#endif
+#include <stdlib.h>
#include <yaz/options.h>
#include <yaz/record_conv.h>
#include <yaz/options.h>
#include <yaz/record_conv.h>
@@
-30,6
+31,7
@@
int main (int argc, char **argv)
case 'V':
break;
case 0:
case 'V':
break;
case 0:
+#if YAZ_HAVE_XML2
if (!p)
{
xmlDocPtr doc = xmlParseFile(arg);
if (!p)
{
xmlDocPtr doc = xmlParseFile(arg);
@@
-70,15
+72,15
@@
int main (int argc, char **argv)
}
while ((c = getc(f)) != EOF)
wrbuf_putc(input_record, c);
}
while ((c = getc(f)) != EOF)
wrbuf_putc(input_record, c);
-
- r = yaz_record_conv_record(p,
+
+ r = yaz_record_conv_record(p,
wrbuf_buf(input_record),
wrbuf_len(input_record),
output_record);
if (r)
{
fprintf(stderr, "%s: %s: Error %s\n",
wrbuf_buf(input_record),
wrbuf_len(input_record),
output_record);
if (r)
{
fprintf(stderr, "%s: %s: Error %s\n",
- prog, arg,
+ prog, arg,
yaz_record_conv_get_error(p));
no_errors++;
}
yaz_record_conv_get_error(p));
no_errors++;
}
@@
-92,11
+94,19
@@
int main (int argc, char **argv)
fclose(f);
}
break;
fclose(f);
}
break;
+#else
+ fprintf(stderr, "%s: YAZ not compiled with Libxml2 support\n",
+ prog);
+ usage();
+ break;
+#endif
default:
usage();
}
default:
usage();
}
- }
+ }
+#if YAZ_HAVE_XML2
yaz_record_conv_destroy(p);
yaz_record_conv_destroy(p);
+#endif
if (no_errors)
exit(1);
exit(0);
if (no_errors)
exit(1);
exit(0);