home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 4
/
FreshFish_May-June1994.bin
/
new
/
dev
/
misc
/
fd2pragma
/
fd2pragma.readme
< prev
next >
Wrap
Text File
|
1994-03-11
|
3KB
|
69 lines
Short: Pragmas, LVOs for Aztec, Dice, SAS, Maxon
Type: dev/misc
Author: wiedmann@mailserv.zdv.uni-tuebingen.de
Uploader: wiedmann@mailserv.zdv.uni-tuebingen.de
This is a new version of my fd2pragma utility. It introduces support of
tag functions, either by using the SAS pragma "tagcall" or by creating
stub routines automatically. (Don't look at these functions: They look
BCPL-like, horrible! But I hope, they'll work. ;-)
As before, the following pragma formats are supported:
Program Recommended filename pragma format (example)
Aztec-C xxx_lib.h #pragma amicall(xBase,0x1e,xfunc(a0,d1))
Maxon xxx_pragmas.h #pragma amicall(xBase,0x1e,xfunc(a0,d1))
Dice xxx_pragmas.h #pragma libcall xBase xfunc 1802
SAS-C xxx_pragmas.h #pragma libcall xBase xfunc 1802
Aztec-As xxx_lib.asm xdef _LVOxfunc
_LVOxfunc equ -30
The tag functions are supported by certain comments. (Note, that the official
includes from the Native Developer Update Kit don't have this comments
included.) Lets look at an excerpt from the fd-file muimaster_lib.fd:
MUI_NewObjectA(class,tags)(a0,a1)
*tagcall
MUI_DisposeObject(obj)(a0)
MUI_RequestA(app,win,flags,title,gadgets,format,params)(d0,d1,d2,a0,a1,a2,a3)
*tagcall
MUI_AllocAslRequest(type,tags)(d0,a0)
*tagcalltags
The comments tell us, that MUI_NewObjectA, MUI_RequestA and
MUI_AllocAslRequest should have stub routines. The respective names are
MUI_NewObject, MUI_Request (as the comment has just the word tagcall) and
MUI_AllocAslRequestTags (as the comment has the word tags included).
Another possibility would be to write something like
SystemTagList(command,tags)(d1/d2)
*tagcall-TagList+Tags
This would create a stub-routine SystemTags (dropping the word TagList,
adding the word Tags).
Tag functions with arguments on the stack are supported in two different ways:
- SAS-C allows special pragmas called "tagcall". Pragmas for the above
functions would look like this:
#pragma tagcall MUIMasterBase MUI_NewObject 1e 9802
#pragma tagcall MUIMasterBase MUI_Request 2a BA9821007
#pragma tagcall MUIMasterBase MUI_AllocAslRequestTags 30 8002
#pragma tagcall DOSBase SystemTags 25e 2102
- Other C compilers need stub routines which are compiled separately and
linked to the program. fd2pragma can create these stub routines for you.
The command template pf fd2pragma is
fd2pragma fdfile/a,aztec/k,as/k,dice/k,sas/k,maxon/k,tagdir/k
where "fdfile" is the file to convert. The arguments aztec, as (Aztec-As),
dice, sas and maxon are the pragma or LVO files that should be created.
The tagdir argument is the name of a directory where to store stub routines.
This program is in the public domain. Use it as you want, but WITHOUT ANY
WARRANTY!