working chat app example with some rough edges

This commit is contained in:
2025-11-30 20:01:06 +01:00
parent f311b242c2
commit 875cd9d044
5 changed files with 346 additions and 105 deletions

11
core.h
View File

@@ -181,8 +181,8 @@ DefineList(string, String);
#define ListRemove(list, index)\
if ((index) >= 0 && (index) < (list)->length) {\
memcpy((list)->data + (index), (list)->data + (index) + 1, (parentNode->children.length - (i + 1))*sizeof(*((list)->data)));\
parentNode->children.length -= 1;\
memcpy((list)->data + (index), (list)->data + (index) + 1, ((list)->length - (i + 1))*sizeof(*((list)->data)));\
(list)->length -= 1;\
}
// ### Strings ###
@@ -255,9 +255,10 @@ typedef enum {
StdStream_stderr,
} StdStream;
#define ANSI_INSTRUCTION_FROM_ENUM(ansiCodeEnum) ANSI_INSTRUCTION(ansiCodeEnum)
#define ANSI_INSTRUCTION(ansiCode) "\x1b[" #ansiCode "m"
#define ANSI_INSTRUCTION_STR(ansiCodeStr) "\x1b[" ansiCodeStr "m"
#define ANSI_INSTRUCTION(ansiCode) "\x1b[" #ansiCode
#define ANSI_INSTRUCTION_STR(ansiCodeStr) "\x1b[" ansiCodeStr
#define ANSI_GRAPHIC_INSTRUCTION(ansiCode) "\x1b[" #ansiCode "m"
#define ANSI_GRAPHIC_INSTRUCTION_STR(ansiCodeStr) "\x1b[" ansiCodeStr "m"
#define ANSI_RESET ANSI_INSTRUCTION(0)
#define ANSI_fg_black 30