While looking into the native.api sample I also glimpsed at the wpipe1 sample 
and found a few things:

  * the Linux C sample seems to be based on the Windows sample except for:
      o the file is named "rexxaspi1.c" (note the "s") instead of "rexxapi1.c" 
for no apparent reason
      o renaming "Api" to "Aspi"
      o using the "const char *" instead of "PSZ" and the like
      o defines INVALID_ROUTINE to be 10 for unknown reasons, as the Windows 
version defines it to
        be 40 (which matches the Rexx error number "40  Incorrect call to 
routine")

  * the Linux Rexx sample seems to be based on the Windows sample except for:
      o renaming "Api" to "Aspi"
      o using a non-exisiting library ("rexxasp1", hence the Linux file named 
"librexxasp1.so") in
        the code as the CMake generated library is named "libwpipe1.so" such 
that "wpipe1" would
        have to be used

  * the Linux shared library is named "libwpipe1.so" where it should be 
probably named "librexxasp1.so"

For this sample there is a CMakeLists.txt file but there are no Windows and 
Linux specific Makefiles
as is the case with the native.api sample.

A working Makefile for Linux is:

    OOREXX_CFLAGS =  -fPIC
    DLL_LFLAGS = -shared 

    # What we want to build.
    all: librexxasp1.so

    rexxasp1.o: rexxasp1.c
        gcc -c rexxasp1.c $(OOREXX_CFLAGS) -o rexxasp1.o 

    librexxasp1.so: rexxasp1.o
        gcc rexxasp1.o ${DLL_LFLAGS} -o librexxasp1.so 


    clean:
        rm -f *.so *.o libwpipe1.so  librexxasp1.so

The name of the Linux sample should be probably changed from "rexxasp" to 
"rexxapi" which makes more
sense as the sample shows the usage of APIs.

It is a quite confusing situation!

---

The other api samples on Linux need to be looked over as well.

---rony


_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to