@NathanH:
As deadwood wrote: the .conf files are the prime source for your information on library function index numbers.
But, it is a bit of an annoyance to use them in case you are not familiar with them as they start "counting" from a certain index and each empty line or line indicated with .skip <number> skips a number of indexes.
We had to use the same .conf files for creating header files for Free Pascal so you could take a look at those header files to verify or use them as your source.
Because all structural and other defined elements are tucked in there as well you could use that information from the Pascal header files as as well for implementing your forth headers. I honestly can't remember if forth uses separate include files (as c does) or requires everything to be included in a single header file so you might be unfamiliar with how Pascal does it.
Main Pascal header files source directory can for example be found here
https://github.com/fpc/FPCSource/tree/main/packages/arosunits/srcThe only difference is that some header files are named differently in order to avoid naming conflicts with other (RTL) Pascal header files so, for instance the AROS header file for DOS is named amigados, Graphics is named agraphics, etc.
The function names and index numbers can be found at the bottom of each header file. The function implementations at the bottom are usually macro's (FreePascal does not support c-style macro's) and variadic versions of certain functions. The information you are probably more interested in is situated just above those implementations.
For instance your Lock function can be found inside Pascal unit header AmigaDOS.pas at line #2217 (
https://github.com/fpc/FPCSource/blob/main/packages/arosunits/src/amigados.pas#L2217) which reads:
function Lock(const Name: STRPTR; AccessMode: LongInt): BPTR; syscall AOS_DOSBase 14;
Indicating that a function named Lock returning a BPTR takes two parameters named Name (type = STRPTR) and AccessMode (type = Long integer) using a SYSCALL (probably your jforth CALL2 implementation) using a LVO index of 14.
If you do tend to use the Pascal header files as a source of information then please take note that Pascal is case insensitive so Lock, LOCK, LoCK and lock all refer to the same thing.
Also always make sure to verify against original AROS c source/include files because it functions can behave strange or wrong when pushing/popping the wrong sized elements to/from the stack. Sometime this is obvious but sometime the difference is subtle.
regards,