-
Notifications
You must be signed in to change notification settings - Fork 0
/
foxdbf.h
52 lines (43 loc) · 1.08 KB
/
foxdbf.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* SPDX-License-Identifier: GPL-2.0+
* Copyright (C) 2018 Abinav Puthan Purayil
* */
#ifndef FOXDBH
#define FOXDBH
#include <stdint.h>
#include "util.h"
#include "crs.h"
#define FOXDBF_LEN_COLNAME 11
struct foxdbf_header {
uint8_t magic;
struct {
uint8_t year;
uint8_t month;
uint8_t day;
} date;
unsigned int n_row;
unsigned short off_row1;
unsigned short sz_row;
/*
* Bunch of unknown sections here. (maybe padding)
* Both, unk_1 and unk_2 are usually nulled
* */
uint8_t unk_1[16];
uint8_t has_index;
uint8_t unk_2[3];
} PACKED;
struct foxdbf_coldef {
char name[FOXDBF_LEN_COLNAME];
char type;
unsigned int sz_sofar;
/* unsigned short width; */
uint8_t width;
uint8_t precision; /* ? */
uint8_t unk[14];
} PACKED;
extern void foxdbf_read_header(struct foxdbf_header *header, const char
*path_foxdbf);
extern void crs_meta_from_foxdbf(struct crs_meta *meta, const char *path_foxdbf);
extern void crs_content_from_foxdbf(const char *path_content, const char *path_foxdbf);
extern void crs_from_foxdbf(const char *path_dst, const char *path_foxdbf);
#endif