~obeancomputer/bitter

927368a2a76fe84d2f6cc114790f76f337bacb23 — ocsmit 1 year, 2 months ago e5e0398
documentation
1 files changed, 21 insertions(+), 0 deletions(-)

M src/bitarr_io.h
M src/bitarr_io.h => src/bitarr_io.h +21 -0
@@ 1,3 1,24 @@
/*
 * File format is specified as follows
 *  The header is 9 bytes long
 *  - magic number: 3 char   (3 byte)
 *  - l:            1 uint8  (1 byte)
 *  - width:        1 uint8  (1 byte)
 *  - n:            1 uint32 (4 byte)
 *
 * The magic number is specified as "BIT"
 *
 * The length (i) of the data array is computed by ceil((l*n)/32),
 * where 32 is the size of a computer word. Thus the data is read
 * as the next unsigned int * i bytes
 *
 * ┌─────────┬───┬───┬────────────┬───────────────── 
 * │   BIT   │ l │ w │     n      │       ...        
 * └─────────┴───┴───┴────────────┴───────────────── 
 *
 */


#ifndef BITARR_IO_H_
#define BITARR_IO_H_