diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Makefile.am | 10 | ||||
| -rw-r--r-- | lib/Makefile.in | 12 | ||||
| -rw-r--r-- | lib/libconfig.c | 4 | ||||
| -rw-r--r-- | lib/libconfig.h | 2 | ||||
| -rw-r--r-- | lib/libconfig.h++ | 15 | ||||
| -rw-r--r-- | lib/libconfigcpp.c++ | 10 | ||||
| -rw-r--r-- | lib/scanner.c | 125 | ||||
| -rw-r--r-- | lib/scanner.l | 1 | 
8 files changed, 94 insertions, 85 deletions
| diff --git a/lib/Makefile.am b/lib/Makefile.am index 240c519..5c1c4e0 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -14,17 +14,17 @@ endif  #    of the current interface.  # 3. If the interface has changed, increment C and set R to 0. This is the  #    first revision of a new interface. -# 4. If the new interface is a superset of the previous interface -#    (that is, if the previous interface has not been broken by the -#    changes in this new release), increment A. This release is backwards -#    compatible with the previous release. +# 4. If the interface has changed, and the new interface is a superset of the +#    previous interface (that is, if the previous interface has not been +#    broken by the changes in this new release), increment A. This release is +#    backwards compatible with the previous release.  # 5. If the new interface has removed elements with respect to the  #    previous interface, then backward compatibility is broken; set A to 0.  #    This release has a new, but backwards incompatible interface.  #  # For more info see section 6.3 of the GNU Libtool Manual. -VERINFO = -version-info 10:2:1 +VERINFO = -version-info 10:3:1  PARSER_PREFIX = libconfig_yy diff --git a/lib/Makefile.in b/lib/Makefile.in index 059644c..3ff722b 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -182,6 +182,7 @@ LIPO = @LIPO@  LN_S = @LN_S@  LTLIBOBJS = @LTLIBOBJS@  MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@  MKDIR_P = @MKDIR_P@  NM = @NM@  NMEDIT = @NMEDIT@ @@ -209,6 +210,7 @@ abs_builddir = @abs_builddir@  abs_srcdir = @abs_srcdir@  abs_top_builddir = @abs_top_builddir@  abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@  ac_ct_CC = @ac_ct_CC@  ac_ct_CXX = @ac_ct_CXX@  ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -272,16 +274,16 @@ lib_LTLIBRARIES = libconfig.la $(am__append_1)  #    of the current interface.  # 3. If the interface has changed, increment C and set R to 0. This is the  #    first revision of a new interface. -# 4. If the new interface is a superset of the previous interface -#    (that is, if the previous interface has not been broken by the -#    changes in this new release), increment A. This release is backwards -#    compatible with the previous release. +# 4. If the interface has changed, and the new interface is a superset of the +#    previous interface (that is, if the previous interface has not been +#    broken by the changes in this new release), increment A. This release is +#    backwards compatible with the previous release.  # 5. If the new interface has removed elements with respect to the  #    previous interface, then backward compatibility is broken; set A to 0.  #    This release has a new, but backwards incompatible interface.  #  # For more info see section 6.3 of the GNU Libtool Manual. -VERINFO = -version-info 10:2:1 +VERINFO = -version-info 10:3:1  PARSER_PREFIX = libconfig_yy  libconfig_la_LDFLAGS = $(VERINFO) -no-undefined  libconfig___la_LDFLAGS = $(VERINFO) -no-undefined diff --git a/lib/libconfig.c b/lib/libconfig.c index f301c8c..edf7b8b 100644 --- a/lib/libconfig.c +++ b/lib/libconfig.c @@ -534,12 +534,12 @@ static int __config_validate_name(const char *name)    if(*p == '\0')      return(CONFIG_FALSE); -  if(! isalpha(*p) && (*p != '*')) +  if(! isalpha((int)*p) && (*p != '*'))      return(CONFIG_FALSE);    for(++p; *p; ++p)    { -    if(! (isalpha(*p) || isdigit(*p) || strchr("*_-", (int)*p))) +    if(! (isalpha((int)*p) || isdigit((int)*p) || strchr("*_-", (int)*p)))        return(CONFIG_FALSE);    } diff --git a/lib/libconfig.h b/lib/libconfig.h index cc079db..1774a26 100644 --- a/lib/libconfig.h +++ b/lib/libconfig.h @@ -41,7 +41,7 @@ extern "C" {  #define LIBCONFIG_VER_MAJOR    1  #define LIBCONFIG_VER_MINOR    4 -#define LIBCONFIG_VER_REVISION 8 +#define LIBCONFIG_VER_REVISION 9  #include <stdio.h> diff --git a/lib/libconfig.h++ b/lib/libconfig.h++ index dfc7939..04be7a9 100644 --- a/lib/libconfig.h++ +++ b/lib/libconfig.h++ @@ -41,7 +41,7 @@  #define LIBCONFIGXX_VER_MAJOR    1  #define LIBCONFIGXX_VER_MINOR    4 -#define LIBCONFIGXX_VER_REVISION 8 +#define LIBCONFIGXX_VER_REVISION 9  struct config_t; // fwd decl  struct config_setting_t; // fwd decl @@ -86,7 +86,7 @@ class LIBCONFIGXX_API SettingTypeException : public SettingException    public: -  const char *what() const throw(); +  virtual const char *what() const throw();    private: @@ -102,7 +102,7 @@ class LIBCONFIGXX_API SettingNotFoundException : public SettingException    public: -  const char *what() const throw(); +  virtual const char *what() const throw();    private: @@ -118,7 +118,7 @@ class LIBCONFIGXX_API SettingNameException : public SettingException    public: -  const char *what() const throw(); +  virtual const char *what() const throw();    private: @@ -129,7 +129,7 @@ class LIBCONFIGXX_API FileIOException : public ConfigException  {    public: -  const char *what() const throw(); +  virtual const char *what() const throw();  };  class LIBCONFIGXX_API ParseException : public ConfigException @@ -151,7 +151,7 @@ class LIBCONFIGXX_API ParseException : public ConfigException    inline const char *getError() const throw()    { return(_error); } -  const char *what() const throw(); +  virtual const char *what() const throw();    private: @@ -197,8 +197,7 @@ class LIBCONFIGXX_API Setting    Setting(config_setting_t *setting); -  void assertType(Type type) const -    throw(SettingTypeException); +  void assertType(Type type) const throw(SettingTypeException);    static Setting & wrapSetting(config_setting_t *setting);    Setting(const Setting& other); // not supported diff --git a/lib/libconfigcpp.c++ b/lib/libconfigcpp.c++ index 846c067..6d196e7 100644 --- a/lib/libconfigcpp.c++ +++ b/lib/libconfigcpp.c++ @@ -45,7 +45,8 @@ ParseException::ParseException(const char *file, int line, const char *error)  // ---------------------------------------------------------------------------  ParseException::ParseException(const ParseException &other) -  : _file(other._file ? ::strdup(other._file) : NULL), +  : ConfigException(other), +    _file(other._file ? ::strdup(other._file) : NULL),      _line(other._line),      _error(other._error)  { @@ -182,6 +183,7 @@ const char *SettingException::getPath() const  // ---------------------------------------------------------------------------  SettingException::SettingException(const SettingException &other) +  : ConfigException(other)  {    _path = ::strdup(other._path);  } @@ -461,7 +463,7 @@ bool Config::exists(const char *path) const throw()      V = (T)s;                                   \      return(true);                               \    }                                             \ -  catch(ConfigException)                        \ +  catch(const ConfigException &)                \    {                                             \      return(false);                              \    } @@ -868,7 +870,7 @@ Setting & Setting::operator[](const char *key) const      V = (T)s;                                   \      return(true);                               \    }                                             \ -  catch(ConfigException)                        \ +  catch(const ConfigException &)                \    {                                             \      return(false);                              \    } @@ -1162,6 +1164,6 @@ Setting & Setting::wrapSetting(config_setting_t *s)  // --------------------------------------------------------------------------- -}; // namespace libconfig +} // namespace libconfig  // eof diff --git a/lib/scanner.c b/lib/scanner.c index c2eb7d1..a7a401a 100644 --- a/lib/scanner.c +++ b/lib/scanner.c @@ -369,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 41 -#define YY_END_OF_BUFFER 42 +#define YY_NUM_RULES 42 +#define YY_END_OF_BUFFER 43  /* This struct is not used in this scanner,     but its presence is necessary. */  struct yy_trans_info @@ -380,18 +380,18 @@ struct yy_trans_info  	};  static yyconst flex_int16_t yy_accept[103] =      {   0, -        0,    0,    0,    0,    0,    0,    0,    0,   42,   40, -       21,   20,   20,    5,   40,   36,   37,   28,   40,   23, -       29,   40,   30,   30,   22,   38,   28,   28,   34,   35, -       24,   25,   21,   40,    3,    4,    3,    6,   14,   41, -       16,   19,   41,   21,    0,   39,   28,   29,   30,   29, -        0,    1,    0,   29,    0,   31,    0,   28,   28,   21, +        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,   16,   18,   17,    0,   29,   29,    0,    0,   29, -       31,   32,   28,   28,    0,    0,    0,   29,   33,   28, -       26,    0,   13,   33,   27,    0,    0,    0,    0,    0, +        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, -       15,    0 +       16,    0      } ;  static yyconst flex_int32_t yy_ec[256] = @@ -534,11 +534,11 @@ static yyconst flex_int16_t yy_chk[253] =      } ;  /* Table of booleans, true if rule could match eol. */ -static yyconst flex_int32_t yy_rule_can_match_eol[42] = +static yyconst flex_int32_t yy_rule_can_match_eol[43] =      {   0, -0, 0, 0, 1, 0, 1, 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, 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,     };  /* The intent behind this definition is that it'll catch   * any uses of REJECT which flex missed. @@ -1037,36 +1037,41 @@ YY_RULE_SETUP  case 14:  YY_RULE_SETUP  #line 120 "scanner.l" +{ scanctx_append_string(yyextra, "\\"); } +	YY_BREAK +case 15: +YY_RULE_SETUP +#line 121 "scanner.l"  {                      yylval->sval = scanctx_take_string(yyextra);                      BEGIN INITIAL;                      return(TOK_STRING);                    }  	YY_BREAK -case 15: -YY_RULE_SETUP -#line 126 "scanner.l" -{ BEGIN INCLUDE; } -	YY_BREAK  case 16: -/* rule 16 can match eol */  YY_RULE_SETUP  #line 127 "scanner.l" -{ scanctx_append_string(yyextra, yytext); } +{ BEGIN INCLUDE; }  	YY_BREAK  case 17: +/* rule 17 can match eol */  YY_RULE_SETUP  #line 128 "scanner.l" -{ scanctx_append_string(yyextra, "\\"); } +{ scanctx_append_string(yyextra, yytext); }  	YY_BREAK  case 18:  YY_RULE_SETUP  #line 129 "scanner.l" -{ scanctx_append_string(yyextra, "\""); } +{ scanctx_append_string(yyextra, "\\"); }  	YY_BREAK  case 19:  YY_RULE_SETUP  #line 130 "scanner.l" +{ scanctx_append_string(yyextra, "\""); } +	YY_BREAK +case 20: +YY_RULE_SETUP +#line 131 "scanner.l"  {                      const char *error;                      FILE *fp = scanctx_push_include(yyextra, @@ -1089,123 +1094,123 @@ YY_RULE_SETUP                      BEGIN INITIAL;                    }  	YY_BREAK -case 20: -/* rule 20 can match eol */ -YY_RULE_SETUP -#line 154 "scanner.l" -{ /* ignore */ } -	YY_BREAK  case 21: +/* rule 21 can match eol */  YY_RULE_SETUP  #line 155 "scanner.l"  { /* ignore */ }  	YY_BREAK  case 22:  YY_RULE_SETUP -#line 157 "scanner.l" -{ return(TOK_EQUALS); } +#line 156 "scanner.l" +{ /* ignore */ }  	YY_BREAK  case 23:  YY_RULE_SETUP  #line 158 "scanner.l" -{ return(TOK_COMMA); } +{ return(TOK_EQUALS); }  	YY_BREAK  case 24:  YY_RULE_SETUP  #line 159 "scanner.l" -{ return(TOK_GROUP_START); } +{ return(TOK_COMMA); }  	YY_BREAK  case 25:  YY_RULE_SETUP  #line 160 "scanner.l" -{ return(TOK_GROUP_END); } +{ return(TOK_GROUP_START); }  	YY_BREAK  case 26:  YY_RULE_SETUP  #line 161 "scanner.l" -{ yylval->ival = 1; return(TOK_BOOLEAN); } +{ return(TOK_GROUP_END); }  	YY_BREAK  case 27:  YY_RULE_SETUP  #line 162 "scanner.l" -{ yylval->ival = 0; return(TOK_BOOLEAN); } +{ yylval->ival = 1; return(TOK_BOOLEAN); }  	YY_BREAK  case 28:  YY_RULE_SETUP  #line 163 "scanner.l" -{ yylval->sval = yytext; return(TOK_NAME); } +{ yylval->ival = 0; return(TOK_BOOLEAN); }  	YY_BREAK  case 29:  YY_RULE_SETUP  #line 164 "scanner.l" -{ yylval->fval = atof(yytext); return(TOK_FLOAT); } +{ yylval->sval = yytext; return(TOK_NAME); }  	YY_BREAK  case 30:  YY_RULE_SETUP  #line 165 "scanner.l" -{ yylval->ival = atoi(yytext); return(TOK_INTEGER); } +{ yylval->fval = atof(yytext); return(TOK_FLOAT); }  	YY_BREAK  case 31:  YY_RULE_SETUP  #line 166 "scanner.l" -{ yylval->llval = atoll(yytext); return(TOK_INTEGER64); } +{ yylval->ival = atoi(yytext); return(TOK_INTEGER); }  	YY_BREAK  case 32:  YY_RULE_SETUP  #line 167 "scanner.l" +{ yylval->llval = atoll(yytext); return(TOK_INTEGER64); } +	YY_BREAK +case 33: +YY_RULE_SETUP +#line 168 "scanner.l"  {                      yylval->ival = strtoul(yytext, NULL, 16);                      return(TOK_HEX);                    }  	YY_BREAK -case 33: -YY_RULE_SETUP -#line 171 "scanner.l" -{ yylval->llval = fromhex(yytext); return(TOK_HEX64); } -	YY_BREAK  case 34:  YY_RULE_SETUP  #line 172 "scanner.l" -{ return(TOK_ARRAY_START); } +{ yylval->llval = fromhex(yytext); return(TOK_HEX64); }  	YY_BREAK  case 35:  YY_RULE_SETUP  #line 173 "scanner.l" -{ return(TOK_ARRAY_END); } +{ return(TOK_ARRAY_START); }  	YY_BREAK  case 36:  YY_RULE_SETUP  #line 174 "scanner.l" -{ return(TOK_LIST_START); } +{ return(TOK_ARRAY_END); }  	YY_BREAK  case 37:  YY_RULE_SETUP  #line 175 "scanner.l" -{ return(TOK_LIST_END); } +{ return(TOK_LIST_START); }  	YY_BREAK  case 38:  YY_RULE_SETUP  #line 176 "scanner.l" -{ return(TOK_SEMICOLON); } +{ return(TOK_LIST_END); }  	YY_BREAK  case 39: +YY_RULE_SETUP +#line 177 "scanner.l" +{ return(TOK_SEMICOLON); } +	YY_BREAK +case 40:  *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 177 "scanner.l" +#line 178 "scanner.l"  { /* ignore */ }  	YY_BREAK -case 40: +case 41:  YY_RULE_SETUP -#line 178 "scanner.l" +#line 179 "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 180 "scanner.l" +#line 181 "scanner.l"  {                      YY_BUFFER_STATE buf = (YY_BUFFER_STATE)scanctx_pop_include(                        yyextra); @@ -1218,12 +1223,12 @@ case YY_STATE_EOF(INCLUDE):                        yyterminate();                    }  	YY_BREAK -case 41: +case 42:  YY_RULE_SETUP -#line 191 "scanner.l" +#line 192 "scanner.l"  ECHO;  	YY_BREAK -#line 1227 "scanner.c" +#line 1232 "scanner.c"  	case YY_END_OF_BUFFER:  		{ @@ -2359,4 +2364,4 @@ void libconfig_yyfree (void * ptr , yyscan_t yyscanner)  #define YYTABLES_NAME "yytables" -#line 191 "scanner.l" +#line 192 "scanner.l" diff --git a/lib/scanner.l b/lib/scanner.l index 2703eb6..fb467cf 100644 --- a/lib/scanner.l +++ b/lib/scanner.l @@ -117,6 +117,7 @@ include_open      ^[ \t]*@include[ \t]+\"                                    0 };                      scanctx_append_string(yyextra, c);                    } +<STRING>\\        { scanctx_append_string(yyextra, "\\"); }  <STRING>\"        {                      yylval->sval = scanctx_take_string(yyextra);                      BEGIN INITIAL; | 
