91e51c8d8e9e2468e437f4870f8a0041c3cfad1d
[kernel/swap-modules.git] / parser / msg_buf.h
1 #ifndef _MSG_BUF_H
2 #define _MSG_BUF_H
3
4 #include <linux/types.h>
5
6 struct msg_buf {
7         char *begin;
8         char *end;
9         char *ptr;
10 };
11
12 int init_mb(struct msg_buf *mb, size_t size);
13 void uninit_mb(struct msg_buf *mb);
14
15 int cmp_mb(struct msg_buf *mb, size_t size);
16 size_t remained_mb(struct msg_buf *mb);
17 int is_end_mb(struct msg_buf *mb);
18
19 int get_u32(struct msg_buf *mb, u32 *val);
20 int get_u64(struct msg_buf *mb, u64 *val);
21
22 int get_string(struct msg_buf *mb, char **str);
23 void put_strung(char *str);
24
25 #endif /* _MSG_BUF_H */