[DGD]Include for all objects

Mikael Lind z94lind at mtek.chalmers.se
Mon May 21 11:02:52 CEST 2001


Quoting Tim Vernum from 17:18, 2001-05-21:

> >Where should i put a #include <file.h> to be included by default in all 
> >the objects in the mud??
> 
> In the driver config file there is a line that specifies the default include
> file.
> 
> Usually it is <std.h>
> You can either:
>        Change it to be <file.h> (but you probably don't want to)
>  Or    Put #include <file.h> inside <std.h>

However, if you use the Kernel Library, you probably do not want the
objects in /kernel to include your special file. As discussed on this
list recently, use the path_special() hook outlined in
/doc/kernel/hook/driver instead:

  1. Create the empty file: /include/AUTO
  2. Add this line to /include/std.h: # include "AUTO"
  3. From ~System/initd, register an object manager in the driver.
  4. Let path_special() in the object manager return the path of the
     file to include.

I found this a bit tricky the first time, because it took me a while
to figure out that I had to create the empty file as described in
step 1 above. This file will actually be included by objects in
/kernel and ~System, that is why it should be empty.

// Mikael / Elemel

--
Give up yourself unto the moment / The time is now / Give up yourself
unto the moment / Let's make this moment last // Moloko


List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list