commit: ba44c4e611c22458fad42713a911d2f22c47b24c
parent 42cc39d519e2d21ed325dd512d38145aad268805
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Mon, 18 Jul 2022 03:01:16 +0200
Use def variables for magic headers
This allows to more easily identify and comment each
Diffstat:
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/main.ha b/main.ha
@@ -14,12 +14,12 @@ use strings;
let excludes: []str = [];
let noop: bool = false;
-const magic: [_]str = [
- "\x7FELF",
- "!<arch>\n",
- "\x55\xAA",
- "FOR1",
-];
+def ELF: str = "\x7FELF";
+def UNIX_AR: str = "!<arch>\n";
+def PC_BIOS_ROM: str = "\x55\xAA";
+def ERL_BEAM: str = "FOR1";
+
+const magic: [_]str = [ELF, UNIX_AR, PC_BIOS_ROM, ERL_BEAM];
fn is_blob(filename: str) (bool | fs::error | io::error) = {
static let buffer: [512]u8 = [0...];