]> jfr.im git - irc/evilnet/x3.git/blobdiff - src/hash.h
Lots of style changes to user replies. added numeric access back
[irc/evilnet/x3.git] / src / hash.h
index 48f680ff23629ee0d18b2842fdc12be20642097f..74555883823ecb99d005d6a49e8f164598487aa4 100644 (file)
@@ -1,7 +1,7 @@
 /* hash.h - IRC network state database
  * Copyright 2000-2004 srvx Development Team
  *
- * This file is part of srvx.
+ * This file is part of x3.
  *
  * srvx is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -49,6 +49,7 @@
 #define MODE_NOAMSG             0x00200000 /* +T no multi-target messages */
 #define MODE_SSLONLY            0x00400000 /* +z ssl only */
 #define MODE_HALFOP             0x00800000 /* +h USER */
+#define MODE_EXEMPT             0x01000000 /* +e exempt */
 #define MODE_REMOVE             0x80000000
 
 #define FLAGS_OPER             0x0001 /* Operator +O */
 #define NICKLEN         30
 #define USERLEN         10
 #define HOSTLEN         63
+#define ACCOUNTLEN     15
 #define REALLEN         50
 #define TOPICLEN        250
 #define CHANNELLEN      200
 
 #define MAXMODEPARAMS  6
 #define MAXBANS                45
+#define MAXEXEMPTS     45
 
 /* IDLEN is 6 because it takes 5.33 Base64 digits to store 32 bytes. */
 #define IDLEN           6
 DECLARE_LIST(userList, struct userNode*);
 DECLARE_LIST(modeList, struct modeNode*);
 DECLARE_LIST(banList, struct banNode*);
+DECLARE_LIST(exemptList, struct exemptNode*);
 DECLARE_LIST(channelList, struct chanNode*);
 DECLARE_LIST(serverList, struct server*);
 
@@ -152,6 +156,7 @@ struct chanNode {
 
     struct modeList members;
     struct banList banlist;
+    struct exemptList exemptlist;
     struct policer join_policer;
     unsigned int join_flooded : 1;
     unsigned int bad_channel : 1;
@@ -167,6 +172,12 @@ struct banNode {
     time_t set; /* time ban was set */
 };
 
+struct exemptNode {
+    char exempt[NICKLEN + USERLEN + HOSTLEN + 3]; /* 1 for '\0', 1 for ! and 1 for @ = 3 */
+    char who[NICKLEN + 1]; /* who set exempt */
+    time_t set; /* time exempt was set */
+};
+
 struct modeNode {
     struct chanNode *channel;
     struct userNode *user;
@@ -226,7 +237,7 @@ void NickChange(struct userNode* user, const char *new_nick, int no_announce);
 typedef void (*account_func_t) (struct userNode *user, const char *stamp);
 void reg_account_func(account_func_t handler);
 void call_account_func(struct userNode *user, const char *stamp);
-void StampUser(struct userNode *user, const char *stamp);
+void StampUser(struct userNode *user, const char *stamp, time_t timestamp);
 void assign_fakehost(struct userNode *user, const char *host, int announce);
 
 typedef void (*new_channel_func_t) (struct chanNode *chan);
@@ -236,7 +247,7 @@ void reg_join_func(join_func_t handler);
 typedef void (*del_channel_func_t) (struct chanNode *chan);
 void reg_del_channel_func(del_channel_func_t handler);
 
-struct chanNode* AddChannel(const char *name, time_t time_, const char *modes, char *banlist);
+struct chanNode* AddChannel(const char *name, time_t time_, const char *modes, char *banlist, char *exemptlist);
 void LockChannel(struct chanNode *channel);
 void UnlockChannel(struct chanNode *channel);
 
@@ -253,6 +264,7 @@ void reg_kick_func(kick_func_t handler);
 void ChannelUserKicked(struct userNode* kicker, struct userNode* victim, struct chanNode* channel);
 
 int ChannelBanExists(struct chanNode *channel, const char *ban);
+int ChannelExemptExists(struct chanNode *channel, const char *exempt);
 
 typedef int (*topic_func_t)(struct userNode *who, struct chanNode *chan, const char *old_topic);
 void reg_topic_func(topic_func_t handler);