]> jfr.im git - irc/quakenet/newserv.git/blobdiff - nick/nick.h
add pool for patricia, dump old stuff from nick
[irc/quakenet/newserv.git] / nick / nick.h
index 4cba97bdcf480c8b2f98bc53174b2326db6de015..6adfa0e4bb0d44c197c22dac424727c03054e595 100644 (file)
 #include "../server/server.h"
 #include "../lib/base64.h"
 #include "../lib/irc_ipv6.h"
-#include "../lib/patricia.h"
+#include "../patricia/patricia.h"
 
 #include "../authext/authext.h"
 
 #include <time.h>
 
+#ifndef MAXNICKEXTS
 #define MAXNICKEXTS       6
+#endif
 
 #define UMODE_INV       0x0001
 #define UMODE_WALLOPS   0x0002
@@ -35,6 +37,9 @@
 
 #define UMODE_ALL       0x3FFF
 
+#define AFLAG_STAFF     0x0001
+#define AFLAG_DEVELOPER 0x0002
+
 #define IsInvisible(x)    ((x)->umodes & UMODE_INV)
 #define IsWallops(x)      ((x)->umodes & UMODE_WALLOPS)
 #define IsDebug(x)        ((x)->umodes & UMODE_DEBUG)
 #define ClearHideIdle(x)     ((x)->umodes &= ~UMODE_HIDEIDLE)
 #define ClearParanoid(x)     ((x)->umodes &= ~UMODE_PARANOID)
 
+#define IsStaff(x)           ((x)->umodes & AFLAG_STAFF)
+#define IsDeveloper(x)       ((x)->umodes & AFLAG_DEVELOPER)
+
+#define SetStaff(x)          ((x)->umodes |= AFLAG_STAFF)
+#define SetDeveloper(x)      ((x)->umodes |= AFLAG_DEVELOPER)
+
+#define ClearStaff(x)        ((x)->umodes &= ~AFLAG_STAFF)
+#define ClearDeveloper(x)    ((x)->umodes &= ~AFLAG_DEVELOPER)
+
 typedef struct host {
   sstring *name;
   int clonecount;
@@ -109,6 +123,7 @@ typedef struct nick {
   authname *auth; /* This requires User ID numbers to work */
   time_t timestamp;
   time_t accountts;
+  flag_t accountflags;
   patricia_node_t *ipnode;
   unsigned int marker;
   struct nick *next;
@@ -131,7 +146,7 @@ extern nick **servernicks[MAXSERVERS];
 extern host *hosttable[HOSTHASHSIZE];
 extern realname *realnametable[REALNAMEHASHSIZE];
 extern const flag umodeflags[];
-extern patricia_tree_t *iptree;
+extern const flag accountflags[];
 
 #define MAXNUMERIC 0x3FFFFFFF
 
@@ -164,9 +179,7 @@ int registernickext(const char *name);
 int findnickext(const char *name);
 void releasenickext(int index);
 char *visiblehostmask(nick *np, char *buf);
-int registernodeext(const char *name);
-int findnodeext(const char *name);
-void releasenodeext(int index);
+char *visibleuserhost(nick *np, char *buf);
 
 /* nickhandlers.c functions */
 int handlenickmsg(void *source, int cargc, char **cargv);
@@ -185,6 +198,7 @@ nick *getnickbynumericstr(char *numericstr);
                     
 /* nickhelpers.c functions */
 void initnickhelpers();
+void fininickhelpers();
 host *findhost(const char *hostname);
 host *findorcreatehost(const char *hostname);
 void releasehost(host *hp);