Version 0.8

This commit is contained in:
2026-02-19 15:27:47 +01:00
commit 868312edf8
37 changed files with 12782 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
#if defined(MAIN_SIMULATION) || defined(MAIN_TEST)
#define QUAKEY_ENABLE_MOCKS
#endif
#include <quakey.h>
#include "log.h"
void log_init(Log *log)
{
log->count = 0;
log->capacity = 0;
log->entries = NULL;
}
void log_free(Log *log)
{
free(log->entries);
}
int log_append(Log *log, LogEntry entry)
{
if (log->count == log->capacity) {
int n= 2 * log->capacity;
if (n < 8)
n = 8;
LogEntry *p = realloc(log->entries, n * sizeof(LogEntry));
if (p == NULL)
return -1;
log->entries = p;
log->capacity = n;
}
log->entries[log->count++] = entry;
return 0;
}