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 struct XLU_ConfigList {
29     int avalues; /* available slots */
30     int nvalues; /* actual occupied slots */
31     XLU_ConfigValue **values;
32 };
33 
34 typedef struct YYLTYPE
35 {
36   int first_line;
37   int first_column;
38   int last_line;
39   int last_column;
40 } YYLTYPE;
41 #define YYLTYPE_IS_DECLARED
42 
43 struct XLU_ConfigValue {
44     enum XLU_ConfigValueType type;
45     union {
46         char *string;
47         XLU_ConfigList list;
48     } u;
49     YYLTYPE loc;
50 };
51 
52 typedef struct XLU_ConfigSetting { /* transparent */
53     struct XLU_ConfigSetting *next;
54     char *name;
55     XLU_ConfigValue *value;
56     int lineno;
57 } XLU_ConfigSetting;
58 
59 struct XLU_Config {
60     XLU_ConfigSetting *settings;
61     FILE *report;
62     char *config_source;
63 };
64 
65 typedef struct {
66     XLU_Config *cfg;
67     int err, lexerrlineno, likely_python;
68     void *scanner;
69 } CfgParseContext;
70 
71 
72 #define STRINGIFY(x) #x
73 #define TOSTRING(x) STRINGIFY(x)
74 
75 #endif /*LIBXLU_INTERNAL_H*/
76 
77 /*
78  * Local variables:
79  * mode: C
80  * c-basic-offset: 4
81  * indent-tabs-mode: nil
82  * End:
83  */
84