[IRCServices Coding] svcs5 - request

v13 at priest.com v13 at priest.com
Sun Jan 6 05:52:14 PST 2002


 If you realy want other people to write useful modules, then it should be 
possible for each module to extend the NickServ and ChanServ (and even the 
others) databases. I suppose that having a:

struct ext_list {
	struct ext_list	*prev, *next;
	long		id;
	size_t		size;
	void		*buf;
};

that will form a list for each nickname/channel whould be what we need. It 
should be easy to save it using the existing database format.
Also by providing some functions like:

struct ext_list *get_extlist_memb(struct ext_list *head, long id);

void update_extlist_memb(struct ext_list **head, long id, size_t size,
			void *buf);

/* and one for delete */

it should be very easy to handle it.

Each module will only need to have a fixed unique integer to use and it will 
need only one field to be added to struct NickInfo etc.. like:

struct NickInfo {
	...
	struct ext_list	*head;
};

and after that..

/**********************************************/

#define MY_ID	0x1234

	struct NickInfo	*ni;
	struct ext_list	*el;

	...code...

	update_extlist_memb( &(ni->head), MY_ID, 7, "RANDOM" );

	...code...

	el=get_extlist_memb(ni->head, MY_ID);

	/* and there we have el==NULL or el->buf == "RANDOM" */

/**********************************************/

Something like this whould *REALY* help to add functionality without changing 
existing code, without creating another database and will be compatible to 
future versions.

TIA
<<V13>>