summaryrefslogtreecommitdiffstats
path: root/word_util.h
blob: 1158d61a271de9b74a846e7b1cea10da5abd27cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef _WORD_UTIL_H
#define _WORD_UTIL_H

#include <stdint.h>

#include "word_file_fmt.h"

struct word_handle {
	int fd;
	uint8_t *base_addr;
	uint32_t file_size;
};

static inline uint32_t word_bptr2offset(uint16_t bptr)
{
	return (bptr * WORD_BLOCK_SIZE);
}

struct word_handle *word_file_open(const char *fname);

#endif