Примеры использования Regina's API
Скачать полную версию в ZIP архиве.
This directory contains examples for the usage of Regina's API.
The examples are rather short and are designed to explain the API's usage
step by step.
Copy and paste them as you like.
You can link your code both against rexx.lib or rexx.a which enables the
resulting program to live without further reference to any Rexx stuff. The
disadvantage is a big program.
Alternatively you can link against regina.lib or regina.dll or regina.so which
enables the use of the dynamic loading interface and makes your application
small. You have to pass a copy a the Regina shared library with your
This examples all use the later kind to save your disk space.
All examples are in plain ANSI C. Feel free to provide examples in other
You have to ensure that Regina's shared library is in your loading path.
You can either install Regina before checking these examples, which is the best
idea, or you can copy a compiled shared library (DLL) to this directory, or you
change your PATH, LD_LIBRARY_PATH or whatever your system or loader uses as
the environment variable's name to set a specific directory as a directory
which contains a shared library (DLL). This is under
DOS, Windows, OS/2: "PATH ..;%PATH%"
unices (most flavours): "set LD_LIBRARY_PATH=..$LD_LIBRARY_PATH"
others: don't know
step1: Querying Regina's version
step2.rexx This file is used by various step2 examples.
step2-1: Invoking a Rexx script
step2-2: Invoking a Rexx script and checking the return values
step2-3: Invoking a Rexx script and passing arguments
step2-4: Invoking some lines Rexx of code without any Rexx script file.
step2-5: Saving a compiled Rexx script file for later use.
step3-1: Using an exit handler to intercept the output of "SAY".
step3-2: Using an exit handler to intercept the output of tracing.
step3-3: Using an exit handler to intercept the input of a stream.
step3-4: Using an exit handler to intercept the input of an interactive
step3-5: Using an exit handler to intercept the start and the end of
the interpretation of a script. This examples shows how to use
one handler for more than one exit event.
step3-6: Using an exit handler to set environment variables and
the current working directory.
step3-7: Using an exit handler to intercept every external function call.
step3-8: Using an exit handler to intercept every external command.
step3-9: Showing if multiple overloaded exit handlers are supported.
step4: Using a function handler to extend Rexx's external function set.
step5: Using a function handler to extend Rexx's external command set.
step6: Using RexxSetHalt to stop the interpretation.
step7: Using callbacks from called functions back into the Rexx script.
step8-1: Using the variable access interface for standard use.
step8-2: Using the variable access interface for direct use.
step8-3: Using the variable access interface for iterating all variables.
step8-4: Using the variable access interface to get access to various
step9: Using the queue interface.
Makefile: This file can be used in unix environments and on some other
systems to generate the executables.
README: This file.
rexxmem.h: This file should be used with foreign interpreters. You should
define UNKNOWN_INTERPRETER during the compilation and have
a look at rexxmem.h to see if it fits the memory requirements
of the interpreter.