From 86ac7ea2ede54dc587074688ed6cec4d05645618 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Mon, 2 Oct 2000 20:13:47 +0000 Subject: [PATCH] Added a (trivial) program to print the contents of a journal file. --- bin/tests/Makefile.in | 8 +++++++- bin/tests/journalprint.c | 26 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 bin/tests/journalprint.c diff --git a/bin/tests/Makefile.in b/bin/tests/Makefile.in index d77f89125f..fa01a5a5e9 100644 --- a/bin/tests/Makefile.in +++ b/bin/tests/Makefile.in @@ -13,7 +13,7 @@ # NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION # WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# $Id: Makefile.in,v 1.102 2000/08/22 01:11:52 bwelling Exp $ +# $Id: Makefile.in,v 1.103 2000/10/02 20:13:47 bwelling Exp $ srcdir = @srcdir@ VPATH = @srcdir@ @@ -58,6 +58,7 @@ XTARGETS = adb_test \ hash_test \ fsaccess_test \ inter_test \ + journalprint \ keyboard_test \ lex_test \ lfsr_test \ @@ -100,6 +101,7 @@ SRCS = adb_test.c \ hash_test.c \ fsaccess_test.c \ inter_test.c \ + journalprint.c \ keyboard_test.c \ lex_test.c \ lfsr_test.c \ @@ -300,6 +302,10 @@ sig0_test: sig0_test.@O@ ${DNSDEPLIBS} ${LIBTOOL} ${CC} ${CFLAGS} -o $@ sig0_test.@O@ \ ${DNSLIBS} ${ISCLIBS} ${LIBS} +journalprint: journalprint.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS} + ${LIBTOOL} ${CC} ${CFLAGS} -o $@ journalprint.@O@ \ + ${DNSLIBS} ${ISCLIBS} ${LIBS} + distclean:: rm -f headerdep_test.sh diff --git a/bin/tests/journalprint.c b/bin/tests/journalprint.c new file mode 100644 index 0000000000..110420d30f --- /dev/null +++ b/bin/tests/journalprint.c @@ -0,0 +1,26 @@ +#include +#include + +#include +#include + +#include + +int +main(int argc, char **argv) { + char *file; + isc_mem_t *mctx = NULL; + + if (argc != 2) { + printf("usage: %s journal", argv[0]); + exit(1); + } + + file = argv[1]; + + RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS); + + RUNTIME_CHECK(dns_journal_print(mctx, file, stdout) == ISC_R_SUCCESS); + isc_mem_detach(&mctx); + exit(0); +}