Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
62 user(s) are online (35 user(s) are browsing Forums)

Members: 0
Guests: 62

more...

Headlines

 
  Register To Post  

Docs about creating an ARexx support library ???
Not too shy to talk
Not too shy to talk


See User information

I am trying to add ARexx support to my own Microbe3D.library
I have an arexx dispatch function at offset -30
LONG RexxSupport(APTR msg,APTR RexxSupportBase)
that analyze rexx messages parameters then call my functions

All seems to be OK with my .library but I have several crash with Arexx programs calling it....

It seems I am missing something when making an ARexx .library ??!!? perhaps it need some special headers or other stuff...

So the question:
Is there some docs or sources about creating such an arexx .library ?

Alain Thellier


Go to top
Re: Docs about creating an ARexx support library ???
Home away from home
Home away from home


See User information
@thellier

Well that's not right At least all the interface defs for libraries with ARexx support show a "STRPTR * " as the second argument.

Found this by googling:

6.3 ARexx function
------------------
The function that gets called from ARexx will receive a RexxMsg(1)
pointer in register A0. The ARG0 member of the RexxMsg holds the name of
the function that ARexx wants to run (the comparison should be case
independent), and the parameters to the function is put in ARG1-ARG15. If
your library doesn't recognize the function, you should return with 1 set
in register D0, otherwise you should run the function with the specified
parameters and return error in D0 (0=OK, 5=WARN etc). When returning OK,
you can return a result string by putting a pointer to an ArgString(2) in
A1, otherwise set A1 to 0 (zero).

(1) = See proper ARexx header file for "struct RexxMsg" definition.
(2) = See documentation for rexxsyslib.library/CreateArgstring().

I'm sure I've seen a proper bit of example code out there but can't find it for the moment.

Surely at least one of the libs on aminet must have src with it?

[edit]

Bit more research confrms the above is correct.






Edited by broadblues on 2014/12/3 16:39:42
Go to top
Re: Docs about creating an ARexx support library ???
Amigans Defender
Amigans Defender


See User information
There's definitely source code out there. My rx3h.library was based on some of Olaf Barthel's source code, found in the 3.9 NDK. The NDK is downloadable from somewhere, but if you can't find it I'm happy to send my rx3h source (should probably upload it, but IIRC it's in a right mess, not that that usually stops me).

Go to top
Re: Docs about creating an ARexx support library ???
Not too shy to talk
Not too shy to talk


See User information
Thanks to all
>See proper ARexx header file for "struct RexxMsg" definition.
>See [...] rexxsyslib.library/CreateArgstring().

Yes i have readed that
1) parameters send from Arexx seems to be OK from Microbe3D side when I print them
For example if I read a 3D object I receive the Scene pointer (3d context) and filename ... but it crash
2) I have implemented the "return two values in D0 and A0/A1" thing but I am not sure it is OK (but Arexx dont send errors)

SO I AM VERY INTERESTED IN SOURCES
( thellier ¤ free ° fr)
Especially the header and glue function for the a0,a1,d0 stuff (*)

All looks like as the memory was trashed ... So I was thinking about a special lib header where arexx write inside
.. so trashing my lib
It may not do an Enforcer hit in this case = still happen in .library memory block

Alain

(*) it is unclear if a0 or a1 is used or both, available doc may be false


Go to top
Re: Docs about creating an ARexx support library ???
Home away from home
Home away from home


See User information
@thellier

Quote:



(*) it is unclear if a0 or a1 is used or both, available doc may be false



Only A1.

Return code ie errors status gos in D0.

Pointer to Argstring for result goes in A1

Leave A0 alone.

(probably save and restore all other registers, but C compiler normal handles that for you any way).

The result is the result of the function

result = func(arg,arg,arg)

rather than RESULT the rexxvariable.

You can probably return additional results or stems if needed via SetRexxVarFromMsg()

Not sure what the glue code for a C function to do that would look like. ARexx has alot of these nasty little multi return code things, which is fine for pure assembler coding but a PITA for higher level stuff.

I would be interested to see the 68k stub code for such a library writen as OS4 PPC as the standards stubs wouldn't work.


Go to top
Re: Docs about creating an ARexx support library ???
Amigans Defender
Amigans Defender


See User information
For those asking: http://homepage.ntlworld.com/cdyoung/tmp/rx3h_src.lha

Earlier comments about it being a mess still apply.
It's for reference purposes ONLY. I have no idea even if that's the latest version of the source. It's an example of an ARexx library, but not necessarily a good example of an ARexx library. Most of the important bits are unchanged from Olaf's original though, so should be fine.

Go to top
Re: Docs about creating an ARexx support library ???
Not too shy to talk
Not too shy to talk


See User information
@Chris
Many Thanks for your sources

@BroadBlues
I will release the arexx part as free source when I will be sure that it works ok (including my OS4 ppc stub that was working).

Alain Thellier

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project