register events

Stefan (metze) Metzmacher metze at metzemix.de
Wed May 7 05:05:59 GMT 2003


At 00:19 07.05.2003 +0000, jra at dp.samba.org wrote:
>On Tue, May 06, 2003 at 01:00:08PM +0200, Stefan (metze) Metzmacher wrote:
> >
> > If you have a good way to unregister events.
> > (and also let the registration of two events with the same fn pointer 
> possible)
> > I'd would :-)
>
>Registering an event should return a 'event_id' that must be
>passed back to all functions manipulating the event list.
>That way all operations are matched on event_id's not fn pointers
>etc.

seems like a good idea...

Jelmer:

what will  be better:

int smb_register_*_event(event_struct *event)
{
                 return event_id;
}

or

NTSTATUS smb_register_*_event(event_struct *event, int *_event_id)
{
                 *_event_id = event_id;
                 return NT_STATUS_OK;
}

or
NTSTATUS smb_eregister_*_event(event_struct *event)
{
                 event->id = event_id;
                 return NT_STATUS_OK;
}

I also want to remove the *prev,*next from the event struct's and use 
internal event_list_entry structs...


metze
-----------------------------------------------------------------------------
Stefan "metze" Metzmacher <metze at metzemix.de> 



More information about the samba-technical mailing list