DataWorks
Database Library/Client
Loading...
Searching...
No Matches
DWF - DataWorks Database Format 1.0

DWF is a simple database format designed for DataWorks.

Specification

You SHOULD use .dwf for the extension.

All numbers MUST use big-endian.

File structure

First 3 bytes MUST be 7F 44 57 (\x7F DW) (signature)

Database entry (dbentry) MUST be in this format:

Name Size Type Info
length 4 bytes uint32_t Size of the entry
size 4 bytes uint32_t
flag 1 byte uint8_t
field_index 1 byte uint8_t
db_index 1 byte uint8_t
count 8 bytes uint64_t
fragnum 8 bytes uint64_t
data [size] bytes ASCII

and 2 flags for dbentry:

Type Mask Info
Used 0b10000000 Flag this if you are using the entry.
Fragment 0b01000000 Flag this if the entry is fragment.

Index entry (indexentry) MUST be in this format:

Name Size Type Info
flag 1 byte uint8_t
count 8 bytes uint64_t
dbname_len 1 byte uint8_t
dbname 256 bytes ASCII
fields 4096 bytes ASCII Separate field names using NUL. Put NUL twice on the last field name. Like: type name <NUL> type name <NUL> ... type name <NUL> <NUL>

There are 5 types for indexentry:

Type Character Type Info
String S ASCII
Integer I uint64_t
Double D double
Logical L uint8_t 0 for false, other value for true
Help ? ASCII Should be just ignored

There is 1 flag for indexentry:

Type Mask Info
Used 0b10000000 Flag this if you are using the entry.

Info entry (infoentry) MUST be in this format:

Name Size Type Info
version 2 bytes uint16_t MUST be 1 for 1.0
mtime 8 bytes int64_t Last modified time of the database

infoentry IS the only thing which SHOULD be compatible in later format.

File MUST look like this:

Data Info
signature
infoentry
indexentry 1st one
indexentry 2nd one
...
indexentry 256th one
dbentry 1st one
dbentry 2nd one
...
dbentry nth one