Deutsch English Français Italiano |
<v8fuib$256sq$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!3.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: =?UTF-8?Q?Arne_Vajh=C3=B8j?= <arne@vajhoej.dk> Newsgroups: comp.os.vms Subject: BridgeWorks -> TIG Date: Thu, 1 Aug 2024 08:20:28 -0400 Organization: A noiseless patient Spider Lines: 365 Message-ID: <v8fuib$256sq$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 01 Aug 2024 14:20:28 +0200 (CEST) Injection-Info: dont-email.me; posting-host="c3ea436082460bef622aadf0493fc7f7"; logging-data="2268058"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+vYP8opEN75ClD1OTFzrMEPbElcT2tsLE=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:nUjr2fkTfVx44xKYYYukx2JeHcM= Content-Language: en-US Bytes: 10362 I could not get BridgeWorks to work. And the VMS side was VMS Alpha only. And the non-Java option for client side was COM. But I do like the concept. So I tried creating something similar that works with newer stuff. TIG (Transparent Interface Generation). VMS code: data.inc: structure /mydata/ integer*4 iv character*256 sv end structure demof.for: integer*4 function add(a, b, res) implicit none integer*4 a, b, res res = a + b add = 1 end c integer*4 function conc(a, b, res) implicit none character*(*) a, b, res res = a // b conc = 1 end c integer*4 function modify(o) implicit none include 'data.inc' record /mydata/o o.iv = o.iv + 1 o.sv = trim(o.sv) // 'X' modify = 1 end c integer*4 function getid(id) implicit none character*(*) id id = 'Fortran on VMS' getid = 1 end (trivial I know, but ...) So to make it all work I describe the functions in an XML file. demof.xml: <config> <image>demof</image> <port>12346</port> <mt>false</mt> <server> <language>dk.vajhoej.vms.tig.server.JavaServerGen</language> </server> <client> <language>dk.vajhoej.vms.tig.client.JavaClientGen</language> <language>dk.vajhoej.vms.tig.client.CSharpClientGen</language> <language>dk.vajhoej.vms.tig.client.CClientGen</language> </client> <methods> <method> <name>add</name> <args> <arg> <name>a</name> <type>LongWord</type> <pass>Reference</pass> <use>In</use> </arg> <arg> <name>b</name> <type>LongWord</type> <pass>Reference</pass> <use>In</use> </arg> <arg> <name>res</name> <type>LongWord</type> <pass>Reference</pass> <use>Out</use> </arg> </args> </method> <method> <name>conc</name> <args> <arg> <name>a</name> <type>FixedCharacterString</type> <pass>Descriptor</pass> <use>In</use> </arg> <arg> <name>b</name> <type>FixedCharacterString</type> <pass>Descriptor</pass> <use>In</use> </arg> <arg> <name>res</name> <type>FixedCharacterString</type> <pass>Descriptor</pass> <use>Out</use> </arg> </args> </method> <method> <name>modify</name> <args> <arg> <name>o</name> <type>Block</type> <pass>Reference</pass> <use>InOut</use> <impl>Dataf</impl> </arg> </args> </method> <method> <name>getid</name> <args> <arg> <name>res</name> <type>FixedCharacterString</type> <pass>Descriptor</pass> <use>Out</use> </arg> </args> </method> </methods> </config> (I prefer XML config file over GUI!) Generate some code for both VMS side and client side. Java test client: Dataf.java: import dk.vajhoej.record.FieldType; import dk.vajhoej.record.Struct; import dk.vajhoej.record.StructField; @Struct public class Dataf { @StructField(n=0, type=FieldType.INT4) private int iv; @StructField(n=1, type=FieldType.FIXSTR, length=256, pad=true, padchar=' ') private String sv; public Dataf() { this(0, ""); } public Dataf(int iv, String sv) { this.iv = iv; this.sv = sv; } public int getIv() { return iv; } public void setIv(int iv) { this.iv = iv; } public String getSv() { return sv; } public void setSv(String sv) { this.sv = sv; } @Override public String toString() { return String.format("{iv: %d, sv: %s}", iv, sv); ========== REMAINDER OF ARTICLE TRUNCATED ==========