Parameter block initialisation

Stewart Brodie stewart.brodie at pace.co.uk
Tue Oct 30 13:20:49 GMT 2001


In message <e68c90d14a.Tony at mk-net.demon.co.uk>
          Tony van der Hoff <tony at mk-net.demon.co.uk> wrote:

> It has been suggested that it would be nice if OSLib could automatically
> perform the partial initialisation of parameter blocks where this is
> required, e.g. |oswordreadclock_utc(&utc)| requires that |utc.op| is
> initialised with |oswordreadclock_OP_UTC|.
> 
> Obviously this requires an enhancement to DefMod; and given that there are
> very few calls which initialise a parameter block in this way, it may
> simply not be worth the effort. OTOH, if it could be done simply, it would
> be a nice enhancement.
> 
> Has anyone got any suggestions?

A tough call - does it really fit with the ethos of OSLib to start filling in
structures?  In the case stated, I don't think it's too much effort to
require that the block be initialised by the caller (especially since they
have to declare the structure anyway)

After the OS_Word issues, guaranteed the next ones are the Wimp calls like
Wimp_CloseDown, and pretty much anything else that wants an initialised value
in a buffer.

Could be a can of worms; don't see the point in doing it.  It's a hard line
to take, but that's my opinion anyway.

Perhaps a (hand-written) support library that sits on top of OSLib could be
written that provides extra APIs for this could be written?


-- 
Stewart Brodie, Senior Software Engineer    (Views expressed are my own and
Pace Micro Technology PLC                   not those of my employer)
645 Newmarket Road
Cambridge, CB5 8PB, United Kingdom         WWW: http://www.pacemicro.com/



More information about the oslib-team mailing list