From 1979d85f589c0ffaf9a132c816f3feeba812eb2f Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Fri, 23 Aug 2024 12:07:03 +0100 Subject: [PATCH] Add additional toc helpers --- patterns/db_files/FileBase.pat | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/patterns/db_files/FileBase.pat b/patterns/db_files/FileBase.pat index f8c1883..47e22a8 100644 --- a/patterns/db_files/FileBase.pat +++ b/patterns/db_files/FileBase.pat @@ -45,4 +45,14 @@ fn get_toc_entry(TableOfContents toc, str entry_name) { fn get_offset(TableOfContents toc, str entry_name) { TOCEntry entry = get_toc_entry(toc, entry_name); return entry.offset; +}; + +fn get_size(TableOfContents toc, str entry_name) { + TOCEntry entry = get_toc_entry(toc, entry_name); + return entry.size; +}; + +fn get_end(TableOfContents toc, str entry_name) { + TOCEntry entry = get_toc_entry(toc, entry_name); + return entry.offset + entry.size + 24; }; \ No newline at end of file