#AnchorPath
4 messages in this thread
According to the 1992 edition of _ARKRM, Libraries_ p. 426, in the "ASL
Library" chapter, a requester will under certain circumstances pass a
pointer to an AnchorPath structure to a custom hook function.
An example of its use is given on p. 428:
returnvalue = MatchPattern(pat,
((struct AnchorPath *)obj->ap_Info.fib_FileName)
As an assembly language programmer, I need to know where to find the
pointer. I don't understand how this C routine knows what "AnchorPath"
means–i.e., where it is. Can anyone help me translate this into
assembler?
Bart Mathias
> returnvalue = MatchPattern(pat,
> ((struct AnchorPath *)obj->ap_Info.fib_FileName)
The (struct AnchorPath *) is a typecast. What it means is, treat the
object obj->ap_Info.fib_FileName as if it were a pointer to a struct
AnchorPath.
AnchorPath is a C structure. You will find it defined in
include:dos/dosasl.h, and there is an assembler version of it in
include:dos/dosasl.i
Peter Wade
Autopiloting from London, England
Bart,
Have you looked in the include file DOSASL.I ?
Regards,
Shraddhan (via AP from Hertfordshire, England)
Shraddhan (and Peter Wade),
Yes, I studied dos/dosasl.i and dos/dosasl.h as well as asl.library/#?
quite a bit before posting (I hate to reveal my stupidity except as a last
resort). But I just looked again, and see the crucial line is there after
all: "Allocate this structure and initialize it …" Obviously if I
allocate it I will know where it is.
What threw me off (and still worries me) is that I can find no hint of any
allocation in the sample C program. That program seems to first reference
AnchorPath only AFTER the user has replied to the requester, but there
does not seem to be any way to let the requester know where the structure
is. (And _Libraries_ states "A requester always passes … [a pointer to
an AnchorPath structure] to your custom hook function" as if the requester
itself allocates the structure and has to tell me where it is…)
I'll monkey around and see what new kinds of guru numbers I can generate.
Thanks,
Bart