2 #include "WHOHandler.h"
10 struct WHOQueueEntry *next;
13 static struct WHOQueueEntry *first_entry = NULL, *last_entry = NULL;
15 static struct WHOQueueEntry* addWHOQueueEntry() {
16 struct WHOQueueEntry *entry = malloc(sizeof(*entry));
19 perror("malloc() failed");
24 last_entry->next = entry;
29 static struct WHOQueueEntry* getNextWHOQueueEntry(int remove) {
30 if(!first_entry) return NULL;
31 struct WHOQueueEntry *entry = first_entry;
33 first_entry = first_entry->next;
34 if(last_entry == first_entry)
40 void get_userlist(struct ChanNode *chan, userlist_callback_t callback) {
44 void recv_whohandler_354(struct ClientSocket *client, char **argv, unsigned int argc) {
45 struct WHOQueueEntry* entry = getNextWHOQueueEntry(0);
49 void recv_whohandler_315(struct ClientSocket *client, char **argv, unsigned int argc) {
50 struct WHOQueueEntry* entry = getNextWHOQueueEntry(1);