+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;
+ }
+}
+