• Re: BridgeWorks -> TIG

    From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Wed Aug 14 10:27:25 2024
    On 8/11/2024 7:03 PM, Arne Vajhøj wrote:
    Not much feedback, but I did some of the outstanding tasks and
    packed it up.

    Start here:

    https://www.vajhoej.dk/arne/opensource/vms/doc/tig/doc/

    Download links:

    https://www.vajhoej.dk/arne/opensource/vms/vmstig-bin-v0_1.zip https://www.vajhoej.dk/arne/opensource/vms/vmstig-client-v0_1.zip https://www.vajhoej.dk/arne/opensource/vms/vmstig-src-v0_1.zip

    I have updated.

    Despite the native languages on VMS being non-OO then it
    bothered me that the client side API was really non-OO
    (classes were used but without any data in the class
    it is not much OO).

    So I came up with a hack.

    VMS code (C in this case):

    struct ooctx
    {
    int counter;
    };

    static int counter = 0;

    long increment(struct ooctx *ctx)
    {
    counter++;
    ctx->counter++;
    return 1;
    }

    long get(struct ooctx *ctx, long *c1, long *c2)
    {
    *c1 = counter;
    *c2 = ctx->counter;
    return 1;
    }

    Silly example, but it should illustrate the difference
    between a global variable and a client specific context.

    XML to describe API:

    <config>
    <image>demoo</image>
    <port>12350</port>
    <mt>false</mt>
    <oocontext>o</oocontext> <!-- <=============== this is the trick -->
    <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.PyClientGen</language>
    <language>dk.vajhoej.vms.tig.client.CppClientGen</language>
    </client>
    <methods>
    <method>
    <name>increment</name>
    <args/>
    </method>
    <method>
    <name>get</name>
    <args>
    <arg>
    <name>c1</name>
    <type>LongWord</type>
    <pass>Reference</pass>
    <use>Out</use>
    </arg>
    <arg>
    <name>c2</name>
    <type>LongWord</type>
    <pass>Reference</pass>
    <use>Out</use>
    </arg>
    </args>
    </method>
    </methods>
    </config>

    And let us take client in Python.

    First O.py for client access to context:

    import struct

    class O:
    def __init__(self, counter = 0):
    self.counter = counter
    def pack(self):
    return struct.pack('<l', self.counter)
    def unpack(self, blk):
    self.counter = struct.unpack('<l', blk)[0]

    Test:

    from sys import argv

    from DemooClient import *

    for i in range(3):
    cli = DemooClient(argv[1])
    for j in range(3):
    stat = cli.increment()
    stat, c1, c2 = cli.get()
    print('%d %d (%d)' % (c1, c2, cli.oocontext().counter))

    Output:

    C:\Code\VMS\tig\examples>python testo.py 192.168.68.40
    1 1 (1)
    2 2 (2)
    3 3 (3)
    4 1 (1)
    5 2 (2)
    6 3 (3)
    7 1 (1)
    8 2 (2)
    9 3 (3)

    If one is not interested in the context client side (private context
    in OO world), then one can just specify the size of the context instead
    of the type.

    <oocontext>o</oocontext>



    <oocontext>4</oocontext>

    and drop O.py implementation and do not try to access context
    from client.

    Python client:

    from sys import argv

    from DemoqClient import *

    for i in range(3):
    cli = DemoqClient(argv[1])
    for j in range(3):
    stat = cli.increment()
    stat, c1, c2 = cli.get()
    print('%d %d' % (c1, c2))

    https://www.vajhoej.dk/arne/opensource/vms/vmstig-bin-v0_2.zip https://www.vajhoej.dk/arne/opensource/vms/vmstig-client-v0_2.zip https://www.vajhoej.dk/arne/opensource/vms/vmstig-src-v0_2.zip

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Mon Nov 11 15:39:39 2024
    On 8/11/2024 7:03 PM, Arne Vajhøj wrote:
    On 8/1/2024 8:20 AM, Arne Vajhøj wrote:
    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).

    Start here:

    https://www.vajhoej.dk/arne/opensource/vms/doc/tig/doc/

    I have updated again.

    Support for PHP and VB.NET client side.

    Support for inheriting OO context.

    Download links:

    https://www.vajhoej.dk/arne/opensource/vms/vmstig-bin-v0_3.zip https://www.vajhoej.dk/arne/opensource/vms/vmstig-client-v0_3.zip https://www.vajhoej.dk/arne/opensource/vms/vmstig-src-v0_3.zip

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)