Difference between revisions of "ZIM file format"

Jump to navigation Jump to search
80 bytes added ,  08:54, 17 October 2010
Line 6: Line 6:
A ZIM file starts with a header. This starts always at offset 0.
A ZIM file starts with a header. This starts always at offset 0.


Length in byte, all types are littlendian
Length in byte, all types are littlendian.


{|{{Prettytable}}
{|{{Prettytable}}
! Field Name            !! Type    !! Offset !! Length !! Description
! Field Name            !! Type    !!Offset!!Length!! Description
|-
|-
| magicNumber            || integer || 0 || 4 || Magic number to recognise the file format, must be 72173914
| magicNumber            || integer ||   0 ||   4 || Magic number to recognise the file format, must be 72173914
|-
|-
| version                || integer || 4 || 4 || ZIM=5, version of the file format
| version                || integer ||   4 ||   4 || ZIM=5, bytes 1-2: major, bytes 3-4: minor version of the ZIM file format
|-
|-
| uuid                  || integer || 8 || 16 || unique id of this zim file
| uuid                  || integer ||   8 ||   16 || unique id of this zim file
|-
|-
| articleCount          || integer || 24 || 4 || total number of articles
| articleCount          || integer ||   24 ||   4 || total number of articles
|-
|-
| clusterCount          || integer || 28 || 4 || total number of clusters
| clusterCount          || integer ||   28 ||   4 || total number of clusters
|-
|-
| urlPtrPos              || integer || 32 || 8 || position of the directory pointerlist orderes by URL
| urlPtrPos              || integer ||   32 ||   8 || position of the directory pointerlist orderes by URL
|-
|-
| titlePtrPos            || integer || 40 || 8 || position of the directory pointerlist ordered by Title
| titlePtrPos            || integer ||   40 ||   8 || position of the directory pointerlist ordered by Title
|-
|-
| clusterPtrPos          || integer || 48 || 8 || position of the cluster pointer list
| clusterPtrPos          || integer ||   48 ||   8 || position of the cluster pointer list
|-
|-
| mimeListPos            || integer || 56 || 8 || position of the MIME type list (also header size)
| mimeListPos            || integer ||   56 ||   8 || position of the MIME type list (also header size)
|-
|-
| mainPage              || integer || 64 || 4 || main page or 0xffffffff if no main page
| mainPage              || integer ||   64 ||   4 || main page or 0xffffffff if no main page
|-
|-
| layoutPage            || integer || 68 || 4 || layout page or 0xffffffffff if no layout page
| layoutPage            || integer ||   68 ||   4 || layout page or 0xffffffffff if no layout page
|}
|}


Navigation menu