osword.h

David J. Ruck druck at freeuk.com
Fri Dec 15 20:48:53 GMT 2000


On 15 Dec 2000 Tony van der Hoff <OSLib at mk-net.demon.co.uk> wrote:
> On Thu, 14 Dec 2000, at 20:16:26, David J. Ruck <druck at freeuk.com> wrote
> on the subject "osword.h":
> 
>> Couple of mistakes in the osword.h header, not specific to 6.20 but still
>> in the latest release.
>> 
>>         Currently                                         Should be
>> 
>> #undef  OSWordRead_Clock                               OSWord_ReadClock
>> #define OSWordRead_Clock                        0xE    OSWord_ReadClock
>> 0xE
> 
> Yes, you're right, that is mis-named. This is one of the things that the
> new StrongHelp manual makes much easier to spot. I'll fix that, thanks.

Yes the new manual layout is vastly improved. Having one big mess of
functions, constants and types made it very difficuly to find what you
are after, the sub sections make it clearer, but...

> >#undef  OSWordReadClock_LocalString
> >#define OSWordReadClock_LocalString             0xE           0x0
> >#undef  OSWordReadClock_LocalBCD
> >#define OSWordReadClock_LocalBCD                0xE           0x1
> 
> <snip>
> 
> No, You've mis-understood. Those are the SWI numbers that the function
> calls, and are correct. I think what you're looking for is the op code
> for the specific operation:
> 
> oswordreadclock_OP_LOCAL_STRING
> oswordreadclock_OP_LOCAL_BCD
> etc.
> 
> This is another thing that is easier to find in the new manual.

Ah yes. The problem with the manual though is it doesn't support cut and
paste into the editor, so I tend to go straight to the horses mouth - the
header file.

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.

> 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.
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.

> Thanks for your help, Dave.

No worries, I'll probably have been through all the header files before too
long, so I'll let you know if I find any more inconsistancies.

Cheers
---Dave

-- 
____________________________________________________________________________

  David J. Ruck    Phone: +44- (0)7974 108301    Email: druck at freeuk.com
____________________________________________________________________________




More information about the oslib-user mailing list