I need to create Datatype descriptor which relies on a function to indentify the file being opened.
DTDesc from teh DevCD DSIs for me (when loading an existing descriptor anyway).
I doenloaded dtmake from aminet and those tools can read "disassemble" and create the new descriptor, but I'm unsure of how to compile the function element so that it works.
On OS4 can it be PPC or 68k code or either?
The original I'm upgrading was 68k so I compiled the fixed (I hope) code with m68k-amigaos- ggc but the resultant descriptor crashes.
Comparing with the original it looks like gcc has placed the strings before the function so that it's not the first thing in the linked object.
My options were
m68k-amigaos-gcc -nostartfiles -nostdlib -noixemul desc_func.c -o DT.drec

and compile it into an ELF file with ppc-amigaos-gcc -nostartfiles.
The return value should be TRUE if the file is a match and FALSE if it's not.
IExec, IDOS and IUtility interface pointers are available in the DTHookContext structure.

I must confess I don't understand this whole datatypes function business. The wiki says, "A Function is a stand-alone executable", which must be compiled as salass00 has explained above. But where is the executable supposed to be placed on disk, and how is it referred to by the descriptor?

@trixie >
The old "DTDesc" utility from the OS3 developer CD's might have crashed for broadblues when loading an existing descriptor but it does work to create a descriptor from example files. When I used it to create a new descriptor for example 8SVX files and added a function, it embedded the function in the descriptor. The function I used to create the descriptor was just an old OS3 (68k) AmigaDOS command which would not actually work but it was embedded in the descriptor produced by "DTDesc".