modules/oldbotnet/oldbotnet.h File Reference

Go to the source code of this file.

Data Structures

struct  oldbotnet_t

Defines

#define bothandler   oldbotnet_LTX_bothandler
#define assoc_get_id   oldbotnet_LTX_assoc_get_id

Functions

int assoc_get_id (const char *name)

Variables

botnet_handler_t bothandler


Define Documentation

#define assoc_get_id   oldbotnet_LTX_assoc_get_id

Definition at line 26 of file oldbotnet.h.

Referenced by on_chanmsg(), on_join(), and on_part().

#define bothandler   oldbotnet_LTX_bothandler

Definition at line 25 of file oldbotnet.h.


Function Documentation

int assoc_get_id ( const char *  name  ) 

Definition at line 225 of file oldbotnet.c.

References assoc::dynamic, assoc::id, assoc::last_bounced, assoc::name, and assoc::next.

00226 {
00227   int highest_id = 0;
00228   assoc_t *a;
00229 
00230   for (a = &assocs; a; a = a->next) {
00231     if (!strcmp(a->name, name)) break;
00232     if (a->id > highest_id) highest_id = a->id;
00233   }
00234   if (a) return a->id;
00235 
00236   a = malloc(sizeof(*a));
00237   a->name = strdup(name);
00238   a->id = highest_id + 1;
00239   a->last_bounced = 0;
00240   a->dynamic = 0;
00241   a->next = assocs.next;
00242   assocs.next = a;
00243   return a->id;
00244 }


Variable Documentation

Definition at line 42 of file oldbotnet.h.


Generated on Sun Nov 30 18:43:36 2008 for eggdrop1.9 by  doxygen 1.5.6