debuggers.hg

view tools/libxl/libxlutil.h @ 21067:b4a1832a916f

Update Xen version to 4.0.0-rc6
author Keir Fraser <keir.fraser@citrix.com>
date Tue Mar 09 18:18:05 2010 +0000 (2010-03-09)
parents 71af69a9d393
children 3ffdb094c2c0
line source
1 /*
2 * Copyright (C) 2010 Citrix Ltd.
3 * Author Ian Jackson <ian.jackson@eu.citrix.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published
7 * by the Free Software Foundation; version 2.1 only. with the special
8 * exception on linking described in file LICENSE.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 */
16 #ifndef LIBXLUTIL_H
17 #define LIBXLUTIL_H
19 #include <stdio.h>
21 #include "libxl.h"
23 /* Unless otherwise stated, all functions return an errno value. */
24 typedef struct XLU_Config XLU_Config;
25 typedef struct XLU_ConfigList XLU_ConfigList;
27 XLU_Config *xlu_cfg_init(FILE *report, const char *report_filename);
28 /* 0 means we got ENOMEM. */
29 /* report_filename is copied; report is saved and must remain valid
30 * until the Config is destroyed. */
32 int xlu_cfg_readfile(XLU_Config*, const char *real_filename);
33 /* If this fails, then it is undefined behaviour to call xlu_cfg_get_...
34 * functions. You have to just xlu_cfg_destroy. */
36 void xlu_cfg_destroy(XLU_Config*);
39 /* All of the following print warnings to "report" if there is a problem.
40 * Return values are:
41 * 0 OK
42 * ESRCH not defined
43 * EINVAL value found but wrong format for request (prints warning)
44 * ERANGE value out of range (from strtol)
45 */
47 int xlu_cfg_get_string(const XLU_Config*, const char *n, const char **value_r);
48 int xlu_cfg_get_long(const XLU_Config*, const char *n, long *value_r);
50 int xlu_cfg_get_list(const XLU_Config*, const char *n,
51 XLU_ConfigList **list_r /* may be 0 */,
52 int *entries_r /* may be 0 */);
53 /* there is no need to free *list_r; lifetime is that of the XLU_Config */
54 const char *xlu_cfg_get_listitem(const XLU_ConfigList*, int entry);
55 /* xlu_cfg_get_listitem cannot fail, except that if entry is
56 * out of range it returns 0 (not setting errno) */
58 #endif /* LIBXLUTIL_H */