Difference between revisions of "ZIM file format"

From openZIM
Jump to: navigation, search
(updated zim library format)
Line 2: Line 2:
  
 
{|{{Prettytable}}
 
{|{{Prettytable}}
! Field Name !! Type !! Length !! Description
+
! Field Name !! Type !! Offset !! Length !! Description
 
|-
 
|-
| rMagicNumber            || integer || 32 || Magic number to recognise the file format, must be "1439867043"
+
| rMagicNumber            || integer || 0 || 32 || Magic number to recognise the file format, must be "1439867043"
 
|-
 
|-
| rVersion                || integer || 32 || wp2006=2, wp2007=3, ZIM=4, version of the file format for backwards compatibility
+
| rVersion                || integer || 4 || 32 || wp2006=2, wp2007=3, ZIM=4, version of the file format for backwards compatibility
 
|-
 
|-
| rCount                  || integer || 32 || total number of articles
+
| rCount                  || integer || 8 || 32 || total number of articles
 
|-
 
|-
|                        || integer || 32 || ''unused''
+
|                        || integer || 12 || 32 || ''deprecated''
 
|-
 
|-
| rIndexPos              || integer || 64 || position of the article index
+
| rIndexPos              || integer || 16 || 64 || position of the article index
 
|-
 
|-
| rIndexLen              || integer || 32 || length of the article index
+
| rIndexLen              || integer || 24 || 32 || length of the article index
 
|-
 
|-
|                        || integer || 32 || ''unused''
+
|                        || integer || 28 || 32 || ''deprecated''
 
|-
 
|-
| rIndexPtrPos            || integer || 64 || Position der Zeigerliste auf das Inhaltsverzeichnis
+
| rIndexPtrPos            || integer || 32 || 64 || position to the directory pointerlist
 
|-
 
|-
| rIndexPtrLen            || integer || 32 || Länge der Zeigerliste auf das Inhaltsverzeichnis, also 4*rCount
+
| rIndexPtrLen            || integer || 40 || 32 || length of directory pointerlist (always 4*rCount)
 
|-
 
|-
| rTreeDataPos            || integer || 64 || bei wp nicht benutzt
+
| rMainPage              || integer || 44 || 32 || article index of main page or 0xffff if no main page
 
|-
 
|-
| rTreeDataLen           || integer || 32 || bei wp nicht benutzt
+
| rLayoutPage           || integer || 48 || 32 || article index of layout page or 0xffff if no layout page
 
|-
 
|-
| rIndexTotalArticleCount || integer || 32 ||  nur für die Indexdatei
+
|                                 || integer || 52 || 64 || ''deprecated''
|-
 
| rIsIndexCompressed      || boolean ||  8 ||  in der ausgelieferten Version immer true bei der Indexdatei
 
|-
 
| rNamespaceCountPos      || integer || 64 || Fileposition der Tabelle, die Infos über die Namespaces hat, siehe unten
 
|-
 
| rNamespaceCountLen      || integer || 32 || Länge dieser Tabelle, z.Zt. fix auf 368 Bytes (8 Bytes * 46 Namespaces)
 
 
|}
 
|}

Revision as of 18:35, 21 February 2009

length in bit, all types are littlendian

Field Name Type Offset Length Description
rMagicNumber integer 0 32 Magic number to recognise the file format, must be "1439867043"
rVersion integer 4 32 wp2006=2, wp2007=3, ZIM=4, version of the file format for backwards compatibility
rCount integer 8 32 total number of articles
integer 12 32 deprecated
rIndexPos integer 16 64 position of the article index
rIndexLen integer 24 32 length of the article index
integer 28 32 deprecated
rIndexPtrPos integer 32 64 position to the directory pointerlist
rIndexPtrLen integer 40 32 length of directory pointerlist (always 4*rCount)
rMainPage integer 44 32 article index of main page or 0xffff if no main page
rLayoutPage integer 48 32 article index of layout page or 0xffff if no layout page
integer 52 64 deprecated