diff options
author | fschildt <florian.schildt@protonmail.com> | 2025-08-22 15:23:11 +0200 |
---|---|---|
committer | fschildt <florian.schildt@protonmail.com> | 2025-08-22 15:23:11 +0200 |
commit | 2050c0e0576f05156f192aa4caf48834d2f28b14 (patch) | |
tree | ee58bd35b0df0a1bacfbc9700ed99ce80c99294e /src/client/session.h |
Diffstat (limited to 'src/client/session.h')
-rw-r--r-- | src/client/session.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/client/session.h b/src/client/session.h new file mode 100644 index 0000000..0a91755 --- /dev/null +++ b/src/client/session.h @@ -0,0 +1,42 @@ +#ifndef SESSION_H +#define SESSION_H + +#include <basic/arena.h> +#include <basic/string32.h> +#include <basic/time.h> +#include <os/os.h> + +struct Fscord; + +typedef struct { + String32Buffer *name; +} User; + +typedef struct { + Time creation_time; + String32Buffer *sender_name; + String32Buffer *content; +} ChatMessage; + +typedef struct { + size_t cur_user_count; + size_t max_user_count; + User *users; + + size_t message0; + size_t cur_message_count; + size_t max_message_count; + ChatMessage *messages; + + String32Buffer *prompt; +} Session; + +Session *session_create(Arena *arena, struct Fscord *fscord); +void session_reset(Session *session); +void session_process_event(Session *session, OSEvent *event); +void session_draw(Session *session); +void session_add_chat_message(Session *session, Time creation_time, String32 *sender_name, String32 *content); +void session_add_user(Session *session, String32 *username); +void session_rm_user(Session *session, String32 *username); + +#endif // SESSION_H |