× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



You know what would be useful? A prototype template, let me explain.

I created a procedure that takes as a parameter a pointer to a callback procedure. The module with the caller (procA) and the callback (procB) procedures doesn't really need a prototype for procB as it isn't really called in a traditional way. But, the called procdedure (procC) which receives a pointer to procB and executes it, does need a prototype that references the procedure pointer. Now that prototype in procC has to be local because it references the procedure pointer being passed in as a parameter, but even if I found a way to make the pointer and prototype global, I couldn't use the same prototype for procB because it references the pointer, and I really don't necessarily always want to use the same name for procB. It is a callback after all, and I might have more than one procedure in a given program providing services to procC. A prototype template would allow me to define the prototype in procC LikeProc(callback_t) with a reverence to the local procedure pointer being passed in as a parameter, and also define the callback procB LikeProc(callback_t) which would provide the matching procedure interface without the procedure pointer, but the parameters and return would be the same. Here is what I would like to see.

dcl-pr callback_t Int(10) Template;
Parm1 <keywords>;
Parm2 <keywords>;
end-pr;


dcl-proc procA;

...
procC(%paddr(procB));
...
end-proc;

dcl-proc procB LikeProc(callback_t);

<procedure body>
end-proc;

dcl-proc procC;
dcl-pi *n;
callbackPtr Pointer(*Proc);
end-pi;

dcl-pr callback LikeProc(callback_t) ExtProc(callbackPtr);

callback(...: ...);
...
end-proc;

Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.