]> git.proxmox.com Git - mirror_lxc.git/blame_incremental - src/lxc/parse.h
github: Update for main branch
[mirror_lxc.git] / src / lxc / parse.h
... / ...
CommitLineData
1/* SPDX-License-Identifier: LGPL-2.1+ */
2
3#ifndef __LXC_PARSE_H
4#define __LXC_PARSE_H
5
6#include "config.h"
7
8#include <stdio.h>
9#include <sys/types.h>
10
11#include "compiler.h"
12
13typedef int (*lxc_dir_cb)(const char *name, const char *directory,
14 const char *file, void *data);
15
16typedef int (*lxc_file_cb)(char *buffer, void *data);
17
18__hidden __hot extern int lxc_file_for_each_line(const char *file, lxc_file_cb callback, void *data);
19
20__hidden __hot extern int lxc_file_for_each_line_mmap(const char *file, lxc_file_cb callback,
21 void *data);
22
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. */
25__hidden extern void *lxc_strmmap(void *addr, size_t length, int prot, int flags, int fd,
26 off_t offset);
27/* munmap() wrapper. Use it to free memory mmap()ed with lxc_strmmap(). */
28__hidden extern int lxc_strmunmap(void *addr, size_t length);
29
30#endif /* __LXC_PARSE_H */