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
Fix install doc rule for Automake 1.11
[yaz-moved-to-github.git]
/
util
/
srwtst.c
diff --git
a/util/srwtst.c
b/util/srwtst.c
index
b10fb5b
..
5c3d4bd
100644
(file)
--- a/
util/srwtst.c
+++ b/
util/srwtst.c
@@
-1,13
+1,12
@@
-/*
- * Copyright (c) 2002-2003, Index Data.
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2009 Index Data
* See the file LICENSE for details.
* See the file LICENSE for details.
- *
- * $Id: srwtst.c,v 1.1 2003-10-27 12:21:40 adam Exp $
*/
*/
+#include <stdlib.h>
#include <yaz/srw.h>
#include <yaz/srw.h>
-#if HAVE_XML2
+#if YAZ_HAVE_XML2
Z_SOAP_Handler h[2] = {
{"http://www.loc.gov/zing/srw/v1.0/", 0, (Z_SOAP_fun) yaz_srw_codec},
{0, 0, 0}
Z_SOAP_Handler h[2] = {
{"http://www.loc.gov/zing/srw/v1.0/", 0, (Z_SOAP_fun) yaz_srw_codec},
{0, 0, 0}
@@
-24,7
+23,6
@@
int main(int argc, char **argv)
ODR decode, encode;
int debug = 0;
ODR decode, encode;
int debug = 0;
- nmem_init();
if (argc == 2 && !strcmp(argv[1], "debug"))
debug = 1;
no = fread(buf, 1, sizeof(buf), stdin);
if (argc == 2 && !strcmp(argv[1], "debug"))
debug = 1;
no = fread(buf, 1, sizeof(buf), stdin);
@@
-49,7
+47,7
@@
int main(int argc, char **argv)
if (soap_package->which == Z_SOAP_generic &&
soap_package->u.generic->no == 0)
{
if (soap_package->which == Z_SOAP_generic &&
soap_package->u.generic->no == 0)
{
- Z_SRW_PDU *sr = soap_package->u.generic->p;
+ Z_SRW_PDU *sr = (Z_SRW_PDU *) soap_package->u.generic->p;
if (sr->which == Z_SRW_searchRetrieve_request)
{
Z_SRW_searchRetrieveRequest *req = sr->u.request;
if (sr->which == Z_SRW_searchRetrieve_request)
{
Z_SRW_searchRetrieveRequest *req = sr->u.request;
@@
-76,8
+74,11
@@
int main(int argc, char **argv)
{
fprintf (stderr, "%d\n", i);
if (res->records[i].recordData_buf)
{
fprintf (stderr, "%d\n", i);
if (res->records[i].recordData_buf)
- fwrite(res->records[i].recordData_buf, 1,
- res->records[i].recordData_len, stderr);
+ {
+ fprintf(stderr, "%.*s",
+ res->records[i].recordData_len,
+ res->records[i].recordData_buf);
+ }
}
}
}
}
}
}
@@
-87,7
+88,9
@@
int main(int argc, char **argv)
ret = z_soap_codec(encode, &soap_package,
&content_buf, &content_len, h);
if (content_buf && content_len)
ret = z_soap_codec(encode, &soap_package,
&content_buf, &content_len, h);
if (content_buf && content_len)
- fwrite (content_buf, content_len, 1, stdout);
+ {
+ printf("%.*s", content_len, content_buf);
+ }
else
{
fprintf(stderr, "No output!\n");
else
{
fprintf(stderr, "No output!\n");
@@
-95,7
+98,6
@@
int main(int argc, char **argv)
}
odr_destroy(decode);
odr_destroy(encode);
}
odr_destroy(decode);
odr_destroy(encode);
- nmem_exit();
exit(0);
}
#else
exit(0);
}
#else
@@
-105,3
+107,12
@@
int main(int argc, char **argv)
exit(1);
}
#endif
exit(1);
}
#endif
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * c-file-style: "Stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+