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 enum XLU_Operation op; 57 int lineno; 58 } XLU_ConfigSetting; 59 60 struct XLU_Config { 61 XLU_ConfigSetting *settings; 62 FILE *report; 63 char *config_source; 64 }; 65 66 typedef struct { 67 XLU_Config *cfg; 68 int err, lexerrlineno, likely_python; 69 void *scanner; 70 } CfgParseContext; 71 72 73 #define STRINGIFY(x) #x 74 #define TOSTRING(x) STRINGIFY(x) 75 76 #endif /*LIBXLU_INTERNAL_H*/ 77 78 /* 79 * Local variables: 80 * mode: C 81 * c-basic-offset: 4 82 * indent-tabs-mode: nil 83 * End: 84 */ 85