]> jfr.im git - irc/quakenet/newserv.git/blobdiff - authext/authext.h
build: Keep track of #include dependencies.
[irc/quakenet/newserv.git] / authext / authext.h
index ddc09c4f8d789d3be41036bcb204545d7919d187..4a78c2f0f4d5bc10aee4f80c561208e215cbaadb 100644 (file)
@@ -1,8 +1,17 @@
 #ifndef __AUTHEXT_H
 #define __AUTHEXT_H
 
+#include "../irc/irc_config.h"
+#include "../lib/flags.h"
+#include "../lib/ccassert.h"
+
+#include <sys/types.h>
+
 #define MAXAUTHNAMEEXTS 5
 
+/* checking to see that u_int64_t == unsigned long long for strtoull */
+CCASSERT(sizeof(unsigned long long) == sizeof(u_int64_t))
+
 struct nick;
 
 typedef struct authname {
@@ -10,7 +19,10 @@ typedef struct authname {
   int usercount;
   unsigned int marker;
   struct nick *nicks;
-  struct authname *next;
+  struct authname *next, *nextbyname;
+  unsigned int namebucket;
+  u_int64_t flags;
+  char name[ACCOUNTLEN+1];
   /* These are extensions only used by other modules */
   void *exts[MAXAUTHNAMEEXTS];
 } authname;
@@ -20,20 +32,23 @@ typedef struct authname {
 extern authname *authnametable[AUTHNAMEHASHSIZE];
 
 /* Allocators */
-authname *newauthname();
+authname *newauthname(void);
 void freeauthname (authname *hp);
 
 /* EXT management */
-int registerauthnameext(const char *name);
+int registerauthnameext(const char *name, int persistant);
 int findauthnameext(const char *name);
 void releaseauthnameext(int index);
 
 /* Actual user commands */
 authname *findauthname(unsigned long userid);
-authname *findorcreateauthname(unsigned long userid);
+authname *findauthnamebyname(const char *name);
+authname *findorcreateauthname(unsigned long userid, const char *name);
 void releaseauthname(authname *anp);
 
 /* Marker */
-unsigned int nextauthnamemarker();
+unsigned int nextauthnamemarker(void);
+
+authname *getauthbyname(const char *name);
 
 #endif