1
0
mirror of https://github.com/CPunch/Laika.git synced 2026-02-24 23:40:03 +00:00

lmem.h: new laikaM_*Vector macros

- these will slowly replace laikaM_*array
- lpeer.[ch] has been migrated
This commit is contained in:
2022-09-01 18:47:29 -05:00
parent dbbe5f5a2a
commit af09e74263
4 changed files with 68 additions and 42 deletions

View File

@@ -4,6 +4,7 @@
#include "hashmap.h"
#include "laika.h"
#include "lsocket.h"
#include "lmem.h"
#include <stdbool.h>
@@ -20,22 +21,16 @@ struct sLaika_pollEvent
struct sLaika_pollList
{
struct hashmap *sockets;
struct sLaika_socket **outQueue; /* holds sockets which have data needed to be sent */
struct sLaika_pollEvent *revents;
laikaM_newVector(struct sLaika_socket *, outQueue); /* holds sockets which have data needed to be sent */
laikaM_newVector(struct sLaika_pollEvent, revents);
#ifdef LAIKA_USE_EPOLL
/* epoll */
struct epoll_event ev, ep_events[MAX_EPOLL_EVENTS];
SOCKET epollfd;
#else
/* raw poll descriptor */
PollFD *fds;
int fdCapacity;
int fdCount;
laikaM_newVector(PollFD, fds);
#endif
int reventCap;
int reventCount;
int outCap;
int outCount;
};
void laikaP_initPList(struct sLaika_pollList *pList);