version 0.9.26

aper
Lev Walkin 2014-09-11 01:28:57 -07:00
parent 5809ec65dd
commit e0d321a650
71 changed files with 426 additions and 556 deletions

View File

@ -1,5 +1,5 @@
???:
0.9.26: 2014-Sep-11
* Updated asn1c-usage.pdf.
* Made -fskeletons-copy a default option; removed cmdline option.
* Made -fnative-types a default option; removed cmdline option.

View File

@ -4,12 +4,12 @@ ACLOCAL_AMFLAGS = -I m4
SUBDIRS = \
libasn1parser libasn1fix \
libasn1print libasn1compiler \
skeletons examples tests \
skeletons examples \
doc asn1c
docsdir = $(datadir)/doc/asn1c
docs_DATA = README FAQ COPYING ChangeLog BUGS TODO
EXTRA_DIST = asn1c.spec.in FAQ BUGS MANIFEST
EXTRA_DIST = asn1c.spec.in FAQ BUGS MANIFEST tests/
CLEANFILES = asn1c.spec

View File

@ -171,6 +171,7 @@ LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
@ -253,12 +254,12 @@ ACLOCAL_AMFLAGS = -I m4
SUBDIRS = \
libasn1parser libasn1fix \
libasn1print libasn1compiler \
skeletons examples tests \
skeletons examples \
doc asn1c
docsdir = $(datadir)/doc/asn1c
docs_DATA = README FAQ COPYING ChangeLog BUGS TODO
EXTRA_DIST = asn1c.spec.in FAQ BUGS MANIFEST
EXTRA_DIST = asn1c.spec.in FAQ BUGS MANIFEST tests/
CLEANFILES = asn1c.spec
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
@ -266,7 +267,7 @@ all: config.h
.SUFFIXES:
am--refresh:
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@ -293,9 +294,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps)
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
@ -308,7 +309,7 @@ config.h: stamp-h1
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: $(am__configure_deps)
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h1
touch $@

40
aclocal.m4 vendored
View File

