From 3823de7144fa4f53fd520520f1ce51f1d12c2af8 Mon Sep 17 00:00:00 2001
From: Roland Haeder <roland@mxchange.org>
Date: Wed, 14 May 2014 20:54:32 +0200
Subject: [PATCH] Added explanation and improved format (idea).
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

Signed-off-by: Roland Häder <roland@mxchange.org>
---
 contrib/file_stack/format.txt | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/contrib/file_stack/format.txt b/contrib/file_stack/format.txt
index 12c18863..03b61652 100644
--- a/contrib/file_stack/format.txt
+++ b/contrib/file_stack/format.txt
@@ -9,12 +9,24 @@ Purpose: | "magic"   | separator | count    | position      | separator |
 ---------+-----------+-----------+----------+---------------+-----------+
 Bytes:   | 9         | 1         | 20 (hex) | 2 - n^2 (hex) | 1         |
 ---------+-----------+-----------+----------+---------------+-----------+
-Example: | STACKv1.0 |    ???    | 0...ff   | 01            |    ???    |
+Example: | STACKv1.0 |    ???    | 00...ff  | 01            |    ???    |
 
 Continued:
 
-Purpose: | name 0 | entry 0    | separator | name 1 | entry 1    | separator | name n | entry n    | EOF |
----------+--------+------------+-----------+--------+------------+-----------+--------+------------+-----+
-Bytes:   | 10     | 1-n (pack) | 1         | 10     | 1-n (pack) | 1         | 10     | 1-n (pack) | 1   |
----------+--------+------------+-----------+--------+------------+-----------+--------+------------+-----+
-Example: | foo    |     ...    |    ???    | bar    |     ...    |    ???    | bar    |     ...    | EOF |
+Purpose: | hash 0 | separator | name 0 | entry 0    | hash n | separator | name n | entry n    | EOF |
+---------+--------+-----------+--------+------------+--------+-----------+--------+------------+-----+
+Bytes:   |  ???   | 1         | 10     | 1-n (pack) |  ???   | 1         | 10     | 1-n (pack) | 1   |
+---------+--------+-----------+--------+------------+--------+-----------+--------+------------+-----+
+Example: | abc    |    ???    | foo    |    ...     | abc    |    ???    | bar    |     ...    | EOF |
+
+Explanations:
+-------------
+ magic        - Identifies the file and version of format
+ separator    - Serves to detect end of strings with unknown/flexible length
+ count        - Total amount of entries (not deleted) encoded in hexa-decimal
+ position     - Seek position of current entry (which current() will give)
+ hash X       - Hash sum of entry X
+ name X       - Name of stack the entries belongs in
+ entry X      - The actual data, compressed with pack()
+ EOF          - End-of-file character
+ ???          - Must be still found out which character/hashing algorthym fits best
-- 
2.39.5