X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Foidtoc.tcl;h=2e72d033a177d3b305b68bdd9f7d599f708f196a;hp=c57a56e32db9ea574546c4f97628bd9036c991e0;hb=7fbf3f2eceeb0978881992fbf1e77cd6fc3c4a9b;hpb=38ce2c71a8aa497a5c445dd36d12d0d535dea79a diff --git a/src/oidtoc.tcl b/src/oidtoc.tcl index c57a56e..2e72d03 100644 --- a/src/oidtoc.tcl +++ b/src/oidtoc.tcl @@ -1,8 +1,7 @@ # This file is part of the YAZ toolkit -# Copyright (c) Index Data 2006-2007 +# Copyright (C) Index Data # See the file LICENSE for details. # -# $Id: oidtoc.tcl,v 1.6 2007-05-07 13:18:32 adam Exp $ # # Converts a CSV file with Object identifiers to C @@ -47,19 +46,16 @@ proc oid_to_xml {srcdir input xname} { set xfile [open "${xname}" w] puts $xfile "" - puts $xfile {} - puts $xfile {Standard Object Identifiers} - puts $xfile {} + puts $xfile {} + puts $xfile {} puts $xfile {} puts $xfile {} - puts $xfile {} - puts $xfile {} + puts $xfile {} puts $xfile {} puts $xfile {} puts $xfile {Name} puts $xfile {Class} - puts $xfile {Constant} - puts $xfile {OID} + puts $xfile {Constant / OID} puts $xfile {} puts $xfile {} puts $xfile {} @@ -67,12 +63,12 @@ proc oid_to_xml {srcdir input xname} { foreach oid $oids { puts $xfile {} - puts $xfile {} + puts $xfile {} puts $xfile [lindex $oid 2] puts $xfile {} - puts $xfile {} + puts $xfile {} puts $xfile [lindex $oid 0] puts $xfile {} @@ -81,7 +77,11 @@ proc oid_to_xml {srcdir input xname} { puts $xfile $v puts $xfile {} - puts $xfile {} + + puts $xfile {} + puts $xfile {} + + puts $xfile {} puts $xfile [lindex $oid 1] puts $xfile {} @@ -91,7 +91,7 @@ proc oid_to_xml {srcdir input xname} { puts $xfile {} puts $xfile {} - puts $xfile {
} + puts $xfile {} close $xfile } @@ -109,6 +109,10 @@ proc oid_to_c {srcdir input cname hname} { puts $hfile "\#ifndef OID_STD_H" puts $hfile "\#define OID_STD_H" + puts $cfile "\#if HAVE_CONFIG_H" + puts $cfile "\#include " + puts $cfile "\#endif" + puts $cfile "\#include " puts $cfile "" # To avoid LNK4049 @@ -123,11 +127,11 @@ proc oid_to_c {srcdir input cname hname} { set v [constant_var $oid] - puts -nonewline $cfile "YAZ_EXPORT const int $v\[\] = \{" + puts -nonewline $cfile "YAZ_EXPORT const Odr_oid $v\[\] = \{" puts -nonewline $cfile [string map {. ,} [lindex $oid 1]] puts $cfile ",-1\};" - puts $hfile "OID_EXPORT extern const int $v\[\];" + puts $hfile "OID_EXPORT extern const Odr_oid $v\[\];" } puts $cfile "YAZ_EXPORT struct yaz_oid_entry yaz_oid_standard_entries\[\] ="