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
For ICU enabled YAZ defined YAZ_HAVE_ICU instead of HAVE_ICU.
[yaz-moved-to-github.git]
/
util
/
marcdump.c
diff --git
a/util/marcdump.c
b/util/marcdump.c
index
4ecdc86
..
e65aed5
100644
(file)
--- a/
util/marcdump.c
+++ b/
util/marcdump.c
@@
-2,7
+2,7
@@
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: marcdump.c,v 1.50 2007-03-17 09:14:00 adam Exp $
+ * $Id: marcdump.c,v 1.53 2007-09-23 07:40:13 adam Exp $
*/
#define _FILE_OFFSET_BITS 64
*/
#define _FILE_OFFSET_BITS 64
@@
-52,7
+52,7
@@
static void usage(const char *prog)
{
fprintf (stderr, "Usage: %s [-c cfile] [-f from] [-t to] "
"[-i format] [-o format] "
{
fprintf (stderr, "Usage: %s [-c cfile] [-f from] [-t to] "
"[-i format] [-o format] "
- "[-n] [-l pos=value] [-v] [-C chunk] [-s splitfname] file...\n",
+ "[-n] [-l pos=value] [-v] [-C chunk] [-s splitfname] [-p] file...\n",
prog);
}
prog);
}
@@
-90,8
+90,8
@@
static void marcdump_read_line(yaz_marc_t mt, const char *fname)
{
WRBUF wrbuf = wrbuf_alloc();
yaz_marc_write_mode(mt, wrbuf);
{
WRBUF wrbuf = wrbuf_alloc();
yaz_marc_write_mode(mt, wrbuf);
- fputs(wrbuf_buf(wrbuf), stdout);
- wrbuf_free(wrbuf, 1);
+ fputs(wrbuf_cstr(wrbuf), stdout);
+ wrbuf_destroy(wrbuf);
}
fclose(inf);
}
}
fclose(inf);
}
@@
-116,9
+116,9
@@
static void marcdump_read_xml(yaz_marc_t mt, const char *fname)
{
yaz_marc_write_mode(mt, wrbuf);
{
yaz_marc_write_mode(mt, wrbuf);
- fputs(wrbuf_buf(wrbuf), stdout);
+ fputs(wrbuf_cstr(wrbuf), stdout);
}
}
- wrbuf_free(wrbuf, 1);
+ wrbuf_destroy(wrbuf);
}
xmlFreeDoc(doc);
}
}
xmlFreeDoc(doc);
}
@@
-181,10
+181,10
@@
static void dump(const char *fname, const char *from, const char *to,
fprintf (cfile, "char *marc_records[] = {\n");
for(;; marc_no++)
{
fprintf (cfile, "char *marc_records[] = {\n");
for(;; marc_no++)
{
- char *result = 0;
+ const char *result = 0;
size_t len;
size_t rlen;
size_t len;
size_t rlen;
- int len_result;
+ size_t len_result;
size_t r;
char buf[100001];
size_t r;
char buf[100001];
@@
-274,7
+274,7
@@
static void dump(const char *fname, const char *from, const char *to,
fclose(sf);
}
}
fclose(sf);
}
}
- len_result = (int) rlen;
+ len_result = rlen;
r = yaz_marc_decode_buf(mt, buf, -1, &result, &len_result);
if (r > 0 && result)
{
r = yaz_marc_decode_buf(mt, buf, -1, &result, &len_result);
if (r > 0 && result)
{
@@
-328,7
+328,6
@@
int main (int argc, char **argv)
const char *leader_spec = 0;
int write_using_libxml2 = 0;
const char *leader_spec = 0;
int write_using_libxml2 = 0;
- nmem_init();
#if HAVE_LOCALE_H
setlocale(LC_CTYPE, "");
#endif
#if HAVE_LOCALE_H
setlocale(LC_CTYPE, "");
#endif
@@
-443,7
+442,6
@@
int main (int argc, char **argv)
}
if (cfile)
fclose (cfile);
}
if (cfile)
fclose (cfile);
- nmem_exit();
if (!no)
{
usage(prog);
if (!no)
{
usage(prog);