added cmd_info & cmd_debug
[NeonServV5.git] / src / ChanNode.c
index 011b997550deb86c16aa0c58e4d149cd6cbdf54b..affe863cc1034cc3bdf914ec15fdf0e59cde239a 100644 (file)
@@ -92,6 +92,21 @@ static int get_chanlist_entry(int name) {
     return 46;
 }
 
+struct ChanNode* getAllChans(struct ChanNode *last) {
+    if(last == NULL || last->next == NULL) {
+        int cindex;
+        if(last == NULL)
+            cindex = 0;
+        else
+            cindex = get_chanlist_entry(last->name[1]) + 1;
+        while(chanList[cindex] == NULL && cindex < CHANNEL_LIST_SIZE)
+            cindex++;
+        if(cindex >= CHANNEL_LIST_SIZE) return NULL;
+        return chanList[cindex];
+    } else
+        return last->next;
+}
+
 struct ChanNode* getChanByName(const char *name) { //case insensitive
     int chanListIndex = get_chanlist_entry(name[1]);
     if(chanListIndex == -1 || chanList[chanListIndex] == NULL)