summaryrefslogtreecommitdiff
path: root/lib/Input.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Input.cc')
-rw-r--r--lib/Input.cc34
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/Input.cc b/lib/Input.cc
index e9b859a..6644dd0 100644
--- a/lib/Input.cc
+++ b/lib/Input.cc
@@ -22,6 +22,40 @@
#define BUILTIN_SIG 0x5141504e
+/*
+
+ NPAQ file format
+ ================
+
+off|siz|description
+---+---+-----------
+ 0 | 4 | Magic: NPAQ
+ 4 | X | Index
+4+X| Y | Files
+
+Index:
+It's composed of entries. Each entries have the same format:
+
+off|siz|description
+---+---+-----------
+ 0 | 1 | name size = n
+ 1 | n | file name
+1+n| 4 | file size
+5+n| 1 | type --> 0 = file / 1 = directory
+
+If it's a directory, it means the following entries belongs to this directory.
+If n = 0, there is nothing else afterward (no filesize nor type) and it
+means the end of the current directory. The end of the root directory
+means the end of the index.
+
+Files:
+Each file are gzipped. They are all concatenated after the index. They
+all start with a four bytes length which correspond to the unpacked size.
+The size in the index corresponds to the size of the gzipped result plus
+those 4 bytes.
+
+*/
+
static Input::openresults_t gresults;
Input::Input(const String & no) throw (GeneralException) :