- fprintf (stderr, "Usage: %s [-i format] [-o format] [-f from] [-t to] "
- "[-l pos=value] [-c cfile] [-s prefix] [-C size] [-n] "
- "[-p] [-v] [-V] file...\n",
- prog);
-}
+ fprintf(stderr, "Usage: %s [-i format] [-o format] [-f from] [-t to] "
+ "[-l pos=value] [-c cfile] [-s prefix] [-C size] [-n] "
+ "[-p] [-v] [-V] file...\n",
+ prog);
+}
- fprintf (stderr, "%s: cannot open %s:%s\n",
- prog, fname, strerror (errno));
+ fprintf(stderr, "%s: cannot open %s:%s\n",
+ prog, fname, strerror(errno));
while (yaz_marc_read_line(mt, getbyte_stream,
ungetbyte_stream, inf) == 0)
{
while (yaz_marc_read_line(mt, getbyte_stream,
ungetbyte_stream, inf) == 0)
{
int r = yaz_marc_read_xml(mt, ptr);
if (r)
fprintf(stderr, "yaz_marc_read_xml failed\n");
else
{
int write_rc = yaz_marc_write_mode(mt, wrbuf);
int r = yaz_marc_read_xml(mt, ptr);
if (r)
fprintf(stderr, "yaz_marc_read_xml failed\n");
else
{
int write_rc = yaz_marc_write_mode(mt, wrbuf);
- if (!strcmp((const char *) ptr->name, "record"))
+ if (!strcmp((const char *) ptr->name, "record") ||
+ !strcmp((const char *) ptr->name, "r"))
- yaz_marc_set_read_format(mt, input_format);
- yaz_marc_set_write_format(mt, output_format);
+ yaz_marc_xml(mt, output_format);
yaz_marc_write_using_libxml2(mt, write_using_libxml2);
yaz_marc_debug(mt, verbose);
yaz_marc_write_using_libxml2(mt, write_using_libxml2);
yaz_marc_debug(mt, verbose);
- fprintf (stderr, "%s: cannot open %s:%s\n",
- prog, fname, strerror (errno));
+ fprintf(stderr, "%s: cannot open %s:%s\n",
+ prog, fname, strerror(errno));
-
- r = fread (buf, 1, 5, inf);
+
+ r = fread(buf, 1, 5, inf);
long off = ftell(inf) - 5;
if (verbose || print_offset)
printf("<!-- Skipping bad byte %d (0x%02X) at offset "
long off = ftell(inf) - 5;
if (verbose || print_offset)
printf("<!-- Skipping bad byte %d (0x%02X) at offset "
- r = fread (buf + 5, 1, rlen, inf);
+ r = fread(buf + 5, 1, rlen, inf);
- r = fread (buf + len, 1, 1, inf);
+ r = fread(buf + len, 1, 1, inf);
- fprintf (cfile, " \"");
- fprintf (cfile, "\\x%02X", p[i] & 255);
-
+ fprintf(cfile, " \"");
+ fprintf(cfile, "\\x%02X", p[i] & 255);
+
|| input_format == YAZ_MARC_XCHANGE)
{
fprintf(stderr, "%s: Libxml2 support not enabled\n", prog);
|| input_format == YAZ_MARC_XCHANGE)
{
fprintf(stderr, "%s: Libxml2 support not enabled\n", prog);
rather than WRBUF */
if (strlen(arg) > 4 && strncmp(arg, "xml,", 4) == 0)
{
rather than WRBUF */
if (strlen(arg) > 4 && strncmp(arg, "xml,", 4) == 0)
{