From f509833a3c155aa1839c5225758c41f2e0cae00b Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Mon, 23 Dec 2024 20:39:31 +0100 Subject: [PATCH] Pack file struct for. Signed-off-by: Pol Henarejos --- src/fs/file.c | 1 - src/fs/file.h | 12 +++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/fs/file.c b/src/fs/file.c index 4137d6b..ac7a3fa 100644 --- a/src/fs/file.c +++ b/src/fs/file.c @@ -113,7 +113,6 @@ void process_fci(const file_t *pe, int fmd) { } } -#define MAX_DYNAMIC_FILES 128 uint16_t dynamic_files = 0; file_t dynamic_file[MAX_DYNAMIC_FILES]; diff --git a/src/fs/file.h b/src/fs/file.h index 072786f..1758cbe 100644 --- a/src/fs/file.h +++ b/src/fs/file.h @@ -69,15 +69,17 @@ #define MAX_DEPTH 4 +#define MAX_DYNAMIC_FILES 256 + typedef struct file { - const uint16_t fid; - const uint8_t parent; //entry number in the whole table!! const uint8_t *name; + uint8_t *data; //should include 2 bytes len at begining + const uint16_t fid; + const uint8_t acl[7]; + const uint8_t parent; //entry number in the whole table!! const uint8_t type; const uint8_t ef_structure; - uint8_t *data; //should include 2 bytes len at begining - const uint8_t acl[7]; -} file_t; +} __attribute__ ((packed)) file_t; extern bool file_has_data(file_t *);