Started working on a refactored version

This commit is contained in:
2024-02-17 00:40:09 +01:00
parent 66caca4a7f
commit 85ad0ab103
11 changed files with 254 additions and 762 deletions

23
src/entry.c Normal file
View File

@@ -0,0 +1,23 @@
#include "entry.h"
#include "utils.h"
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
bool is_entry_id_valid(const char* entry_id) {
if (entry_id == NULL)
return false;
size_t length = strlen(entry_id);
if (length == 0 || length > MAX_ENTRY_LENGTH)
return false;
for (size_t i = 0; i < length; i++)
if (entry_id[i] == '/')
return false;
return true;
}