There were several memory leaks inside jfsck(), they've probably been there for a...
[libjio.git] / common.h
blob1b7bada574900f7c02929eaad500bb0fb41529a5
2 /*
3 * libjio - A library for Journaled I/O
4 * Alberto Bertogli (albertogli@telpin.com.ar)
6 * Header for internal functions
7 */
9 #ifndef _COMMON_H
10 #define _COMMON_H
12 #include <sys/types.h> /* for ssize_t and off_t */
13 #include <stdint.h> /* for uint*_t */
16 #define _F_READ 0x00001
17 #define _F_WRITE 0x00010
18 #define _F_LOCK 0x00100
19 #define _F_TLOCK 0x01000
20 #define _F_ULOCK 0x10000
22 #define F_LOCKR (_F_LOCK | _F_READ)
23 #define F_LOCKW (_F_LOCK | _F_WRITE)
24 #define F_TLOCKR (_F_TLOCK | _F_READ)
25 #define F_TLOCKW (_F_TLOCK | _F_WRITE)
26 #define F_UNLOCK (_F_ULOCK)
29 off_t plockf(int fd, int cmd, off_t offset, off_t len);
30 ssize_t spread(int fd, void *buf, size_t count, off_t offset);
31 ssize_t spwrite(int fd, const void *buf, size_t count, off_t offset);
32 int get_jdir(const char *filename, char *jdir);
33 int get_jtfile(const char *filename, int tid, char *jtfile);
35 int checksum(int fd, size_t len, uint32_t *csum);
36 uint32_t checksum_map(uint8_t *map, size_t count);
38 #endif