From 04b09c082a7882398a10d5ec62e80ac175fe2a9b Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 30 May 2008 13:31:16 +0200 Subject: [PATCH] Added proper header for reader record utilities for yaz-ztest. --- ztest/Makefile.am | 2 +- ztest/read-grs.c | 6 ++++-- ztest/read-marc.c | 7 +++++-- ztest/ztest.c | 6 ++---- ztest/ztest.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 58 insertions(+), 9 deletions(-) create mode 100644 ztest/ztest.h diff --git a/ztest/Makefile.am b/ztest/Makefile.am index a10a4c4..5a5297f 100644 --- a/ztest/Makefile.am +++ b/ztest/Makefile.am @@ -3,7 +3,7 @@ bin_PROGRAMS=yaz-ztest -yaz_ztest_SOURCES=ztest.c read-grs.c read-marc.c +yaz_ztest_SOURCES=ztest.c read-grs.c read-marc.c ztest.h EXTRA_DIST=dummy-records dummy-words dummy-grs ztest.pem config1.xml diff --git a/ztest/read-grs.c b/ztest/read-grs.c index ed806cf..f1f40f3 100644 --- a/ztest/read-grs.c +++ b/ztest/read-grs.c @@ -3,8 +3,8 @@ * See the file LICENSE for details. */ -/* - * Little toy-thing to read a GRS-1 records from a file. +/** \file + * \brief Little toy-thing to read GRS-1 records from a file. */ #include @@ -14,6 +14,8 @@ #include #include +#include "ztest.h" + #define GRS_MAX_FIELDS 50 static Z_GenericRecord *read_grs1(FILE *f, ODR o) diff --git a/ztest/read-marc.c b/ztest/read-marc.c index afd6272..e1ecb3b 100644 --- a/ztest/read-marc.c +++ b/ztest/read-marc.c @@ -3,14 +3,17 @@ * See the file LICENSE for details. */ -/* - * Little toy-thing to read a MARC records from a fixed array. +/** \file + * \brief Little toy-thing to read MARC records from a file or fixed array. */ + #include #include #include #include +#include "ztest.h" + char *marc_records[] = { "\x30\x30\x33\x36\x36\x6E\x61\x6D\x20\x20\x32\x32\x30\x30\x31\x36" diff --git a/ztest/ztest.c b/ztest/ztest.c index 6b0c11f..7ed5e2a 100644 --- a/ztest/ztest.c +++ b/ztest/ztest.c @@ -19,13 +19,11 @@ #include #include +#include "ztest.h" + static int log_level=0; static int log_level_set=0; -Z_GenericRecord *dummy_grs_record (int num, ODR o); -char *dummy_marc_record (int num, ODR odr); -char *dummy_xml_record (int num, ODR odr); - int ztest_search(void *handle, bend_search_rr *rr); int ztest_sort(void *handle, bend_sort_rr *rr); int ztest_present(void *handle, bend_present_rr *rr); diff --git a/ztest/ztest.h b/ztest/ztest.h new file mode 100644 index 0000000..5f7f2af --- /dev/null +++ b/ztest/ztest.h @@ -0,0 +1,46 @@ +/* This file is part of the YAZ toolkit. + * Copyright (C) 1995-2008 Index Data. + * All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Index Data nor the names of its contributors + * may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/** + * \file + * \brief Internal header for yaz-ztest + */ + +#include + +Z_GenericRecord *dummy_grs_record (int num, ODR o); +char *dummy_marc_record (int num, ODR odr); +char *dummy_xml_record (int num, ODR odr); + + +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ + -- 1.7.10.4