From ff0aae89238f4d60267def24476e8b9f4cb596cf Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sat, 19 Oct 2024 15:31:51 +0200 Subject: add serialization to file code --- config.h | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'config.h') diff --git a/config.h b/config.h index 039367d..626ccad 100644 --- a/config.h +++ b/config.h @@ -1,20 +1,11 @@ -#include -#include -#include - #define PORT 9983 // max size for a message sent #define BUF_MAX 255 // max length of messages #define MSG_MAX 256 +// max length of author field +#define MSG_AUTHOR_LEN 12 +// max length of timestamp field +#define MSG_TIMESTAMP_LEN 9 // current user's name -#define USERNAME "unrtdqttr" - -void writef(char* format, ...); - -struct message { - char buf[MSG_MAX]; - int buf_len; - char timestamp[9]; // HH:MM:SS - char author[12]; -}; +#define USERNAME "Jef Koek" -- cgit v1.2.3