add circular buffer logic and fix makefile bug

This commit is contained in:
thorium1256
2026-05-27 19:15:44 +03:00
parent 7be1ef312e
commit 94561cfa24
7 changed files with 83 additions and 28 deletions

View File

@@ -31,7 +31,7 @@ typedef struct {
typedef struct
{
irc_event_type_t type;
irc_message_t orig_msg;
char line[513];
} irc_event_t;
typedef struct
@@ -96,6 +96,14 @@ typedef struct
irc_connection_type_t connType;
} irc_connection_info_t;
typedef struct
{
irc_event_t *events;
int eventsSize;
int front;
int rear;
} irc_event_queue_t;
typedef struct
{
irc_connection_info_t connectionInfo;
@@ -111,13 +119,13 @@ typedef struct
/* Identity */
irc_identity_t identity;
irc_event_t* eventQueue; // lives on the heap
int eventQueuePtr;
/* Event queues */
irc_event_queue_t evtQueue;
} irc_client_t;
typedef struct {
const char *name;
void (*handler)(irc_message_t *msg, irc_client_t *irc);
} command_t;
} irc_command_t;
#endif