[IRCServices Coding] svcs5 - request
Andrew Church
achurch at achurch.org
Sun Jan 6 22:57:52 PST 2002
I'm planning to do this when I redo the database handling, but that
will be in a future version--the current design has settled too much for me
to want to redo it right now. As things stand now, such additions can
still be done--they just require a separate database. (Whether this is
more or less efficient than a structure of the kind described below is left
as an exercise for the reader.)
--Andrew Church
achurch at achurch.org
http://achurch.org/
> If you realy want other people to write useful modules, then it should b
>e
>possible for each module to extend the NickServ and ChanServ (and even th
>e
>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. I
>t
>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 w
>ill
>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 chan
>ging
>existing code, without creating another database and will be compatible t
>o
>future versions.
>
>TIA
><<V13>>
>------------------------------------------------------------------
>To unsubscribe or change your subscription options, visit:
>http://www.ircservices.za.net/mailman/listinfo/ircservices-coding