1 /******************************************************************************
2  *                    Internetting Cooperating Programmers
3  * ----------------------------------------------------------------------------
4  *
5  *  ____    PROJECT
6  * |  _ \  __ _ _ __   ___ ___ _ __
7  * | | | |/ _` | '_ \ / __/ _ \ '__|
8  * | |_| | (_| | | | | (_|  __/ |
9  * |____/ \__,_|_| |_|\___\___|_|   the IRC bot
10  *
11  * All files in this archive are subject to the GNU General Public License.
12  *
13  * $Source: /cvsroot/dancer/dancer/src/seen.h,v $
14  * $Revision: 1.1.1.1 $
15  * $Date: 2000/11/13 02:42:47 $
16  * $Author: holsta $
17  * $State: Exp $
18  * $Locker:  $
19  *
20  * ---------------------------------------------------------------------------
21  *****************************************************************************/
22 
23 #ifndef SEEN_H
24 #define SEEN_H
25 
26 #include "dancer.h"
27 #include "user.h"
28 
29 typedef struct Auxstruct {
30   struct Auxstruct *link;   /* all nick belonging to the same nick */
31   struct Auxstruct *next;   /* for hash table */
32   struct Seenstruct *root;
33   char *nick;
34   long count;
35   time_t departure; /* 4.0beta3 entry */
36   ulong signature;
37 } itemaux;
38 
39 typedef struct Seenstruct {
40   struct Seenstruct *link;   /* single-list of all users */
41   struct Seenstruct *next;   /* next chained collided hash entry */
42   struct Auxstruct *first;   /* head of single list of all nick for this user */
43   char *usite;               /* This is the key */
44   char *host;                /* This is only used for wildcards */
45   time_t departure;
46   int type;
47   char *by;
48   char *msg;
49   ulong signature;
50 } itemseen;
51 
52 enum seentypes {
53   SEENLEAVE = 1, SEENQUIT,     SEENKICK,
54   SEENLEFT,      SEENQUITED,   SEENKICKED,
55   SEENERROR,     SEENCHANGE
56 };
57 
58 
59 bool SeenInit(void);
60 void SeenCleanup(void);
61 void Seen(char *, char *);
62 void SeenNick(char *, char *, char);
63 void SeenMatch(char *, char *);
64 void SeenInsert(itemguest *, int, char *, char *);
65 void SeenInsertAll(int, char *, char *);
66 void SeenSave(void);
67 itemaux *SeenMostNick(char *);
68 itemaux *SeenRecentNick(char *);
69 
70 #endif /* SEEN_H */
71