osword.h

Tony van der Hoff OSLib at mk-net.demon.co.uk
Sat Dec 16 12:46:49 GMT 2000


On Fri, 15 Dec 2000, at 20:48:53, David J. Ruck <druck at freeuk.com> wrote
on the subject "osword.h":

>
>The headers do seem to be a bit inconsistant, with some sub reason codes
>being included with the main reason codes for certain SWI's, and others
>further on in the file. I'd prefer them to be close together, so when you do
>a search for ReadClock, you find the sub codes near by.
>
This is an artefact if the way the headers (in fact everything in OSLib)
are generated machine generated. For what you're doing, you may be
better off scanning the SWI source files. 

>> The SWI numbers, although publicly defined, should not be of any real
>> interest to application programmers.
>
>Not for everyone perhapse, but I'm going through the entire range of RISC OS
>SWI's and building recognition for them into my code analyser, so I can
>mark data structures and entry point registrations. This involves me
>using the SWI number and reason code definitions from the OSLib header files.

This sounds like an ideal case for another output mode for DefMod. It
could scan the SWI definitions, and generate the data in just the form
you require, untrammeled by the interpretation which the CHeader module
imposes upon it. However, that's not a trivial task.

>It does become a bit confusing to find the same reason codes multiply defined
>as for OS_Word above, when I'm expecting to find the sub codes. These
>definitions wont be normally used by people calling the oslib functions, so
>it seems a bit superflous to have multiple defintions - they all have to be
>parsed by our rather slow compilers after all.
>
As I said, the headers are machine generated. I guess the background is
that we've made the veneers for the sub-swis look like SWIs in their own
right.  The other side of that coin is that they get SWI codes defined.
Yes, I'd agree they're superfluous, but I don't think it's worth
extending much effort in getting rid of them.  DefMod is quite hairy
enough as it is!
In fact, It is probably unnecessary to have the SWI codes in the C
headers at all, I can't think of any instance where they'd be useful
(apart from what you're doing, of course). Removing them entirely would
probably be a straightforward task, but would the milliseconds saved at
compile time warrant such a change? I believe not!

cheers, Tony
-- 
Tony van der Hoff         |  mailto:OSLib at mk-net.demon.co.uk
Buckinghamshire, England  |  http://www.mk-net.demon.co.uk/oslib/
----------------------------------------------------------------



More information about the oslib-user mailing list