X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=util%2Fyaz-asncomp;h=2c32c009b2fbc147779b4c261d0c2cd5ec2c8d8f;hb=c22010a486adc7fe881418f831873dd62b7860f1;hp=f858c772b0d682c631d73601aca7137d993d693d;hpb=9f5de9011e59569e0bae5b484defe53bda38a457;p=yaz-moved-to-github.git diff --git a/util/yaz-asncomp b/util/yaz-asncomp index f858c77..2c32c00 100755 --- a/util/yaz-asncomp +++ b/util/yaz-asncomp @@ -1,13 +1,9 @@ -#!/bin/sh -# the next line restarts using tclsh \ -if [ -f /usr/local/bin/tclsh8.4 ]; then exec tclsh8.4 "$0" "$@"; else exec tclsh "$0" "$@"; fi +#!/usr/bin/tclsh # # yaz-comp: ASN.1 Compiler for YAZ -# (c) Index Data 1996-2004 +# (c) Index Data 1996-2010 # See the file LICENSE for details. # -# $Id: yaz-asncomp,v 1.7 2006-05-22 19:08:38 adam Exp $ -# set yc_version 0.4 @@ -523,7 +519,7 @@ proc asnSequence {name tag implicit tagtype} { lappend l "\tif (!odr_sequence_begin (o, p, sizeof(**p), 0))" lappend l "\t\{" - lappend l "\t\tif(o->direction == ODR_DECODE)" + lappend l "\t\tif (o->direction == ODR_DECODE)" lappend l "\t\t\t*p = 0;" lappend l "\t\treturn 0;" lappend l "\t\}" @@ -736,7 +732,7 @@ proc asnOf {name tag implicit tagtype isset} { } lappend j "\}" lappend l "\t\treturn 1;" - lappend l "\tif(o->direction == ODR_DECODE)" + lappend l "\tif (o->direction == ODR_DECODE)" lappend l "\t\t*p = 0;" lappend l "\treturn odr_missing(o, opt, name);" return [list [join $l \n] [join $j \n]] @@ -851,7 +847,7 @@ proc asnChoice {name tag implicit tagtype} { } lappend l "\t\treturn 1;" - lappend l "\tif(o->direction == ODR_DECODE)" + lappend l "\tif (o->direction == ODR_DECODE)" lappend l "\t\t*p = 0;" lappend l "\treturn odr_missing(o, opt, name);" @@ -1096,6 +1092,11 @@ proc asnModules {} { puts $file(outc) "" puts $file(outc) " ${greeting} ${yc_version}" puts $file(outc) "*/" + + puts $file(outc) "\#if HAVE_CONFIG_H" + puts $file(outc) "\#include " + puts $file(outc) "\#endif" + puts $file(outc) {} puts $file(outh) "/** \\file $inf(h-file)" @@ -1221,11 +1222,11 @@ proc asnBasicEXTERNAL {} { } proc asnBasicINTEGER {} { - return {odr_integer {int}} + return {odr_integer {Odr_int}} } proc asnBasicENUMERATED {} { - return {odr_enum {int}} + return {odr_enum {Odr_int}} } proc asnBasicNULL {} { @@ -1233,7 +1234,7 @@ proc asnBasicNULL {} { } proc asnBasicBOOLEAN {} { - return {odr_bool {bool_t}} + return {odr_bool {Odr_bool}} } proc asnBasicOCTET {} {