X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=util%2Fyaz-asncomp;h=e155e5b2e44f2a5cc4ea987a31c903a4a83d0994;hb=3e45202a276daf769ce4727bc47147a1e669d4b1;hp=c73adb70fa969e81c8cf9355d90ba9f718e3e51c;hpb=16ba4ea8a26971aff40e56398d6d826fd6107889;p=yaz-moved-to-github.git diff --git a/util/yaz-asncomp b/util/yaz-asncomp index c73adb7..e155e5b 100755 --- a/util/yaz-asncomp +++ b/util/yaz-asncomp @@ -1,15 +1,11 @@ -#!/bin/sh -# the next line restarts using tclsh \ -exec tclsh "$0" "$@" +#!/usr/bin/tclsh # # yaz-comp: ASN.1 Compiler for YAZ -# (c) Index Data 1996-2004 +# (c) Index Data 1996-2011 # See the file LICENSE for details. # -# $Id: yaz-asncomp,v 1.4 2004-11-01 20:16:44 adam Exp $ -# -set yc_version 0.3 +set yc_version 0.4 # Syntax for the ASN.1 supported: # file -> file module @@ -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);" @@ -1089,20 +1085,34 @@ 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) "/** \\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) "\#if HAVE_CONFIG_H" + puts $file(outc) "\#include " + puts $file(outc) "\#endif" - puts $file(outc) "/* ${greeting} ${yc_version} */" - puts $file(outc) "/* Module-C: $inf(module) */" 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)]} { @@ -1212,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 {} { @@ -1224,7 +1234,7 @@ proc asnBasicNULL {} { } proc asnBasicBOOLEAN {} { - return {odr_bool {bool_t}} + return {odr_bool {Odr_bool}} } proc asnBasicOCTET {} {