X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2FChanNode.c;h=a58b5922e78fa858369ef8e741f047381b174d7b;hb=2d9db1adb1946aba00b203f40eff7d5db8163f01;hp=011b997550deb86c16aa0c58e4d149cd6cbdf54b;hpb=95fed4deda0319bee515e44ceec0c77061a2c04e;p=NeonServV5.git diff --git a/src/ChanNode.c b/src/ChanNode.c index 011b997..a58b592 100644 --- a/src/ChanNode.c +++ b/src/ChanNode.c @@ -1,4 +1,4 @@ -/* ChanNode.c - NeonServ v5.0 +/* ChanNode.c - NeonServ v5.1 * Copyright (C) 2011 Philipp Kreil (pk910) * * This program is free software: you can redistribute it and/or modify @@ -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)