X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=util%2Fyaz-asncomp;h=f858c772b0d682c631d73601aca7137d993d693d;hb=acbea5b1df81001dc8c0e1eb75386796dde425b3;hp=f035b56327bb9513c9ac61338fcfd965fa193b00;hpb=0ff4f5bd6fc1007c322530ba6a3633869140f448;p=yaz-moved-to-github.git diff --git a/util/yaz-asncomp b/util/yaz-asncomp index f035b56..f858c77 100755 --- a/util/yaz-asncomp +++ b/util/yaz-asncomp @@ -1,15 +1,15 @@ #!/bin/sh # the next line restarts using tclsh \ -exec tclsh "$0" "$@" +if [ -f /usr/local/bin/tclsh8.4 ]; then exec tclsh8.4 "$0" "$@"; else exec tclsh "$0" "$@"; fi # # yaz-comp: ASN.1 Compiler for YAZ # (c) Index Data 1996-2004 # See the file LICENSE for details. # -# $Id: yaz-asncomp,v 1.2 2004-01-23 11:52:52 adam Exp $ +# $Id: yaz-asncomp,v 1.7 2006-05-22 19:08:38 adam Exp $ # -set yc_version 0.3 +set yc_version 0.4 # Syntax for the ASN.1 supported: # file -> file module @@ -842,8 +842,6 @@ proc asnChoice {name tag implicit tagtype} { lappend l "\todr_implicit_settag(o, $tagtype, $tag);" lappend l "\tif (odr_choice(o, arm, &(*p)->[lindex $uName 1], &(*p)->[lindex $uName 0], name))" } else { - lappend l "\tif (!*p && o->direction != ODR_DECODE)" - lappend l "\t\treturn opt;" lappend l "\tif (!odr_constructed_begin(o, p, $tagtype, $tag, 0))" lappend l "\t\treturn odr_missing(o, opt, name);" lappend l "\tif (!odr_initmember(o, p, sizeof(**p)))" @@ -1091,20 +1089,29 @@ proc asnModules {} { set file(outp) [open $inf(h-path)/$inf(h-dir)$inf(p-file) w] } - set greeting {Generated automatically by the YAZ ASN.1 Compiler} + set greeting {Generated automatically by YAZ ASN.1 Compiler} - puts $file(outc) "/* ${greeting} ${yc_version} */" - puts $file(outc) "/* Module-C: $inf(module) */" + puts $file(outc) "/** \\file $inf(c-file)" + puts $file(outc) " \\brief ASN.1 Module $inf(module)" + puts $file(outc) "" + puts $file(outc) " ${greeting} ${yc_version}" + puts $file(outc) "*/" puts $file(outc) {} - puts $file(outh) "/* ${greeting} ${yc_version} */" - puts $file(outh) "/* Module-H $inf(module) */" + puts $file(outh) "/** \\file $inf(h-file)" + puts $file(outh) " \\brief ASN.1 Module $inf(module)" + puts $file(outh) "" + puts $file(outh) " ${greeting} ${yc_version}" + puts $file(outh) "*/" puts $file(outh) {} if {[info exists file(outp)]} { - puts $file(outp) "/* ${greeting} ${yc_version} */" - puts $file(outp) "/* Module-P: $inf(module) */" - puts $file(outp) {} + puts $file(outp) "/** \\file $inf(p-file)" + puts $file(outp) " \\brief ASN.1 Module $inf(module)" + puts $file(outp) "" + puts $file(outp) " ${greeting} ${yc_version}" + puts $file(outp) "*/" + puts $file(outp) {} } if {[info exists inf(p-file)]} { @@ -1392,8 +1399,8 @@ if {![info exists inf(iname)]} { puts "YAZ ASN.1 Compiler ${yc_version}" puts "Usage:" puts -nonewline ${argv0} - puts { [-v] [-c cfile] [-h hfile] [-p hfile] [-d dfile] [-I iout] [-i idir]} - puts { [-m module] file} + puts { [-v] [-c cfile] [-h hfile] [-p hfile] [-d dfile] [-I iout]} + puts { [-i idir] [-m module] file} exit 1 }