Re: [CODE] DG Events - Pointers to events Wed, May 06, 1998 at 06:10:18PM -0500

From: Eric Green (ejg3@CORNELL.EDU)
Date: 05/06/98

On Wed, May 06, 1998 at 06:10:18PM -0500, Chuck Reed wrote:
> I'm sorry, my last message wasn't exactly clear.  I was wondering how to
> define the pointers to events.  In the example the pointer is
> GET_CHAR_SNIFF(ch).  Now, I was wondering what the
> Subject in question part looks like :)  Does this have to be defined like
> that?  If I don't define it like that, I get implicit declaration warnings.
>  If it does have to be defined, heh, what as?

Ah, okay.  Sorry.

The usage in the example assumes you have added a field such as
sniff_event to struct char_data, so you might have something in structs.h

    struct char_data {
        struct event *sniff_event;

GET_CHAR_SNIFF(ch) would then be

    #define GET_CHAR_SNIFF(ch)        ((ch)->sniff_event)

You need to save the sniff event so if you free the char_data structure
at some point, you can call an event_cancel(sniff_event);


     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/15/00 PST