Rexx scripting support has been available on OS/2
for a long time. This patch attempts to make it
available as an (optional) portable feature. It requires
an installed rexx interpreter and (as an option) the
rexx/trans package, which will load whichever
interpreter is available at runtime.
It has been tested on OS/2 and Windows (VC).
configure.in and documentation have not been
changed yet.
To activate simply define WITH_REXX and
HAVE_REXXTRANS if appropriate.
platform independent rexx scripting
Logged In: YES
user_id=31505
I propose you split this patch in two:
1. Let rexx support be compiled in only when HAVE_REXX is
defined.
Let config.os2 be the only one #defining it.
2. Patch for other platform(s) to support rexx.
Put them conditionally into makefile.xxx as it depends on
an extern
library.
Questions:
- Could it be compiled by MingW?
- Does it work with the Regina interpreter?
Logged In: YES
user_id=1180072
> -Could it be compiled by MingW?
> - Does it work with the Regina interpreter?
I don't see a reason why it cannot, but I haven't tested it.
There's is only one change specific to the Rexx interpreter
on OS/2 (Use of RexxFreeMemory instead of DosFreeMem).
The rest should work with every ANSI standard compliant
rexx interpreter. The only problem there might be are
different calling conventions on different platforms.
I have tested this patch on Windows using
"rexx/trans with regina" and with "regina rexx" alone.
The compiler used was VC.
If using Mark Hessling's rexx/trans package we can even
ship binaries with WITH_REXX compiled in, as these will
will load any supported rexx interpreter at runtime. They
will still work normally if there's no interpreter installed.
Logged In: YES
user_id=1180072
Here is a short description of what packages are needed
and a little test script:
First install a standard compliant rexx interpreter, e.g.
Regina Rexx, which can be downloaded at
http://regina-rexx.sourceforge.net
Most Linux distributions bring their own package
which is easier to install.
On Linux the regina package should contain regina.so,
regina.a and rexxsaa.h. That should be all you need to
get started.
Then compile gnuplot with WITH_REXX defined. To
test issue "testrexx" at the gnuplot command line.
This should invoke the attached testrexx.cmd
script. It contains a simple loop (i=1 to 5) which plots
sin(i*x) and pauses between iterations.
To get independent of the type of interpreter
(rexx/imc, ObjectRexx, Regina) you can install
the rexx/trans package available at
http://rexxtrans.sourceforge.net
It also loads the interpreter at runtime, so gnuplot can
run without a rexx interpreter installed. To use it in
gnuplot compile with HAVE_REXXTRANS defined.
simple test rexx script for testing
Logged In: YES
user_id=31505
Wow, that's great! Welcome OS/2 on Linux :-))
It's a full-featured scripting language for gnuplot, and now
not only on OS/2. Loops and much more.
On Linux, you have to additionally add "-lregina" into
src/Makefile's LIBS.
The technology seems to use "print". Thus, would "awk"
scripts be also used for such a scripting? I think it is
more used than rexx.
Then, gnuplot could be used like
./configure --with-interpreter=rexx,awk | rexxtrans,awk
For compatibility, there should be an option like
(un)set rexx | (un)set interpreter rexx
Logged In: YES
user_id=1180072
>Wow, that's great! Welcome OS/2 on Linux :-))
It may not be the 'unix way' of adding scripting capabilities,
but I like it. It's not yet really full featured. You don't
have access to gnuplot's variables and on Windows you
cannot print messages. So there's is room for a lot of
improvements...
>The technology seems to use "print". Thus, would "awk"
>scripts be also used for such a scripting? I think it is
>more used than rexx.
Actually no. It doesn't use print, but rather a nice feature
of the Rexx API. If the command given on the gnuplot
command line is not recognized as an (internal) gnuplot
command, the rexx interpreter is invoked using
RexxStart. Whenever the rexx interpreter encounters
an unrecognized command (e.g. "plot sin(x)") it passes
it on to an external (so called) SubCommandHandler.
Our SubCommandHandler is the RexxInterface() routine,
which just passes the command on to gnuplot
(via do_line()). Adding rexx scripting to a program that
way is common and very easy.
But sorry, I don't have a clue how something like this
could be done with awk. But there're many other scripting
languages which provide APIs. Some of them are surely
more popular than Rexx ;)
Logged In: YES
user_id=235620
In preparation for a code freeze and the run-up to a release of
version 4.2, existing bugs and patchsets are being prioritized.
This patchset is not on my (sfeam) list for inclusion in 4.2 and
is therefore being marked as priority 2.
Note that this does not mean it is a bad patch, or that it won't
be incorporated into cvs after 4.2 is released. We can
re-evaluate priorities after 4.2 is out.
If you want to argue for immediate reconsideration - go right
ahead; but do so quickly!
Ethan Merritt