diff options
Diffstat (limited to '0.4.5/encoder/test')
-rw-r--r-- | 0.4.5/encoder/test/Makefile.am | 51 | ||||
-rw-r--r-- | 0.4.5/encoder/test/enc_test.c | 30 |
2 files changed, 81 insertions, 0 deletions
diff --git a/0.4.5/encoder/test/Makefile.am b/0.4.5/encoder/test/Makefile.am new file mode 100644 index 0000000..1d8518e --- /dev/null +++ b/0.4.5/encoder/test/Makefile.am @@ -0,0 +1,51 @@ +# +# $Id$ +# +# Copyright 2015, Juniper Networks, Inc. +# All rights reserved. +# This SOFTWARE is licensed under the LICENSE provided in the +# ../Copyright file. By downloading, installing, copying, or otherwise +# using the SOFTWARE, you agree to be bound by the terms of that +# LICENSE. + +if LIBXO_WARNINGS_HIGH +LIBXO_WARNINGS = HIGH +endif +if HAVE_GCC +GCC_WARNINGS = yes +endif +include ${top_srcdir}/warnings.mk + +enc_testincdir = ${includedir}/libxo + +AM_CFLAGS = \ + -I${top_srcdir}/libxo \ + -I${top_builddir}/libxo \ + ${WARNINGS} + +LIBNAME = libenc_test +pkglib_LTLIBRARIES = libenc_test.la +LIBS = \ + -L${top_builddir}/libxo -lxo + +LDADD = ${top_builddir}/libxo/libxo.la + +libenc_test_la_SOURCES = \ + enc_test.c + +pkglibdir = ${XO_ENCODERDIR} + +UGLY_NAME = test.enc + +install-exec-hook: + @DLNAME=`sh -c '. ./libenc_test.la ; echo $$dlname'` ; \ + if [ x"$$DLNAME" = x ]; \ + then DLNAME=${LIBNAME}.${XO_LIBEXT}; fi ; \ + if [ "$(build_os)" = "cygwin" ]; \ + then DLNAME="../bin/$$DLNAME"; fi ; \ + echo Install link $$DLNAME "->" ${UGLY_NAME} "..." ; \ + mkdir -p ${DESTDIR}${XO_ENCODERDIR} ; \ + cd ${DESTDIR}${XO_ENCODERDIR} \ + && chmod +w . \ + && rm -f ${UGLY_NAME} \ + && ${LN_S} $$DLNAME ${UGLY_NAME} diff --git a/0.4.5/encoder/test/enc_test.c b/0.4.5/encoder/test/enc_test.c new file mode 100644 index 0000000..ec49499 --- /dev/null +++ b/0.4.5/encoder/test/enc_test.c @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2015, Juniper Networks, Inc. + * All rights reserved. + * This SOFTWARE is licensed under the LICENSE provided in the + * ../Copyright file. By downloading, installing, copying, or otherwise + * using the SOFTWARE, you agree to be bound by the terms of that + * LICENSE. + * Phil Shafer, August 2015 + */ + +#include "xo.h" +#include "xo_encoder.h" + +static int +test_handler (XO_ENCODER_HANDLER_ARGS) +{ + printf("op %s: [%s] [%s]\n", xo_encoder_op_name(op), + name ?: "", value ?: ""); + + return 0; +} + +int +xo_encoder_library_init (XO_ENCODER_INIT_ARGS) +{ + arg->xei_version = XO_ENCODER_VERSION; + arg->xei_handler = test_handler; + + return 0; +} |