vcpkg/ports/libconfig/fix-scanner-source-msvc-patch.patch

1123 lines
37 KiB
Diff
Raw Normal View History

2017-06-29 05:06:52 +08:00
diff --git a/lib/scanner.c b/lib/scanner.c
index dc07eb0..efb6730 100644
--- a/lib/scanner.c
+++ b/lib/scanner.c
@@ -9,7 +9,7 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 39
+#define YY_FLEX_SUBMINOR_VERSION 35
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
@@ -159,7 +159,15 @@ typedef void* yyscan_t;
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
#define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
#endif
/* The state buf must be large enough to hold one state per character in the main buffer.
@@ -171,11 +179,6 @@ typedef void* yyscan_t;
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
@@ -194,13 +197,6 @@ typedef size_t yy_size_t;
if ( yytext[yyl] == '\n' )\
--yylineno;\
}while(0)
- #define YY_LINENO_REWIND_TO(dst) \
- do {\
- const char *p;\
- for ( p = yy_cp-1; p >= (dst); --p)\
- if ( *p == '\n' )\
- --yylineno;\
- }while(0)
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
@@ -218,6 +214,11 @@ typedef size_t yy_size_t;
#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
@@ -235,7 +236,7 @@ struct yy_buffer_state
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
- yy_size_t yy_n_chars;
+ int yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
@@ -314,7 +315,7 @@ static void libconfig_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yys
YY_BUFFER_STATE libconfig_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
YY_BUFFER_STATE libconfig_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE libconfig_yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
+YY_BUFFER_STATE libconfig_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
void *libconfig_yyalloc (yy_size_t ,yyscan_t yyscanner );
void *libconfig_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
@@ -344,7 +345,7 @@ void libconfig_yyfree (void * ,yyscan_t yyscanner );
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
-#define libconfig_yywrap(yyscanner) 1
+#define libconfig_yywrap(n) 1
#define YY_SKIP_YYWRAP
typedef unsigned char YY_CHAR;
@@ -368,8 +369,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
*yy_cp = '\0'; \
yyg->yy_c_buf_p = yy_cp;
-#define YY_NUM_RULES 42
-#define YY_END_OF_BUFFER 43
+#define YY_NUM_RULES 47
+#define YY_END_OF_BUFFER 48
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
@@ -377,20 +378,21 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[103] =
+static yyconst flex_int16_t yy_accept[117] =
{ 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 43, 41,
- 22, 21, 21, 5, 41, 37, 38, 29, 41, 24,
- 30, 41, 31, 31, 23, 39, 29, 29, 35, 36,
- 25, 26, 22, 41, 3, 4, 3, 6, 15, 14,
- 17, 20, 42, 22, 0, 40, 29, 30, 31, 30,
- 0, 1, 0, 30, 0, 32, 0, 29, 29, 22,
- 0, 0, 2, 6, 12, 0, 11, 10, 7, 8,
- 9, 17, 19, 18, 0, 30, 30, 0, 0, 30,
- 32, 33, 29, 29, 0, 0, 0, 30, 34, 29,
- 27, 0, 13, 34, 28, 0, 0, 0, 0, 0,
-
- 16, 0
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 48, 46, 27, 26, 26, 5, 46, 42, 43, 34,
+ 46, 29, 35, 46, 36, 36, 28, 44, 34, 34,
+ 40, 41, 30, 31, 27, 46, 3, 4, 3, 6,
+ 15, 14, 17, 20, 47, 22, 25, 47, 27, 0,
+ 45, 34, 35, 36, 35, 0, 1, 0, 35, 0,
+ 37, 0, 34, 34, 27, 0, 0, 2, 6, 12,
+ 0, 11, 10, 7, 8, 9, 17, 19, 18, 22,
+ 24, 23, 0, 35, 35, 0, 0, 35, 37, 38,
+ 34, 34, 0, 0, 0, 35, 39, 34, 32, 0,
+
+ 13, 39, 33, 0, 0, 0, 0, 0, 0, 16,
+ 0, 0, 0, 0, 21, 0
} ;
static yyconst flex_int32_t yy_ec[256] =
@@ -434,110 +436,116 @@ static yyconst flex_int32_t yy_meta[49] =
3, 3, 3, 3, 3, 3, 1, 1
} ;
-static yyconst flex_int16_t yy_base[113] =
+static yyconst flex_int16_t yy_base[129] =
{ 0,
- 0, 47, 47, 48, 46, 47, 48, 49, 203, 204,
- 200, 204, 204, 204, 198, 204, 204, 0, 45, 204,
- 47, 50, 60, 74, 204, 204, 178, 28, 204, 204,
- 204, 204, 64, 158, 204, 204, 183, 0, 204, 63,
- 0, 204, 83, 195, 193, 204, 0, 88, 102, 98,
- 62, 204, 190, 104, 119, 162, 0, 67, 65, 121,
- 127, 124, 204, 0, 204, 0, 204, 204, 204, 204,
- 204, 0, 204, 204, 108, 117, 122, 134, 132, 136,
- 204, 139, 136, 116, 126, 0, 140, 142, 135, 130,
- 0, 102, 204, 204, 0, 85, 72, 63, 98, 158,
-
- 204, 204, 169, 173, 177, 181, 183, 187, 191, 89,
- 66, 63
+ 0, 47, 47, 48, 46, 47, 48, 49, 50, 53,
+ 223, 224, 220, 224, 224, 224, 218, 224, 224, 0,
+ 46, 224, 49, 54, 62, 76, 224, 224, 198, 33,
+ 224, 224, 224, 224, 70, 178, 224, 224, 203, 0,
+ 224, 64, 0, 224, 61, 0, 224, 65, 215, 213,
+ 224, 0, 89, 100, 94, 109, 224, 212, 113, 125,
+ 187, 0, 70, 88, 100, 172, 169, 224, 0, 224,
+ 0, 224, 224, 224, 224, 224, 0, 224, 224, 0,
+ 224, 224, 58, 115, 127, 137, 129, 139, 224, 184,
+ 181, 123, 172, 0, 141, 143, 181, 125, 0, 165,
+
+ 224, 224, 0, 160, 167, 165, 133, 159, 163, 224,
+ 156, 149, 166, 161, 224, 224, 169, 173, 177, 181,
+ 185, 187, 191, 195, 199, 136, 119, 81
} ;
-static yyconst flex_int16_t yy_def[113] =
+static yyconst flex_int16_t yy_def[129] =
{ 0,
- 102, 1, 103, 103, 104, 104, 105, 105, 102, 102,
- 102, 102, 102, 102, 106, 102, 102, 107, 102, 102,
- 102, 102, 102, 102, 102, 102, 107, 107, 102, 102,
- 102, 102, 102, 102, 102, 102, 102, 108, 102, 102,
- 109, 102, 102, 102, 106, 102, 107, 102, 102, 102,
- 102, 102, 106, 102, 102, 102, 110, 107, 107, 102,
- 102, 102, 102, 108, 102, 111, 102, 102, 102, 102,
- 102, 109, 102, 102, 102, 102, 102, 102, 102, 102,
- 102, 110, 107, 107, 102, 112, 102, 102, 102, 107,
- 107, 102, 102, 102, 107, 102, 102, 102, 102, 102,
-
- 102, 0, 102, 102, 102, 102, 102, 102, 102, 102,
- 102, 102
+ 116, 1, 117, 117, 118, 118, 119, 119, 120, 120,
+ 116, 116, 116, 116, 116, 116, 121, 116, 116, 122,
+ 116, 116, 116, 116, 116, 116, 116, 116, 122, 122,
+ 116, 116, 116, 116, 116, 116, 116, 116, 116, 123,
+ 116, 116, 124, 116, 116, 125, 116, 116, 116, 121,
+ 116, 122, 116, 116, 116, 116, 116, 121, 116, 116,
+ 116, 126, 122, 122, 116, 116, 116, 116, 123, 116,
+ 127, 116, 116, 116, 116, 116, 124, 116, 116, 125,
+ 116, 116, 116, 116, 116, 116, 116, 116, 116, 126,
+ 122, 122, 116, 128, 116, 116, 116, 122, 122, 116,
+
+ 116, 116, 122, 116, 116, 116, 116, 116, 116, 116,
+ 116, 116, 116, 116, 116, 0, 116, 116, 116, 116,
+ 116, 116, 116, 116, 116, 116, 116, 116
} ;
-static yyconst flex_int16_t yy_nxt[253] =
+static yyconst flex_int16_t yy_nxt[273] =
{ 0,
- 10, 11, 12, 13, 13, 14, 15, 16, 17, 18,
- 19, 20, 19, 21, 22, 23, 24, 25, 26, 25,
- 10, 18, 18, 18, 27, 18, 18, 18, 18, 28,
- 18, 18, 29, 10, 30, 10, 18, 18, 18, 27,
- 18, 18, 18, 18, 28, 18, 31, 32, 33, 36,
- 36, 39, 39, 42, 42, 59, 37, 37, 48, 52,
- 49, 49, 50, 50, 53, 60, 93, 34, 65, 86,
- 51, 59, 75, 54, 75, 49, 49, 76, 76, 40,
- 40, 43, 43, 55, 61, 51, 56, 54, 73, 49,
- 49, 57, 82, 83, 66, 84, 67, 55, 55, 100,
-
- 56, 99, 68, 50, 50, 69, 70, 71, 83, 98,
- 84, 51, 55, 50, 50, 54, 74, 49, 49, 77,
- 77, 51, 60, 76, 76, 55, 51, 78, 56, 79,
- 97, 79, 76, 76, 80, 80, 51, 77, 77, 91,
- 55, 61, 78, 96, 87, 78, 87, 80, 80, 88,
- 88, 80, 80, 95, 91, 88, 88, 88, 88, 100,
- 78, 94, 92, 101, 90, 89, 85, 62, 95, 35,
- 35, 35, 35, 38, 38, 38, 38, 41, 41, 41,
- 41, 45, 45, 45, 45, 47, 47, 64, 81, 64,
- 64, 72, 46, 72, 72, 46, 44, 63, 62, 58,
-
- 46, 44, 102, 9, 102, 102, 102, 102, 102, 102,
- 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
- 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
- 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
- 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
- 102, 102
+ 12, 13, 14, 15, 15, 16, 17, 18, 19, 20,
+ 21, 22, 21, 23, 24, 25, 26, 27, 28, 27,
+ 12, 20, 20, 20, 29, 20, 20, 20, 20, 30,
+ 20, 20, 31, 12, 32, 12, 20, 20, 20, 29,
+ 20, 20, 20, 20, 30, 20, 33, 34, 35, 38,
+ 38, 41, 41, 44, 44, 47, 39, 39, 47, 53,
+ 64, 54, 54, 57, 55, 55, 78, 36, 58, 70,
+ 81, 65, 56, 84, 84, 59, 64, 54, 54, 42,
+ 42, 45, 45, 48, 101, 60, 48, 56, 61, 59,
+ 66, 54, 54, 62, 79, 71, 91, 72, 82, 60,
+
+ 60, 65, 61, 73, 55, 55, 74, 75, 76, 55,
+ 55, 91, 56, 59, 60, 54, 54, 56, 92, 83,
+ 66, 83, 94, 60, 84, 84, 61, 56, 85, 85,
+ 84, 84, 56, 92, 108, 87, 86, 87, 60, 90,
+ 88, 88, 85, 85, 88, 88, 99, 95, 103, 95,
+ 86, 86, 96, 96, 88, 88, 96, 96, 96, 96,
+ 108, 99, 114, 103, 110, 86, 115, 114, 109, 37,
+ 37, 37, 37, 40, 40, 40, 40, 43, 43, 43,
+ 43, 46, 46, 46, 46, 50, 50, 50, 50, 52,
+ 52, 69, 113, 69, 69, 77, 112, 77, 77, 80,
+
+ 111, 80, 80, 107, 106, 105, 104, 102, 100, 98,
+ 97, 93, 67, 89, 51, 51, 49, 68, 67, 63,
+ 51, 49, 116, 11, 116, 116, 116, 116, 116, 116,
+ 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
+ 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
+ 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
+ 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
+ 116, 116
} ;
-static yyconst flex_int16_t yy_chk[253] =
+static yyconst flex_int16_t yy_chk[273] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
- 4, 5, 6, 7, 8, 28, 3, 4, 19, 22,
- 19, 19, 21, 21, 22, 33, 112, 2, 40, 111,
- 21, 28, 51, 23, 51, 23, 23, 51, 51, 5,
- 6, 7, 8, 23, 33, 21, 23, 24, 43, 24,
- 24, 23, 110, 58, 40, 59, 40, 24, 23, 99,
-
- 24, 98, 40, 48, 48, 40, 40, 40, 58, 97,
- 59, 48, 24, 50, 50, 49, 43, 49, 49, 54,
- 54, 50, 60, 75, 75, 49, 48, 54, 49, 55,
- 96, 55, 76, 76, 55, 55, 50, 77, 77, 84,
- 49, 60, 54, 92, 78, 77, 78, 79, 79, 78,
- 78, 80, 80, 90, 84, 87, 87, 88, 88, 100,
- 77, 89, 85, 100, 83, 82, 62, 61, 90, 103,
- 103, 103, 103, 104, 104, 104, 104, 105, 105, 105,
- 105, 106, 106, 106, 106, 107, 107, 108, 56, 108,
- 108, 109, 53, 109, 109, 45, 44, 37, 34, 27,
-
- 15, 11, 9, 102, 102, 102, 102, 102, 102, 102,
- 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
- 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
- 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
- 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
- 102, 102
+ 4, 5, 6, 7, 8, 9, 3, 4, 10, 21,
+ 30, 21, 21, 24, 23, 23, 45, 2, 24, 42,
+ 48, 35, 23, 83, 83, 25, 30, 25, 25, 5,
+ 6, 7, 8, 9, 128, 25, 10, 23, 25, 26,
+ 35, 26, 26, 25, 45, 42, 63, 42, 48, 26,
+
+ 25, 65, 26, 42, 53, 53, 42, 42, 42, 55,
+ 55, 63, 53, 54, 26, 54, 54, 55, 64, 56,
+ 65, 56, 127, 54, 56, 56, 54, 53, 59, 59,
+ 84, 84, 55, 64, 107, 60, 59, 60, 54, 126,
+ 60, 60, 85, 85, 87, 87, 92, 86, 98, 86,
+ 85, 59, 86, 86, 88, 88, 95, 95, 96, 96,
+ 108, 92, 114, 98, 108, 85, 114, 113, 107, 117,
+ 117, 117, 117, 118, 118, 118, 118, 119, 119, 119,
+ 119, 120, 120, 120, 120, 121, 121, 121, 121, 122,
+ 122, 123, 112, 123, 123, 124, 111, 124, 124, 125,
+
+ 109, 125, 125, 106, 105, 104, 100, 97, 93, 91,
+ 90, 67, 66, 61, 58, 50, 49, 39, 36, 29,
+ 17, 13, 11, 116, 116, 116, 116, 116, 116, 116,
+ 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
+ 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
+ 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
+ 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
+ 116, 116
} ;
/* Table of booleans, true if rule could match eol. */
-static yyconst flex_int32_t yy_rule_can_match_eol[43] =
+static yyconst flex_int32_t yy_rule_can_match_eol[48] =
{ 0,
0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, };
+ 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, };
/* The intent behind this definition is that it'll catch
* any uses of REJECT which flex missed.
@@ -550,7 +558,7 @@ static yyconst flex_int32_t yy_rule_can_match_eol[43] =
/* -*- mode: C -*- */
/* --------------------------------------------------------------------------
libconfig - A library for processing structured configuration files
- Copyright (C) 2005-2014 Mark A Lindner
+ Copyright (C) 2005-2015 Mark A Lindner
This file is part of libconfig.
@@ -577,9 +585,11 @@ static yyconst flex_int32_t yy_rule_can_match_eol[43] =
#endif
#include <stdlib.h>
+#include <errno.h>
#include <ctype.h>
#include <string.h>
#include <limits.h>
+#include <dirent.h>
#include "parsectx.h"
#include "scanctx.h"
#include "grammar.h"
@@ -621,13 +631,30 @@ static unsigned long long fromhex(const char *s)
#endif /* __MINGW32__ */
}
+static int filter_dotfiles(const struct dirent *de)
+{
+ const char *fname = de->d_name;
+
+#ifdef _DIRENT_HAVE_D_TYPE
+ /* filter out non-files and non-symlinks */
+ if((de->d_type != DT_REG) && (de->d_type != DT_LNK) && (de->d_type != DT_UNKNOWN))
+ return 0;
+#endif
+
+ return (fname /* != NULL */
+ && ('\0' != fname[0]) /* can't really happen */
+ && ('.' != fname[0])
+ ) ? 1 : 0 ;
+}
-#line 626 "scanner.c"
+
+#line 652 "scanner.c"
#define INITIAL 0
#define COMMENT 1
#define STRING 2
-#define INCLUDE 3
+#define INCLUDE_F 3
+#define INCLUDE_D 4
#ifndef YY_NO_UNISTD_H
/* Special case for "unistd.h", since it is non-ANSI. We include it way
@@ -652,8 +679,8 @@ struct yyguts_t
size_t yy_buffer_stack_max; /**< capacity of stack. */
YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
char yy_hold_char;
- yy_size_t yy_n_chars;
- yy_size_t yyleng_r;
+ int yy_n_chars;
+ int yyleng_r;
char *yy_c_buf_p;
int yy_init;
int yy_start;
@@ -706,7 +733,7 @@ FILE *libconfig_yyget_out (yyscan_t yyscanner );
void libconfig_yyset_out (FILE * out_str ,yyscan_t yyscanner );
-yy_size_t libconfig_yyget_leng (yyscan_t yyscanner );
+int libconfig_yyget_leng (yyscan_t yyscanner );
char *libconfig_yyget_text (yyscan_t yyscanner );
@@ -714,10 +741,6 @@ int libconfig_yyget_lineno (yyscan_t yyscanner );
void libconfig_yyset_lineno (int line_number ,yyscan_t yyscanner );
-int libconfig_yyget_column (yyscan_t yyscanner );
-
-void libconfig_yyset_column (int column_no ,yyscan_t yyscanner );
-
YYSTYPE * libconfig_yyget_lval (yyscan_t yyscanner );
void libconfig_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
@@ -754,7 +777,12 @@ static int input (yyscan_t yyscanner );
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
#define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
#endif
/* Copy whatever the last rule matched to the standard output. */
@@ -861,6 +889,11 @@ YY_DECL
register int yy_act;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+#line 121 "scanner.l"
+
+
+#line 896 "scanner.c"
+
yylval = yylval_param;
if ( !yyg->yy_init )
@@ -889,12 +922,6 @@ YY_DECL
libconfig_yy_load_buffer_state(yyscanner );
}
- {
-#line 102 "scanner.l"
-
-
-#line 897 "scanner.c"
-
while ( 1 ) /* loops until end-of-file is reached */
{
yy_cp = yyg->yy_c_buf_p;
@@ -912,7 +939,7 @@ YY_DECL
yy_match:
do
{
- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
if ( yy_accept[yy_current_state] )
{
yyg->yy_last_accepting_state = yy_current_state;
@@ -921,13 +948,13 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 103 )
+ if ( yy_current_state >= 117 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
- while ( yy_current_state != 102 );
+ while ( yy_current_state != 116 );
yy_cp = yyg->yy_last_accepting_cpos;
yy_current_state = yyg->yy_last_accepting_state;
@@ -938,7 +965,7 @@ yy_find_action:
if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
{
- yy_size_t yyl;
+ int yyl;
for ( yyl = 0; yyl < yyleng; ++yyl )
if ( yytext[yyl] == '\n' )
@@ -961,69 +988,69 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
YY_RULE_SETUP
-#line 104 "scanner.l"
+#line 123 "scanner.l"
{ BEGIN COMMENT; }
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 105 "scanner.l"
+#line 124 "scanner.l"
{ BEGIN INITIAL; }
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 106 "scanner.l"
+#line 125 "scanner.l"
{ /* ignore */ }
YY_BREAK
case 4:
/* rule 4 can match eol */
YY_RULE_SETUP
-#line 107 "scanner.l"
+#line 126 "scanner.l"
{ /* ignore */ }
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 109 "scanner.l"
+#line 128 "scanner.l"
{ BEGIN STRING; }
YY_BREAK
case 6:
/* rule 6 can match eol */
YY_RULE_SETUP
-#line 110 "scanner.l"
+#line 129 "scanner.l"
{ scanctx_append_string(yyextra, yytext); }
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 111 "scanner.l"
+#line 130 "scanner.l"
{ scanctx_append_string(yyextra, "\n"); }
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 112 "scanner.l"
+#line 131 "scanner.l"
{ scanctx_append_string(yyextra, "\r"); }
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 113 "scanner.l"
+#line 132 "scanner.l"
{ scanctx_append_string(yyextra, "\t"); }
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 114 "scanner.l"
+#line 133 "scanner.l"
{ scanctx_append_string(yyextra, "\f"); }
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 115 "scanner.l"
+#line 134 "scanner.l"
{ scanctx_append_string(yyextra, "\\"); }
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 116 "scanner.l"
+#line 135 "scanner.l"
{ scanctx_append_string(yyextra, "\""); }
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 117 "scanner.l"
+#line 136 "scanner.l"
{
char c[2] = { (char)(strtol(yytext + 2, NULL, 16) & 0xFF),
0 };
@@ -1032,12 +1059,12 @@ YY_RULE_SETUP
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 122 "scanner.l"
+#line 141 "scanner.l"
{ scanctx_append_string(yyextra, "\\"); }
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 123 "scanner.l"
+#line 142 "scanner.l"
{
yylval->sval = scanctx_take_string(yyextra);
BEGIN INITIAL;
@@ -1046,198 +1073,304 @@ YY_RULE_SETUP
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 129 "scanner.l"
-{ BEGIN INCLUDE; }
+#line 148 "scanner.l"
+{ BEGIN INCLUDE_F; }
YY_BREAK
case 17:
/* rule 17 can match eol */
YY_RULE_SETUP
-#line 130 "scanner.l"
+#line 149 "scanner.l"
{ scanctx_append_string(yyextra, yytext); }
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 131 "scanner.l"
+#line 150 "scanner.l"
{ scanctx_append_string(yyextra, "\\"); }
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 132 "scanner.l"
+#line 151 "scanner.l"
{ scanctx_append_string(yyextra, "\""); }
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 133 "scanner.l"
+#line 152 "scanner.l"
{
- const char *error;
- FILE *fp = scanctx_push_include(yyextra,
- (void *)YY_CURRENT_BUFFER,
- &error);
- if(fp)
- {
- yyin = fp;
- libconfig_yy_switch_to_buffer(libconfig_yy_create_buffer(yyin,YY_BUF_SIZE,yyscanner),yyscanner);
- }
- else
- {
- yyextra->config->error_text = error;
- yyextra->config->error_file = scanctx_current_filename(
- yyextra);
- yyextra->config->error_line = libconfig_yyget_lineno(
- yyscanner);
- return TOK_ERROR;
- }
- BEGIN INITIAL;
- }
+ const char *error;
+ FILE *fp = scanctx_push_include(yyextra,
+ (void *)YY_CURRENT_BUFFER,
+ scanctx_getpath(yyextra),
+ &error);
+ if(fp)
+ {
+ yyin = fp;
+ libconfig_yy_switch_to_buffer(libconfig_yy_create_buffer(yyin,YY_BUF_SIZE,yyscanner),yyscanner
+ );
+ }
+ else
+ {
+ yyextra->config->error_text = error;
+ yyextra->config->error_file = scanctx_current_filename(
+ yyextra);
+ yyextra->config->error_line = libconfig_yyget_lineno(yyscanner);
+ return TOK_ERROR;
+ }
+ BEGIN INITIAL;
+ }
YY_BREAK
case 21:
-/* rule 21 can match eol */
YY_RULE_SETUP
-#line 157 "scanner.l"
-{ /* ignore */ }
+#line 177 "scanner.l"
+{ BEGIN INCLUDE_D; }
YY_BREAK
case 22:
+/* rule 22 can match eol */
YY_RULE_SETUP
-#line 158 "scanner.l"
-{ /* ignore */ }
+#line 178 "scanner.l"
+{ scanctx_append_string(yyextra, yytext); }
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 160 "scanner.l"
-{ return(TOK_EQUALS); }
+#line 179 "scanner.l"
+{ scanctx_append_string(yyextra, "\\"); }
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 161 "scanner.l"
-{ return(TOK_COMMA); }
+#line 180 "scanner.l"
+{ scanctx_append_string(yyextra, "\""); }
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 162 "scanner.l"
-{ return(TOK_GROUP_START); }
+#line 181 "scanner.l"
+{
+ const char *error;
+ const char* basedir;
+ FILE *fp = NULL;
+
+ basedir = scanctx_getpath(yyextra);
+ if(scanctx_dirscan(yyextra, basedir, filter_dotfiles, NULL) < 0)
+ {
+ if(basedir)
+ free((void*)basedir);
+ return TOK_ERROR;
+ }
+
+ if(scanctx_inloop(yyextra))
+ {
+ fp = scanctx_push_include(yyextra,
+ (void *)YY_CURRENT_BUFFER,
+ scanctx_filename(yyextra, NULL, scanctx_dirnext(yyextra)),
+ &error
+ );
+
+ if(fp)
+ {
+ yyin = fp;
+ libconfig_yy_switch_to_buffer(libconfig_yy_create_buffer(yyin,YY_BUF_SIZE,yyscanner),yyscanner
+ );
+ }
+ else
+ {
+ yyextra->config->error_text = error;
+ yyextra->config->error_file = scanctx_current_filename(yyextra);
+ yyextra->config->error_line = libconfig_yyget_lineno(yyscanner);
+ }
+ }
+ else
+ scanctx_dirend(yyextra); /* avoid leaks */
+
+ BEGIN INITIAL;
+ }
YY_BREAK
case 26:
+/* rule 26 can match eol */
YY_RULE_SETUP
-#line 163 "scanner.l"
-{ return(TOK_GROUP_END); }
+#line 223 "scanner.l"
+{ /* ignore */ }
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 164 "scanner.l"
-{ yylval->ival = 1; return(TOK_BOOLEAN); }
+#line 224 "scanner.l"
+{ /* ignore */ }
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 165 "scanner.l"
-{ yylval->ival = 0; return(TOK_BOOLEAN); }
+#line 226 "scanner.l"
+{ return(TOK_EQUALS); }
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 166 "scanner.l"
-{ yylval->sval = yytext; return(TOK_NAME); }
+#line 227 "scanner.l"
+{ return(TOK_COMMA); }
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 167 "scanner.l"
-{ yylval->fval = atof(yytext); return(TOK_FLOAT); }
+#line 228 "scanner.l"
+{ return(TOK_GROUP_START); }
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 168 "scanner.l"
+#line 229 "scanner.l"
+{ return(TOK_GROUP_END); }
+ YY_BREAK
+case 32:
+YY_RULE_SETUP
+#line 230 "scanner.l"
+{ yylval->ival = 1; return(TOK_BOOLEAN); }
+ YY_BREAK
+case 33:
+YY_RULE_SETUP
+#line 231 "scanner.l"
+{ yylval->ival = 0; return(TOK_BOOLEAN); }
+ YY_BREAK
+case 34:
+YY_RULE_SETUP
+#line 232 "scanner.l"
+{ yylval->sval = yytext; return(TOK_NAME); }
+ YY_BREAK
+case 35:
+YY_RULE_SETUP
+#line 233 "scanner.l"
+{ yylval->fval = atof(yytext); return(TOK_FLOAT); }
+ YY_BREAK
+case 36:
+YY_RULE_SETUP
+#line 234 "scanner.l"
{
long long llval;
- llval = atoll(yytext);
+ char *endptr;
+ int errsave = errno;
+ errno = 0;
+ llval = strtoll(yytext, &endptr, 0); /* base 10 or base 8 */
+ if(*endptr || errno)
+ {
+ errno = 0;
+ return(TOK_ERROR); /* some error occured ... */
+ }
+ errno = errsave;
+ if((*yytext == '0') && (*(yytext+1) != '\0'))
+ { /* it's octal... so INT we go */
+ yylval->ival = (int)(llval);
+ return(TOK_INTEGER);
+ }
+
if((llval < INT_MIN) || (llval > INT_MAX))
{
- yylval->llval = llval;
- return(TOK_INTEGER64);
+ yylval->llval = llval;
+ return(TOK_INTEGER64);
}
else
{
- yylval->ival = llval;
- return(TOK_INTEGER);
+ yylval->ival = llval;
+ return(TOK_INTEGER);
}
}
YY_BREAK
-case 32:
+case 37:
YY_RULE_SETUP
-#line 182 "scanner.l"
+#line 263 "scanner.l"
{ yylval->llval = atoll(yytext); return(TOK_INTEGER64); }
YY_BREAK
-case 33:
+case 38:
YY_RULE_SETUP
-#line 183 "scanner.l"
+#line 264 "scanner.l"
{
yylval->ival = strtoul(yytext, NULL, 16);
return(TOK_HEX);
}
YY_BREAK
-case 34:
+case 39:
YY_RULE_SETUP
-#line 187 "scanner.l"
+#line 268 "scanner.l"
{ yylval->llval = fromhex(yytext); return(TOK_HEX64); }
YY_BREAK
-case 35:
+case 40:
YY_RULE_SETUP
-#line 188 "scanner.l"
+#line 269 "scanner.l"
{ return(TOK_ARRAY_START); }
YY_BREAK
-case 36:
+case 41:
YY_RULE_SETUP
-#line 189 "scanner.l"
+#line 270 "scanner.l"
{ return(TOK_ARRAY_END); }
YY_BREAK
-case 37:
+case 42:
YY_RULE_SETUP
-#line 190 "scanner.l"
+#line 271 "scanner.l"
{ return(TOK_LIST_START); }
YY_BREAK
-case 38:
+case 43:
YY_RULE_SETUP
-#line 191 "scanner.l"
+#line 272 "scanner.l"
{ return(TOK_LIST_END); }
YY_BREAK
-case 39:
+case 44:
YY_RULE_SETUP
-#line 192 "scanner.l"
+#line 273 "scanner.l"
{ return(TOK_SEMICOLON); }
YY_BREAK
-case 40:
+case 45:
*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
yyg->yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 193 "scanner.l"
+#line 274 "scanner.l"
{ /* ignore */ }
YY_BREAK
-case 41:
+case 46:
YY_RULE_SETUP
-#line 194 "scanner.l"
+#line 275 "scanner.l"
{ return(TOK_GARBAGE); }
YY_BREAK
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(COMMENT):
case YY_STATE_EOF(STRING):
-case YY_STATE_EOF(INCLUDE):
-#line 196 "scanner.l"
+case YY_STATE_EOF(INCLUDE_F):
+case YY_STATE_EOF(INCLUDE_D):
+#line 277 "scanner.l"
{
- YY_BUFFER_STATE buf = (YY_BUFFER_STATE)scanctx_pop_include(
- yyextra);
- if(buf)
- {
- libconfig_yy_delete_buffer(YY_CURRENT_BUFFER,yyscanner);
- libconfig_yy_switch_to_buffer(buf,yyscanner);
- }
- else
- yyterminate();
- }
+ const char* error;
+ FILE *fp;
+ YY_BUFFER_STATE buf = (YY_BUFFER_STATE)scanctx_pop_include(yyextra);
+ if(buf)
+ {
+ libconfig_yy_delete_buffer(YY_CURRENT_BUFFER,yyscanner);
+ libconfig_yy_switch_to_buffer(buf,yyscanner);
+ }
+ else /* if no more buffers, we are done */
+ yyterminate();
+
+ if(scanctx_inloop(yyextra))
+ {
+ /* gotta keep looping.... */
+ fp = scanctx_push_include(yyextra,
+ (void *)YY_CURRENT_BUFFER,
+ scanctx_filename(yyextra, NULL, scanctx_dirnext(yyextra)),
+ &error
+ );
+ if(fp)
+ {
+ yyin = fp;
+ libconfig_yy_switch_to_buffer(libconfig_yy_create_buffer(yyin,YY_BUF_SIZE,yyscanner),yyscanner
+ );
+ }
+ else
+ {
+ yyextra->config->error_text = error;
+ yyextra->config->error_file = scanctx_current_filename(yyextra);
+ yyextra->config->error_line = libconfig_yyget_lineno(yyscanner);
+ }
+ }
+ else /* not on loop, or just finished */
+ scanctx_dirend(yyextra);
+ }
YY_BREAK
-case 42:
+case 47:
YY_RULE_SETUP
-#line 207 "scanner.l"
+#line 315 "scanner.l"
ECHO;
YY_BREAK
-#line 1241 "scanner.c"
+#line 1374 "scanner.c"
case YY_END_OF_BUFFER:
{
@@ -1367,7 +1500,6 @@ ECHO;
"fatal flex scanner internal error--no action found" );
} /* end of action switch */
} /* end of scanning one token */
- } /* end of user's declarations */
} /* end of libconfig_yylex */
/* yy_get_next_buffer - try to read in a new buffer
@@ -1424,21 +1556,21 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
{
- yy_size_t num_to_read =
+ int num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */
/* just a shorter name for the current buffer */
- YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
int yy_c_buf_p_offset =
(int) (yyg->yy_c_buf_p - b->yy_ch_buf);
if ( b->yy_is_our_buffer )
{
- yy_size_t new_size = b->yy_buf_size * 2;
+ int new_size = b->yy_buf_size * 2;
if ( new_size <= 0 )
b->yy_buf_size += b->yy_buf_size / 8;
@@ -1469,7 +1601,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
/* Read in more data. */
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
- yyg->yy_n_chars, num_to_read );
+ yyg->yy_n_chars, (size_t) num_to_read );
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
}
@@ -1532,7 +1664,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 103 )
+ if ( yy_current_state >= 117 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -1561,13 +1693,12 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 103 )
+ if ( yy_current_state >= 117 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 102);
+ yy_is_jam = (yy_current_state == 116);
- (void)yyg;
return yy_is_jam ? 0 : yy_current_state;
}
@@ -1596,7 +1727,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
{ /* need more input */
- yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+ int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
++yyg->yy_c_buf_p;
switch ( yy_get_next_buffer( yyscanner ) )
@@ -1884,7 +2015,7 @@ void libconfig_yypop_buffer_state (yyscan_t yyscanner)
*/
static void libconfig_yyensure_buffer_stack (yyscan_t yyscanner)
{
- yy_size_t num_to_alloc;
+ int num_to_alloc;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (!yyg->yy_buffer_stack) {
@@ -1982,12 +2113,12 @@ YY_BUFFER_STATE libconfig_yy_scan_string (yyconst char * yystr , yyscan_t yyscan
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE libconfig_yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner)
+YY_BUFFER_STATE libconfig_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
- yy_size_t i;
+ int i;
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
@@ -2097,7 +2228,7 @@ FILE *libconfig_yyget_out (yyscan_t yyscanner)
/** Get the length of the current token.
* @param yyscanner The scanner object.
*/
-yy_size_t libconfig_yyget_leng (yyscan_t yyscanner)
+int libconfig_yyget_leng (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyleng;
@@ -2133,7 +2264,7 @@ void libconfig_yyset_lineno (int line_number , yyscan_t yyscanner)
/* lineno is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
- YY_FATAL_ERROR( "libconfig_yyset_lineno called with no buffer" );
+ yy_fatal_error( "libconfig_yyset_lineno called with no buffer" , yyscanner);
yylineno = line_number;
}
@@ -2148,7 +2279,7 @@ void libconfig_yyset_column (int column_no , yyscan_t yyscanner)
/* column is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
- YY_FATAL_ERROR( "libconfig_yyset_column called with no buffer" );
+ yy_fatal_error( "libconfig_yyset_column called with no buffer" , yyscanner);
yycolumn = column_no;
}
@@ -2372,4 +2503,4 @@ void libconfig_yyfree (void * ptr , yyscan_t yyscanner)
#define YYTABLES_NAME "yytables"
-#line 207 "scanner.l"
+#line 315 "scanner.l"