Difference between revisions of "ZIM file format"

Jump to navigation Jump to search
546 bytes added ,  08:50, 17 October 2010
no edit summary
Line 35: Line 35:


Each article in the ZIM file has a directory entry. Since the directory entry has a variable size we have an index pointerlist which is a list of 4-byte offsets. The pointers points to the directory entries.
Each article in the ZIM file has a directory entry. Since the directory entry has a variable size we have an index pointerlist which is a list of 4-byte offsets. The pointers points to the directory entries.
== MIME Type List (mimeListPos) ==
The MIME type list always follows directly after the header, so the ''mimeListPos'' also defines the end and size of the ZIM file header.
The MIME types in this list are zero terminated strings. An empty string marks the end of the MIME type list.
{|{{Prettytable}}
! Field Name            !! Type    !!Offset!!Length!! Description
|-
| <1st MIME Type>        ||  string ||    0 ||  n/a || declaration of the <1st MIME Type> - zero terminated
|-
| <2nd MIME Type>        ||  string ||  n/a ||  n/a || declaration of the <2nd MIME Type> - zero terminated
|-
| ...                    ||  string ||  ... ||  ... || ...
|-
| <last entry / end>    ||  string ||  n/a ||    0 || empty string - zero terminated
|}


== URL pointer list (urlPtrPos) ==
== URL pointer list (urlPtrPos) ==
Line 93: Line 110:
| ...                    || integer || ...  ||    8 || ...
| ...                    || integer || ...  ||    8 || ...
|}
|}
== MIME List Pointer (mimeListPos) ==
The MIME list pointer if a file offset to a list of MIME types. The MIME types are zero terminated strings. An empty string marks the end of the MIME type list.


== Directory entries ==
== Directory entries ==

Navigation menu