#include "WHOHandler.h"
+#include "ChanNode.h"
+#include "UserNode.h"
+
+struct WHOQueueEntry {
+ char type;
+ struct ChanNode *chan;
+ struct UserNode *user;
+ struct WHOQueueEntry *next;
+}
+
+static struct WHOQueueEntry *first_entry = NULL, *last_entry = NULL;
+
+static struct WHOQueueEntry* addWHOQueueEntry() {
+ struct WHOQueueEntry *entry = malloc(sizeof(*entry));
+ if (!entry)
+ {
+ perror("malloc() failed");
+ return NULL;
+ }
+ entry->next = NULL;
+ if(last_entry)
+ last_entry->next = entry;
+ if(!first_entry)
+ first_entry = entry;
+}
+
+static struct WHOQueueEntry* getNextWHOQueueEntry(int remove) {
+ if(!first_entry) return NULL;
+ struct WHOQueueEntry *entry = first_entry;
+ if(remove) {
+ first_entry = first_entry->next;
+ if(last_entry == first_entry)
+ last_entry = NULL;
+ }
+ return entry;
+}
void get_userlist(struct ChanNode *chan, userlist_callback_t callback) {
}
void recv_whohandler_354(struct ClientSocket *client, char **argv, unsigned int argc) {
+ struct WHOQueueEntry* entry = getNextWHOQueueEntry(0);
}
void recv_whohandler_315(struct ClientSocket *client, char **argv, unsigned int argc) {
+ struct WHOQueueEntry* entry = getNextWHOQueueEntry(1);
+ free(entry);
}