diff options
author | tlatorre <tlatorre@uchicago.edu> | 2018-08-14 10:08:27 -0500 |
---|---|---|
committer | tlatorre <tlatorre@uchicago.edu> | 2018-08-14 10:08:27 -0500 |
commit | 24c8bcfe7f76b20124e2862ea050f815c0f768e7 (patch) | |
tree | e5bdbd638a2c7f38f1c094cc9e95cbdfe05b9481 /src/zebra.h | |
parent | 0b7f199c0d93074484ea580504485a32dc29f5e2 (diff) | |
download | sddm-24c8bcfe7f76b20124e2862ea050f815c0f768e7.tar.gz sddm-24c8bcfe7f76b20124e2862ea050f815c0f768e7.tar.bz2 sddm-24c8bcfe7f76b20124e2862ea050f815c0f768e7.zip |
move everything to src directory
Diffstat (limited to 'src/zebra.h')
-rw-r--r-- | src/zebra.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/zebra.h b/src/zebra.h new file mode 100644 index 0000000..2f24939 --- /dev/null +++ b/src/zebra.h @@ -0,0 +1,48 @@ +#ifndef ZEBRA_H +#define ZEBRA_H + +#include <stdio.h> /* for FILE */ +#include <stdlib.h> /* for size_t */ +#include <stdint.h> /* for uint8_t, etc. */ + +extern char zebra_err[256]; + +#define ZEBRA_SIG0 0x0123cdefUL +#define ZEBRA_SIG1 0x80708070UL +#define ZEBRA_SIG2 0x4321abcdUL +#define ZEBRA_SIG3 0x80618061UL + +#define ZEBRA_BLOCK_SIZE_MASK 0x00ffffffUL +#define ZEBRA_EMERGENCY_STOP 0x80000000UL +#define ZEBRA_END_OF_RUN 0x20000000UL +#define ZEBRA_START_OF_RUN 0x40000000UL + +typedef struct bank { + uint32_t next; + uint32_t up; + uint32_t orig; + uint32_t number; + uint32_t name; + uint32_t num_links; + uint32_t num_structural_links; + uint32_t num_data_words; + uint32_t status; + uint32_t *data; +} bank; + +typedef struct zebraFile { + FILE *f; + size_t offset; + size_t lr_size; + uint8_t *buf; + size_t buf_size; +} zebraFile; + +zebraFile *zebra_open(const char *filename); +int read_next_physical_record(zebraFile *z); +int get_bytes(zebraFile *z, size_t size); +int read_next_logical_record(zebraFile *z); +int next_bank(zebraFile *z, bank *b); +void zebra_close(zebraFile *z); + +#endif |