Added a (trivial) program to print the contents of a journal file.

This commit is contained in:
Brian Wellington 2000-10-02 20:13:47 +00:00
parent d2792acfaf
commit 86ac7ea2ed
2 changed files with 33 additions and 1 deletions

View file

@ -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

26
bin/tests/journalprint.c Normal file
View file

@ -0,0 +1,26 @@
#include <isc/mem.h>
#include <isc/util.h>
#include <dns/journal.h>
#include <dns/types.h>
#include <stdlib.h>
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);
}