moved unber and enber into asn1-tools

This commit is contained in:
Lev Walkin 2019-01-21 14:54:50 -08:00
parent 4cc779fd9b
commit b47d1adac3
15 changed files with 55 additions and 28 deletions

6
.gitignore vendored
View File

@ -34,8 +34,10 @@ stamp-h*
# /asn1c/
/asn1c/asn1c
/asn1c/unber
/asn1c/enber
# /asn1c-tools
/asn1-tools/enber
/asn1-tools/unber
# /skeletons
/skeletons/check-*

View File

@ -8,8 +8,8 @@ SUBDIRS = \
libasn1common libasn1parser \
libasn1fix libasn1print \
libasn1compiler \
asn1c skeletons tests \
examples doc
asn1-tools asn1c skeletons \
tests examples doc
docsdir = $(datadir)/doc/asn1c

11
asn1-tools/Makefile.am Normal file
View File

@ -0,0 +1,11 @@
@CODE_COVERAGE_RULES@
SUBDIRS=unber enber
AM_CFLAGS = @ADD_CFLAGS@
AM_CPPFLAGS = -I${top_srcdir}/skeletons
dist_check_SCRIPTS = check-xxber.sh
TESTS_ENVIRONMENT= builddir=${builddir}
TESTS = $(dist_check_SCRIPTS)
CLEANFILES = .check-xxber.*.tmp

2
asn1-tools/README Normal file
View File

@ -0,0 +1,2 @@
unber - The ASN.1 BER Decoder
enber - Reverse unber(1) output back into BER

View File

@ -3,6 +3,10 @@
ORIG="./.check-xxber.orig.$$.tmp"
TEST="./.check-xxber.test.$$.tmp"
builddir=${builddir:-.}
ENBER=${builddir}/enber/enber
UNBER=${builddir}/unber/unber
# Test diff(1) capabilities
diff -a . . 2>/dev/null && diffArgs="-a" # Assume text files
diff -u . . 2>/dev/null && diffArgs="$diffArgs -u" # Unified diff output
@ -23,7 +27,7 @@ cat<<EOM > $ORIG
</I O="32" T="[UNIVERSAL 0]" TL="2" L="4">
EOM
./enber $ORIG | ./unber -p -i 0 - > $TEST 2>&1
${ENBER} $ORIG | ${UNBER} -p -i 0 - > $TEST 2>&1
diff $diffArgs "$ORIG" "$TEST" >/dev/null 2>&1
diffExitCode=$?
@ -36,7 +40,7 @@ fi
echo '</I O="34" T="[UNIVERSAL 0]" TL="2" L="36">' >> $ORIG
# Try trancoding again
./enber $ORIG | ./unber -p -i 0 - > $TEST 2>&1
${ENBER} $ORIG | ${UNBER} -p -i 0 - > $TEST 2>&1
diff $diffArgs "$ORIG" "$TEST"
diffExitCode=$?

View File

@ -0,0 +1,9 @@
@CODE_COVERAGE_RULES@
AM_CFLAGS = @ADD_CFLAGS@
AM_CPPFLAGS = \
-I${top_srcdir}/libasn1common \
-I${top_srcdir}/libasn1parser \
-I${top_srcdir}/skeletons
bin_PROGRAMS = enber

View File

@ -1,4 +1,4 @@
/*-
/*
* Copyright (c) 2004, 2005 Lev Walkin <vlm@lionet.info>. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -22,9 +22,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
*/
#include "sys-common.h"
#include "asn1_common.h"
#include <asn1parser.h> /* For static string tables */

View File

@ -0,0 +1,11 @@
@CODE_COVERAGE_RULES@
AM_CFLAGS = @ADD_CFLAGS@
AM_CPPFLAGS = \
-I${top_srcdir}/libasn1common \
-I${top_srcdir}/libasn1parser \
-I${top_srcdir}/skeletons
unber_LDADD = $(top_builddir)/libasn1common/libasn1common.la
bin_PROGRAMS = unber

View File

@ -1,4 +1,4 @@
/*-
/*
* Copyright (c) 2004, 2005, 2006 Lev Walkin <vlm@lionet.info>.
* All rights reserved.
*
@ -23,9 +23,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
*/
#include "sys-common.h"
#include "asn1_common.h"
#define ASN_DISABLE_PER_SUPPORT 1
#define ASN_DISABLE_OER_SUPPORT 1

View File

@ -17,14 +17,4 @@ asn1c_LDADD = \
$(top_builddir)/libasn1fix/libasn1fix.la \
$(top_builddir)/libasn1compiler/libasn1compiler.la
unber_LDADD = \
$(top_builddir)/libasn1common/libasn1common.la
bin_PROGRAMS = asn1c unber enber
noinst_HEADERS = sys-common.h
dist_check_SCRIPTS = check-xxber.sh
TESTS_ENVIRONMENT= top_srcdir=${top_srcdir}
TESTS = $(dist_check_SCRIPTS)
CLEANFILES = .check-xxber.*.tmp
bin_PROGRAMS = asn1c

View File

@ -1,3 +1 @@
asn1c - The ASN.1 Compiler
unber - The ASN.1 BER Decoder
enber - Reverse unber(1) output back into BER

View File

@ -23,13 +23,12 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
*/
/*
* This is the program that connects the libasn1* libraries together.
* It uses them in turn to parse, fix and then compile or print the ASN.1 tree.
*/
#include "sys-common.h"
#include "asn1_common.h"
#undef COPYRIGHT
#define COPYRIGHT "Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info> and contributors.\n"

View File

@ -292,6 +292,9 @@ tests/tests-asn1c-smoke/Makefile \
tests/tests-randomized/Makefile \
tests/tests-c-compiler/Makefile \
tests/tests-skeletons/Makefile \
asn1-tools/enber/Makefile \
asn1-tools/unber/Makefile \
asn1-tools/Makefile \
libasn1compiler/Makefile \
libasn1common/Makefile \
libasn1parser/Makefile \

View File

@ -5,7 +5,7 @@ AM_CFLAGS = @ADD_CFLAGS@
noinst_LTLIBRARIES = libasn1common.la
libasn1common_la_SOURCES = \
asn1_ref.c asn1_ref.h \
asn1_common.h asn1_ref.c asn1_ref.h \
asn1_buffer.c asn1_buffer.h \
asn1_namespace.c asn1_namespace.h \
genhash.c genhash.h