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  */
15 
16 #ifndef LIBXLU_INTERNAL_H
17 #define LIBXLU_INTERNAL_H
18 
19 #include <stdio.h>
20 #include <stdlib.h>
21 #include <errno.h>
22 #include <string.h>
23 #include <assert.h>
24 #include <regex.h>
25 
26 #include "libxlutil.h"
27 
28 #include <xen-tools/common-macros.h>
29 
30 struct XLU_ConfigList {
31     int avalues; /* available slots */
32     int nvalues; /* actual occupied slots */
33     XLU_ConfigValue **values;
34 };
35 
36 typedef struct YYLTYPE
37 {
38   int first_line;
39   int first_column;
40   int last_line;
41   int last_column;
42 } YYLTYPE;
43 #define YYLTYPE_IS_DECLARED
44 
45 struct XLU_ConfigValue {
46     enum XLU_ConfigValueType type;
47     union {
48         char *string;
49         XLU_ConfigList list;
50     } u;
51     YYLTYPE loc;
52 };
53 
54 typedef struct XLU_ConfigSetting { /* transparent */
55     struct XLU_ConfigSetting *next;
56     char *name;
57     XLU_ConfigValue *value;
58     enum XLU_Operation op;
59     int lineno;
60 } XLU_ConfigSetting;
61 
62 struct XLU_Config {
63     XLU_ConfigSetting *settings;
64     FILE *report;
65     char *config_source;
66 };
67 
68 typedef struct {
69     XLU_Config *cfg;
70     int err, lexerrlineno, likely_python;
71     void *scanner;
72 } CfgParseContext;
73 
74 #endif /*LIBXLU_INTERNAL_H*/
75 
76 /*
77  * Local variables:
78  * mode: C
79  * c-basic-offset: 4
80  * indent-tabs-mode: nil
81  * End:
82  */
83