]>
Commit | Line | Data |
---|---|---|
cc73685d CB |
1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
2 | ||
f1a4a029 ÇO |
3 | #ifndef __LXC_PARSE_H |
4 | #define __LXC_PARSE_H | |
cb698658 | 5 | |
1160ce89 CB |
6 | #include "config.h" |
7 | ||
9994d140 CB |
8 | #include <stdio.h> |
9 | #include <sys/types.h> | |
10 | ||
afeec9b7 CB |
11 | #include "compiler.h" |
12 | ||
cb698658 | 13 | typedef int (*lxc_dir_cb)(const char *name, const char *directory, |
14 | const char *file, void *data); | |
15 | ||
7a7ff0c6 | 16 | typedef int (*lxc_file_cb)(char *buffer, void *data); |
cb698658 | 17 | |
a804cff7 | 18 | __hidden __hot extern int lxc_file_for_each_line(const char *file, lxc_file_cb callback, void *data); |
cb698658 | 19 | |
a804cff7 CB |
20 | __hidden __hot extern int lxc_file_for_each_line_mmap(const char *file, lxc_file_cb callback, |
21 | void *data); | |
9994d140 | 22 | |
9994d140 CB |
23 | /* mmap() wrapper. lxc_strmmap() will take care to \0-terminate files so that |
24 | * normal string-handling functions can be used on the buffer. */ | |
a804cff7 CB |
25 | __hidden extern void *lxc_strmmap(void *addr, size_t length, int prot, int flags, int fd, |
26 | off_t offset); | |
9994d140 | 27 | /* munmap() wrapper. Use it to free memory mmap()ed with lxc_strmmap(). */ |
a804cff7 | 28 | __hidden extern int lxc_strmunmap(void *addr, size_t length); |
9994d140 | 29 | |
a804cff7 | 30 | #endif /* __LXC_PARSE_H */ |