diff --git a/CMakeLists.txt b/CMakeLists.txt index f9af8888b8ee3b4627ba34fce1407f5b62e7cf7e..aeeed7d25bc6618482162cb6d827c1405b2e0d76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,6 @@ find_program(LYNX lynx) find_program(CAT cat) find_program(GIT git) find_program(RAGEL ragel) -find_program(CONFETTI confetti) find_program(LD ld) find_program(POD2MAN pod2man) @@ -340,7 +339,6 @@ include (cmake/package.cmake) # include (cmake/rpm.cmake) -add_subdirectory(cfg) # Disable connector_c for 1.6 add_subdirectory(connector) add_subdirectory(src) diff --git a/cfg/CMakeLists.txt b/cfg/CMakeLists.txt deleted file mode 100644 index 1dd26484d33ddbc19a44706ecf2b6d571825ff42..0000000000000000000000000000000000000000 --- a/cfg/CMakeLists.txt +++ /dev/null @@ -1,67 +0,0 @@ - -# Do not clean the generated configuration files in "make clean" -# -set_property(DIRECTORY PROPERTY CLEAN_NO_CUSTOM 1) - -execute_process(COMMAND ${CMAKE_COMMAND} -E touch_nocreate - ${CMAKE_SOURCE_DIR}/cfg/prscfg.h - ${CMAKE_SOURCE_DIR}/cfg/prscfg.c) -add_custom_command( - OUTPUT ${CMAKE_SOURCE_DIR}/cfg/prscfg.h - ${CMAKE_SOURCE_DIR}/cfg/prscfg.c - COMMAND ${ECHO} '%{' > tmp.cfg - COMMAND ${ECHO} '\#include \"cfg/warning.h\"' >> tmp.cfg - COMMAND ${ECHO} '%}' >> tmp.cfg - COMMAND ${CAT} ${CMAKE_SOURCE_DIR}/cfg/core_cfg.cfg_tmpl >> tmp.cfg - COMMAND ${CONFETTI} -i tmp.cfg -n tarantool_cfg - -H ${CMAKE_SOURCE_DIR}/cfg/prscfg.h - -p ${CMAKE_SOURCE_DIR}/cfg/prscfg.c - COMMAND ${CMAKE_COMMAND} -E remove tmp.cfg - DEPENDS ${CMAKE_SOURCE_DIR}/cfg/warning.h) - -# -# Optionally rebuild the configuration file parsing code from -# templates. -# -macro(generate_mod_config mod) -# Gracefully handle out-of-source builds with missing -# 'confetti'. Make sure that generated files are older than -# their sources when configuring the project. -execute_process(COMMAND ${CMAKE_COMMAND} -E touch_nocreate - ${CMAKE_SOURCE_DIR}/cfg/tarantool_${mod}_cfg.h - ${CMAKE_SOURCE_DIR}/cfg/tarantool_${mod}_cfg.c) -add_custom_command( - OUTPUT ${CMAKE_SOURCE_DIR}/cfg/tarantool_${mod}_cfg.h - ${CMAKE_SOURCE_DIR}/cfg/tarantool_${mod}_cfg.c - COMMAND ${ECHO} '%{' > ${mod}_tmp.cfg - COMMAND ${ECHO} '\#include \"cfg/warning.h\"' >> ${mod}_tmp.cfg - COMMAND ${ECHO} '\#include \"cfg/tarantool_${mod}_cfg.h\"' >> ${mod}_tmp.cfg - COMMAND ${ECHO} '%}' >> ${mod}_tmp.cfg - COMMAND ${CAT} ${CMAKE_SOURCE_DIR}/cfg/core_cfg.cfg_tmpl >> ${mod}_tmp.cfg - COMMAND ${CONFETTI} -i ${mod}_tmp.cfg -n tarantool_cfg - -c ${CMAKE_SOURCE_DIR}/cfg/tarantool_${mod}_cfg.c - -h ${CMAKE_SOURCE_DIR}/cfg/tarantool_${mod}_cfg.h - COMMAND ${CMAKE_COMMAND} -E remove ${mod}_tmp.cfg - DEPENDS ${CMAKE_SOURCE_DIR}/cfg/core_cfg.cfg_tmpl - ${CMAKE_SOURCE_DIR}/cfg/warning.h - ) -endmacro() - -foreach (mod ${TARANTOOL_MODULES}) - generate_mod_config(${mod}) - set (generated_headers ${generated_headers} - ${CMAKE_SOURCE_DIR}/cfg/tarantool_${mod}_cfg.h) -endforeach() - -set_source_files_properties(${CMAKE_SOURCE_DIR}/cfg/prscfg.c - PROPERTIES COMPILE_FLAGS "-Wno-unused") - -add_library(cfg prscfg.c warning.c) -# -# Make sure all generated headers are built before they are used. -# This is also necessary to avoid races in parallel make, -# when tmp.cfg is corrupted by two paralled targets. -# See http://www.cmake.org/Bug/view.php?id=10082 for details. -# -add_custom_target(config - DEPENDS ${CMAKE_SOURCE_DIR}/cfg/prscfg.h ${generated_headers}) diff --git a/cfg/core_cfg.cfg_tmpl b/cfg/core_cfg.cfg_tmpl deleted file mode 100644 index ff0da87cefd3147355fbca363d07df8a728e0525..0000000000000000000000000000000000000000 --- a/cfg/core_cfg.cfg_tmpl +++ /dev/null @@ -1,107 +0,0 @@ -# username to switch to -username=NULL, ro - -# Local hot standby (if enabled, the server will run in hot -# standby mode, continuously fetching WAL records from wal_dir, -# until it is able to bind to the primary port. -# In local hot standby mode the server only accepts reads. -local_hot_standby=false, ro - -# tarantool bind ip address, applies to primary port. -# INADDR_ANY is the default value. -bind_ipaddr="INADDR_ANY", ro - -# save core on abort/assert -# deprecated; use ulimit instead -coredump=false, ro - -# admin port -# used for admin's connections -admin_port=0, ro - -# Log verbosity, possible values: SYS_ERROR = 1, ERROR=2, CRIT=3, WARN=4, INFO=5(default), DEBUG=6 -log_level=5 - -# Size of slab arena in GB -slab_alloc_arena=1.0, ro -# Size of minimal allocation unit -slab_alloc_minimal=64, ro -# Growth factor, each subsequent unit size is factor * prev unit size -slab_alloc_factor=2.0, ro - -# working directory (daemon will chdir(2) to it) -work_dir=NULL, ro - -# Snapshot directory (where snapshots get saved/read) -snap_dir=".", ro - -# WAL directory (where WALs get saved/read) -wal_dir=".", ro - -# name of pid file -pid_file="tarantool.pid", ro - -# logger command will be executed via /bin/sh -c {} -# example: 'exec cronolog /var/log/tarantool/%Y-%m/%Y-%m-%d/tarantool.log' -# example: 'exec extra/logger.pl /var/log/tarantool/tarantool.log' -# when logger is not configured all logging going to STDERR -logger=NULL, ro - -#daemonize or not -background=false, ro - -# make logging nonblocking, this potentially can lose some logging data -logger_nonblock=true, ro - -# delay between loop iterations -io_collect_interval=0.0 - -# network io readahead -readahead=16320 - -# Do not write into snapshot faster than snap_io_rate_limit MB/sec -snap_io_rate_limit=0.0 - -# Write no more rows in WAL -rows_per_wal=500000, ro - -# Defines fiber/data synchronization fsync(2) policy: -# "none": does not write to WAL -# "write": fibers wait for their data to be written to the log. -# "fsync": fibers wait for their data, fsync(2) follows each write(2) -# "fsync_delay": fibers wait for their data, fsync every N=wal_fsync_delay seconds, -# N=0.0 means no fsync (equivalent to wal_mode = "write"); -wal_mode="fsync_delay" - -# Fsync WAL delay, only issue fsync if last fsync was wal_fsync_delay -# seconds ago. -# WARNING: actually, several last requests may stall fsync for much longer -wal_fsync_delay=0.0 - -# Delay, in seconds, between successive re-readings of wal_dir. -# The re-scan is necessary to discover new WAL files or snapshots. -wal_dir_rescan_delay=0.1, ro - -# Panic if there is an error reading a snapshot or WAL. -# By default, panic on any snapshot reading error and ignore errors -# when reading WALs. -panic_on_snap_error=true, ro -panic_on_wal_error=false, ro -## BOX - -# Primary port (where updates are accepted) -primary_port=0, ro - -# Warn about requests which take longer to process, in seconds. -too_long_threshold=0.5 - -# A custom process list (ps) title string, appended after the standard -# program title. -custom_proc_title=NULL, ro - -# Replication mode (if enabled, the server, once -# bound to the primary port, will connect to -# replication_source (ipaddr:port) and run continously -# fetching records from it.. In replication mode the server -# only accepts reads. -replication_source=NULL diff --git a/cfg/prscfg.c b/cfg/prscfg.c deleted file mode 100644 index bb11bf987669dedc3e12e76b7d9e90e3fcde19b9..0000000000000000000000000000000000000000 --- a/cfg/prscfg.c +++ /dev/null @@ -1,4742 +0,0 @@ - -#include "cfg/warning.h" -#include <stdio.h> - -typedef struct prscfg_yy_extra_type { - char *strbuf; - int length; - int total; - int lineno; - int commentCounter; - int ostate; -} prscfg_yy_extra_type; -typedef void *prscfg_yyscan_t; -static prscfg_yyscan_t prscfgScannerInit(FILE *fh, prscfg_yy_extra_type *yyext); -static prscfg_yyscan_t prscfgScannerInitBuffer(char *buffer, prscfg_yy_extra_type *yyext); -static void prscfgScannerFinish(prscfg_yyscan_t scanner); -static void prscfgScannerStartValue(prscfg_yyscan_t scanner); -static void prscfgScannerEndValue(prscfg_yyscan_t scanner); -static int prscfgGetLineNo(prscfg_yyscan_t yyscanner); - -/* A Bison parser, made by GNU Bison 2.5. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - OPT_P = 258, - KEY_P = 259, - INDEX_P = 260, - NULL_P = 261, - STRING_P = 262 - }; -#endif -/* Tokens. */ -#define OPT_P 258 -#define KEY_P 259 -#define INDEX_P 260 -#define NULL_P 261 -#define STRING_P 262 - - - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -{ - -/* Line 2068 of yacc.c */ -#line 100 "prscfg.y" - - char *str; - OptDef *node; - NameAtom *atom; - int flag; - - - -/* Line 2068 of yacc.c */ -#line 73 "y.tab.h" -} YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -#endif - - - - -/* A Bison parser, made by GNU Bison 2.5. */ - -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.5" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 1 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - -/* Substitute the variable and function names. */ -#define yyparse prscfg_yyparse -#define yylex prscfg_yylex -#define yyerror prscfg_yyerror -#define yylval prscfg_yylval -#define yychar prscfg_yychar -#define yydebug prscfg_yydebug -#define yynerrs prscfg_yynerrs - - -/* Copy the first part of user declarations. */ - -/* Line 268 of yacc.c */ -#line 1 "prscfg.y" - - -#undef yylval -#undef yylloc - -#include <errno.h> -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <limits.h> -#include <sys/types.h> - -static int prscfg_yyerror(prscfg_yyscan_t yyscanner, const char *msg); -extern int prscfg_yylex (YYSTYPE * yylval_param, prscfg_yyscan_t yyscanner); -static NameAtom* prependName(NameAtom *prep, NameAtom *name); -static void freeName(NameAtom *atom); -static OptDef *output; - -#define MakeAtom(r, n) do { \ - (r) = malloc(sizeof(NameAtom)); \ - if (!(r)) { \ - prscfg_yyerror(yyscanner, "No memory"); \ - YYERROR; \ - } \ - (r)->name = (n); \ - (r)->index = -1; \ - (r)->next = NULL; \ -} while(0) - -#define MakeScalarParam(r, t, n, v, p) do { \ - (r) = malloc(sizeof(OptDef)); \ - if (!(r)) { \ - prscfg_yyerror(yyscanner, "No memory"); \ - YYERROR; \ - } \ - (r)->paramType = t##Type; \ - (r)->optional = p; \ - (r)->paramValue.t##val = (v); \ - (r)->name = (n); \ - (r)->parent = NULL; \ - (r)->next = NULL; \ -} while(0) - -#define MakeList(r, f, l) \ - if (f) { \ - (f)->next = (l); \ - (r) = (f); \ - } else { \ - (r) = (l); \ - } - -#define ConcatList(r, f, l) \ - if (f) { \ - (r) = (f); \ - while ((f)->next) \ - (f) = (f)->next; \ - (f)->next = (l); \ - } else { \ - (r) = (l); \ - } - -#define SetParent(p, l) do { \ - OptDef *i = (l); \ - while(i) { \ - i->parent = (p); \ - i = i->next; \ - } \ -} while(0) - -#define SetIndex(l, in) do { \ - OptDef *i = (l); \ - while(i) { \ - i->name->index = (in); \ - i = i->next; \ - } \ -} while(0) - -#define SetSection(out, in, sec) do { \ - OptDef *opt; \ - opt = (out) = (in); \ - \ - while(opt) { \ - opt->name = prependName((sec), opt->name); \ - \ - opt = opt->next; \ - } \ - freeName(sec); \ -} while(0) - - - -/* Line 268 of yacc.c */ -#line 171 "y.tab.c" - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 1 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - OPT_P = 258, - KEY_P = 259, - INDEX_P = 260, - NULL_P = 261, - STRING_P = 262 - }; -#endif -/* Tokens. */ -#define OPT_P 258 -#define KEY_P 259 -#define INDEX_P 260 -#define NULL_P 261 -#define STRING_P 262 - - - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -{ - -/* Line 293 of yacc.c */ -#line 100 "prscfg.y" - - char *str; - OptDef *node; - NameAtom *atom; - int flag; - - - -/* Line 293 of yacc.c */ -#line 230 "y.tab.c" -} YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -#endif - - -/* Copy the second part of user declarations. */ - - -/* Line 343 of yacc.c */ -#line 242 "y.tab.c" - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) -#else -# define YYUSE(e) /* empty */ -#endif - -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) - int yyi; -#endif -{ - return yyi; -} -#endif - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include <alloca.h> /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include <malloc.h> /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 8 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 50 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 15 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 18 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 32 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 56 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 262 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 14, 2, 13, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 10, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 8, 2, 9, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 11, 2, 12, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint8 yyprhs[] = -{ - 0, 0, 3, 5, 7, 10, 11, 13, 18, 23, - 25, 29, 30, 36, 41, 43, 45, 48, 53, 55, - 60, 65, 72, 75, 78, 79, 83, 87, 92, 94, - 95, 97, 99 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = -{ - 16, 0, -1, 17, -1, 18, -1, 17, 19, -1, - -1, 20, -1, 8, 26, 9, 18, -1, 8, 27, - 9, 18, -1, 21, -1, 20, 32, 21, -1, -1, - 31, 26, 10, 22, 23, -1, 31, 27, 10, 24, - -1, 6, -1, 7, -1, 8, 9, -1, 8, 25, - 32, 9, -1, 24, -1, 11, 20, 32, 12, -1, - 11, 20, 32, 12, -1, 25, 32, 11, 20, 32, - 12, -1, 28, 30, -1, 28, 29, -1, -1, 28, - 30, 13, -1, 28, 29, 13, -1, 30, 8, 5, - 9, -1, 4, -1, -1, 3, -1, 14, -1, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint8 yyrline[] = -{ - 0, 117, 117, 121, 122, 126, 127, 131, 132, 136, - 137, 141, 141, 144, 148, 149, 150, 151, 152, 156, - 160, 171, 186, 190, 194, 195, 196, 200, 209, 213, - 214, 218, 219 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "OPT_P", "KEY_P", "INDEX_P", "NULL_P", - "STRING_P", "'['", "']'", "'='", "'{'", "'}'", "'.'", "','", "$accept", - "cfg", "section_list", "section", "named_section", "param_list", "param", - "$@1", "value", "evalue", "struct_list", "qname", "qelem", "qualifier", - "elem", "name", "opt", "comma_opt", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 91, 93, - 61, 123, 125, 46, 44 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 15, 16, 17, 17, 18, 18, 19, 19, 20, - 20, 22, 21, 21, 23, 23, 23, 23, 23, 24, - 25, 25, 26, 27, 28, 28, 28, 29, 30, 31, - 31, 32, 32 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 1, 1, 2, 0, 1, 4, 4, 1, - 3, 0, 5, 4, 1, 1, 2, 4, 1, 4, - 4, 6, 2, 2, 0, 3, 3, 4, 1, 0, - 1, 1, 0 -}; - -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 5, 30, 0, 2, 3, 6, 9, 24, 1, 24, - 4, 31, 29, 0, 0, 0, 0, 0, 10, 11, - 0, 28, 23, 22, 5, 5, 0, 29, 13, 26, - 0, 25, 7, 8, 14, 15, 0, 12, 18, 32, - 0, 16, 29, 32, 29, 27, 32, 0, 19, 29, - 17, 29, 20, 32, 29, 21 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = -{ - -1, 2, 3, 4, 10, 5, 6, 26, 37, 28, - 43, 13, 14, 15, 22, 23, 7, 12 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -37 -static const yytype_int8 yypact[] = -{ - 30, -37, 14, -2, -37, 1, -37, -37, -37, -37, - -37, -37, 27, 25, 26, 34, 31, 32, -37, -37, - 28, -37, 33, 0, 30, 30, 16, 27, -37, -37, - 38, -37, -37, -37, -37, -37, 17, -37, -37, 35, - 36, -37, 27, 35, -1, -37, 35, 20, -37, 6, - -37, 27, -37, 35, 9, -37 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = -{ - -37, -37, -37, -5, -37, -26, -12, -37, -37, 18, - -37, 39, 41, -37, -37, -37, -37, -36 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -33 -static const yytype_int8 yytable[] = -{ - 18, 39, 1, 44, -32, -32, 9, 47, 30, 1, - 49, 48, 1, 31, 8, 11, 46, 54, 52, 32, - 33, 55, 34, 35, 36, 53, 41, 27, 42, 50, - 1, 51, 18, 1, -29, 19, 20, 18, 21, 27, - 24, 25, 18, 40, 38, 45, 29, 0, 16, 11, - 17 -}; - -#define yypact_value_is_default(yystate) \ - ((yystate) == (-37)) - -#define yytable_value_is_error(yytable_value) \ - YYID (0) - -static const yytype_int8 yycheck[] = -{ - 12, 27, 3, 39, 3, 4, 8, 43, 8, 3, - 46, 12, 3, 13, 0, 14, 42, 53, 12, 24, - 25, 12, 6, 7, 8, 51, 9, 11, 11, 9, - 3, 11, 44, 3, 4, 10, 10, 49, 4, 11, - 9, 9, 54, 5, 26, 9, 13, -1, 9, 14, - 9 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 3, 16, 17, 18, 20, 21, 31, 0, 8, - 19, 14, 32, 26, 27, 28, 26, 27, 21, 10, - 10, 4, 29, 30, 9, 9, 22, 11, 24, 13, - 8, 13, 18, 18, 6, 7, 8, 23, 24, 20, - 5, 9, 11, 25, 32, 9, 20, 32, 12, 32, - 9, 11, 12, 20, 32, 12 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ - -#define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (yyscanner, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif - - -/* This macro is provided for backward compatibility. */ - -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, YYLEX_PARAM) -#else -# define YYLEX yylex (&yylval, yyscanner) -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, yyscanner); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, prscfg_yyscan_t yyscanner) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep, yyscanner) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - prscfg_yyscan_t yyscanner; -#endif -{ - if (!yyvaluep) - return; - YYUSE (yyscanner); -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); -# endif - switch (yytype) - { - default: - break; - } -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, prscfg_yyscan_t yyscanner) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep, yyscanner) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - prscfg_yyscan_t yyscanner; -#endif -{ - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep, yyscanner); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule, prscfg_yyscan_t yyscanner) -#else -static void -yy_reduce_print (yyvsp, yyrule, yyscanner) - YYSTYPE *yyvsp; - int yyrule; - prscfg_yyscan_t yyscanner; -#endif -{ - int yynrhs = yyr2[yyrule]; - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - , yyscanner); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule, yyscanner); \ -} while (YYID (0)) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T -yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static char * -yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = 0; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> - for details. YYERROR is fine as it does not invoke this - function. - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, prscfg_yyscan_t yyscanner) -#else -static void -yydestruct (yymsg, yytype, yyvaluep, yyscanner) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; - prscfg_yyscan_t yyscanner; -#endif -{ - YYUSE (yyvaluep); - YYUSE (yyscanner); - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - - -/* Prevent warnings from -Wmissing-prototypes. */ -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (prscfg_yyscan_t yyscanner); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (prscfg_yyscan_t yyscanner) -#else -int -yyparse (yyscanner) - prscfg_yyscan_t yyscanner; -#endif -#endif -{ -/* The lookahead symbol. */ -int yychar; - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; - - /* Number of syntax errors so far. */ - int yynerrs; - - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yytoken = 0; - yyss = yyssa; - yyvs = yyvsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - *++yyvsp = yylval; - - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: - -/* Line 1806 of yacc.c */ -#line 117 "prscfg.y" - { output = (yyval.node) = (yyvsp[(1) - (1)].node); } - break; - - case 3: - -/* Line 1806 of yacc.c */ -#line 121 "prscfg.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); } - break; - - case 4: - -/* Line 1806 of yacc.c */ -#line 122 "prscfg.y" - { MakeList((yyval.node), (yyvsp[(2) - (2)].node), (yyvsp[(1) - (2)].node)); } - break; - - case 5: - -/* Line 1806 of yacc.c */ -#line 126 "prscfg.y" - { (yyval.node) = NULL; } - break; - - case 6: - -/* Line 1806 of yacc.c */ -#line 127 "prscfg.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); } - break; - - case 7: - -/* Line 1806 of yacc.c */ -#line 131 "prscfg.y" - { SetSection((yyval.node), (yyvsp[(4) - (4)].node), (yyvsp[(2) - (4)].atom)); } - break; - - case 8: - -/* Line 1806 of yacc.c */ -#line 132 "prscfg.y" - { SetSection((yyval.node), (yyvsp[(4) - (4)].node), (yyvsp[(2) - (4)].atom)); } - break; - - case 9: - -/* Line 1806 of yacc.c */ -#line 136 "prscfg.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); } - break; - - case 10: - -/* Line 1806 of yacc.c */ -#line 137 "prscfg.y" - { MakeList((yyval.node), (yyvsp[(3) - (3)].node), (yyvsp[(1) - (3)].node)); /* plainOptDef will revert the list */ } - break; - - case 11: - -/* Line 1806 of yacc.c */ -#line 141 "prscfg.y" - { prscfgScannerStartValue(yyscanner); } - break; - - case 12: - -/* Line 1806 of yacc.c */ -#line 142 "prscfg.y" - { prscfgScannerEndValue(yyscanner); - (yyvsp[(5) - (5)].node)->name = (yyvsp[(2) - (5)].atom); (yyvsp[(5) - (5)].node)->optional = (yyvsp[(1) - (5)].flag); (yyval.node) = (yyvsp[(5) - (5)].node); } - break; - - case 13: - -/* Line 1806 of yacc.c */ -#line 144 "prscfg.y" - { (yyvsp[(4) - (4)].node)->name = (yyvsp[(2) - (4)].atom); (yyvsp[(4) - (4)].node)->optional = (yyvsp[(1) - (4)].flag); (yyval.node) = (yyvsp[(4) - (4)].node); } - break; - - case 14: - -/* Line 1806 of yacc.c */ -#line 148 "prscfg.y" - { MakeScalarParam((yyval.node), scalar, NULL, NULL, 0); free((yyvsp[(1) - (1)].str)); } - break; - - case 15: - -/* Line 1806 of yacc.c */ -#line 149 "prscfg.y" - { MakeScalarParam((yyval.node), scalar, NULL, (yyvsp[(1) - (1)].str), 0); } - break; - - case 16: - -/* Line 1806 of yacc.c */ -#line 150 "prscfg.y" - { MakeScalarParam((yyval.node), array, NULL, NULL, 0); } - break; - - case 17: - -/* Line 1806 of yacc.c */ -#line 151 "prscfg.y" - { (yyval.node) = (yyvsp[(2) - (4)].node); } - break; - - case 18: - -/* Line 1806 of yacc.c */ -#line 152 "prscfg.y" - { (yyval.node) = (yyvsp[(1) - (1)].node); } - break; - - case 19: - -/* Line 1806 of yacc.c */ -#line 156 "prscfg.y" - { MakeScalarParam((yyval.node), struct, NULL, (yyvsp[(2) - (4)].node), 0); SetParent( (yyval.node), (yyvsp[(2) - (4)].node) ); } - break; - - case 20: - -/* Line 1806 of yacc.c */ -#line 160 "prscfg.y" - { - OptDef *str; - NameAtom *idx; - - MakeAtom(idx, NULL); - MakeScalarParam(str, struct, idx, (yyvsp[(2) - (4)].node), 0); - SetParent( str, (yyvsp[(2) - (4)].node) ); - SetIndex( str, 0 ); - MakeScalarParam((yyval.node), array, NULL, str, 0); - SetParent( (yyval.node), str ); - } - break; - - case 21: - -/* Line 1806 of yacc.c */ -#line 171 "prscfg.y" - { - OptDef *str; - NameAtom *idx; - - MakeAtom(idx, NULL); - MakeScalarParam(str, struct, idx, (yyvsp[(4) - (6)].node), 0); - SetParent(str, (yyvsp[(4) - (6)].node)); - SetIndex(str, (yyvsp[(1) - (6)].node)->paramValue.arrayval->name->index + 1); - MakeList((yyvsp[(1) - (6)].node)->paramValue.arrayval, str, (yyvsp[(1) - (6)].node)->paramValue.arrayval); - SetParent((yyvsp[(1) - (6)].node), str); - (yyval.node) = (yyvsp[(1) - (6)].node); - } - break; - - case 22: - -/* Line 1806 of yacc.c */ -#line 186 "prscfg.y" - { ConcatList((yyval.atom), (yyvsp[(1) - (2)].atom), (yyvsp[(2) - (2)].atom)); } - break; - - case 23: - -/* Line 1806 of yacc.c */ -#line 190 "prscfg.y" - { ConcatList((yyval.atom), (yyvsp[(1) - (2)].atom), (yyvsp[(2) - (2)].atom)); } - break; - - case 24: - -/* Line 1806 of yacc.c */ -#line 194 "prscfg.y" - { (yyval.atom) = NULL; } - break; - - case 25: - -/* Line 1806 of yacc.c */ -#line 195 "prscfg.y" - { ConcatList((yyval.atom), (yyvsp[(1) - (3)].atom), (yyvsp[(2) - (3)].atom)); } - break; - - case 26: - -/* Line 1806 of yacc.c */ -#line 196 "prscfg.y" - { ConcatList((yyval.atom), (yyvsp[(1) - (3)].atom), (yyvsp[(2) - (3)].atom)); } - break; - - case 27: - -/* Line 1806 of yacc.c */ -#line 200 "prscfg.y" - { - (yyval.atom) = (yyvsp[(1) - (4)].atom); - (yyval.atom)->index = atoi((yyvsp[(3) - (4)].str)); - /* XXX check !*/ - free((yyvsp[(3) - (4)].str)); - } - break; - - case 28: - -/* Line 1806 of yacc.c */ -#line 209 "prscfg.y" - { MakeAtom((yyval.atom), (yyvsp[(1) - (1)].str)); } - break; - - case 29: - -/* Line 1806 of yacc.c */ -#line 213 "prscfg.y" - { (yyval.flag) = 0; } - break; - - case 30: - -/* Line 1806 of yacc.c */ -#line 214 "prscfg.y" - { (yyval.flag) = 1; free((yyvsp[(1) - (1)].str)); } - break; - - case 31: - -/* Line 1806 of yacc.c */ -#line 218 "prscfg.y" - { (yyval.str)=NULL; } - break; - - case 32: - -/* Line 1806 of yacc.c */ -#line 219 "prscfg.y" - { (yyval.str)=NULL; } - break; - - - -/* Line 1806 of yacc.c */ -#line 1753 "y.tab.c" - default: break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (yyscanner, YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (yyscanner, yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval, yyscanner); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp, yyscanner); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - *++yyvsp = yylval; - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#if !defined(yyoverflow) || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (yyscanner, YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, yyscanner); - } - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, yyscanner); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - /* Make sure YYID is used. */ - return YYID (yyresult); -} - - - -/* Line 2067 of yacc.c */ -#line 222 "prscfg.y" - - -static int -prscfg_yyerror(prscfg_yyscan_t yyscanner, const char *msg) { - out_warning(CNF_SYNTAXERROR, "gram_yyerror: %s at line %d", msg, prscfgGetLineNo(yyscanner)); - return 0; -} - -static NameAtom* -cloneName(NameAtom *list, NameAtom **end) { - NameAtom *newList = NULL, *ptr, *endptr = NULL; - - while(list) { - ptr = *end = malloc(sizeof(*ptr)); - if (!ptr) { - out_warning(CNF_NOMEMORY, "No memory"); - return NULL; - } - *ptr = *list; - if (ptr->name) { - ptr->name = strdup(ptr->name); - if (!ptr->name) { - out_warning(CNF_NOMEMORY, "No memory"); - free(ptr); - return NULL; - } - } - - if (newList) { - endptr->next = ptr; - endptr = ptr; - } else { - newList = endptr = ptr; - } - - list = list->next; - } - - return newList; -} - -static NameAtom* -prependName(NameAtom *prep, NameAtom *name) { - NameAtom *b, *e; - - b = cloneName(prep, &e); - - if (!b) { - out_warning(CNF_NOMEMORY, "No memory"); - return NULL; - } - - e->next = name; - - return b; -} - -static void -freeName(NameAtom *atom) { - NameAtom *p; - - while(atom) { - free(atom->name); - p = atom->next; - free(atom); - atom = p; - } -} - -static int -compileName(OptDef *def) { - NameAtom *beginPtr = NULL, *endPtr, *list; - OptDef *c = def; - int index = -1; - - list = NULL; - - while(c) { - if (c->name->name) { - beginPtr = cloneName(c->name, &endPtr); - if (!beginPtr) - return 1; - - if (index >= 0) { - endPtr->index = index; - index = -1; - } - - endPtr->next = list; - list = beginPtr; - } else { - index = c->name->index; - } - - c = c->parent; - } - - def->name = list; - - return 0; -} - -static OptDef* -plainOptDef(OptDef *def, OptDef *list) { - OptDef *ptr; - - while(def) { - switch(def->paramType) { - case scalarType: - ptr = malloc(sizeof(*ptr)); - if (!ptr) { - out_warning(CNF_NOMEMORY, "No memory"); - freeCfgDef(def); - freeCfgDef(list); - return NULL; - } - *ptr = *def; - if (compileName(ptr)) { - freeName(ptr->name); - free(ptr); - freeCfgDef(def); - freeCfgDef(list); - return NULL; - } - ptr->parent = NULL; - ptr->next = list; - list = ptr; - break; - case structType: - list = plainOptDef(def->paramValue.structval, list); - break; - case arrayType: - if (def->paramValue.arrayval == NULL) { - ptr = malloc(sizeof(*ptr)); - if (!ptr) { - out_warning(CNF_NOMEMORY, "No memory"); - freeCfgDef(def); - freeCfgDef(list); - return NULL; - } - *ptr = *def; - if (compileName(ptr)) { - freeName(ptr->name); - free(ptr); - freeCfgDef(def); - freeCfgDef(list); - return NULL; - } - ptr->parent = NULL; - ptr->next = list; - list = ptr; - } else { - list = plainOptDef(def->paramValue.arrayval, list); - } - break; - default: - out_warning(CNF_INTERNALERROR, "Unkown paramType: %d", def->paramType); - } - - ptr = def->next; - freeName(def->name); - free(def); - def = ptr; - } - - return list; -} - -void -freeCfgDef(OptDef *def) { - OptDef *ptr; - - while(def) { - switch(def->paramType) { - case scalarType: - free(def->paramValue.scalarval); - break; - case structType: - freeCfgDef(def->paramValue.structval); - break; - case arrayType: - freeCfgDef(def->paramValue.arrayval); - break; - default: - break; - } - - ptr = def->next; - freeName(def->name); - free(def); - def = ptr; - } -} - -OptDef* -parseCfgDef(FILE *fh, int *error) { - prscfg_yyscan_t yyscanner; - prscfg_yy_extra_type yyextra; - int yyresult; - - yyscanner = prscfgScannerInit(fh, &yyextra); - - output = NULL; - yyresult = prscfg_yyparse(yyscanner); - prscfgScannerFinish(yyscanner); - - if (error) - *error = yyresult; - if (yyresult != 0) - return NULL; - - return plainOptDef(output, NULL); -} - -OptDef* -parseCfgDefBuffer(char *buffer, int *error) { - prscfg_yyscan_t yyscanner; - prscfg_yy_extra_type yyextra; - int yyresult; - - yyscanner = prscfgScannerInitBuffer(buffer, &yyextra); - - output = NULL; - yyresult = prscfg_yyparse(yyscanner); - prscfgScannerFinish(yyscanner); - - if (error) - *error = yyresult; - if (yyresult != 0) - return NULL; - - return plainOptDef(output, NULL); -} - - - -#line 2 "prscfg_scan.c" - -#line 4 "prscfg_scan.c" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include <stdio.h> -#include <string.h> -#include <errno.h> -#include <stdlib.h> - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include <inttypes.h> -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* An opaque pointer. */ -#ifndef YY_TYPEDEF_YY_SCANNER_T -#define YY_TYPEDEF_YY_SCANNER_T -typedef void* yyscan_t; -#endif - -/* For convenience, these vars (plus the bison vars far below) - are macros in the reentrant scanner. */ -#define yyin yyg->yyin_r -#define yyout yyg->yyout_r -#define yyextra yyg->yyextra_r -#define yyleng yyg->yyleng_r -#define yytext yyg->yytext_r -#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) -#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) -#define yy_flex_debug yyg->yy_flex_debug_r - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yyg->yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yyg->yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE prscfg_yyrestart(yyin ,yyscanner ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* 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. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - - #define YY_LESS_LINENO(n) - -/* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = yyg->yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#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 - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - 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 - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via prscfg_yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - * - * Returns the top of the stack, or NULL. - */ -#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ - ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ - : NULL) - -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] - -void prscfg_yyrestart (FILE *input_file ,yyscan_t yyscanner ); -void prscfg_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -YY_BUFFER_STATE prscfg_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); -void prscfg_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void prscfg_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void prscfg_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -void prscfg_yypop_buffer_state (yyscan_t yyscanner ); - -static void prscfg_yyensure_buffer_stack (yyscan_t yyscanner ); -static void prscfg_yy_load_buffer_state (yyscan_t yyscanner ); -static void prscfg_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); - -#define YY_FLUSH_BUFFER prscfg_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner) - -YY_BUFFER_STATE prscfg_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); -YY_BUFFER_STATE prscfg_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE prscfg_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); - -void *prscfg_yyalloc (yy_size_t ,yyscan_t yyscanner ); -void *prscfg_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner ); -void prscfg_yyfree (void * ,yyscan_t yyscanner ); - -#define yy_new_buffer prscfg_yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ - prscfg_yyensure_buffer_stack (yyscanner); \ - YY_CURRENT_BUFFER_LVALUE = \ - prscfg_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ - prscfg_yyensure_buffer_stack (yyscanner); \ - YY_CURRENT_BUFFER_LVALUE = \ - prscfg_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) - -/* Begin user sect3 */ - -#define prscfg_yywrap(n) 1 -#define YY_SKIP_YYWRAP - -typedef unsigned char YY_CHAR; - -typedef int yy_state_type; - -#define yytext_ptr yytext_r - -static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); -static int yy_get_next_buffer (yyscan_t yyscanner ); -static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yyg->yytext_ptr = yy_bp; \ - yyg->yytext_ptr -= yyg->yy_more_len; \ - yyleng = (size_t) (yy_cp - yyg->yytext_ptr); \ - yyg->yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yyg->yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 30 -#define YY_END_OF_BUFFER 31 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static yyconst flex_int16_t yy_accept[60] = - { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 31, 9, 2, 1, 3, 8, 9, 7, 6, 6, - 13, 2, 11, 3, 12, 13, 13, 24, 25, 22, - 23, 19, 16, 15, 14, 17, 19, 29, 28, 29, - 29, 2, 3, 4, 7, 6, 6, 0, 24, 20, - 21, 18, 29, 27, 26, 5, 0, 10, 0 - } ; - -static yyconst flex_int32_t yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 4, 5, 1, 1, 1, 1, 1, - 1, 6, 1, 7, 1, 8, 9, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 1, 1, 1, - 7, 1, 1, 1, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 12, 11, 13, 14, 15, - 11, 11, 11, 16, 17, 11, 11, 11, 11, 11, - 7, 18, 7, 1, 11, 1, 11, 11, 11, 11, - - 11, 11, 11, 11, 11, 11, 11, 12, 11, 13, - 14, 15, 11, 11, 11, 16, 17, 11, 11, 11, - 11, 11, 7, 1, 7, 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, 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, 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 - } ; - -static yyconst flex_int32_t yy_meta[19] = - { 0, - 1, 1, 2, 3, 1, 1, 1, 1, 1, 4, - 4, 4, 4, 4, 4, 4, 4, 3 - } ; - -static yyconst flex_int16_t yy_base[69] = - { 0, - 0, 0, 17, 29, 40, 56, 73, 81, 88, 95, - 52, 137, 49, 137, 0, 137, 44, 39, 0, 33, - 137, 45, 137, 0, 137, 40, 28, 0, 137, 137, - 38, 137, 137, 137, 137, 137, 34, 0, 137, 30, - 31, 33, 0, 137, 19, 0, 12, 15, 0, 137, - 137, 137, 0, 0, 0, 0, 13, 137, 137, 104, - 108, 112, 116, 120, 19, 124, 128, 132 - } ; - -static yyconst flex_int16_t yy_def[69] = - { 0, - 59, 1, 60, 60, 61, 61, 62, 62, 63, 63, - 59, 59, 59, 59, 64, 59, 59, 59, 65, 65, - 59, 59, 59, 64, 59, 59, 59, 66, 59, 59, - 67, 59, 59, 59, 59, 59, 59, 68, 59, 68, - 68, 59, 64, 59, 59, 65, 65, 59, 66, 59, - 59, 59, 68, 68, 68, 65, 59, 59, 0, 59, - 59, 59, 59, 59, 59, 59, 59, 59 - } ; - -static yyconst flex_int16_t yy_nxt[156] = - { 0, - 12, 13, 14, 12, 15, 12, 16, 16, 17, 18, - 19, 19, 19, 20, 19, 19, 19, 12, 22, 14, - 23, 24, 46, 25, 58, 26, 57, 56, 45, 27, - 22, 14, 23, 24, 42, 25, 55, 26, 54, 52, - 51, 27, 29, 30, 48, 44, 42, 47, 45, 44, - 42, 59, 59, 59, 59, 59, 59, 31, 29, 30, - 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, - 59, 59, 59, 31, 33, 34, 59, 35, 59, 36, - 59, 37, 33, 34, 59, 35, 59, 36, 59, 37, - 39, 59, 59, 40, 59, 59, 41, 39, 59, 59, - - 40, 59, 59, 41, 21, 21, 21, 21, 28, 28, - 28, 28, 32, 32, 32, 32, 38, 38, 38, 38, - 43, 59, 43, 43, 49, 59, 59, 49, 50, 50, - 50, 50, 53, 59, 53, 53, 11, 59, 59, 59, - 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, - 59, 59, 59, 59, 59 - } ; - -static yyconst flex_int16_t yy_chk[156] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, - 3, 3, 65, 3, 57, 3, 48, 47, 45, 3, - 4, 4, 4, 4, 42, 4, 41, 4, 40, 37, - 31, 4, 5, 5, 27, 26, 22, 20, 18, 17, - 13, 11, 0, 0, 0, 0, 0, 5, 6, 6, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 6, 7, 7, 0, 7, 0, 7, - 0, 7, 8, 8, 0, 8, 0, 8, 0, 8, - 9, 0, 0, 9, 0, 0, 9, 10, 0, 0, - - 10, 0, 0, 10, 60, 60, 60, 60, 61, 61, - 61, 61, 62, 62, 62, 62, 63, 63, 63, 63, - 64, 0, 64, 64, 66, 0, 0, 66, 67, 67, - 67, 67, 68, 0, 68, 68, 59, 59, 59, 59, - 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, - 59, 59, 59, 59, 59 - } ; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() (yyg->yy_more_flag = 1) -#define YY_MORE_ADJ yyg->yy_more_len -#define YY_RESTORE_YY_MORE_OFFSET -#line 1 "prscfg.l" -#line 2 "prscfg.l" - -#undef yylval -#undef yylloc - -#include <stdlib.h> -#include <string.h> - -#define YY_EXTRA_TYPE prscfg_yy_extra_type * - -static int scan_yyerror(char *s, int lineno); -static int addstring(prscfg_yyscan_t yyscanner, char *s, int l); -static int addchar(prscfg_yyscan_t yyscanner, char s); -static char * strdupn(char *src, size_t size); - -static YY_BUFFER_STATE buf = NULL; - -#define YY_NO_INPUT 1 - - - - -/* Default separators */ -/* Value separators */ -#line 516 "prscfg_scan.c" - -#define INITIAL 0 -#define VALUE 1 -#define QUOTED 2 -#define UNQUOTED 3 -#define CCOMMENT 4 - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include <unistd.h> -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -/* Holds the entire state of the reentrant scanner. */ -struct yyguts_t - { - - /* User-defined. Not touched by flex. */ - YY_EXTRA_TYPE yyextra_r; - - /* The rest are the same as the globals declared in the non-reentrant scanner. */ - FILE *yyin_r, *yyout_r; - size_t yy_buffer_stack_top; /**< index of top of stack. */ - size_t yy_buffer_stack_max; /**< capacity of stack. */ - YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ - char yy_hold_char; - int yy_n_chars; - int yyleng_r; - char *yy_c_buf_p; - int yy_init; - int yy_start; - int yy_did_buffer_switch_on_eof; - int yy_start_stack_ptr; - int yy_start_stack_depth; - int *yy_start_stack; - yy_state_type yy_last_accepting_state; - char* yy_last_accepting_cpos; - - int yylineno_r; - int yy_flex_debug_r; - - char *yytext_r; - int yy_more_flag; - int yy_more_len; - - YYSTYPE * yylval_r; - - }; /* end struct yyguts_t */ - -static int yy_init_globals (yyscan_t yyscanner ); - - /* This must go here because YYSTYPE and YYLTYPE are included - * from bison output in section 1.*/ - # define yylval yyg->yylval_r - -int prscfg_yylex_init (yyscan_t* scanner); - -int prscfg_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int prscfg_yylex_destroy (yyscan_t yyscanner ); - -int prscfg_yyget_debug (yyscan_t yyscanner ); - -void prscfg_yyset_debug (int debug_flag ,yyscan_t yyscanner ); - -YY_EXTRA_TYPE prscfg_yyget_extra (yyscan_t yyscanner ); - -void prscfg_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); - -FILE *prscfg_yyget_in (yyscan_t yyscanner ); - -void prscfg_yyset_in (FILE * in_str ,yyscan_t yyscanner ); - -FILE *prscfg_yyget_out (yyscan_t yyscanner ); - -void prscfg_yyset_out (FILE * out_str ,yyscan_t yyscanner ); - -int prscfg_yyget_leng (yyscan_t yyscanner ); - -char *prscfg_yyget_text (yyscan_t yyscanner ); - -int prscfg_yyget_lineno (yyscan_t yyscanner ); - -void prscfg_yyset_lineno (int line_number ,yyscan_t yyscanner ); - -YYSTYPE * prscfg_yyget_lval (yyscan_t yyscanner ); - -void prscfg_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int prscfg_yywrap (yyscan_t yyscanner ); -#else -extern int prscfg_yywrap (yyscan_t yyscanner ); -#endif -#endif - - static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner); - -#ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); -#endif - -#ifndef YY_NO_INPUT - -#ifdef __cplusplus -static int yyinput (yyscan_t yyscanner ); -#else -static int input (yyscan_t yyscanner ); -#endif - -#endif - - static void yy_push_state (int new_state ,yyscan_t yyscanner); - - static void yy_pop_state (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. */ -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - size_t n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - }\ -\ - -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) -#endif - -/* end tables serialization structures and prototypes */ - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int prscfg_yylex \ - (YYSTYPE * yylval_param ,yyscan_t yyscanner); - -#define YY_DECL int prscfg_yylex \ - (YYSTYPE * yylval_param , yyscan_t yyscanner) -#endif /* !YY_DECL */ - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -/** The main scanner function which does all the work. - */ -YY_DECL -{ - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - -#line 49 "prscfg.l" - - -#line 765 "prscfg_scan.c" - - yylval = yylval_param; - - if ( !yyg->yy_init ) - { - yyg->yy_init = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yyg->yy_start ) - yyg->yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - prscfg_yyensure_buffer_stack (yyscanner); - YY_CURRENT_BUFFER_LVALUE = - prscfg_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); - } - - prscfg_yy_load_buffer_state(yyscanner ); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yyg->yy_more_len = 0; - if ( yyg->yy_more_flag ) - { - yyg->yy_more_len = yyg->yy_c_buf_p - yyg->yytext_ptr; - yyg->yy_more_flag = 0; - } - yy_cp = yyg->yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yyg->yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yyg->yy_start; -yy_match: - do - { - 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; - yyg->yy_last_accepting_cpos = yy_cp; - } - 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 >= 60 ) - 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 != 59 ); - yy_cp = yyg->yy_last_accepting_cpos; - yy_current_state = yyg->yy_last_accepting_state; - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - - YY_DO_BEFORE_ACTION; - -do_action: /* This label is used only to access EOF actions. */ - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yyg->yy_hold_char; - yy_cp = yyg->yy_last_accepting_cpos; - yy_current_state = yyg->yy_last_accepting_state; - goto yy_find_action; - -case 1: -/* rule 1 can match eol */ -YY_RULE_SETUP -#line 51 "prscfg.l" -{ yyextra->lineno++; } - YY_BREAK -case 2: -YY_RULE_SETUP -#line 53 "prscfg.l" -{ /* ignore whitespace */ } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 55 "prscfg.l" -{ /* ignore single-line comment */ } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 57 "prscfg.l" -{ - /* scan a C-style comment */ - yyextra->commentCounter = 1; - yyextra->ostate = YYSTATE; - BEGIN CCOMMENT; - } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 64 "prscfg.l" -{ - yylval->str = strdup("OPT"); - if (!yylval->str) - scan_yyerror("No memory", yyextra->lineno); - return OPT_P; - } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 71 "prscfg.l" -{ - yylval->str = strdupn(yytext, yyleng); - if (!yylval->str) - scan_yyerror("No memory", yyextra->lineno); - return KEY_P; - } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 78 "prscfg.l" -{ - yylval->str = strdupn(yytext, yyleng); - if (!yylval->str) - scan_yyerror("No memory", yyextra->lineno); - return INDEX_P; - } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 85 "prscfg.l" -{ return *yytext; } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 87 "prscfg.l" -{ return scan_yyerror("syntax error: Unknown character", yyextra->lineno); } - YY_BREAK -case YY_STATE_EOF(INITIAL): -#line 89 "prscfg.l" -{ yyterminate(); } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 91 "prscfg.l" -{ - yylval->str = strdup("NULL"); - if (!yylval->str) - scan_yyerror("No memory", yyextra->lineno); - BEGIN INITIAL; - return NULL_P; - } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 99 "prscfg.l" -{ - /* Accept a quoted string. */ - yyextra->total = 256; - yyextra->strbuf = malloc(yyextra->total); - if (!yyextra->strbuf) - scan_yyerror("No memory", yyextra->lineno); - yyextra->length = 0; - BEGIN QUOTED; - } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 109 "prscfg.l" -{ - BEGIN INITIAL; - return *yytext; - } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 114 "prscfg.l" -{ - /* Accept an unquoted string. */ - yymore(); - BEGIN UNQUOTED; - } - YY_BREAK -case YY_STATE_EOF(VALUE): -#line 120 "prscfg.l" -{ - return scan_yyerror("Unexpected end of string (expecting value)", yyextra->lineno); - } - YY_BREAK -case 14: -#line 125 "prscfg.l" -case 15: -/* rule 15 can match eol */ -#line 126 "prscfg.l" -case 16: -/* rule 16 can match eol */ -#line 127 "prscfg.l" -case 17: -/* rule 17 can match eol */ -YY_RULE_SETUP -#line 127 "prscfg.l" -{ - int next = yytext[yyleng - 1]; - yylval->str = strdupn(yytext, yyleng - 1); - if (!yylval->str) - scan_yyerror("No memory", yyextra->lineno); - unput(next); - BEGIN INITIAL; - return STRING_P; - } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 137 "prscfg.l" -{ - yylval->str = strdupn(yytext, yyleng - 2); - if (!yylval->str) - scan_yyerror("No memory", yyextra->lineno); - unput('*'); - unput('/'); - BEGIN INITIAL; - return STRING_P; - } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 147 "prscfg.l" -{ yymore(); } - YY_BREAK -case YY_STATE_EOF(UNQUOTED): -#line 149 "prscfg.l" -{ - yylval->str = strdupn(yytext, yyleng - 1); - if (!yylval->str) - scan_yyerror("No memory", yyextra->lineno); - BEGIN INITIAL; - return STRING_P; - } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 157 "prscfg.l" -{ - if (addchar(yyscanner, yytext[1])) - scan_yyerror("No memory", yyextra->lineno); - } - YY_BREAK -case 21: -/* rule 21 can match eol */ -YY_RULE_SETUP -#line 162 "prscfg.l" -{ - yyextra->lineno++; - } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 166 "prscfg.l" -{ - yyextra->strbuf[yyextra->length] = '\0'; - yylval->str = yyextra->strbuf; - BEGIN INITIAL; - yyextra->strbuf = NULL; - return STRING_P; - } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 174 "prscfg.l" -{ - /* This is only needed for \ just before EOF */ - } - YY_BREAK -case 24: -YY_RULE_SETUP -#line 178 "prscfg.l" -{ - if (addstring(yyscanner, yytext, yyleng)) - scan_yyerror("No memory", yyextra->lineno); - } - YY_BREAK -case 25: -/* rule 25 can match eol */ -YY_RULE_SETUP -#line 183 "prscfg.l" -{ - if (addchar(yyscanner, yytext[0])) - scan_yyerror("No memory", yyextra->lineno); - yyextra->lineno++; - } - YY_BREAK -case YY_STATE_EOF(QUOTED): -#line 189 "prscfg.l" -{ - return scan_yyerror("Unexpected end of string (expecting closing quote)", yyextra->lineno); - } - YY_BREAK -case 26: -YY_RULE_SETUP -#line 193 "prscfg.l" -{ - yyextra->commentCounter++; - } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 197 "prscfg.l" -{ - yyextra->commentCounter--; - if (yyextra->commentCounter == 0) - BEGIN yyextra->ostate; - } - YY_BREAK -case 28: -/* rule 28 can match eol */ -YY_RULE_SETUP -#line 203 "prscfg.l" -{ yyextra->lineno++; } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 205 "prscfg.l" -{ /* ignore */ } - YY_BREAK -case YY_STATE_EOF(CCOMMENT): -#line 207 "prscfg.l" -{ - return scan_yyerror("Unexpected end of string (inside comment)", yyextra->lineno); - } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 211 "prscfg.l" -YY_FATAL_ERROR( "flex scanner jammed" ); - YY_BREAK -#line 1115 "prscfg_scan.c" - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yyg->yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * prscfg_yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( yyscanner ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); - - yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yyg->yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yyg->yy_last_accepting_cpos; - yy_current_state = yyg->yy_last_accepting_state; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( yyscanner ) ) - { - case EOB_ACT_END_OF_FILE: - { - yyg->yy_did_buffer_switch_on_eof = 0; - - if ( prscfg_yywrap(yyscanner ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yyg->yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yyg->yy_c_buf_p = - yyg->yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( yyscanner ); - - yy_cp = yyg->yy_c_buf_p; - yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yyg->yy_c_buf_p = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; - - yy_current_state = yy_get_previous_state( yyscanner ); - - yy_cp = yyg->yy_c_buf_p; - yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ -} /* end of prscfg_yylex */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ -static int yy_get_next_buffer (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = yyg->yytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; - - else - { - 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; - - int yy_c_buf_p_offset = - (int) (yyg->yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - prscfg_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - yyg->yy_n_chars, (size_t) num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; - } - - if ( yyg->yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - prscfg_yyrestart(yyin ,yyscanner); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) prscfg_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - } - - yyg->yy_n_chars += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - - static yy_state_type yy_get_previous_state (yyscan_t yyscanner) -{ - register yy_state_type yy_current_state; - register char *yy_cp; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - yy_current_state = yyg->yy_start; - - for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - yyg->yy_last_accepting_state = yy_current_state; - yyg->yy_last_accepting_cpos = yy_cp; - } - 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 >= 60 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) -{ - register int yy_is_jam; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ - register char *yy_cp = yyg->yy_c_buf_p; - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - yyg->yy_last_accepting_state = yy_current_state; - yyg->yy_last_accepting_cpos = yy_cp; - } - 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 >= 60 ) - 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 == 59); - - return yy_is_jam ? 0 : yy_current_state; -} - - static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner) -{ - register char *yy_cp; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - yy_cp = yyg->yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yyg->yy_hold_char; - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yyg->yy_n_chars + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - - while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - yyg->yytext_ptr = yy_bp; - yyg->yy_hold_char = *yy_cp; - yyg->yy_c_buf_p = yy_cp; -} - -#ifndef YY_NO_INPUT -#ifdef __cplusplus - static int yyinput (yyscan_t yyscanner) -#else - static int input (yyscan_t yyscanner) -#endif - -{ - int c; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - *yyg->yy_c_buf_p = yyg->yy_hold_char; - - if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) - /* This was really a NUL. */ - *yyg->yy_c_buf_p = '\0'; - - else - { /* need more input */ - int offset = yyg->yy_c_buf_p - yyg->yytext_ptr; - ++yyg->yy_c_buf_p; - - switch ( yy_get_next_buffer( yyscanner ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - prscfg_yyrestart(yyin ,yyscanner); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( prscfg_yywrap(yyscanner ) ) - return EOF; - - if ( ! yyg->yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(yyscanner); -#else - return input(yyscanner); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yyg->yy_c_buf_p = yyg->yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ - *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ - yyg->yy_hold_char = *++yyg->yy_c_buf_p; - - return c; -} -#endif /* ifndef YY_NO_INPUT */ - -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * @param yyscanner The scanner object. - * @note This function does not reset the start condition to @c INITIAL . - */ - void prscfg_yyrestart (FILE * input_file , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if ( ! YY_CURRENT_BUFFER ){ - prscfg_yyensure_buffer_stack (yyscanner); - YY_CURRENT_BUFFER_LVALUE = - prscfg_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); - } - - prscfg_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); - prscfg_yy_load_buffer_state(yyscanner ); -} - -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * @param yyscanner The scanner object. - */ - void prscfg_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - /* TODO. We should be able to replace this entire function body - * with - * prscfg_yypop_buffer_state(); - * prscfg_yypush_buffer_state(new_buffer); - */ - prscfg_yyensure_buffer_stack (yyscanner); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *yyg->yy_c_buf_p = yyg->yy_hold_char; - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - prscfg_yy_load_buffer_state(yyscanner ); - - /* We don't actually know whether we did this switch during - * EOF (prscfg_yywrap()) processing, but the only time this flag - * is looked at is after prscfg_yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yyg->yy_did_buffer_switch_on_eof = 1; -} - -static void prscfg_yy_load_buffer_state (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - yyg->yy_hold_char = *yyg->yy_c_buf_p; -} - -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * @param yyscanner The scanner object. - * @return the allocated buffer state. - */ - YY_BUFFER_STATE prscfg_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) prscfg_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in prscfg_yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) prscfg_yyalloc(b->yy_buf_size + 2 ,yyscanner ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in prscfg_yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - prscfg_yy_init_buffer(b,file ,yyscanner); - - return b; -} - -/** Destroy the buffer. - * @param b a buffer created with prscfg_yy_create_buffer() - * @param yyscanner The scanner object. - */ - void prscfg_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if ( ! b ) - return; - - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - prscfg_yyfree((void *) b->yy_ch_buf ,yyscanner ); - - prscfg_yyfree((void *) b ,yyscanner ); -} - -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a prscfg_yyrestart() or at EOF. - */ - static void prscfg_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) - -{ - int oerrno = errno; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - prscfg_yy_flush_buffer(b ,yyscanner); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - - /* If b is the current buffer, then prscfg_yy_init_buffer was _probably_ - * called from prscfg_yyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = 0; - - errno = oerrno; -} - -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * @param yyscanner The scanner object. - */ - void prscfg_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == YY_CURRENT_BUFFER ) - prscfg_yy_load_buffer_state(yyscanner ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * @param yyscanner The scanner object. - */ -void prscfg_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if (new_buffer == NULL) - return; - - prscfg_yyensure_buffer_stack(yyscanner); - - /* This block is copied from prscfg_yy_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *yyg->yy_c_buf_p = yyg->yy_hold_char; - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - yyg->yy_buffer_stack_top++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from prscfg_yy_switch_to_buffer. */ - prscfg_yy_load_buffer_state(yyscanner ); - yyg->yy_did_buffer_switch_on_eof = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * @param yyscanner The scanner object. - */ -void prscfg_yypop_buffer_state (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if (!YY_CURRENT_BUFFER) - return; - - prscfg_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner); - YY_CURRENT_BUFFER_LVALUE = NULL; - if (yyg->yy_buffer_stack_top > 0) - --yyg->yy_buffer_stack_top; - - if (YY_CURRENT_BUFFER) { - prscfg_yy_load_buffer_state(yyscanner ); - yyg->yy_did_buffer_switch_on_eof = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void prscfg_yyensure_buffer_stack (yyscan_t yyscanner) -{ - int num_to_alloc; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if (!yyg->yy_buffer_stack) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; - yyg->yy_buffer_stack = (struct yy_buffer_state**)prscfg_yyalloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - , yyscanner); - if ( ! yyg->yy_buffer_stack ) - YY_FATAL_ERROR( "out of dynamic memory in prscfg_yyensure_buffer_stack()" ); - - memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - yyg->yy_buffer_stack_max = num_to_alloc; - yyg->yy_buffer_stack_top = 0; - return; - } - - if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = yyg->yy_buffer_stack_max + grow_size; - yyg->yy_buffer_stack = (struct yy_buffer_state**)prscfg_yyrealloc - (yyg->yy_buffer_stack, - num_to_alloc * sizeof(struct yy_buffer_state*) - , yyscanner); - if ( ! yyg->yy_buffer_stack ) - YY_FATAL_ERROR( "out of dynamic memory in prscfg_yyensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); - yyg->yy_buffer_stack_max = num_to_alloc; - } -} - -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE prscfg_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) -{ - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) prscfg_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in prscfg_yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - prscfg_yy_switch_to_buffer(b ,yyscanner ); - - return b; -} - -/** Setup the input buffer state to scan a string. The next call to prscfg_yylex() will - * scan from a @e copy of @a str. - * @param yystr a NUL-terminated string to scan - * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * prscfg_yy_scan_bytes() instead. - */ -YY_BUFFER_STATE prscfg_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner) -{ - - return prscfg_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner); -} - -/** Setup the input buffer state to scan the given bytes. The next call to prscfg_yylex() will - * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE prscfg_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner) -{ - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) prscfg_yyalloc(n ,yyscanner ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in prscfg_yy_scan_bytes()" ); - - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - - b = prscfg_yy_scan_buffer(buf,n ,yyscanner); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in prscfg_yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} - - static void yy_push_state (int new_state , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if ( yyg->yy_start_stack_ptr >= yyg->yy_start_stack_depth ) - { - yy_size_t new_size; - - yyg->yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yyg->yy_start_stack_depth * sizeof( int ); - - if ( ! yyg->yy_start_stack ) - yyg->yy_start_stack = (int *) prscfg_yyalloc(new_size ,yyscanner ); - - else - yyg->yy_start_stack = (int *) prscfg_yyrealloc((void *) yyg->yy_start_stack,new_size ,yyscanner ); - - if ( ! yyg->yy_start_stack ) - YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); - } - - yyg->yy_start_stack[yyg->yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); -} - - static void yy_pop_state (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if ( --yyg->yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yyg->yy_start_stack[yyg->yy_start_stack_ptr]); -} - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) -{ - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = yyg->yy_hold_char; \ - yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ - yyg->yy_hold_char = *yyg->yy_c_buf_p; \ - *yyg->yy_c_buf_p = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) - -/* Accessor methods (get/set functions) to struct members. */ - -/** Get the user-defined data for this scanner. - * @param yyscanner The scanner object. - */ -YY_EXTRA_TYPE prscfg_yyget_extra (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyextra; -} - -/** Get the current line number. - * @param yyscanner The scanner object. - */ -int prscfg_yyget_lineno (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if (! YY_CURRENT_BUFFER) - return 0; - - return yylineno; -} - -/** Get the current column number. - * @param yyscanner The scanner object. - */ -int prscfg_yyget_column (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if (! YY_CURRENT_BUFFER) - return 0; - - return yycolumn; -} - -/** Get the input stream. - * @param yyscanner The scanner object. - */ -FILE *prscfg_yyget_in (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyin; -} - -/** Get the output stream. - * @param yyscanner The scanner object. - */ -FILE *prscfg_yyget_out (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyout; -} - -/** Get the length of the current token. - * @param yyscanner The scanner object. - */ -int prscfg_yyget_leng (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyleng; -} - -/** Get the current token. - * @param yyscanner The scanner object. - */ - -char *prscfg_yyget_text (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yytext; -} - -/** Set the user-defined data. This data is never touched by the scanner. - * @param user_defined The data to be associated with this scanner. - * @param yyscanner The scanner object. - */ -void prscfg_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyextra = user_defined ; -} - -/** Set the current line number. - * @param line_number - * @param yyscanner The scanner object. - */ -void prscfg_yyset_lineno (int line_number , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - /* lineno is only valid if an input buffer exists. */ - if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "prscfg_yyset_lineno called with no buffer" , yyscanner); - - yylineno = line_number; -} - -/** Set the current column. - * @param line_number - * @param yyscanner The scanner object. - */ -void prscfg_yyset_column (int column_no , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - /* column is only valid if an input buffer exists. */ - if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "prscfg_yyset_column called with no buffer" , yyscanner); - - yycolumn = column_no; -} - -/** Set the input stream. This does not discard the current - * input buffer. - * @param in_str A readable stream. - * @param yyscanner The scanner object. - * @see prscfg_yy_switch_to_buffer - */ -void prscfg_yyset_in (FILE * in_str , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyin = in_str ; -} - -void prscfg_yyset_out (FILE * out_str , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyout = out_str ; -} - -int prscfg_yyget_debug (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yy_flex_debug; -} - -void prscfg_yyset_debug (int bdebug , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yy_flex_debug = bdebug ; -} - -/* Accessor methods for yylval and yylloc */ - -YYSTYPE * prscfg_yyget_lval (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yylval; -} - -void prscfg_yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yylval = yylval_param; -} - -/* User-visible API */ - -/* prscfg_yylex_init is special because it creates the scanner itself, so it is - * the ONLY reentrant function that doesn't take the scanner as the last argument. - * That's why we explicitly handle the declaration, instead of using our macros. - */ - -int prscfg_yylex_init(yyscan_t* ptr_yy_globals) - -{ - if (ptr_yy_globals == NULL){ - errno = EINVAL; - return 1; - } - - *ptr_yy_globals = (yyscan_t) prscfg_yyalloc ( sizeof( struct yyguts_t ), NULL ); - - if (*ptr_yy_globals == NULL){ - errno = ENOMEM; - return 1; - } - - /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ - memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - - return yy_init_globals ( *ptr_yy_globals ); -} - -/* prscfg_yylex_init_extra has the same functionality as prscfg_yylex_init, but follows the - * convention of taking the scanner as the last argument. Note however, that - * this is a *pointer* to a scanner, as it will be allocated by this call (and - * is the reason, too, why this function also must handle its own declaration). - * The user defined value in the first argument will be available to prscfg_yyalloc in - * the yyextra field. - */ - -int prscfg_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) - -{ - struct yyguts_t dummy_yyguts; - - prscfg_yyset_extra (yy_user_defined, &dummy_yyguts); - - if (ptr_yy_globals == NULL){ - errno = EINVAL; - return 1; - } - - *ptr_yy_globals = (yyscan_t) prscfg_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); - - if (*ptr_yy_globals == NULL){ - errno = ENOMEM; - return 1; - } - - /* By setting to 0xAA, we expose bugs in - yy_init_globals. Leave at 0x00 for releases. */ - memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - - prscfg_yyset_extra (yy_user_defined, *ptr_yy_globals); - - return yy_init_globals ( *ptr_yy_globals ); -} - -static int yy_init_globals (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from prscfg_yylex_destroy(), so don't allocate here. - */ - - yyg->yy_buffer_stack = 0; - yyg->yy_buffer_stack_top = 0; - yyg->yy_buffer_stack_max = 0; - yyg->yy_c_buf_p = (char *) 0; - yyg->yy_init = 0; - yyg->yy_start = 0; - - yyg->yy_start_stack_ptr = 0; - yyg->yy_start_stack_depth = 0; - yyg->yy_start_stack = NULL; - -/* Defined in main.c */ -#ifdef YY_STDINIT - yyin = stdin; - yyout = stdout; -#else - yyin = (FILE *) 0; - yyout = (FILE *) 0; -#endif - - /* For future reference: Set errno on error, since we are called by - * prscfg_yylex_init() - */ - return 0; -} - -/* prscfg_yylex_destroy is for both reentrant and non-reentrant scanners. */ -int prscfg_yylex_destroy (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - prscfg_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); - YY_CURRENT_BUFFER_LVALUE = NULL; - prscfg_yypop_buffer_state(yyscanner); - } - - /* Destroy the stack itself. */ - prscfg_yyfree(yyg->yy_buffer_stack ,yyscanner); - yyg->yy_buffer_stack = NULL; - - /* Destroy the start condition stack. */ - prscfg_yyfree(yyg->yy_start_stack ,yyscanner ); - yyg->yy_start_stack = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * prscfg_yylex() is called, initialization will occur. */ - yy_init_globals( yyscanner); - - /* Destroy the main struct (reentrant only). */ - prscfg_yyfree ( yyscanner , yyscanner ); - yyscanner = NULL; - return 0; -} - -/* - * Internal utility routines. - */ - -#ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) -{ - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) -{ - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; -} -#endif - -void *prscfg_yyalloc (yy_size_t size , yyscan_t yyscanner) -{ - return (void *) malloc( size ); -} - -void *prscfg_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) -{ - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); -} - -void prscfg_yyfree (void * ptr , yyscan_t yyscanner) -{ - free( (char *) ptr ); /* see prscfg_yyrealloc() for (char *) cast */ -} - -#define YYTABLES_NAME "yytables" - -#line 211 "prscfg.l" - - - -static int -scan_yyerror(char *msg, int lineno) { - out_warning(CNF_SYNTAXERROR, "scan_yyerror: %s at line %d", msg, lineno); - return 0; -} - -prscfg_yyscan_t -prscfgScannerInit(FILE *fh, prscfg_yy_extra_type *yyext) { - yyscan_t scanner; - - memset(yyext, 0, sizeof(*yyext)); - yyext->lineno = 1; - prscfg_yylex_init_extra(yyext,&scanner); - - buf = prscfg_yy_create_buffer(fh,YY_BUF_SIZE,scanner ); - prscfg_yy_switch_to_buffer(buf,scanner ); - - return scanner; -} - -prscfg_yyscan_t -prscfgScannerInitBuffer(char *buffer, prscfg_yy_extra_type *yyext) { - yyscan_t scanner; - - memset(yyext, 0, sizeof(*yyext)); - yyext->lineno = 1; - prscfg_yylex_init_extra(yyext,&scanner); - - buf = prscfg_yy_scan_string(buffer,scanner ); - prscfg_yy_switch_to_buffer(buf,scanner ); - - return scanner; -} - -void -prscfgScannerFinish(prscfg_yyscan_t scanner) { - if (buf) - prscfg_yy_delete_buffer(buf,scanner ); - prscfg_yylex_destroy(scanner); - buf = NULL; -} - -void -prscfgScannerStartValue(prscfg_yyscan_t scanner) -{ - yy_push_state(VALUE, scanner); -} - -static void -prscfgScannerEndValue(prscfg_yyscan_t scanner) -{ - yy_pop_state(scanner); -} - -/* - * Arrange access to yyextra for subroutines of the main prscfg_yylex() function. - * We expect each subroutine to have a yyscanner parameter. Rather than - * use the yyget_xxx functions, which might or might not get inlined by the - * compiler, we cheat just a bit and cast yyscanner to the right type. - */ -#undef yyextra -#define yyextra (((struct yyguts_t *) yyscanner)->yyextra_r) - -int -prscfgGetLineNo(prscfg_yyscan_t yyscanner) { - return yyextra->lineno; -} - -static int -addstring(prscfg_yyscan_t yyscanner, char *s, int l) { - while( yyextra->length + l + 1 >= yyextra->total ) { - yyextra->total *= 2; - yyextra->strbuf=realloc(yyextra->strbuf, yyextra->total); - } - if (!yyextra->strbuf) - return 1; - - memcpy( yyextra->strbuf+yyextra->length, s, l); - yyextra->length+=l; - return 0; -} - -static int -addchar(prscfg_yyscan_t yyscanner, char s) { - if( yyextra->length + 2 >= yyextra->total ) { - yyextra->total*=2; - yyextra->strbuf=realloc(yyextra->strbuf, yyextra->total); - } - if (!yyextra->strbuf) - return 1; - yyextra->strbuf[ yyextra->length++ ] = s; - return 0; -} - -static char * -strdupn(char *src, size_t size) { - char *dst = malloc(size + 1); - - if (!dst) - return NULL; - - memcpy(dst, src, size); - dst[size] = '\0'; - - return dst; -} - - - diff --git a/cfg/prscfg.h b/cfg/prscfg.h deleted file mode 100644 index 07243b78b3255e34983f8ddc8d4a91e17ed77300..0000000000000000000000000000000000000000 --- a/cfg/prscfg.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef PRSCFG_H -#define PRSCFG_H - -#include <stdio.h> - -typedef struct NameAtom { - char *name; - int index; - struct NameAtom *next; -} NameAtom; - -typedef struct OptDef { - - enum { - scalarType = 0, - structType = 1, - arrayType = 2 - } paramType; - - int optional; - - union { - char *scalarval; - struct OptDef *structval; - struct OptDef *arrayval; - } paramValue; - - NameAtom *name; - - struct OptDef *parent; - struct OptDef *next; -} OptDef; - -OptDef* parseCfgDef(FILE *fh, int *error); -OptDef* parseCfgDefBuffer(char *buffer, int *error); -void freeCfgDef(OptDef *def); - -typedef enum ConfettyError { - CNF_OK = 0, - CNF_MISSED, - CNF_WRONGTYPE, - CNF_WRONGINDEX, - CNF_RDONLY, - CNF_WRONGINT, - CNF_WRONGRANGE, - CNF_NOMEMORY, - CNF_SYNTAXERROR, - CNF_NOTSET, - CNF_OPTIONAL, - CNF_INTERNALERROR -} ConfettyError; - -#endif diff --git a/cfg/tarantool_box_cfg.c b/cfg/tarantool_box_cfg.c deleted file mode 100644 index af9789acdcc60ceb083d78a4c05008178ec54f8a..0000000000000000000000000000000000000000 --- a/cfg/tarantool_box_cfg.c +++ /dev/null @@ -1,1412 +0,0 @@ -#include <errno.h> -#include <limits.h> -#include <inttypes.h> -#include <math.h> -#include <stdlib.h> -#include <string.h> -#include <stdio.h> - -/* - * Autogenerated file, do not edit it! - */ - - -#include "cfg/warning.h" -#include "cfg/tarantool_box_cfg.h" -static int -cmpNameAtoms(NameAtom *a, NameAtom *b) { - while(a && b) { - if (strcasecmp(a->name, b->name) != 0) - return 0; - a = a->next; - b = b->next; - } - return (a == NULL && b == NULL) ? 1 : 0; -} - -void -init_tarantool_cfg(tarantool_cfg *c) { - c->__confetti_flags = 0; - - c->username = NULL; - c->local_hot_standby = false; - c->bind_ipaddr = NULL; - c->coredump = false; - c->admin_port = 0; - c->log_level = 0; - c->slab_alloc_arena = 0; - c->slab_alloc_minimal = 0; - c->slab_alloc_factor = 0; - c->work_dir = NULL; - c->snap_dir = NULL; - c->wal_dir = NULL; - c->pid_file = NULL; - c->logger = NULL; - c->background = false; - c->logger_nonblock = false; - c->io_collect_interval = 0; - c->readahead = 0; - c->snap_io_rate_limit = 0; - c->rows_per_wal = 0; - c->wal_mode = NULL; - c->wal_fsync_delay = 0; - c->wal_dir_rescan_delay = 0; - c->panic_on_snap_error = false; - c->panic_on_wal_error = false; - c->primary_port = 0; - c->too_long_threshold = 0; - c->custom_proc_title = NULL; - c->replication_source = NULL; -} - -int -fill_default_tarantool_cfg(tarantool_cfg *c) { - c->__confetti_flags = 0; - - c->username = NULL; - c->local_hot_standby = false; - c->bind_ipaddr = strdup("INADDR_ANY"); - if (c->bind_ipaddr == NULL) return CNF_NOMEMORY; - c->coredump = false; - c->admin_port = 0; - c->log_level = 5; - c->slab_alloc_arena = 1; - c->slab_alloc_minimal = 64; - c->slab_alloc_factor = 2; - c->work_dir = NULL; - c->snap_dir = strdup("."); - if (c->snap_dir == NULL) return CNF_NOMEMORY; - c->wal_dir = strdup("."); - if (c->wal_dir == NULL) return CNF_NOMEMORY; - c->pid_file = strdup("tarantool.pid"); - if (c->pid_file == NULL) return CNF_NOMEMORY; - c->logger = NULL; - c->background = false; - c->logger_nonblock = true; - c->io_collect_interval = 0; - c->readahead = 16320; - c->snap_io_rate_limit = 0; - c->rows_per_wal = 500000; - c->wal_mode = strdup("fsync_delay"); - if (c->wal_mode == NULL) return CNF_NOMEMORY; - c->wal_fsync_delay = 0; - c->wal_dir_rescan_delay = 0.1; - c->panic_on_snap_error = true; - c->panic_on_wal_error = false; - c->primary_port = 0; - c->too_long_threshold = 0.5; - c->custom_proc_title = NULL; - c->replication_source = NULL; - return 0; -} - -void -swap_tarantool_cfg(struct tarantool_cfg *c1, struct tarantool_cfg *c2) { - struct tarantool_cfg tmpcfg = *c1; - *c1 = *c2; - *c2 = tmpcfg; -} - -static NameAtom _name__username[] = { - { "username", -1, NULL } -}; -static NameAtom _name__local_hot_standby[] = { - { "local_hot_standby", -1, NULL } -}; -static NameAtom _name__bind_ipaddr[] = { - { "bind_ipaddr", -1, NULL } -}; -static NameAtom _name__coredump[] = { - { "coredump", -1, NULL } -}; -static NameAtom _name__admin_port[] = { - { "admin_port", -1, NULL } -}; -static NameAtom _name__log_level[] = { - { "log_level", -1, NULL } -}; -static NameAtom _name__slab_alloc_arena[] = { - { "slab_alloc_arena", -1, NULL } -}; -static NameAtom _name__slab_alloc_minimal[] = { - { "slab_alloc_minimal", -1, NULL } -}; -static NameAtom _name__slab_alloc_factor[] = { - { "slab_alloc_factor", -1, NULL } -}; -static NameAtom _name__work_dir[] = { - { "work_dir", -1, NULL } -}; -static NameAtom _name__snap_dir[] = { - { "snap_dir", -1, NULL } -}; -static NameAtom _name__wal_dir[] = { - { "wal_dir", -1, NULL } -}; -static NameAtom _name__pid_file[] = { - { "pid_file", -1, NULL } -}; -static NameAtom _name__logger[] = { - { "logger", -1, NULL } -}; -static NameAtom _name__background[] = { - { "background", -1, NULL } -}; -static NameAtom _name__logger_nonblock[] = { - { "logger_nonblock", -1, NULL } -}; -static NameAtom _name__io_collect_interval[] = { - { "io_collect_interval", -1, NULL } -}; -static NameAtom _name__readahead[] = { - { "readahead", -1, NULL } -}; -static NameAtom _name__snap_io_rate_limit[] = { - { "snap_io_rate_limit", -1, NULL } -}; -static NameAtom _name__rows_per_wal[] = { - { "rows_per_wal", -1, NULL } -}; -static NameAtom _name__wal_mode[] = { - { "wal_mode", -1, NULL } -}; -static NameAtom _name__wal_fsync_delay[] = { - { "wal_fsync_delay", -1, NULL } -}; -static NameAtom _name__wal_dir_rescan_delay[] = { - { "wal_dir_rescan_delay", -1, NULL } -}; -static NameAtom _name__panic_on_snap_error[] = { - { "panic_on_snap_error", -1, NULL } -}; -static NameAtom _name__panic_on_wal_error[] = { - { "panic_on_wal_error", -1, NULL } -}; -static NameAtom _name__primary_port[] = { - { "primary_port", -1, NULL } -}; -static NameAtom _name__too_long_threshold[] = { - { "too_long_threshold", -1, NULL } -}; -static NameAtom _name__custom_proc_title[] = { - { "custom_proc_title", -1, NULL } -}; -static NameAtom _name__replication_source[] = { - { "replication_source", -1, NULL } -}; - -#define ARRAYALLOC(x,n,t,_chk_ro, __flags) do { \ - int l = 0, ar; \ - __typeof__(x) y = (x), t; \ - if ( (n) <= 0 ) return CNF_WRONGINDEX; /* wrong index */ \ - while(y && *y) { \ - l++; y++; \ - } \ - if ( (n) >= (l + 1) ) { \ - if (_chk_ro) return CNF_RDONLY; \ - if ( (x) == NULL ) \ - t = y = malloc( ((n)+1) * sizeof( __typeof__(*(x))) ); \ - else { \ - t = realloc((x), ((n)+1) * sizeof( __typeof__(*(x))) ); \ - y = t + l; \ - } \ - if (t == NULL) return CNF_NOMEMORY; \ - (x) = t; \ - memset(y, 0, (((n)+1) - l) * sizeof( __typeof__(*(x))) ); \ - while ( y - (x) < (n) ) { \ - *y = malloc( sizeof( __typeof__(**(x))) ); \ - if (*y == NULL) return CNF_NOMEMORY; \ - if ( (ar = acceptDefault##t(*y)) != 0 ) return ar; \ - (*y)->__confetti_flags = __flags; \ - y++; \ - } \ - } \ -} while(0) - -int -confetti_strcmp(char *s1, char *s2); - -static ConfettyError -acceptValue(tarantool_cfg* c, OptDef* opt, int check_rdonly) { - - if ( cmpNameAtoms( opt->name, _name__username) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - if (check_rdonly && ( (opt->paramValue.scalarval == NULL && c->username == NULL) || confetti_strcmp(opt->paramValue.scalarval, c->username) != 0)) - return CNF_RDONLY; - if (c->username) free(c->username); - c->username = (opt->paramValue.scalarval) ? strdup(opt->paramValue.scalarval) : NULL; - if (opt->paramValue.scalarval && c->username == NULL) - return CNF_NOMEMORY; - } - else if ( cmpNameAtoms( opt->name, _name__local_hot_standby) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - bool bln; - - if (strcasecmp(opt->paramValue.scalarval, "true") == 0 || - strcasecmp(opt->paramValue.scalarval, "yes") == 0 || - strcasecmp(opt->paramValue.scalarval, "enable") == 0 || - strcasecmp(opt->paramValue.scalarval, "on") == 0 || - strcasecmp(opt->paramValue.scalarval, "1") == 0 ) - bln = true; - else if (strcasecmp(opt->paramValue.scalarval, "false") == 0 || - strcasecmp(opt->paramValue.scalarval, "no") == 0 || - strcasecmp(opt->paramValue.scalarval, "disable") == 0 || - strcasecmp(opt->paramValue.scalarval, "off") == 0 || - strcasecmp(opt->paramValue.scalarval, "0") == 0 ) - bln = false; - else - return CNF_WRONGRANGE; - if (check_rdonly && c->local_hot_standby != bln) - return CNF_RDONLY; - c->local_hot_standby = bln; - } - else if ( cmpNameAtoms( opt->name, _name__bind_ipaddr) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - if (check_rdonly && ( (opt->paramValue.scalarval == NULL && c->bind_ipaddr == NULL) || confetti_strcmp(opt->paramValue.scalarval, c->bind_ipaddr) != 0)) - return CNF_RDONLY; - if (c->bind_ipaddr) free(c->bind_ipaddr); - c->bind_ipaddr = (opt->paramValue.scalarval) ? strdup(opt->paramValue.scalarval) : NULL; - if (opt->paramValue.scalarval && c->bind_ipaddr == NULL) - return CNF_NOMEMORY; - } - else if ( cmpNameAtoms( opt->name, _name__coredump) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - bool bln; - - if (strcasecmp(opt->paramValue.scalarval, "true") == 0 || - strcasecmp(opt->paramValue.scalarval, "yes") == 0 || - strcasecmp(opt->paramValue.scalarval, "enable") == 0 || - strcasecmp(opt->paramValue.scalarval, "on") == 0 || - strcasecmp(opt->paramValue.scalarval, "1") == 0 ) - bln = true; - else if (strcasecmp(opt->paramValue.scalarval, "false") == 0 || - strcasecmp(opt->paramValue.scalarval, "no") == 0 || - strcasecmp(opt->paramValue.scalarval, "disable") == 0 || - strcasecmp(opt->paramValue.scalarval, "off") == 0 || - strcasecmp(opt->paramValue.scalarval, "0") == 0 ) - bln = false; - else - return CNF_WRONGRANGE; - if (check_rdonly && c->coredump != bln) - return CNF_RDONLY; - c->coredump = bln; - } - else if ( cmpNameAtoms( opt->name, _name__admin_port) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - long int i32 = strtol(opt->paramValue.scalarval, NULL, 10); - if (i32 == 0 && errno == EINVAL) - return CNF_WRONGINT; - if ( (i32 == LONG_MIN || i32 == LONG_MAX) && errno == ERANGE) - return CNF_WRONGRANGE; - if (check_rdonly && c->admin_port != i32) - return CNF_RDONLY; - c->admin_port = i32; - } - else if ( cmpNameAtoms( opt->name, _name__log_level) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - long int i32 = strtol(opt->paramValue.scalarval, NULL, 10); - if (i32 == 0 && errno == EINVAL) - return CNF_WRONGINT; - if ( (i32 == LONG_MIN || i32 == LONG_MAX) && errno == ERANGE) - return CNF_WRONGRANGE; - c->log_level = i32; - } - else if ( cmpNameAtoms( opt->name, _name__slab_alloc_arena) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - double dbl = strtod(opt->paramValue.scalarval, NULL); - if ( (dbl == 0 || dbl == -HUGE_VAL || dbl == HUGE_VAL) && errno == ERANGE) - return CNF_WRONGRANGE; - if (check_rdonly && c->slab_alloc_arena != dbl) - return CNF_RDONLY; - c->slab_alloc_arena = dbl; - } - else if ( cmpNameAtoms( opt->name, _name__slab_alloc_minimal) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - long int i32 = strtol(opt->paramValue.scalarval, NULL, 10); - if (i32 == 0 && errno == EINVAL) - return CNF_WRONGINT; - if ( (i32 == LONG_MIN || i32 == LONG_MAX) && errno == ERANGE) - return CNF_WRONGRANGE; - if (check_rdonly && c->slab_alloc_minimal != i32) - return CNF_RDONLY; - c->slab_alloc_minimal = i32; - } - else if ( cmpNameAtoms( opt->name, _name__slab_alloc_factor) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - double dbl = strtod(opt->paramValue.scalarval, NULL); - if ( (dbl == 0 || dbl == -HUGE_VAL || dbl == HUGE_VAL) && errno == ERANGE) - return CNF_WRONGRANGE; - if (check_rdonly && c->slab_alloc_factor != dbl) - return CNF_RDONLY; - c->slab_alloc_factor = dbl; - } - else if ( cmpNameAtoms( opt->name, _name__work_dir) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - if (check_rdonly && ( (opt->paramValue.scalarval == NULL && c->work_dir == NULL) || confetti_strcmp(opt->paramValue.scalarval, c->work_dir) != 0)) - return CNF_RDONLY; - if (c->work_dir) free(c->work_dir); - c->work_dir = (opt->paramValue.scalarval) ? strdup(opt->paramValue.scalarval) : NULL; - if (opt->paramValue.scalarval && c->work_dir == NULL) - return CNF_NOMEMORY; - } - else if ( cmpNameAtoms( opt->name, _name__snap_dir) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - if (check_rdonly && ( (opt->paramValue.scalarval == NULL && c->snap_dir == NULL) || confetti_strcmp(opt->paramValue.scalarval, c->snap_dir) != 0)) - return CNF_RDONLY; - if (c->snap_dir) free(c->snap_dir); - c->snap_dir = (opt->paramValue.scalarval) ? strdup(opt->paramValue.scalarval) : NULL; - if (opt->paramValue.scalarval && c->snap_dir == NULL) - return CNF_NOMEMORY; - } - else if ( cmpNameAtoms( opt->name, _name__wal_dir) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - if (check_rdonly && ( (opt->paramValue.scalarval == NULL && c->wal_dir == NULL) || confetti_strcmp(opt->paramValue.scalarval, c->wal_dir) != 0)) - return CNF_RDONLY; - if (c->wal_dir) free(c->wal_dir); - c->wal_dir = (opt->paramValue.scalarval) ? strdup(opt->paramValue.scalarval) : NULL; - if (opt->paramValue.scalarval && c->wal_dir == NULL) - return CNF_NOMEMORY; - } - else if ( cmpNameAtoms( opt->name, _name__pid_file) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - if (check_rdonly && ( (opt->paramValue.scalarval == NULL && c->pid_file == NULL) || confetti_strcmp(opt->paramValue.scalarval, c->pid_file) != 0)) - return CNF_RDONLY; - if (c->pid_file) free(c->pid_file); - c->pid_file = (opt->paramValue.scalarval) ? strdup(opt->paramValue.scalarval) : NULL; - if (opt->paramValue.scalarval && c->pid_file == NULL) - return CNF_NOMEMORY; - } - else if ( cmpNameAtoms( opt->name, _name__logger) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - if (check_rdonly && ( (opt->paramValue.scalarval == NULL && c->logger == NULL) || confetti_strcmp(opt->paramValue.scalarval, c->logger) != 0)) - return CNF_RDONLY; - if (c->logger) free(c->logger); - c->logger = (opt->paramValue.scalarval) ? strdup(opt->paramValue.scalarval) : NULL; - if (opt->paramValue.scalarval && c->logger == NULL) - return CNF_NOMEMORY; - } - else if ( cmpNameAtoms( opt->name, _name__background) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - bool bln; - - if (strcasecmp(opt->paramValue.scalarval, "true") == 0 || - strcasecmp(opt->paramValue.scalarval, "yes") == 0 || - strcasecmp(opt->paramValue.scalarval, "enable") == 0 || - strcasecmp(opt->paramValue.scalarval, "on") == 0 || - strcasecmp(opt->paramValue.scalarval, "1") == 0 ) - bln = true; - else if (strcasecmp(opt->paramValue.scalarval, "false") == 0 || - strcasecmp(opt->paramValue.scalarval, "no") == 0 || - strcasecmp(opt->paramValue.scalarval, "disable") == 0 || - strcasecmp(opt->paramValue.scalarval, "off") == 0 || - strcasecmp(opt->paramValue.scalarval, "0") == 0 ) - bln = false; - else - return CNF_WRONGRANGE; - if (check_rdonly && c->background != bln) - return CNF_RDONLY; - c->background = bln; - } - else if ( cmpNameAtoms( opt->name, _name__logger_nonblock) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - bool bln; - - if (strcasecmp(opt->paramValue.scalarval, "true") == 0 || - strcasecmp(opt->paramValue.scalarval, "yes") == 0 || - strcasecmp(opt->paramValue.scalarval, "enable") == 0 || - strcasecmp(opt->paramValue.scalarval, "on") == 0 || - strcasecmp(opt->paramValue.scalarval, "1") == 0 ) - bln = true; - else if (strcasecmp(opt->paramValue.scalarval, "false") == 0 || - strcasecmp(opt->paramValue.scalarval, "no") == 0 || - strcasecmp(opt->paramValue.scalarval, "disable") == 0 || - strcasecmp(opt->paramValue.scalarval, "off") == 0 || - strcasecmp(opt->paramValue.scalarval, "0") == 0 ) - bln = false; - else - return CNF_WRONGRANGE; - if (check_rdonly && c->logger_nonblock != bln) - return CNF_RDONLY; - c->logger_nonblock = bln; - } - else if ( cmpNameAtoms( opt->name, _name__io_collect_interval) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - double dbl = strtod(opt->paramValue.scalarval, NULL); - if ( (dbl == 0 || dbl == -HUGE_VAL || dbl == HUGE_VAL) && errno == ERANGE) - return CNF_WRONGRANGE; - c->io_collect_interval = dbl; - } - else if ( cmpNameAtoms( opt->name, _name__readahead) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - long int i32 = strtol(opt->paramValue.scalarval, NULL, 10); - if (i32 == 0 && errno == EINVAL) - return CNF_WRONGINT; - if ( (i32 == LONG_MIN || i32 == LONG_MAX) && errno == ERANGE) - return CNF_WRONGRANGE; - c->readahead = i32; - } - else if ( cmpNameAtoms( opt->name, _name__snap_io_rate_limit) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - double dbl = strtod(opt->paramValue.scalarval, NULL); - if ( (dbl == 0 || dbl == -HUGE_VAL || dbl == HUGE_VAL) && errno == ERANGE) - return CNF_WRONGRANGE; - c->snap_io_rate_limit = dbl; - } - else if ( cmpNameAtoms( opt->name, _name__rows_per_wal) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - long int i32 = strtol(opt->paramValue.scalarval, NULL, 10); - if (i32 == 0 && errno == EINVAL) - return CNF_WRONGINT; - if ( (i32 == LONG_MIN || i32 == LONG_MAX) && errno == ERANGE) - return CNF_WRONGRANGE; - if (check_rdonly && c->rows_per_wal != i32) - return CNF_RDONLY; - c->rows_per_wal = i32; - } - else if ( cmpNameAtoms( opt->name, _name__wal_mode) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - if (c->wal_mode) free(c->wal_mode); - c->wal_mode = (opt->paramValue.scalarval) ? strdup(opt->paramValue.scalarval) : NULL; - if (opt->paramValue.scalarval && c->wal_mode == NULL) - return CNF_NOMEMORY; - } - else if ( cmpNameAtoms( opt->name, _name__wal_fsync_delay) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - double dbl = strtod(opt->paramValue.scalarval, NULL); - if ( (dbl == 0 || dbl == -HUGE_VAL || dbl == HUGE_VAL) && errno == ERANGE) - return CNF_WRONGRANGE; - c->wal_fsync_delay = dbl; - } - else if ( cmpNameAtoms( opt->name, _name__wal_dir_rescan_delay) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - double dbl = strtod(opt->paramValue.scalarval, NULL); - if ( (dbl == 0 || dbl == -HUGE_VAL || dbl == HUGE_VAL) && errno == ERANGE) - return CNF_WRONGRANGE; - if (check_rdonly && c->wal_dir_rescan_delay != dbl) - return CNF_RDONLY; - c->wal_dir_rescan_delay = dbl; - } - else if ( cmpNameAtoms( opt->name, _name__panic_on_snap_error) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - bool bln; - - if (strcasecmp(opt->paramValue.scalarval, "true") == 0 || - strcasecmp(opt->paramValue.scalarval, "yes") == 0 || - strcasecmp(opt->paramValue.scalarval, "enable") == 0 || - strcasecmp(opt->paramValue.scalarval, "on") == 0 || - strcasecmp(opt->paramValue.scalarval, "1") == 0 ) - bln = true; - else if (strcasecmp(opt->paramValue.scalarval, "false") == 0 || - strcasecmp(opt->paramValue.scalarval, "no") == 0 || - strcasecmp(opt->paramValue.scalarval, "disable") == 0 || - strcasecmp(opt->paramValue.scalarval, "off") == 0 || - strcasecmp(opt->paramValue.scalarval, "0") == 0 ) - bln = false; - else - return CNF_WRONGRANGE; - if (check_rdonly && c->panic_on_snap_error != bln) - return CNF_RDONLY; - c->panic_on_snap_error = bln; - } - else if ( cmpNameAtoms( opt->name, _name__panic_on_wal_error) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - bool bln; - - if (strcasecmp(opt->paramValue.scalarval, "true") == 0 || - strcasecmp(opt->paramValue.scalarval, "yes") == 0 || - strcasecmp(opt->paramValue.scalarval, "enable") == 0 || - strcasecmp(opt->paramValue.scalarval, "on") == 0 || - strcasecmp(opt->paramValue.scalarval, "1") == 0 ) - bln = true; - else if (strcasecmp(opt->paramValue.scalarval, "false") == 0 || - strcasecmp(opt->paramValue.scalarval, "no") == 0 || - strcasecmp(opt->paramValue.scalarval, "disable") == 0 || - strcasecmp(opt->paramValue.scalarval, "off") == 0 || - strcasecmp(opt->paramValue.scalarval, "0") == 0 ) - bln = false; - else - return CNF_WRONGRANGE; - if (check_rdonly && c->panic_on_wal_error != bln) - return CNF_RDONLY; - c->panic_on_wal_error = bln; - } - else if ( cmpNameAtoms( opt->name, _name__primary_port) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - long int i32 = strtol(opt->paramValue.scalarval, NULL, 10); - if (i32 == 0 && errno == EINVAL) - return CNF_WRONGINT; - if ( (i32 == LONG_MIN || i32 == LONG_MAX) && errno == ERANGE) - return CNF_WRONGRANGE; - if (check_rdonly && c->primary_port != i32) - return CNF_RDONLY; - c->primary_port = i32; - } - else if ( cmpNameAtoms( opt->name, _name__too_long_threshold) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - double dbl = strtod(opt->paramValue.scalarval, NULL); - if ( (dbl == 0 || dbl == -HUGE_VAL || dbl == HUGE_VAL) && errno == ERANGE) - return CNF_WRONGRANGE; - c->too_long_threshold = dbl; - } - else if ( cmpNameAtoms( opt->name, _name__custom_proc_title) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - if (check_rdonly && ( (opt->paramValue.scalarval == NULL && c->custom_proc_title == NULL) || confetti_strcmp(opt->paramValue.scalarval, c->custom_proc_title) != 0)) - return CNF_RDONLY; - if (c->custom_proc_title) free(c->custom_proc_title); - c->custom_proc_title = (opt->paramValue.scalarval) ? strdup(opt->paramValue.scalarval) : NULL; - if (opt->paramValue.scalarval && c->custom_proc_title == NULL) - return CNF_NOMEMORY; - } - else if ( cmpNameAtoms( opt->name, _name__replication_source) ) { - if (opt->paramType != scalarType ) - return CNF_WRONGTYPE; - c->__confetti_flags &= ~CNF_FLAG_STRUCT_NOTSET; - errno = 0; - if (c->replication_source) free(c->replication_source); - c->replication_source = (opt->paramValue.scalarval) ? strdup(opt->paramValue.scalarval) : NULL; - if (opt->paramValue.scalarval && c->replication_source == NULL) - return CNF_NOMEMORY; - } - else { - return opt->optional ? CNF_OPTIONAL : CNF_MISSED; - } - return CNF_OK; -} - -#define PRINTBUFLEN 8192 -static char* -dumpOptDef(NameAtom *atom) { - static char buf[PRINTBUFLEN], *ptr; - int i = 0; - - ptr = buf; - while(atom) { - if (i) ptr += snprintf(ptr, PRINTBUFLEN - 1 - (ptr - buf), "."); - ptr += snprintf(ptr, PRINTBUFLEN - 1 - (ptr - buf), "%s", atom->name); - if (atom->index >= 0) - ptr += snprintf(ptr, PRINTBUFLEN - 1 - (ptr - buf), "[%d]", atom->index); - i = 1; - atom = atom->next; - } - return buf; -} - -static void -acceptCfgDef(tarantool_cfg *c, OptDef *opt, int check_rdonly, int *n_accepted, int *n_skipped, int *n_optional) { - ConfettyError r; - - while(opt) { - r = acceptValue(c, opt, check_rdonly); - switch(r) { - case CNF_OK: - if (n_accepted) (*n_accepted)++; - break; - case CNF_OPTIONAL: - out_warning(r, "Option '%s' is not supported", dumpOptDef(opt->name)); - if (n_optional) (*n_optional)++; - break; - case CNF_MISSED: - out_warning(r, "Could not find '%s' option", dumpOptDef(opt->name)); - if (n_skipped) (*n_skipped)++; - break; - case CNF_WRONGTYPE: - out_warning(r, "Wrong value type for '%s' option", dumpOptDef(opt->name)); - if (n_skipped) (*n_skipped)++; - break; - case CNF_WRONGINDEX: - out_warning(r, "Wrong array index in '%s' option", dumpOptDef(opt->name)); - if (n_skipped) (*n_skipped)++; - break; - case CNF_RDONLY: - out_warning(r, "Could not accept read only '%s' option", dumpOptDef(opt->name)); - if (n_skipped) (*n_skipped)++; - break; - case CNF_WRONGINT: - out_warning(r, "Could not parse integer value for '%s' option", dumpOptDef(opt->name)); - if (n_skipped) (*n_skipped)++; - break; - case CNF_WRONGRANGE: - out_warning(r, "Wrong range for '%s' option", dumpOptDef(opt->name)); - if (n_skipped) (*n_skipped)++; - break; - case CNF_NOMEMORY: - out_warning(r, "Not enough memory to accept '%s' option", dumpOptDef(opt->name)); - if (n_skipped) (*n_skipped)++; - break; - case CNF_NOTSET: - out_warning(r, "Option '%s' is not set (or has a default value)", dumpOptDef(opt->name)); - if (n_skipped) (*n_skipped)++; - break; - default: - out_warning(r, "Unknown error for '%s' option", dumpOptDef(opt->name)); - if (n_skipped) (*n_skipped)++; - break; - } - - opt = opt->next; - } -} - -int -parse_cfg_file_tarantool_cfg(tarantool_cfg *c, FILE *fh, int check_rdonly, int *n_accepted, int *n_skipped, int *n_optional) { - int error; - OptDef *option = parseCfgDef(fh, &error); - if (n_accepted) *n_accepted=0; - if (n_skipped) *n_skipped=0; - if (n_optional) *n_optional=0; - if (option == NULL) - return error ? -1 : 0; - acceptCfgDef(c, option, check_rdonly, n_accepted, n_skipped, n_optional); - freeCfgDef(option); - return 0; -} - -int -parse_cfg_buffer_tarantool_cfg(tarantool_cfg *c, char *buffer, int check_rdonly, int *n_accepted, int *n_skipped, int *n_optional) { - int error; - OptDef *option = parseCfgDefBuffer(buffer, &error); - if (n_accepted) *n_accepted=0; - if (n_skipped) *n_skipped=0; - if (n_optional) *n_optional=0; - if (option == NULL) - return error ? -1 : 0; - acceptCfgDef(c, option, check_rdonly, n_accepted, n_skipped, n_optional); - freeCfgDef(option); - return 0; -} - -/************** Iterator **************/ -typedef enum IteratorState { - _S_Initial = 0, - S_name__username, - S_name__local_hot_standby, - S_name__bind_ipaddr, - S_name__coredump, - S_name__admin_port, - S_name__log_level, - S_name__slab_alloc_arena, - S_name__slab_alloc_minimal, - S_name__slab_alloc_factor, - S_name__work_dir, - S_name__snap_dir, - S_name__wal_dir, - S_name__pid_file, - S_name__logger, - S_name__background, - S_name__logger_nonblock, - S_name__io_collect_interval, - S_name__readahead, - S_name__snap_io_rate_limit, - S_name__rows_per_wal, - S_name__wal_mode, - S_name__wal_fsync_delay, - S_name__wal_dir_rescan_delay, - S_name__panic_on_snap_error, - S_name__panic_on_wal_error, - S_name__primary_port, - S_name__too_long_threshold, - S_name__custom_proc_title, - S_name__replication_source, - _S_Finished -} IteratorState; - -struct tarantool_cfg_iterator_t { - IteratorState state; -}; - -tarantool_cfg_iterator_t* -tarantool_cfg_iterator_init() { - tarantool_cfg_iterator_t *i = malloc(sizeof(*i)); - if (i == NULL) return NULL; - memset(i, 0, sizeof(*i)); - return i; -} - -char* -tarantool_cfg_iterator_next(tarantool_cfg_iterator_t* i, tarantool_cfg *c, char **v) { - static char buf[PRINTBUFLEN]; - - *v = NULL; - goto again; /* keep compiler quiet */ -again: - switch(i->state) { - case _S_Initial: - case S_name__username: - *v = (c->username) ? strdup(c->username) : NULL; - if (*v == NULL && c->username) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - snprintf(buf, PRINTBUFLEN-1, "username"); - i->state = S_name__local_hot_standby; - return buf; - case S_name__local_hot_standby: - *v = malloc(8); - if (*v == NULL) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - sprintf(*v, "%s", c->local_hot_standby ? "true" : "false"); - snprintf(buf, PRINTBUFLEN-1, "local_hot_standby"); - i->state = S_name__bind_ipaddr; - return buf; - case S_name__bind_ipaddr: - *v = (c->bind_ipaddr) ? strdup(c->bind_ipaddr) : NULL; - if (*v == NULL && c->bind_ipaddr) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - snprintf(buf, PRINTBUFLEN-1, "bind_ipaddr"); - i->state = S_name__coredump; - return buf; - case S_name__coredump: - *v = malloc(8); - if (*v == NULL) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - sprintf(*v, "%s", c->coredump ? "true" : "false"); - snprintf(buf, PRINTBUFLEN-1, "coredump"); - i->state = S_name__admin_port; - return buf; - case S_name__admin_port: - *v = malloc(32); - if (*v == NULL) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - sprintf(*v, "%"PRId32, c->admin_port); - snprintf(buf, PRINTBUFLEN-1, "admin_port"); - i->state = S_name__log_level; - return buf; - case S_name__log_level: - *v = malloc(32); - if (*v == NULL) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - sprintf(*v, "%"PRId32, c->log_level); - snprintf(buf, PRINTBUFLEN-1, "log_level"); - i->state = S_name__slab_alloc_arena; - return buf; - case S_name__slab_alloc_arena: - *v = malloc(32); - if (*v == NULL) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - sprintf(*v, "%g", c->slab_alloc_arena); - snprintf(buf, PRINTBUFLEN-1, "slab_alloc_arena"); - i->state = S_name__slab_alloc_minimal; - return buf; - case S_name__slab_alloc_minimal: - *v = malloc(32); - if (*v == NULL) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - sprintf(*v, "%"PRId32, c->slab_alloc_minimal); - snprintf(buf, PRINTBUFLEN-1, "slab_alloc_minimal"); - i->state = S_name__slab_alloc_factor; - return buf; - case S_name__slab_alloc_factor: - *v = malloc(32); - if (*v == NULL) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - sprintf(*v, "%g", c->slab_alloc_factor); - snprintf(buf, PRINTBUFLEN-1, "slab_alloc_factor"); - i->state = S_name__work_dir; - return buf; - case S_name__work_dir: - *v = (c->work_dir) ? strdup(c->work_dir) : NULL; - if (*v == NULL && c->work_dir) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - snprintf(buf, PRINTBUFLEN-1, "work_dir"); - i->state = S_name__snap_dir; - return buf; - case S_name__snap_dir: - *v = (c->snap_dir) ? strdup(c->snap_dir) : NULL; - if (*v == NULL && c->snap_dir) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - snprintf(buf, PRINTBUFLEN-1, "snap_dir"); - i->state = S_name__wal_dir; - return buf; - case S_name__wal_dir: - *v = (c->wal_dir) ? strdup(c->wal_dir) : NULL; - if (*v == NULL && c->wal_dir) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - snprintf(buf, PRINTBUFLEN-1, "wal_dir"); - i->state = S_name__pid_file; - return buf; - case S_name__pid_file: - *v = (c->pid_file) ? strdup(c->pid_file) : NULL; - if (*v == NULL && c->pid_file) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - snprintf(buf, PRINTBUFLEN-1, "pid_file"); - i->state = S_name__logger; - return buf; - case S_name__logger: - *v = (c->logger) ? strdup(c->logger) : NULL; - if (*v == NULL && c->logger) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - snprintf(buf, PRINTBUFLEN-1, "logger"); - i->state = S_name__background; - return buf; - case S_name__background: - *v = malloc(8); - if (*v == NULL) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - sprintf(*v, "%s", c->background ? "true" : "false"); - snprintf(buf, PRINTBUFLEN-1, "background"); - i->state = S_name__logger_nonblock; - return buf; - case S_name__logger_nonblock: - *v = malloc(8); - if (*v == NULL) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - sprintf(*v, "%s", c->logger_nonblock ? "true" : "false"); - snprintf(buf, PRINTBUFLEN-1, "logger_nonblock"); - i->state = S_name__io_collect_interval; - return buf; - case S_name__io_collect_interval: - *v = malloc(32); - if (*v == NULL) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - sprintf(*v, "%g", c->io_collect_interval); - snprintf(buf, PRINTBUFLEN-1, "io_collect_interval"); - i->state = S_name__readahead; - return buf; - case S_name__readahead: - *v = malloc(32); - if (*v == NULL) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - sprintf(*v, "%"PRId32, c->readahead); - snprintf(buf, PRINTBUFLEN-1, "readahead"); - i->state = S_name__snap_io_rate_limit; - return buf; - case S_name__snap_io_rate_limit: - *v = malloc(32); - if (*v == NULL) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - sprintf(*v, "%g", c->snap_io_rate_limit); - snprintf(buf, PRINTBUFLEN-1, "snap_io_rate_limit"); - i->state = S_name__rows_per_wal; - return buf; - case S_name__rows_per_wal: - *v = malloc(32); - if (*v == NULL) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - sprintf(*v, "%"PRId32, c->rows_per_wal); - snprintf(buf, PRINTBUFLEN-1, "rows_per_wal"); - i->state = S_name__wal_mode; - return buf; - case S_name__wal_mode: - *v = (c->wal_mode) ? strdup(c->wal_mode) : NULL; - if (*v == NULL && c->wal_mode) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - snprintf(buf, PRINTBUFLEN-1, "wal_mode"); - i->state = S_name__wal_fsync_delay; - return buf; - case S_name__wal_fsync_delay: - *v = malloc(32); - if (*v == NULL) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - sprintf(*v, "%g", c->wal_fsync_delay); - snprintf(buf, PRINTBUFLEN-1, "wal_fsync_delay"); - i->state = S_name__wal_dir_rescan_delay; - return buf; - case S_name__wal_dir_rescan_delay: - *v = malloc(32); - if (*v == NULL) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - sprintf(*v, "%g", c->wal_dir_rescan_delay); - snprintf(buf, PRINTBUFLEN-1, "wal_dir_rescan_delay"); - i->state = S_name__panic_on_snap_error; - return buf; - case S_name__panic_on_snap_error: - *v = malloc(8); - if (*v == NULL) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - sprintf(*v, "%s", c->panic_on_snap_error ? "true" : "false"); - snprintf(buf, PRINTBUFLEN-1, "panic_on_snap_error"); - i->state = S_name__panic_on_wal_error; - return buf; - case S_name__panic_on_wal_error: - *v = malloc(8); - if (*v == NULL) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - sprintf(*v, "%s", c->panic_on_wal_error ? "true" : "false"); - snprintf(buf, PRINTBUFLEN-1, "panic_on_wal_error"); - i->state = S_name__primary_port; - return buf; - case S_name__primary_port: - *v = malloc(32); - if (*v == NULL) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - sprintf(*v, "%"PRId32, c->primary_port); - snprintf(buf, PRINTBUFLEN-1, "primary_port"); - i->state = S_name__too_long_threshold; - return buf; - case S_name__too_long_threshold: - *v = malloc(32); - if (*v == NULL) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - sprintf(*v, "%g", c->too_long_threshold); - snprintf(buf, PRINTBUFLEN-1, "too_long_threshold"); - i->state = S_name__custom_proc_title; - return buf; - case S_name__custom_proc_title: - *v = (c->custom_proc_title) ? strdup(c->custom_proc_title) : NULL; - if (*v == NULL && c->custom_proc_title) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - snprintf(buf, PRINTBUFLEN-1, "custom_proc_title"); - i->state = S_name__replication_source; - return buf; - case S_name__replication_source: - *v = (c->replication_source) ? strdup(c->replication_source) : NULL; - if (*v == NULL && c->replication_source) { - free(i); - out_warning(CNF_NOMEMORY, "No memory to output value"); - return NULL; - } - snprintf(buf, PRINTBUFLEN-1, "replication_source"); - i->state = _S_Finished; - return buf; - case _S_Finished: - free(i); - break; - default: - out_warning(CNF_INTERNALERROR, "Unknown state for tarantool_cfg_iterator_t: %d", i->state); - free(i); - } - return NULL; -} - -/************** Checking of required fields **************/ -int -check_cfg_tarantool_cfg(tarantool_cfg *c) { - int res = 0; - - return res; -} - -/************** Duplicate config **************/ - -int -dup_tarantool_cfg(tarantool_cfg* dst, tarantool_cfg* src) { - - if (dst->username) free(dst->username);dst->username = src->username == NULL ? NULL : strdup(src->username); - if (src->username != NULL && dst->username == NULL) - return CNF_NOMEMORY; - dst->local_hot_standby = src->local_hot_standby; - if (dst->bind_ipaddr) free(dst->bind_ipaddr);dst->bind_ipaddr = src->bind_ipaddr == NULL ? NULL : strdup(src->bind_ipaddr); - if (src->bind_ipaddr != NULL && dst->bind_ipaddr == NULL) - return CNF_NOMEMORY; - dst->coredump = src->coredump; - dst->admin_port = src->admin_port; - dst->log_level = src->log_level; - dst->slab_alloc_arena = src->slab_alloc_arena; - dst->slab_alloc_minimal = src->slab_alloc_minimal; - dst->slab_alloc_factor = src->slab_alloc_factor; - if (dst->work_dir) free(dst->work_dir);dst->work_dir = src->work_dir == NULL ? NULL : strdup(src->work_dir); - if (src->work_dir != NULL && dst->work_dir == NULL) - return CNF_NOMEMORY; - if (dst->snap_dir) free(dst->snap_dir);dst->snap_dir = src->snap_dir == NULL ? NULL : strdup(src->snap_dir); - if (src->snap_dir != NULL && dst->snap_dir == NULL) - return CNF_NOMEMORY; - if (dst->wal_dir) free(dst->wal_dir);dst->wal_dir = src->wal_dir == NULL ? NULL : strdup(src->wal_dir); - if (src->wal_dir != NULL && dst->wal_dir == NULL) - return CNF_NOMEMORY; - if (dst->pid_file) free(dst->pid_file);dst->pid_file = src->pid_file == NULL ? NULL : strdup(src->pid_file); - if (src->pid_file != NULL && dst->pid_file == NULL) - return CNF_NOMEMORY; - if (dst->logger) free(dst->logger);dst->logger = src->logger == NULL ? NULL : strdup(src->logger); - if (src->logger != NULL && dst->logger == NULL) - return CNF_NOMEMORY; - dst->background = src->background; - dst->logger_nonblock = src->logger_nonblock; - dst->io_collect_interval = src->io_collect_interval; - dst->readahead = src->readahead; - dst->snap_io_rate_limit = src->snap_io_rate_limit; - dst->rows_per_wal = src->rows_per_wal; - if (dst->wal_mode) free(dst->wal_mode);dst->wal_mode = src->wal_mode == NULL ? NULL : strdup(src->wal_mode); - if (src->wal_mode != NULL && dst->wal_mode == NULL) - return CNF_NOMEMORY; - dst->wal_fsync_delay = src->wal_fsync_delay; - dst->wal_dir_rescan_delay = src->wal_dir_rescan_delay; - dst->panic_on_snap_error = src->panic_on_snap_error; - dst->panic_on_wal_error = src->panic_on_wal_error; - dst->primary_port = src->primary_port; - dst->too_long_threshold = src->too_long_threshold; - if (dst->custom_proc_title) free(dst->custom_proc_title);dst->custom_proc_title = src->custom_proc_title == NULL ? NULL : strdup(src->custom_proc_title); - if (src->custom_proc_title != NULL && dst->custom_proc_title == NULL) - return CNF_NOMEMORY; - if (dst->replication_source) free(dst->replication_source);dst->replication_source = src->replication_source == NULL ? NULL : strdup(src->replication_source); - if (src->replication_source != NULL && dst->replication_source == NULL) - return CNF_NOMEMORY; - - return CNF_OK; -} - -/************** Destroy config **************/ - -void -destroy_tarantool_cfg(tarantool_cfg* c) { - - if (c->username != NULL) - free(c->username); - if (c->bind_ipaddr != NULL) - free(c->bind_ipaddr); - if (c->work_dir != NULL) - free(c->work_dir); - if (c->snap_dir != NULL) - free(c->snap_dir); - if (c->wal_dir != NULL) - free(c->wal_dir); - if (c->pid_file != NULL) - free(c->pid_file); - if (c->logger != NULL) - free(c->logger); - if (c->wal_mode != NULL) - free(c->wal_mode); - if (c->custom_proc_title != NULL) - free(c->custom_proc_title); - if (c->replication_source != NULL) - free(c->replication_source); -} - -/************** Compare config **************/ - -int -confetti_strcmp(char *s1, char *s2) { - if (s1 == NULL || s2 == NULL) { - if (s1 != s2) - return s1 == NULL ? -1 : 1; - else - return 0; - } - - return strcmp(s1, s2); -} - -char * -cmp_tarantool_cfg(tarantool_cfg* c1, tarantool_cfg* c2, int only_check_rdonly) { - static char diff[PRINTBUFLEN]; - - if (confetti_strcmp(c1->username, c2->username) != 0) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->username"); - - return diff; -} - if (c1->local_hot_standby != c2->local_hot_standby) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->local_hot_standby"); - - return diff; - } - if (confetti_strcmp(c1->bind_ipaddr, c2->bind_ipaddr) != 0) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->bind_ipaddr"); - - return diff; -} - if (c1->coredump != c2->coredump) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->coredump"); - - return diff; - } - if (c1->admin_port != c2->admin_port) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->admin_port"); - - return diff; - } - if (!only_check_rdonly) { - if (c1->log_level != c2->log_level) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->log_level"); - - return diff; - } - } - if (c1->slab_alloc_arena != c2->slab_alloc_arena) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->slab_alloc_arena"); - - return diff; - } - if (c1->slab_alloc_minimal != c2->slab_alloc_minimal) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->slab_alloc_minimal"); - - return diff; - } - if (c1->slab_alloc_factor != c2->slab_alloc_factor) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->slab_alloc_factor"); - - return diff; - } - if (confetti_strcmp(c1->work_dir, c2->work_dir) != 0) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->work_dir"); - - return diff; -} - if (confetti_strcmp(c1->snap_dir, c2->snap_dir) != 0) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->snap_dir"); - - return diff; -} - if (confetti_strcmp(c1->wal_dir, c2->wal_dir) != 0) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->wal_dir"); - - return diff; -} - if (confetti_strcmp(c1->pid_file, c2->pid_file) != 0) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->pid_file"); - - return diff; -} - if (confetti_strcmp(c1->logger, c2->logger) != 0) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->logger"); - - return diff; -} - if (c1->background != c2->background) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->background"); - - return diff; - } - if (c1->logger_nonblock != c2->logger_nonblock) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->logger_nonblock"); - - return diff; - } - if (!only_check_rdonly) { - if (c1->io_collect_interval != c2->io_collect_interval) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->io_collect_interval"); - - return diff; - } - } - if (!only_check_rdonly) { - if (c1->readahead != c2->readahead) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->readahead"); - - return diff; - } - } - if (!only_check_rdonly) { - if (c1->snap_io_rate_limit != c2->snap_io_rate_limit) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->snap_io_rate_limit"); - - return diff; - } - } - if (c1->rows_per_wal != c2->rows_per_wal) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->rows_per_wal"); - - return diff; - } - if (!only_check_rdonly) { - if (confetti_strcmp(c1->wal_mode, c2->wal_mode) != 0) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->wal_mode"); - - return diff; -} - } - if (!only_check_rdonly) { - if (c1->wal_fsync_delay != c2->wal_fsync_delay) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->wal_fsync_delay"); - - return diff; - } - } - if (c1->wal_dir_rescan_delay != c2->wal_dir_rescan_delay) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->wal_dir_rescan_delay"); - - return diff; - } - if (c1->panic_on_snap_error != c2->panic_on_snap_error) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->panic_on_snap_error"); - - return diff; - } - if (c1->panic_on_wal_error != c2->panic_on_wal_error) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->panic_on_wal_error"); - - return diff; - } - if (c1->primary_port != c2->primary_port) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->primary_port"); - - return diff; - } - if (!only_check_rdonly) { - if (c1->too_long_threshold != c2->too_long_threshold) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->too_long_threshold"); - - return diff; - } - } - if (confetti_strcmp(c1->custom_proc_title, c2->custom_proc_title) != 0) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->custom_proc_title"); - - return diff; -} - if (!only_check_rdonly) { - if (confetti_strcmp(c1->replication_source, c2->replication_source) != 0) { - snprintf(diff, PRINTBUFLEN - 1, "%s", "c->replication_source"); - - return diff; -} - } - - return 0; -} - diff --git a/cfg/tarantool_box_cfg.h b/cfg/tarantool_box_cfg.h deleted file mode 100644 index c4fc1cacdc4d87246df9287f763ca685cee0eaf2..0000000000000000000000000000000000000000 --- a/cfg/tarantool_box_cfg.h +++ /dev/null @@ -1,187 +0,0 @@ -#ifndef tarantool_cfg_CFG_H -#define tarantool_cfg_CFG_H - -#include <stdio.h> -#include <stdbool.h> -#include <sys/types.h> - -#ifndef confetti_bool_t -#define confetti_bool_t char -#endif - -/* - * Autogenerated file, do not edit it! - */ - -typedef struct tarantool_cfg { - unsigned char __confetti_flags; - - - /* username to switch to */ - char* username; - - /* - * Local hot standby (if enabled, the server will run in hot - * standby mode, continuously fetching WAL records from wal_dir, - * until it is able to bind to the primary port. - * In local hot standby mode the server only accepts reads. - */ - confetti_bool_t local_hot_standby; - - /* - * tarantool bind ip address, applies to primary port. - * INADDR_ANY is the default value. - */ - char* bind_ipaddr; - - /* - * save core on abort/assert - * deprecated; use ulimit instead - */ - confetti_bool_t coredump; - - /* - * admin port - * used for admin's connections - */ - int32_t admin_port; - - /* Log verbosity, possible values: SYS_ERROR = 1, ERROR=2, CRIT=3, WARN=4, INFO=5(default), DEBUG=6 */ - int32_t log_level; - - /* Size of slab arena in GB */ - double slab_alloc_arena; - - /* Size of minimal allocation unit */ - int32_t slab_alloc_minimal; - - /* Growth factor, each subsequent unit size is factor * prev unit size */ - double slab_alloc_factor; - - /* working directory (daemon will chdir(2) to it) */ - char* work_dir; - - /* Snapshot directory (where snapshots get saved/read) */ - char* snap_dir; - - /* WAL directory (where WALs get saved/read) */ - char* wal_dir; - - /* name of pid file */ - char* pid_file; - - /* - * logger command will be executed via /bin/sh -c {} - * example: 'exec cronolog /var/log/tarantool/%Y-%m/%Y-%m-%d/tarantool.log' - * example: 'exec extra/logger.pl /var/log/tarantool/tarantool.log' - * when logger is not configured all logging going to STDERR - */ - char* logger; - - /* daemonize or not */ - confetti_bool_t background; - - /* make logging nonblocking, this potentially can lose some logging data */ - confetti_bool_t logger_nonblock; - - /* delay between loop iterations */ - double io_collect_interval; - - /* network io readahead */ - int32_t readahead; - - /* Do not write into snapshot faster than snap_io_rate_limit MB/sec */ - double snap_io_rate_limit; - - /* Write no more rows in WAL */ - int32_t rows_per_wal; - - /* - * Defines fiber/data synchronization fsync(2) policy: - * "none": does not write to WAL - * "write": fibers wait for their data to be written to the log. - * "fsync": fibers wait for their data, fsync(2) follows each write(2) - * "fsync_delay": fibers wait for their data, fsync every N=wal_fsync_delay seconds, - * N=0.0 means no fsync (equivalent to wal_mode = "write"); - */ - char* wal_mode; - - /* - * Fsync WAL delay, only issue fsync if last fsync was wal_fsync_delay - * seconds ago. - * WARNING: actually, several last requests may stall fsync for much longer - */ - double wal_fsync_delay; - - /* - * Delay, in seconds, between successive re-readings of wal_dir. - * The re-scan is necessary to discover new WAL files or snapshots. - */ - double wal_dir_rescan_delay; - - /* - * Panic if there is an error reading a snapshot or WAL. - * By default, panic on any snapshot reading error and ignore errors - * when reading WALs. - */ - confetti_bool_t panic_on_snap_error; - confetti_bool_t panic_on_wal_error; - - /* - * # BOX - * Primary port (where updates are accepted) - */ - int32_t primary_port; - - /* Warn about requests which take longer to process, in seconds. */ - double too_long_threshold; - - /* - * A custom process list (ps) title string, appended after the standard - * program title. - */ - char* custom_proc_title; - - /* - * Replication mode (if enabled, the server, once - * bound to the primary port, will connect to - * replication_source (ipaddr:port) and run continously - * fetching records from it.. In replication mode the server - * only accepts reads. - */ - char* replication_source; -} tarantool_cfg; - -#ifndef CNF_FLAG_STRUCT_NEW -#define CNF_FLAG_STRUCT_NEW 0x01 -#endif -#ifndef CNF_FLAG_STRUCT_NOTSET -#define CNF_FLAG_STRUCT_NOTSET 0x02 -#endif -#ifndef CNF_STRUCT_DEFINED -#define CNF_STRUCT_DEFINED(s) ((s) != NULL && ((s)->__confetti_flags & CNF_FLAG_STRUCT_NOTSET) == 0) -#endif - -void init_tarantool_cfg(tarantool_cfg *c); - -int fill_default_tarantool_cfg(tarantool_cfg *c); - -void swap_tarantool_cfg(struct tarantool_cfg *c1, struct tarantool_cfg *c2); - -int parse_cfg_file_tarantool_cfg(tarantool_cfg *c, FILE *fh, int check_rdonly, int *n_accepted, int *n_skipped, int *n_optional); - -int parse_cfg_buffer_tarantool_cfg(tarantool_cfg *c, char *buffer, int check_rdonly, int *n_accepted, int *n_skipped, int *n_optional); - -int check_cfg_tarantool_cfg(tarantool_cfg *c); - -int dup_tarantool_cfg(tarantool_cfg *dst, tarantool_cfg *src); - -void destroy_tarantool_cfg(tarantool_cfg *c); - -char *cmp_tarantool_cfg(tarantool_cfg* c1, tarantool_cfg* c2, int only_check_rdonly); - -typedef struct tarantool_cfg_iterator_t tarantool_cfg_iterator_t; -tarantool_cfg_iterator_t* tarantool_cfg_iterator_init(); -char* tarantool_cfg_iterator_next(tarantool_cfg_iterator_t* i, tarantool_cfg *c, char **v); - -#endif diff --git a/cfg/warning.c b/cfg/warning.c deleted file mode 100644 index c2a9ecd24ef1d1831ad7b305e4ee6559a7a06d5d..0000000000000000000000000000000000000000 --- a/cfg/warning.c +++ /dev/null @@ -1,26 +0,0 @@ -#include "warning.h" - -#include <stdio.h> - -#include <stdarg.h> - -FILE *cfg_out; -char *cfg_log; -size_t cfg_logsize; - -/** This is a callback function used by the generated - * configuration file parser (tarantool_{box, feeder, ...}_cfg.c) - * to complain when something wrong happens. - */ -void -out_warning(ConfettyError v, const char *format, ...) -{ - va_list ap; - - (void)v; /* make gcc happy */ - va_start(ap, format); - vfprintf(cfg_out, format, ap); - fprintf(cfg_out, ".\n"); - fflush(cfg_out); - va_end(ap); -} diff --git a/cfg/warning.h b/cfg/warning.h deleted file mode 100644 index d41252a984065c789295f8092bd9fa9e5da10624..0000000000000000000000000000000000000000 --- a/cfg/warning.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef TARANTOOL_WARNING_H -#define TARANTOOL_WARNING_H - -#include "prscfg.h" - -/** Begin logging - must be called before load_cfg() . */ -extern FILE *cfg_out; -extern char *cfg_log; -extern size_t cfg_logsize; - -void out_warning(ConfettyError r, const char *format, ...); - -#endif diff --git a/debian/etc/example.cfg b/debian/etc/example.cfg deleted file mode 100644 index 2c1dd18de7d148df414927a1755d0b2417dc1689..0000000000000000000000000000000000000000 --- a/debian/etc/example.cfg +++ /dev/null @@ -1,46 +0,0 @@ -# -# Limit of memory used to store tuples to 100MB -# (0.1 GB) -# This effectively limits the memory, used by -# Tarantool. However, index and connection memory -# is stored outside the slab allocator, hence -# the effective memory usage can be higher (sometimes -# twice as high). -# -slab_alloc_arena = 0.1 - -# -# Read only and read-write port. -primary_port = 3301 - -# ************* Debian option *********************** -# count of file descriptors -# -opt file_descriptors = 8192 -# *************************************************** - -# ************* Debian option *********************** -# Count of snapshots to save (default = 10). COUNT=0 -# disables removing -# -opt save_snapshots = 10 -# *************************************************** - - -# ************* Debian option *********************** -# Snapshot creating period (hours), (default = 24) -# -opt snapshot_period = 12 -# *************************************************** - -# -# The port for administrative commands. -# -admin_port = 3313 - -# -# Each write ahead log contains this many rows. -# When the limit is reached, Tarantool closes -# the WAL and starts a new one. -rows_per_wal = 50000 - diff --git a/doc/developer/developer.xml b/doc/developer/developer.xml index be6c8102d0672ca7dd0be7f1ed80b19417246e43..3d8797afd6bde03dac4429a7041b2eaa09d8b04b 100644 --- a/doc/developer/developer.xml +++ b/doc/developer/developer.xml @@ -23,32 +23,6 @@ </preface> <chapter> <title>Compiling</title> -<section> -<title>How to fix a compile time error about missing confetti</title> -<para> - An error about missing confetti: -<programlisting> -Generating prscfg.h, prscfg.c... -[ 13%] Generating prscfg.h, prscfg.c -/bin/sh: CONFETTI-NOTFOUND: not found -</programlisting> -This error is caused by cmake, trying to re-create generated files -prscfg.h, prscfg.c in <filename>cfg/</filename> directory. -These files are under revision control and normally need not to be -regenerated. -The fix is to -<programlisting> -<prompt>$ </prompt>git checkout cfg/prscfg.h -<prompt>$ </prompt>git checkout cfg/prscfg.c -<prompt>$ </prompt>touch cfg/prscfg.[hc] -</programlisting> -The other alternative, if you have actually modified -<filename>core_cfg.cfg_tmpl</filename> is to install confetti from -<link xlink:href="http://github.com/mailru/confetti"/> and let cmake use it. - - </para> -</section> - <section> <title>How to build the XML manual</title> <para> diff --git a/extra/rpm.spec.in b/extra/rpm.spec.in index 47bedf6678a9bf4a5e1c31f1d5dc4c7f808c0231..596b81b777b00c0d3a139a7c1ca5fd42c697ee62 100644 --- a/extra/rpm.spec.in +++ b/extra/rpm.spec.in @@ -169,7 +169,6 @@ useradd -r -g tarantool tarantool > /dev/null 2>&1 "/etc/init.d/tarantool_box" %dir "%{_sysconfdir}/tarantool" -%config(noreplace) "%{_sysconfdir}/tarantool/tarantool.cfg" %files sql-module %defattr(-,root,root,-) diff --git a/test/big/tarantool.cfg b/test/big/tarantool.cfg deleted file mode 100644 index 0928ece87bc576df37df4d8792a909729a7d0816..0000000000000000000000000000000000000000 --- a/test/big/tarantool.cfg +++ /dev/null @@ -1,11 +0,0 @@ -slab_alloc_arena = 0.1 - -pid_file = "box.pid" - -logger="cat - >> tarantool.log" - -primary_port = 3301 -admin_port = 3313 - -rows_per_wal = 50 - diff --git a/test/box/bug726778.cfg b/test/box/bug726778.cfg deleted file mode 100644 index 5a37830c80b50e62b1f106d2953c3eb2b5c23a3b..0000000000000000000000000000000000000000 --- a/test/box/bug726778.cfg +++ /dev/null @@ -1,17 +0,0 @@ -# -# Used in args.test -# -slab_alloc_arena = 0.1 - -pid_file = "box.pid" - -work_dir = "bug726778" -snap_dir = "snapshots" -wal_dir = "xlogs" - -logger="cat - >> tarantool.log" - -primary_port = 3301 -admin_port = 3313 - -rows_per_wal = 50 diff --git a/test/box/panic_on_wal_error.cfg b/test/box/panic_on_wal_error.cfg deleted file mode 100644 index ee68c9196e64946370b275f00e8dbd246fca48c4..0000000000000000000000000000000000000000 --- a/test/box/panic_on_wal_error.cfg +++ /dev/null @@ -1,36 +0,0 @@ -# -# Limit of memory used to store tuples to 100MB -# (0.1 GB) -# This effectively limits the memory, used by -# Tarantool. However, index and connection memory -# is stored outside the slab allocator, hence -# the effective memory usage can be higher (sometimes -# twice as high). -# -slab_alloc_arena = 0.1 - -# -# Store the pid in this file. Relative to -# startup dir. -# -pid_file = "box.pid" - -# -# Pipe the logs into the following process. -# -logger="cat - >> tarantool.log" - -# -# Read only and read-write port. -primary_port = 3301 -# -# The port for administrative commands. -# -admin_port = 3313 -# -# Each write ahead log contains this many rows. -# When the limit is reached, Tarantool closes -# the WAL and starts a new one. -rows_per_wal = 50 -panic_on_wal_error = false - diff --git a/test/box/snap_io_rate_limit.cfg b/test/box/snap_io_rate_limit.cfg deleted file mode 100644 index e26b5054e8fe1466c55f2e7ed7e94f00bede49ba..0000000000000000000000000000000000000000 --- a/test/box/snap_io_rate_limit.cfg +++ /dev/null @@ -1,17 +0,0 @@ -# gh-45: snap_io_rate_limit was not taken into account if -# no other option has changed -slab_alloc_arena = 0.1 - -pid_file = "box.pid" - -logger="cat - >> tarantool.log" - -primary_port = 3301 -admin_port = 3313 - -rows_per_wal = 50 -too_long_threshold=2 -# 1MBps -snap_io_rate_limit = 1 -io_collect_interval = 0.01 - diff --git a/test/box/tarantool.cfg b/test/box/tarantool.cfg deleted file mode 100644 index 66a06d4ec41d47846616726553db4413914b6ee3..0000000000000000000000000000000000000000 --- a/test/box/tarantool.cfg +++ /dev/null @@ -1,34 +0,0 @@ -# -# Limit of memory used to store tuples to 100MB -# (0.1 GB) -# This effectively limits the memory, used by -# Tarantool. However, index and connection memory -# is stored outside the slab allocator, hence -# the effective memory usage can be higher (sometimes -# twice as high). -# -slab_alloc_arena = 0.1 - -# -# Store the pid in this file. Relative to -# startup dir. -# -pid_file = "box.pid" - -# -# Pipe the logs into the following process. -# -logger="cat - >> tarantool.log" - -# -# Read only and read-write port. -primary_port = 3301 -# -# The port for administrative commands. -# -admin_port = 3313 -# -# Each write ahead log contains this many rows. -# When the limit is reached, Tarantool closes -# the WAL and starts a new one. -rows_per_wal = 50 diff --git a/test/box/tarantool_bad1.cfg b/test/box/tarantool_bad1.cfg deleted file mode 100644 index 131ccfff10786c0139403f76b8f838c7fd9b1761..0000000000000000000000000000000000000000 --- a/test/box/tarantool_bad1.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# bad - change of slab alloc arena on the fly -slab_alloc_arena = 0.2 - -pid_file = "/var/run/box.pid" - -logger="cat tarantool.log" - -primary_port = 33023 -admin_port = 33025 - -rows_per_wal = 500 - diff --git a/test/box/tarantool_bug750658.cfg b/test/box/tarantool_bug750658.cfg deleted file mode 100644 index f58b53bf2da3352724295962056e0b5760cbe5a1..0000000000000000000000000000000000000000 --- a/test/box/tarantool_bug750658.cfg +++ /dev/null @@ -1,31 +0,0 @@ -# -# Limit of memory used to store tuples to 100MB -# (0.1 GB) -# This effectively limits the memory, used by -# Tarantool. However, index and connection memory -# is stored outside the slab allocator, hence -# the effective memory usage can be higher (sometimes -# twice as high). -# -slab_alloc_arena = 0.1 - -# -# Store the pid in this file. Relative to -# startup dir. -# -pid_file = "box.pid" - -# -# Read only and read-write port. -primary_port = 3301 -# -# The port for administrative commands. -# -admin_port = 3313 -# -# Each write ahead log contains this many rows. -# When the limit is reached, Tarantool closes -# the WAL and starts a new one. -rows_per_wal = 50 - -background = true diff --git a/test/box/tarantool_bug876541.cfg b/test/box/tarantool_bug876541.cfg deleted file mode 100644 index f9bf9cade0e76273fdfcc9fc11923c08f79b81bc..0000000000000000000000000000000000000000 --- a/test/box/tarantool_bug876541.cfg +++ /dev/null @@ -1,13 +0,0 @@ -slab_alloc_arena = 0.1 - -pid_file = "box.pid" - -logger="cat - >> tarantool.log" - -primary_port = 3301 -admin_port = 3313 - -rows_per_wal = 50 - - -wal_fsync_delay = 0.01 diff --git a/test/box/tarantool_bug_gh-99.cfg b/test/box/tarantool_bug_gh-99.cfg deleted file mode 100644 index 93f140e80498b3b10db6485f9368d980c8e22c59..0000000000000000000000000000000000000000 --- a/test/box/tarantool_bug_gh-99.cfg +++ /dev/null @@ -1,11 +0,0 @@ -slab_alloc_arena = 100500.0 - -pid_file = "box.pid" - -logger="cat - >> tarantool.log" - -primary_port = 3301 -admin_port = 3313 - -rows_per_wal = 50 - diff --git a/test/box/tarantool_bug_gh100.cfg b/test/box/tarantool_bug_gh100.cfg deleted file mode 100644 index 2b6e6742b1d5a89a9fc53c085617b822c19dec42..0000000000000000000000000000000000000000 --- a/test/box/tarantool_bug_gh100.cfg +++ /dev/null @@ -1,11 +0,0 @@ -slab_alloc_arena = 0.1 - -pid_file = "box.pid" - -logger="cat - >> tarantool.log" - -primary_port = 3301 -admin_port = 3313 - -# Invalid value -rows_per_wal = 0 diff --git a/test/box/tarantool_empty.cfg b/test/box/tarantool_empty.cfg deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/test/box/tarantool_good.cfg b/test/box/tarantool_good.cfg deleted file mode 100644 index 31118a9eb638e7475cf103bb88cfce55c6478c44..0000000000000000000000000000000000000000 --- a/test/box/tarantool_good.cfg +++ /dev/null @@ -1,15 +0,0 @@ -slab_alloc_arena = 0.1 - -pid_file = "box.pid" - -logger="cat - >> tarantool.log" - -primary_port = 3301 -admin_port = 3313 - -rows_per_wal = 50 -# These are modifiable settings, change them. -too_long_threshold=2 -snap_io_rate_limit = 10 -io_collect_interval = 0.01 - diff --git a/test/box/tarantool_with_cpt.cfg b/test/box/tarantool_with_cpt.cfg deleted file mode 100644 index eb5ac706990490b914534e6a5d3088ca808e253c..0000000000000000000000000000000000000000 --- a/test/box/tarantool_with_cpt.cfg +++ /dev/null @@ -1,17 +0,0 @@ -# This config contains custom_proc_title option -custom_proc_title = "custom_proc_title" -slab_alloc_arena = 0.1 - -pid_file = "box.pid" - -logger="cat - >> tarantool.log" - -primary_port = 3301 -admin_port = 3313 - -rows_per_wal = 50 -# These are modifiable settings, change them. -too_long_threshold=2 -snap_io_rate_limit = 10 -io_collect_interval = 0.01 - diff --git a/test/box/tarantool_wo_cpt.cfg b/test/box/tarantool_wo_cpt.cfg deleted file mode 100644 index dd089b992037868661d44d1e79b496f4fcc93d78..0000000000000000000000000000000000000000 --- a/test/box/tarantool_wo_cpt.cfg +++ /dev/null @@ -1,16 +0,0 @@ -# This config does not contain custom_proc_title option -slab_alloc_arena = 0.1 - -pid_file = "box.pid" - -logger="cat - >> tarantool.log" - -primary_port = 3301 -admin_port = 3313 - -rows_per_wal = 50 -# These are modifiable settings, change them. -too_long_threshold=2 -snap_io_rate_limit = 10 -io_collect_interval = 0.01 - diff --git a/test/module/tarantool.cfg b/test/module/tarantool.cfg deleted file mode 100644 index 66a06d4ec41d47846616726553db4413914b6ee3..0000000000000000000000000000000000000000 --- a/test/module/tarantool.cfg +++ /dev/null @@ -1,34 +0,0 @@ -# -# Limit of memory used to store tuples to 100MB -# (0.1 GB) -# This effectively limits the memory, used by -# Tarantool. However, index and connection memory -# is stored outside the slab allocator, hence -# the effective memory usage can be higher (sometimes -# twice as high). -# -slab_alloc_arena = 0.1 - -# -# Store the pid in this file. Relative to -# startup dir. -# -pid_file = "box.pid" - -# -# Pipe the logs into the following process. -# -logger="cat - >> tarantool.log" - -# -# Read only and read-write port. -primary_port = 3301 -# -# The port for administrative commands. -# -admin_port = 3313 -# -# Each write ahead log contains this many rows. -# When the limit is reached, Tarantool closes -# the WAL and starts a new one. -rows_per_wal = 50 diff --git a/test/replication/cfg/hot_standby.cfg b/test/replication/cfg/hot_standby.cfg deleted file mode 100644 index da870ca32b63be59beb5ce5bb4b9aae6ee999a39..0000000000000000000000000000000000000000 --- a/test/replication/cfg/hot_standby.cfg +++ /dev/null @@ -1,13 +0,0 @@ -slab_alloc_arena = 0.1 - -pid_file = "tarantool.pid" -logger="cat - >> tarantool.log" -bind_ipaddr="INADDR_ANY" -custom_proc_title="hot_standby" -local_hot_standby=true - -wal_dir="../" -snap_dir="../" - -primary_port = 3301 -admin_port = 33025 diff --git a/test/replication/cfg/master.cfg b/test/replication/cfg/master.cfg deleted file mode 100644 index 68248d0be28252ae11a005db66ae34ce191d965b..0000000000000000000000000000000000000000 --- a/test/replication/cfg/master.cfg +++ /dev/null @@ -1,9 +0,0 @@ -slab_alloc_arena = 0.1 - -pid_file = "tarantool.pid" -logger="cat - >> tarantool.log" -bind_ipaddr="INADDR_ANY" -custom_proc_title="master" - -primary_port = 3301 -admin_port = 3313 diff --git a/test/replication/cfg/master_to_replica.cfg b/test/replication/cfg/master_to_replica.cfg deleted file mode 100644 index 8df6e064e76ed7bf3221a8bd561cde22e3ed3840..0000000000000000000000000000000000000000 --- a/test/replication/cfg/master_to_replica.cfg +++ /dev/null @@ -1,11 +0,0 @@ -slab_alloc_arena = 0.1 - -pid_file = "tarantool.pid" -logger="cat - >> tarantool.log" -bind_ipaddr="INADDR_ANY" -custom_proc_title="master" - -primary_port = 3301 -admin_port = 3313 - -replication_source = "127.0.0.1:33113" diff --git a/test/replication/cfg/replica.cfg b/test/replication/cfg/replica.cfg deleted file mode 100644 index dc670c1a25a655c8855a866042d302e3a4ffe670..0000000000000000000000000000000000000000 --- a/test/replication/cfg/replica.cfg +++ /dev/null @@ -1,11 +0,0 @@ -slab_alloc_arena = 0.1 - -pid_file = "tarantool.pid" -logger="cat - >> tarantool.log" -bind_ipaddr="INADDR_ANY" -custom_proc_title="replica" - -primary_port = 33113 -admin_port = 33115 - -replication_source = 127.0.0.1:3301 diff --git a/test/replication/cfg/replica_to_master.cfg b/test/replication/cfg/replica_to_master.cfg deleted file mode 100644 index 5fb59c15565ba8bd0a5d9221a47a04e62d92baf3..0000000000000000000000000000000000000000 --- a/test/replication/cfg/replica_to_master.cfg +++ /dev/null @@ -1,9 +0,0 @@ -slab_alloc_arena = 0.1 - -pid_file = "tarantool.pid" -logger="cat - >> tarantool.log" -bind_ipaddr="INADDR_ANY" -custom_proc_title="replica" - -primary_port = 33113 -admin_port = 33115 diff --git a/test/share/tarantool.cfg b/test/share/tarantool.cfg deleted file mode 100644 index ed55fbe61e5c68fdae275e129794507274d226f4..0000000000000000000000000000000000000000 --- a/test/share/tarantool.cfg +++ /dev/null @@ -1,32 +0,0 @@ -# -# Limit of memory used to store tuples to 100MB -# (0.1 GB) -# This effectively limits the memory, used by -# Tarantool. However, index and connection memory -# is stored outside the slab allocator, hence -# the effective memory usage can be higher (sometimes -# twice as high). -slab_alloc_arena = 0.1 - -# -# Store the pid in this file. Relative to -# startup dir. -pid_file = "box.pid" - -# -# Pipe the logs into the following process. -logger="cat - >> tarantool.log" - -# -# Read only and read-write port. -primary_port = 3301 - -# -# The port for administrative commands. -admin_port = 3313 - -# -# Each write ahead log contains this many rows. -# When the limit is reached, Tarantool closes -# the WAL and starts a new one. -rows_per_wal = 50000 diff --git a/test/share/tarantool_dmg.cfg b/test/share/tarantool_dmg.cfg deleted file mode 100644 index fa0809333ee794a055ce978432e5b86a79d7bdaa..0000000000000000000000000000000000000000 --- a/test/share/tarantool_dmg.cfg +++ /dev/null @@ -1,31 +0,0 @@ -# -# Limit of memory used to store tuples to 100MB -# (0.1 GB) -# This effectively limits the memory, used by -# Tarantool. However, index and connection memory -# is stored outside the slab allocator, hence -# the effective memory usage can be higher (sometimes -# twice as high). -slab_alloc_arena = 0.1 - -# -# Store the pid in this file. Relative to -# startup dir. -pid_file = "/var/run/box.pid" - -# -# Read only and read-write port. -primary_port = 3301 - -# -# The port for administrative commands. -admin_port = 3313 - -# -# Each write ahead log contains this many rows. -# When the limit is reached, Tarantool closes -# the WAL and starts a new one. -rows_per_wal = 50000 -# -# working directory (daemon will chdir(2) to it) -work_dir = "var/lib/tarantool" diff --git a/test/share/tarantool_rpm.cfg b/test/share/tarantool_rpm.cfg deleted file mode 100644 index 7aee2fb142c9ea3f43632aeaac6c70306d6473a1..0000000000000000000000000000000000000000 --- a/test/share/tarantool_rpm.cfg +++ /dev/null @@ -1,29 +0,0 @@ -# -# Limit of memory used to store tuples to 100MB -# (0.1 GB) -# This effectively limits the memory, used by -# Tarantool. However, index and connection memory -# is stored outside the slab allocator, hence -# the effective memory usage can be higher (sometimes -# twice as high). -slab_alloc_arena = 0.1 - -# -# Store the pid in this file. Relative to -# startup dir. -# (Should not be changed in rpm deployment) -pid_file = "box.pid" - -# -# Read only and read-write port. -primary_port = 3301 - -# -# The port for administrative commands. -admin_port = 3313 - -# -# Each write ahead log contains this many rows. -# When the limit is reached, Tarantool closes -# the WAL and starts a new one. -rows_per_wal = 50000 diff --git a/test/share/tarantool_tgz.cfg b/test/share/tarantool_tgz.cfg deleted file mode 100644 index 8162a64deba1d1748aa46bd72452855ebf8a4e8b..0000000000000000000000000000000000000000 --- a/test/share/tarantool_tgz.cfg +++ /dev/null @@ -1,35 +0,0 @@ -# -# Limit of memory used to store tuples to 100MB -# (0.1 GB) -# This effectively limits the memory, used by -# Tarantool. However, index and connection memory -# is stored outside the slab allocator, hence -# the effective memory usage can be higher (sometimes -# twice as high). -slab_alloc_arena = 0.1 - -# -# Store the pid in this file. Relative to -# startup dir. -pid_file = "box.pid" - -# -# Pipe all the logs to the console -#logger="" - -# -# Read only and read-write port. -primary_port = 3301 - -# -# The port for administrative commands. -admin_port = 3313 - -# -# Each write ahead log contains this many rows. -# When the limit is reached, Tarantool closes -# the WAL and starts a new one. -rows_per_wal = 50000 - -# working directory (daemon will chdir(2) to it) -work_dir = "var/lib/tarantool" diff --git a/test/wal/tarantool.cfg b/test/wal/tarantool.cfg deleted file mode 100644 index 3c731f6f5468511e6bdbc009e6f454540d06711d..0000000000000000000000000000000000000000 --- a/test/wal/tarantool.cfg +++ /dev/null @@ -1,29 +0,0 @@ -# -# Limit of memory used to store tuples to 100MB -# (0.1 GB) -# This effectively limits the memory, used by -# Tarantool. However, index and connection memory -# is stored outside the slab allocator, hence -# the effective memory usage can be higher (sometimes -# twice as high). -# -slab_alloc_arena = 0.1 - -# -# Store the pid in this file. Relative to -# startup dir. -# -pid_file = "box.pid" - -# -# Pipe the logs into the following process. -# -logger="cat - >> tarantool.log" - -# -# Read only and read-write port. -primary_port = 3301 -# The port for administrative commands. -admin_port = 3313 -wal_mode = none -