]> jfr.im git - irc/quakenet/newserv.git/blobdiff - whowas/whowas.h
whowas: Use a ring buffer for the whowas records.
[irc/quakenet/newserv.git] / whowas / whowas.h
index da49f8cbc561f7172d916e5c4774b86e6e671570..2a6b0e550f17384307c58ce9b0f4d2f24bdf9e91 100644 (file)
@@ -9,7 +9,7 @@
 typedef struct whowas {
   int type;
   time_t timestamp;
-  nick *nick; /* unlinked nick */
+  nick nick; /* unlinked nick */
 
   /* WHOWAS_QUIT or WHOWAS_KILL */
   sstring *reason;
@@ -23,18 +23,20 @@ typedef struct whowas {
   struct whowas *prev;
 } whowas;
 
-extern whowas *whowas_head, *whowas_tail;
-extern int whowas_count;
+extern whowas whowasrecs[WW_MAXENTRIES];
+extern int whowasoffset; /* points to oldest record */
 
-#define WHOWAS_QUIT 0
-#define WHOWAS_KILL 1
-#define WHOWAS_RENAME 2
+#define WHOWAS_UNUSED 0
+#define WHOWAS_QUIT 1
+#define WHOWAS_KILL 2
+#define WHOWAS_RENAME 3
 
-whowas *whowas_fromnick(nick *np);
+whowas *whowas_fromnick(nick *np, int standalone);
 nick *whowas_tonick(whowas *ww);
 void whowas_freenick(nick *np);
-whowas *whowas_chase(const char *nick, int maxage);
+whowas *whowas_chase(const char *target, int maxage);
 const char *whowas_format(whowas *ww);
+void whowas_clean(whowas *ww);
 void whowas_free(whowas *ww);
 
 unsigned int nextwhowasmarker(void);