@ -608,6 +608,46 @@ if test "$LEX" = :; then
LEX=${am_missing_run}flex
fi])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 5
# AM_MAINTAINER_MODE([DEFAULT-MODE])
# ----------------------------------
# Control maintainer-specific portions of Makefiles.
# Default is to disable them, unless `enable' is passed literally.
# For symmetry, `disable' may be passed as well. Anyway, the user
# can override the default with the --enable/--disable switch.
AC_DEFUN([AM_MAINTAINER_MODE],
[m4_case(m4_default([$1], [disable]),
[enable], [m4_define([am_maintainer_other], [disable])],
[disable], [m4_define([am_maintainer_other], [enable])],
[m4_define([am_maintainer_other], [enable])
m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
dnl maintainer-mode's default is 'disable' unless 'enable' is passed
AC_ARG_ENABLE([maintainer-mode],
[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful
(and sometimes confusing) to the casual installer],
[USE_MAINTAINER_MODE=$enableval],
[USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
AC_MSG_RESULT([$USE_MAINTAINER_MODE])
AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
MAINT=$MAINTAINER_MODE_TRUE
AC_SUBST([MAINT])dnl
]
)
AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.

View File

@ -23,5 +23,6 @@ noinst_HEADERS = sys-common.h
dist_man1_MANS = asn1c.1 unber.1 enber.1
dist_check_SCRIPTS = check-xxber.sh check-parsing.sh
TESTS_ENVIRONMENT= top_srcdir=${top_srcdir}
TESTS = $(dist_check_SCRIPTS)
CLEANFILES = .check-xxber.*.tmp .check-parsing.*.tmp

View File

@ -189,6 +189,7 @@ LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
@ -286,13 +287,14 @@ asn1c_LDADD = \
noinst_HEADERS = sys-common.h
dist_man1_MANS = asn1c.1 unber.1 enber.1
dist_check_SCRIPTS = check-xxber.sh check-parsing.sh
TESTS_ENVIRONMENT = top_srcdir=${top_srcdir}
TESTS = $(dist_check_SCRIPTS)
CLEANFILES = .check-xxber.*.tmp .check-parsing.*.tmp
all: all-recursive
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@ -317,9 +319,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-binPROGRAMS: $(bin_PROGRAMS)

View File

@ -1,25 +1,43 @@
#!/bin/sh
tmpfile=".check-parsing.$$.tmp"
# 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
ec=0
for ref in ../tests/*.asn1.-*; do
set -o pipefail
set -e
PROCESSING=""
print_status() {
echo "Error while processing $PROCESSING"
}
trap print_status ERR
if [ "x${top_srcdir}" = "x" ]; then
top_srcdir=".."
fi
for ref in ${top_srcdir}/tests/*.asn1.-*; do
# Figure out the initial source file used to generate this output.
src=`echo "$ref" | sed -e 's/\.-[-a-zA-Z0-9=]*$//'`
# Figure out compiler flags used to create the file.
flags=`echo "$ref" | sed -e 's/.*\.-//'`
echo "Checking $src against $ref"
./asn1c -S../skeletons "-$flags" "$src" > "$tmpfile" || ec=$?
template=.tmp.check-parsing.$$
oldversion=${template}.old
newversion=${template}.new
PROCESSING="$ref (from $src)"
cat "$ref" | LANG=C sed -e 's/^found in .*/found in .../' > $oldversion
(./asn1c -S ${top_srcdir}/skeletons "-$flags" "$src" | LANG=C sed -e 's/^found in .*/found in .../' > "$newversion") || ec=$?
if [ $? = 0 ]; then
diff $diffArgs "$ref" "$tmpfile" || ec=$?
diff $diffArgs "$oldversion" "$newversion" || ec=$?
fi
if [ "$1" != "regenerate" ]; then
rm -f "$tmpfile"
else
mv "$tmpfile" "$ref"
rm -f $oldversion $newversion
if [ "$1" = "regenerate" ]; then
./asn1c -S ${top_srcdir}/skeletons "-$flags" "$src" > "$ref"
fi
done

View File

@ -1,15 +1,15 @@
dist_check_SCRIPTS = check-assembly.sh
TESTS_ENVIRONMENT= CC="${CC}" CFLAGS="${TESTSUITE_CFLAGS} ${CFLAGS} -Wno-error=unused-variable" CXXFLAGS="${CXXFLAGS}" ./check-assembly.sh
TESTS_ENVIRONMENT= CC="${CC}" CFLAGS="${TESTSUITE_CFLAGS} ${CFLAGS} -Wno-error=unused-variable" CXXFLAGS="${CXXFLAGS}" srcdir=${srcdir} top_srcdir=${top_srcdir} top_builddir=${top_builddir} ${srcdir}/check-assembly.sh
TESTS = check-*.c
TESTS = ${srcdir}/check-src/check-*.c
if TEST_64BIT
TESTS += check64-*.c
TESTS += ${srcdir}/check-src/check64-*.c
endif
EXTRA_DIST = \
check-*.c* \
check-src/ \
data-62 \
data-70 \
data-119 \

View File

@ -33,7 +33,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
@TEST_64BIT_TRUE@am__append_1 = check64-*.c
@TEST_64BIT_TRUE@am__append_1 = ${srcdir}/check-src/check64-*.c
subdir = asn1c/tests
DIST_COMMON = README $(dist_check_SCRIPTS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
@ -95,6 +95,7 @@ LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
@ -174,10 +175,10 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
dist_check_SCRIPTS = check-assembly.sh
TESTS_ENVIRONMENT = CC="${CC}" CFLAGS="${TESTSUITE_CFLAGS} ${CFLAGS} -Wno-error=unused-variable" CXXFLAGS="${CXXFLAGS}" ./check-assembly.sh
TESTS = check-*.c $(am__append_1)
TESTS_ENVIRONMENT = CC="${CC}" CFLAGS="${TESTSUITE_CFLAGS} ${CFLAGS} -Wno-error=unused-variable" CXXFLAGS="${CXXFLAGS}" srcdir=${srcdir} top_srcdir=${top_srcdir} top_builddir=${top_builddir} ${srcdir}/check-assembly.sh
TESTS = ${srcdir}/check-src/check-*.c $(am__append_1)
EXTRA_DIST = \
check-*.c* \
check-src/ \
data-62 \
data-70 \
data-119 \
@ -186,7 +187,7 @@ EXTRA_DIST = \
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@ -211,9 +212,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):

View File

@ -10,11 +10,15 @@ if [ "x$1" = "x" ]; then
exit
fi
# Compute the .asn1 spec name by the given file name.
source=`echo "$1" | sed -e 's/.*\///'`
testno=`echo "$source" | cut -f2 -d'-' | cut -f1 -d'.'`
set -o pipefail
set -e
args=`echo "$source" | sed -e 's/\.c[c]*$//'`
# Compute the .asn1 spec name by the given file name.
source_full=$1
source_short=`echo "$source_full" | sed -e 's/.*\///'`
testno=`echo "$source_short" | cut -f2 -d'-' | cut -f1 -d'.'`
args=`echo "$source_short" | sed -e 's/\.c[c]*$//'`
testdir=test-${args}
OFS=$IFS
@ -24,16 +28,15 @@ shift
IFS=$OFS
AFLAGS="$@"
touch ${testdir}-FAILED # Create this file to ease post mortem analysis
# Assume the test fails. Will be removed when it passes well.
touch ${testdir}-FAILED
if [ ! -d $testdir ]; then
mkdir $testdir || exit $?
fi
cd $testdir || exit $?
rm -f ./$source 2>/dev/null
ln -fns ../$source || exit $?
mkdir -p $testdir
cd $testdir
rm -f $source_short
ln -fns ../$source_full
asn_module=`echo ../../../tests/${testno}-*.asn1`
asn_module=`echo ../${top_srcdir}/tests/${testno}-*.asn1`
# Create a Makefile for the project.
cat > Makefile <<EOM
@ -41,6 +44,7 @@ cat > Makefile <<EOM
COMMON_FLAGS= -I. -DEMIT_ASN_DEBUG
CFLAGS = \${COMMON_FLAGS} ${CFLAGS} -g -O0
CPPFLAGS = -DSRCDIR=../${srcdir}
CXXFLAGS = \${COMMON_FLAGS} ${CXXFLAGS}
CC ?= ${CC}
@ -48,11 +52,11 @@ CC ?= ${CC}
all: check-executable
check-executable: compiled-module *.c*
@rm -f *.core
\$(CC) \$(CFLAGS) -o check-executable *.c* -lm
\$(CC) \$(CPPFLAGS) \$(CFLAGS) -o check-executable *.c* -lm
# Compile the corresponding .asn1 spec.
compiled-module: ${asn_module} ../../asn1c
../../asn1c -S ../../../skeletons -Wdebug-compiler \\
compiled-module: ${asn_module} ../${top_builddir}/asn1c/asn1c
../${top_builddir}/asn1c/asn1c -S ../${top_srcdir}/skeletons -Wdebug-compiler \\
${AFLAGS} ${asn_module}
rm -f converter-sample.c
@touch compiled-module
@ -69,8 +73,7 @@ clean:
EOM
# Perform building and checking
make check || exit $?
make check
# Make sure the test is not marked as failed any longer.
rm -f ../${testdir}-FAILED
exit 0

View File

@ -17,6 +17,14 @@
#include <PDU.h>
#ifndef SRCDIR
#define SRCDIR_S ".."
#else
#define STRINGIFY_MACRO2(x) #x
#define STRINGIFY_MACRO(x) STRINGIFY_MACRO2(x)
#define SRCDIR_S STRINGIFY_MACRO(SRCDIR)
#endif
enum expectation {
EXP_OK, /* Encoding/decoding must succeed */
EXP_CXER_EXACT, /* Encoding/decoding using CXER must be exact */
@ -311,7 +319,7 @@ process(const char *fname) {
fprintf(stderr, "\nProcessing file [../%s]\n", fname);
snprintf((char *)fbuf, sizeof(fbuf), "../data-119/%s", fname);
snprintf((char *)fbuf, sizeof(fbuf), SRCDIR_S "/data-119/%s", fname);
fp = fopen((char *)fbuf, "r");
assert(fp);
@ -341,7 +349,7 @@ main() {
return 0;
}
dir = opendir("../data-119");
dir = opendir(SRCDIR_S "/data-119");
assert(dir);
/*

View File

@ -17,6 +17,14 @@
#include <PDU.h>
#ifndef SRCDIR
#define SRCDIR_S ".."
#else
#define STRINGIFY_MACRO2(x) #x
#define STRINGIFY_MACRO(x) STRINGIFY_MACRO2(x)
#define SRCDIR_S STRINGIFY_MACRO(SRCDIR)
#endif
enum expectation {
EXP_OK, /* Encoding/decoding must succeed */
EXP_CXER_EXACT, /* Encoding/decoding using CXER must be exact */
@ -313,7 +321,7 @@ process(const char *fname) {
fprintf(stderr, "\nProcessing file [../%s]\n", fname);
snprintf((char *)fbuf, sizeof(fbuf), "../data-119/%s", fname);
snprintf((char *)fbuf, sizeof(fbuf), SRCDIR_S "/data-119/%s", fname);
fp = fopen((char *)fbuf, "r");
assert(fp);
@ -343,7 +351,7 @@ main() {
return 0;
}
dir = opendir("../data-119");
dir = opendir(SRCDIR_S "/data-119");
assert(dir);
/*

View File

@ -16,6 +16,14 @@
#include <PDU.h>
#ifndef SRCDIR
#define SRCDIR_S ".."
#else
#define STRINGIFY_MACRO2(x) #x
#define STRINGIFY_MACRO(x) STRINGIFY_MACRO2(x)
#define SRCDIR_S STRINGIFY_MACRO(SRCDIR)
#endif
static unsigned char buf[4096];
static int buf_offset;
@ -229,14 +237,14 @@ xer_encoding_equal(void *obufp, size_t osize, void *nbufp, size_t nsize) {
static void
compare_with_data_out(const char *fname, void *datap, size_t size) {
char *data = datap;
char outName[256];
char outName[sizeof(SRCDIR_S) + 256];
unsigned char fbuf[1024];
size_t rd;
FILE *f;
char lastChar;
int mustfail, compare;
sprintf(outName, "../data-126/%s", fname);
sprintf(outName, SRCDIR_S "/data-126/%s", fname);
strcpy(outName + strlen(outName) - 3, ".out");
fprintf(stderr, "Comparing PER output with [%s]\n", outName);
@ -304,7 +312,7 @@ process_XER_data(const char *fname, unsigned char *fbuf, size_t size) {
*/
static int
process(const char *fname) {
unsigned char fbuf[4096];
unsigned char fbuf[sizeof(SRCDIR_S) + 4096];
char *ext = strrchr(fname, '.');
int rd;
FILE *fp;
@ -314,7 +322,7 @@ process(const char *fname) {
fprintf(stderr, "\nProcessing file [../%s]\n", fname);
snprintf((char *)fbuf, sizeof(fbuf), "../data-126/%s", fname);
snprintf((char *)fbuf, sizeof(fbuf), SRCDIR_S "/data-126/%s", fname);
fp = fopen((char *)fbuf, "r");
assert(fp);
@ -344,7 +352,7 @@ main() {
return 0;
}
dir = opendir("../data-126");
dir = opendir(SRCDIR_S "/data-126");
assert(dir);
/*

View File

@ -2,7 +2,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h> /* for chdir(2) */
#include <unistd.h> /* for chdir(2), getcwd(3) */
#include <string.h>
#include <dirent.h>
#include <assert.h>
@ -10,6 +10,14 @@
#include <T.h>
#ifndef SRCDIR
#define SRCDIR_S ".."
#else
#define STRINGIFY_MACRO2(x) #x
#define STRINGIFY_MACRO(x) STRINGIFY_MACRO2(x)
#define SRCDIR_S STRINGIFY_MACRO(SRCDIR)
#endif
enum expectation {
EXP_OK, /* Encoding/decoding must succeed */
EXP_BROKEN, /* Decoding must fail */
@ -142,6 +150,7 @@ process_data(enum expectation expectation, unsigned char *fbuf, ssize_t size) {
*/
static int
process(const char *fname) {
char prevdir[256];
unsigned char fbuf[4096];
char *ext = strrchr(fname, '.');
enum expectation expectation;
@ -165,10 +174,11 @@ process(const char *fname) {
fprintf(stderr, "\nProcessing file [../%s]\n", fname);
ret = chdir("../data-62");
getcwd(prevdir, sizeof(prevdir));
ret = chdir(SRCDIR_S "/data-62");
assert(ret == 0);
fp = fopen(fname, "r");
ret = chdir("../test-check-62");
ret = chdir(prevdir);
assert(ret == 0);
assert(fp);
@ -189,7 +199,7 @@ main() {
int processed_files = 0;
char *str;
dir = opendir("../data-62");
dir = opendir(SRCDIR_S "/data-62");
assert(dir);
str = getenv("DATA_62_FILE");

View File

@ -8,7 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h> /* for chdir(2) */
#include <unistd.h> /* for chdir(2), getcwd(3) */
#include <string.h>
#include <ctype.h>
#include <dirent.h>
@ -17,6 +17,14 @@
#include <PDU.h>
#ifndef SRCDIR
#define SRCDIR_S ".."
#else
#define STRINGIFY_MACRO2(x) #x
#define STRINGIFY_MACRO(x) STRINGIFY_MACRO2(x)
#define SRCDIR_S STRINGIFY_MACRO(SRCDIR)
#endif
enum expectation {
EXP_OK, /* Encoding/decoding must succeed */
EXP_CXER_EXACT, /* Encoding/decoding using CXER must be exact */
@ -250,6 +258,7 @@ process_XER_data(enum expectation expectation, unsigned char *fbuf, size_t size)
*/
static int
process(const char *fname) {
char prevdir[256];
unsigned char fbuf[4096];
char *ext = strrchr(fname, '.');
enum expectation expectation;
@ -275,10 +284,11 @@ process(const char *fname) {
fprintf(stderr, "\nProcessing file [../%s]\n", fname);
ret = chdir("../data-70");
getcwd(prevdir, sizeof(prevdir));
ret = chdir(SRCDIR_S "/data-70");
assert(ret == 0);
fp = fopen(fname, "r");
ret = chdir("../test-check-70.-fwide-types");
ret = chdir(prevdir);
assert(ret == 0);
assert(fp);
@ -306,7 +316,7 @@ main() {
return 0;
}
dir = opendir("../data-70");
dir = opendir(SRCDIR_S "/data-70");
assert(dir);
/*

View File

@ -8,7 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h> /* for chdir(2) */
#include <unistd.h> /* for chdir(2), getcwd(3) */
#include <string.h>
#include <dirent.h>
#include <ctype.h> /* for isspace(3) */
@ -17,6 +17,14 @@
#include <PDU.h>
#ifndef SRCDIR
#define SRCDIR_S ".."
#else
#define STRINGIFY_MACRO2(x) #x
#define STRINGIFY_MACRO(x) STRINGIFY_MACRO2(x)
#define SRCDIR_S STRINGIFY_MACRO(SRCDIR)
#endif
enum expectation {
EXP_OK, /* Encoding/decoding must succeed */
EXP_BROKEN, /* Decoding must fail */
@ -226,6 +234,7 @@ process_XER_data(enum expectation expectation, unsigned char *fbuf, size_t size)
*/
static int
process(const char *fname) {
char prevdir[256];
unsigned char fbuf[4096];
char *ext = strrchr(fname, '.');
enum expectation expectation;
@ -249,10 +258,11 @@ process(const char *fname) {
fprintf(stderr, "\nProcessing file [../%s]\n", fname);
ret = chdir("../data-70");
getcwd(prevdir, sizeof(prevdir));
ret = chdir(SRCDIR_S "/data-70");
assert(ret == 0);
fp = fopen(fname, "r");
ret = chdir("../test-check-70");
ret = chdir(prevdir);
assert(ret == 0);
assert(fp);
@ -278,7 +288,7 @@ main() {
if(str && strncmp(str, "data-70-", 8) == 0)
process(str);
dir = opendir("../data-70");
dir = opendir(SRCDIR_S "/data-70");
assert(dir);
/*

58
configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for asn1c 0.9.24.
# Generated by GNU Autoconf 2.69 for asn1c 0.9.26.
#
# Report bugs to <vlm@lionet.info>.
#
@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='asn1c'
PACKAGE_TARNAME='asn1c'
PACKAGE_VERSION='0.9.24'
PACKAGE_STRING='asn1c 0.9.24'
PACKAGE_VERSION='0.9.26'
PACKAGE_STRING='asn1c 0.9.26'
PACKAGE_BUGREPORT='vlm@lionet.info'
PACKAGE_URL=''
@ -690,6 +690,9 @@ build_vendor
build_cpu
build
LIBTOOL
MAINT
MAINTAINER_MODE_FALSE
MAINTAINER_MODE_TRUE
am__untar
am__tar
AMTAR
@ -754,6 +757,7 @@ SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
enable_maintainer_mode
enable_shared
enable_static
with_pic
@ -1315,7 +1319,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures asn1c 0.9.24 to adapt to many kinds of systems.
\`configure' configures asn1c 0.9.26 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1385,7 +1389,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of asn1c 0.9.24:";;
short | recursive ) echo "Configuration of asn1c 0.9.26:";;
esac
cat <<\_ACEOF
@ -1393,6 +1397,8 @@ Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer
--enable-shared[=PKGS] build shared libraries [default=yes]
--enable-static[=PKGS] build static libraries [default=yes]
--enable-fast-install[=PKGS]
@ -1493,7 +1499,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
asn1c configure 0.9.24
asn1c configure 0.9.26
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -1916,7 +1922,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by asn1c $as_me 0.9.24, which was
It was created by asn1c $as_me 0.9.26, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -2731,7 +2737,7 @@ fi
# Define the identity of the package.
PACKAGE='asn1c'
VERSION='0.9.24'
VERSION='0.9.26'
cat >>confdefs.h <<_ACEOF
@ -2775,6 +2781,30 @@ ac_config_headers="$ac_config_headers config.h"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
# Check whether --enable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then :
enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
else
USE_MAINTAINER_MODE=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
$as_echo "$USE_MAINTAINER_MODE" >&6; }
if test $USE_MAINTAINER_MODE = yes; then
MAINTAINER_MODE_TRUE=
MAINTAINER_MODE_FALSE='#'
else
MAINTAINER_MODE_TRUE='#'
MAINTAINER_MODE_FALSE=
fi
MAINT=$MAINTAINER_MODE_TRUE
case `pwd` in
*\ * | *\ *)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
@ -13224,7 +13254,7 @@ fi
done
ac_config_files="$ac_config_files skeletons/standard-modules/Makefile skeletons/tests/Makefile libasn1compiler/Makefile libasn1parser/Makefile libasn1print/Makefile asn1c/tests/Makefile libasn1fix/Makefile doc/docsrc/Makefile skeletons/Makefile examples/Makefile tests/Makefile asn1c/Makefile doc/Makefile asn1c.spec Makefile"
ac_config_files="$ac_config_files skeletons/tests/Makefile libasn1compiler/Makefile libasn1parser/Makefile libasn1print/Makefile asn1c/tests/Makefile libasn1fix/Makefile doc/docsrc/Makefile skeletons/Makefile examples/Makefile asn1c/Makefile doc/Makefile asn1c.spec Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@ -13343,6 +13373,10 @@ else
am__EXEEXT_FALSE=
fi
if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
as_fn_error $? "conditional \"AMDEP\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@ -13757,7 +13791,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by asn1c $as_me 0.9.24, which was
This file was extended by asn1c $as_me 0.9.26, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -13823,7 +13857,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
asn1c config.status 0.9.24
asn1c config.status 0.9.26
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
@ -14232,7 +14266,6 @@ do
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
"skeletons/standard-modules/Makefile") CONFIG_FILES="$CONFIG_FILES skeletons/standard-modules/Makefile" ;;
"skeletons/tests/Makefile") CONFIG_FILES="$CONFIG_FILES skeletons/tests/Makefile" ;;
"libasn1compiler/Makefile") CONFIG_FILES="$CONFIG_FILES libasn1compiler/Makefile" ;;
"libasn1parser/Makefile") CONFIG_FILES="$CONFIG_FILES libasn1parser/Makefile" ;;
@ -14242,7 +14275,6 @@ do
"doc/docsrc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/docsrc/Makefile" ;;
"skeletons/Makefile") CONFIG_FILES="$CONFIG_FILES skeletons/Makefile" ;;
"examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;;
"tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
"asn1c/Makefile") CONFIG_FILES="$CONFIG_FILES asn1c/Makefile" ;;
"doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
"asn1c.spec") CONFIG_FILES="$CONFIG_FILES asn1c.spec" ;;

View File

@ -1,8 +1,10 @@
AC_INIT([asn1c], [0.9.24], [vlm@lionet.info])
AC_INIT([asn1c], [0.9.26], [vlm@lionet.info])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_MAINTAINER_MODE
AM_PROG_LIBTOOL
dnl Checks for programs.
@ -81,7 +83,6 @@ AC_CHECK_FUNCS(mergesort)
AC_CHECK_FUNCS(mkstemps)
AC_OUTPUT( \
skeletons/standard-modules/Makefile \
skeletons/tests/Makefile \
libasn1compiler/Makefile \
libasn1parser/Makefile \
@ -91,7 +92,6 @@ libasn1fix/Makefile \
doc/docsrc/Makefile \
skeletons/Makefile \
examples/Makefile \
tests/Makefile \
asn1c/Makefile \
doc/Makefile \
asn1c.spec \

View File

@ -155,6 +155,7 @@ LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
@ -240,7 +241,7 @@ EXTRA_DIST = $(srcdir)/*.pdf
all: all-recursive
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@ -265,9 +266,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):

Binary file not shown.

View File

@ -91,6 +91,7 @@ LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
@ -176,7 +177,7 @@ CLEANFILES = *.*~ *.aux *.dvi *.log *.out *.toc
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@ -201,9 +202,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):

View File

@ -102,7 +102,7 @@
\pagestyle{fancy}
\fancyhead[L]{\leftmark}
\fancyhead[R]{\href{http://lionet.info/asn1c}{asn1c-0.9.25}}
\fancyhead[R]{\href{http://lionet.info/asn1c}{asn1c-0.9.26}}
\maketitle
\tableofcontents{}

View File

@ -14,31 +14,32 @@ ASN1_SOURCE_3 = rfc4511.txt
ASN1_FILES_3 = \
rfc4511-Lightweight-Directory-Access-Protocol-V3.asn1
all: $(ASN1_FILES_1) $(ASN1_FILES_2) $(ASN1_FILES_3)
BUILT_SOURCES = $(ASN1_FILES_1) $(ASN1_FILES_2) $(ASN1_FILES_3)
$(ASN1_FILES_1): crfc2asn1.pl $(ASN1_SOURCE_1)
./crfc2asn1.pl $(ASN1_SOURCE_1)
${srcdir}/crfc2asn1.pl ${srcdir}/$(ASN1_SOURCE_1)
$(ASN1_FILES_2): crfc2asn1.pl $(ASN1_SOURCE_2)
./crfc2asn1.pl $(ASN1_SOURCE_2)
${srcdir}/crfc2asn1.pl ${srcdir}/$(ASN1_SOURCE_2)
$(ASN1_FILES_3): crfc2asn1.pl $(ASN1_SOURCE_3)
./crfc2asn1.pl $(ASN1_SOURCE_3)
${srcdir}/crfc2asn1.pl ${srcdir}/$(ASN1_SOURCE_3)
EXTRA_DIST = $(srcdir)/rfc*.txt \
$(srcdir)/sample.source.LDAP3 \
$(srcdir)/sample.source.MEGACO \
$(srcdir)/sample.source.MHEG5 \
$(srcdir)/sample.source.RRC \
$(srcdir)/sample.source.TAP3 \
$(srcdir)/sample.source.PKIX1 \
$(srcdir)/sample.makefile.regen
dist-hook:
rm -f `find $(distdir) -name "*.core" -or -name ".tmp.*"`
rm -f `find $(distdir) -name "*.[ch].??????"`
EXTRA_DIST = \
rfc3280.txt rfc3525.txt rfc4511.txt \
sample.source.LDAP3 \
sample.source.MEGACO \
sample.source.MHEG5 \
sample.source.RRC \
sample.source.TAP3 \
sample.source.PKIX1 \
sample.makefile.regen
CLEANFILES = $(ASN1_FILES_1) $(ASN1_FILES_2) $(ASN1_FILES_3)
clean-local:
for dir in sample.source.*; do (cd $$dir && make distclean); done
for dir in ${srcdir}/sample.source.*; do (cd $$dir && make distclean); done
dist-hook: clean-local
rm -f `find $(distdir) -name "*.core" -or -name ".tmp.*"`
rm -f `find $(distdir) -name "*.[ch].??????"`

View File

@ -116,6 +116,7 @@ LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
@ -208,20 +209,23 @@ ASN1_SOURCE_3 = rfc4511.txt
ASN1_FILES_3 = \
rfc4511-Lightweight-Directory-Access-Protocol-V3.asn1
EXTRA_DIST = $(srcdir)/rfc*.txt \
$(srcdir)/sample.source.LDAP3 \
$(srcdir)/sample.source.MEGACO \
$(srcdir)/sample.source.MHEG5 \
$(srcdir)/sample.source.RRC \
$(srcdir)/sample.source.TAP3 \
$(srcdir)/sample.source.PKIX1 \
$(srcdir)/sample.makefile.regen
BUILT_SOURCES = $(ASN1_FILES_1) $(ASN1_FILES_2) $(ASN1_FILES_3)
EXTRA_DIST = \
rfc3280.txt rfc3525.txt rfc4511.txt \
sample.source.LDAP3 \
sample.source.MEGACO \
sample.source.MHEG5 \
sample.source.RRC \
sample.source.TAP3 \
sample.source.PKIX1 \
sample.makefile.regen
CLEANFILES = $(ASN1_FILES_1) $(ASN1_FILES_2) $(ASN1_FILES_3)
all: all-am
all: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@ -246,9 +250,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-dist_binSCRIPTS: $(dist_bin_SCRIPTS)
@ -332,13 +336,15 @@ distdir: $(DISTFILES)
top_distdir="$(top_distdir)" distdir="$(distdir)" \
dist-hook
check-am: all-am
check: check-am
check: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-am
all-am: Makefile $(SCRIPTS)
installdirs:
for dir in "$(DESTDIR)$(bindir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
@ -364,6 +370,7 @@ distclean-generic:
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-am
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
@ -430,7 +437,7 @@ ps-am:
uninstall-am: uninstall-dist_binSCRIPTS
.MAKE: install-am install-strip
.MAKE: all check install install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
clean-local dist-hook distclean distclean-generic \
@ -446,23 +453,21 @@ uninstall-am: uninstall-dist_binSCRIPTS
uninstall-dist_binSCRIPTS
all: $(ASN1_FILES_1) $(ASN1_FILES_2) $(ASN1_FILES_3)
$(ASN1_FILES_1): crfc2asn1.pl $(ASN1_SOURCE_1)
./crfc2asn1.pl $(ASN1_SOURCE_1)
${srcdir}/crfc2asn1.pl ${srcdir}/$(ASN1_SOURCE_1)
$(ASN1_FILES_2): crfc2asn1.pl $(ASN1_SOURCE_2)
./crfc2asn1.pl $(ASN1_SOURCE_2)
${srcdir}/crfc2asn1.pl ${srcdir}/$(ASN1_SOURCE_2)
$(ASN1_FILES_3): crfc2asn1.pl $(ASN1_SOURCE_3)
./crfc2asn1.pl $(ASN1_SOURCE_3)
dist-hook:
rm -f `find $(distdir) -name "*.core" -or -name ".tmp.*"`
rm -f `find $(distdir) -name "*.[ch].??????"`
${srcdir}/crfc2asn1.pl ${srcdir}/$(ASN1_SOURCE_3)
clean-local:
for dir in sample.source.*; do (cd $$dir && make distclean); done
for dir in ${srcdir}/sample.source.*; do (cd $$dir && make distclean); done
dist-hook: clean-local
rm -f `find $(distdir) -name "*.core" -or -name ".tmp.*"`
rm -f `find $(distdir) -name "*.[ch].??????"`
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

View File

@ -36,7 +36,7 @@ while(<>) {
my $modName = ''; # ASN.1 module name
my $rfcid = '';
$rfcid = $1 . '-' if($ARGV =~ /([a-z0-9]+)/i);
$rfcid = $1 . '-' if($ARGV =~ /([a-z0-9]+)\.[^.]+$/i);
if(/^[ \t]*([A-Z][A-Za-z0-9-]*).*DEFINITIONS.*::=/) {
$modName = $1;