]> git.proxmox.com Git - mirror_lxc.git/blob - src/lxc/confile.h
licensing: Add missing headers and FSF address
[mirror_lxc.git] / src / lxc / confile.h
1 /*
2 * lxc: linux Container library
3 *
4 * (C) Copyright IBM Corp. 2007, 2008
5 *
6 * Authors:
7 * Daniel Lezcano <daniel.lezcano at free.fr>
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24 #include <stdio.h>
25
26 #ifndef _confile_h
27 #define _confile_h
28
29 struct lxc_conf;
30 struct lxc_list;
31
32 typedef int (*config_cb)(const char *, const char *, struct lxc_conf *);
33 struct lxc_config_t {
34 char *name;
35 config_cb cb;
36 };
37
38 extern struct lxc_config_t *lxc_getconfig(const char *key);
39 extern int lxc_list_nicconfigs(struct lxc_conf *c, const char *key, char *retv, int inlen);
40 extern int lxc_listconfigs(char *retv, int inlen);
41 extern int lxc_config_read(const char *file, struct lxc_conf *conf);
42 extern int lxc_config_readline(char *buffer, struct lxc_conf *conf);
43
44 extern int lxc_config_define_add(struct lxc_list *defines, char* arg);
45 extern int lxc_config_define_load(struct lxc_list *defines,
46 struct lxc_conf *conf);
47
48 /* needed for lxc-attach */
49 extern signed long lxc_config_parse_arch(const char *arch);
50
51 extern int lxc_get_config_item(struct lxc_conf *c, const char *key, char *retv, int inlen);
52 extern int lxc_clear_config_item(struct lxc_conf *c, const char *key);
53 extern void write_config(FILE *fout, struct lxc_conf *c);
54 #endif