OSLib Directory Structure

Tony van der Hoff OSLib at mk-net.demon.co.uk
Sat Sep 30 18:14:47 BST 2000


On Thu, 28 Sep 2000, at 22:13:09, David Bryan
<D.J.Bryan at cranfield.ac.uk> wrote on the subject "OSLib 6.11 Released":

>Daniel Ellis wrote:
>
>> On Thu 28 Sep, David Bryan wrote:
>> > Tony van der Hoff wrote:
>> > 
>> > > Well, say the top-level OSLib directory is called <OSLib$Dir> . Then the
>> > > default OSLib$Path would be defined as:
>> > > 
>> > > <OSLib$Dir>.,
>> > > <OSLib$Dir>.types.,
>> > > <OSLib$Dir>.macros.,
>> > > <OSLib$Dir>.core.,
>> > > <OSLib$Dir>.computer.,
>> > > <OSLib$Dir>.user.,
>> > > <OSLib$Dir>.toolbox.,
>> > > <OSLib$Dir>.types.oslib.,
>> > > <OSLib$Dir>.macros.oslib.
>> > > <OSLib$Dir>.core.oslib.,
>> > > <OSLib$Dir>.computer.oslib.,
>> > > <OSLib$Dir>.user.oslib.,
>> > > <OSLib$Dir>.toolbox.oslib.
>> > > 
>> > > Quite a handful, but still manageable, except under RO2, but I think we
>> > > can safely ignore that.
>> > 
>> > With
>> > 
>> >   Set OSLib$Dir ADFS::HardDisc4.$.OSLib
>> > 
>> > the old definition of OSLib$Path comes to 214 characters, which is
>> > OK.  The one above comes to a whopping 439.  AFAICR, this is not
>> > going to work on anything before RO 3.7.  So, the extra layer of
>> > path variables look necessary.
>> 
>> Surely not if it's defined as a macro?  i.e.
>> 
>>   setmacro <oslib$dir>.user.oslib....
>> 
>> instead of
>> 
>>   set <oslib$dir>.user.oslib....
>
>Oh, this does help.  I was expecting buffer overflow; FontInstall
>still has a buffer overflow problem on RO 4.02.  As a macro it's
>284 characters long... time for a shorter alternative to
>OSLib$Dir ?
>

No, but split the path into preferred and legacy...

It all seems to work quite nicely :-) Thanks to all for the helpful
suggestions and comments.

I have built a library with oslib/ in the headers.

I two distribution archives; one with the legacy 'deep' structure, with
the extra 'oslib' layer above the .h layer; and one with the 'flat'
structure for capable file systems.
 
For the legacy system, I have defined two path variables, the preferred
OSLib: for any new stuff using "#include oslib/wimp.h", and a legacy
OSLibInclude: for anyone who doesn't want to change existing code.

The latter is derived from the former:

Set OSLib$Dir <Obey$Dir>

SetMacro OSLib$Path <OSLib$Dir>.,<OSLib$Dir>.Types.,<OSLib$Dir>.Macros.,
<OSLib$Dir>.Core.,<OSLib$Dir>.Computer.,<OSLib$Dir>.User.,
<OSLib$Dir>.Toolbox.

SetMacro OSLibInclude$Path <OSLib$Path>,<OSLib$Dir>.Types.oslib.,
<OSLib$Dir>.Macros.oslib.,<OSLib$Dir>.Core.oslib.,
<OSLib$Dir>.Computer.oslib.,<OSLib$Dir>.User.oslib.,
<OSLib$Dir>.Toolbox.oslib.

For the new structure, I have also defined two paths, but they are
identical, simply OSLib$Dir.

It all compiles and links quite happily on my RPC (RO4) and my A7000
(RO3.6).

Who's going to be the first to point out where I've gone it wrong? ;-)

I'll try to get a release done tomorrow (Sunday), but if not, it'll have
to wait for a week.

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