changed Makefile; build all commands as an own file
[NeonServV5.git] / ModeNode.h
index b396c25c11d25b93aab893cae991d84875203d1c..6d2d5d959f3733cb89523aeb70f3151d23f96597 100644 (file)
@@ -4,19 +4,43 @@
 
 struct ChanNode;
 
+//Types: http://www.irc.org/tech_docs/draft-brocklesby-irc-isupport-03.txt
+#define CHANNEL_MODE_TYPE_A        0x01 /* ... special (addresses or users) ... */
+#define CHANNEL_MODE_TYPE_B        0x02 /* These modes always take a parameter. */
+#define CHANNEL_MODE_TYPE_C        0x03 /* These modes take a parameter only when set. */
+#define CHANNEL_MODE_TYPE_D        0x04 /* These modes never take a parameter. */
+#define CHANNEL_MODE_TYPE          0x07 /* bit mask to get the type */
+
+#define CHANNEL_MODE_VALUE_STRING  0x10
+#define CHANNEL_MODE_VALUE_INTEGER 0x20
+#define CHANNEL_MODE_VALUE         0x30 /* bit mask to get the value */
+
+#define CHANNEL_MODE_KEY           0x40 /* mode is a key - automatically add the current key as parameter on unset */
+
+#define CHANNEL_MODE_VALUE_INDEX_SHIFT 8
+#define CHANNEL_MODE_VALUE_INDEX_MASK  (0xff << CHANNEL_MODE_VALUE_INDEX_SHIFT) /* this "bitrange" is reserved for storing the array indexes of the mode values */
+
 struct ModeNode {
     struct ChanNode *chan;
     unsigned int modes;
+    unsigned int allmodes;
     char **mode_str_args;
     int *mode_int_args;
 };
 
+extern unsigned int valid_modes[];
+
 void init_ModeNode();
 struct ModeNode *createModeNode(struct ChanNode *chan);
 void freeModeNode(struct ModeNode *modes);
 int isModeSet(struct ModeNode* modes, char modeChar);
+int isModeAffected(struct ModeNode* modes, char modeChar);
 void* getModeValue(struct ModeNode* modes, char modeChar);
+unsigned int getModeType(struct ModeNode* modes, char modeChar);
 void parseModes(struct ModeNode* modes, char *modeStr, char **argv, int argc);
+void parseModeString(struct ModeNode* modes, char *modeStr);
+int parseMode(struct ModeNode* modes, int add, char mode, char *param);
 void getModeString(struct ModeNode* modes, char *modesStr);
+void getFullModeString(struct ModeNode* modes, char *modesStr);
 
 #endif
\ No newline at end of file