open_null_file: 30| 1|{ 31| 1| FILE *dev_null = fopen("/dev/null", "w"); 32| | 33| 1| if (dev_null == NULL) ------------------ | Branch (33:9): [True: 0, False: 1] ------------------ 34| 0| { 35| 0| abort(); 36| 0| } 37| | 38| 1| return dev_null; 39| 1|} find_setting_recursive: 46| 35.2k|{ 47| 35.2k| if (NULL == setting || NULL == name) ------------------ | Branch (47:9): [True: 0, False: 35.2k] | Branch (47:28): [True: 0, False: 35.2k] ------------------ 48| 0| { 49| 0| return NULL; 50| 0| } 51| | 52| | // Check if the current setting's name matches 53| 35.2k| const char *setting_name = config_setting_name(setting); ------------------ | | 290| 35.2k| ((S)->name) ------------------ 54| 35.2k| if (NULL != setting_name && strlen(setting_name) == name_len) { ------------------ | Branch (54:9): [True: 7.29k, False: 27.9k] | Branch (54:33): [True: 2.68k, False: 4.60k] ------------------ 55| 2.68k| if (strncmp(config_setting_name(setting), name, name_len) == 0) { ------------------ | | 290| 2.68k| ((S)->name) ------------------ | Branch (55:13): [True: 452, False: 2.23k] ------------------ 56| 452| return setting; 57| 452| } 58| 2.68k| } 59| | 60| | // If it's a group, iterate over its children recursively 61| 34.7k| if (config_setting_is_group(setting) || config_setting_is_array(setting) ------------------ | | 277| 69.5k| ((S)->type == CONFIG_TYPE_GROUP) | | ------------------ | | | | 50| 34.7k|#define CONFIG_TYPE_GROUP 1 | | ------------------ | | | Branch (277:3): [True: 4.38k, False: 30.4k] | | ------------------ ------------------ if (config_setting_is_group(setting) || config_setting_is_array(setting) ------------------ | | 279| 65.2k| ((S)->type == CONFIG_TYPE_ARRAY) | | ------------------ | | | | 56| 30.4k|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (279:3): [True: 1.61k, False: 28.7k] | | ------------------ ------------------ 62| 28.7k| || config_setting_is_list(setting)) ------------------ | | 281| 28.7k| ((S)->type == CONFIG_TYPE_LIST) | | ------------------ | | | | 57| 28.7k|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (281:3): [True: 1.17k, False: 27.6k] | | ------------------ ------------------ 63| 7.17k| { 64| 7.17k| int count = config_setting_length(setting); 65| 39.8k| for (int i = 0; i < count; ++i) ------------------ | Branch (65:25): [True: 33.4k, False: 6.44k] ------------------ 66| 33.4k| { 67| 33.4k| config_setting_t *child = config_setting_get_elem(setting, i); 68| 33.4k| config_setting_t *result = find_setting_recursive(child, name, name_len); 69| 33.4k| if (result != NULL) ------------------ | Branch (69:17): [True: 731, False: 32.7k] ------------------ 70| 731| { 71| 731| return result; // Return the found setting 72| 731| } 73| 33.4k| } 74| 7.17k| } 75| | 76| | // Return NULL if not found 77| 34.0k| return NULL; 78| 34.7k|} LLVMFuzzerTestOneInput: 129| 2.32k|{ 130| 2.32k| static FILE *dev_null; 131| 2.32k| uint8_t data_buff[MAX_BUFF_SIZE] = {0}; 132| 2.32k| uint8_t scratch_mem[sizeof(uint64_t)] = {0}; 133| 2.32k| config_t cfg = {0}; 134| 2.32k| uint8_t *config_ptr; 135| 2.32k| uint8_t *path_ptr; 136| 2.32k| config_setting_t *root; 137| 2.32k| int rc = -1; 138| | 139| 2.32k| fuzz_data_t *fuzz_data = (fuzz_data_t*) data_buff; 140| | 141| 2.32k| if (NULL == dev_null) ------------------ | Branch (141:9): [True: 1, False: 2.32k] ------------------ 142| 1| { 143| | // Only called once per process 144| 1| dev_null = open_null_file(); 145| 1| } 146| | 147| 2.32k| if (size < MIN_BUFF_SIZE || size > MAX_BUFF_SIZE) ------------------ | | 10| 4.65k|#define MIN_BUFF_SIZE sizeof(fuzz_data_t) + 2 // Room for fixed-width data and two null terminators ------------------ if (size < MIN_BUFF_SIZE || size > MAX_BUFF_SIZE) ------------------ | | 11| 2.32k|#define MAX_BUFF_SIZE sizeof(fuzz_data_t) + MAX_CONFIG_SIZE + MAX_PATH_SIZE + 2 | | ------------------ | | | | 8| 2.32k|#define MAX_CONFIG_SIZE 4096 | | ------------------ | | #define MAX_BUFF_SIZE sizeof(fuzz_data_t) + MAX_CONFIG_SIZE + MAX_PATH_SIZE + 2 | | ------------------ | | | | 9| 2.32k|#define MAX_PATH_SIZE 256 | | ------------------ ------------------ | Branch (147:9): [True: 7, False: 2.32k] | Branch (147:33): [True: 6, False: 2.31k] ------------------ 148| 13| { 149| | // Not enough bytes to be a fuzz_data_t 150| 13| rc = 0; 151| 13| goto end; 152| 13| } 153| | 154| | // Copy the data to a buffer that can be mutated 155| 2.31k| memcpy(data_buff, data, size); 156| | 157| 2.31k| config_init(&cfg); 158| | 159| 2.31k| if (fuzz_data->content_size > MAX_CONFIG_SIZE || ------------------ | | 8| 4.63k|#define MAX_CONFIG_SIZE 4096 ------------------ | Branch (159:9): [True: 36, False: 2.28k] ------------------ 160| 2.28k| fuzz_data->path_size > MAX_PATH_SIZE || ------------------ | | 9| 4.59k|#define MAX_PATH_SIZE 256 ------------------ | Branch (160:9): [True: 49, False: 2.23k] ------------------ 161| 2.23k| sizeof(fuzz_data_t) + fuzz_data->content_size + fuzz_data->path_size > size) { ------------------ | Branch (161:9): [True: 17, False: 2.21k] ------------------ 162| 102| goto end; 163| 102| } 164| 2.21k| fuzz_data_content(fuzz_data, &config_ptr); 165| 2.21k| fuzz_data_path(fuzz_data, &path_ptr); 166| 2.21k| const char *config_data = (const char *) config_ptr; 167| 2.21k| const char *path_data = (const char *) path_ptr; 168| | 169| 2.21k| if (CONFIG_TRUE != config_read_string(&cfg, config_data) ------------------ | | 73| 2.21k|#define CONFIG_TRUE (1) ------------------ | Branch (169:9): [True: 399, False: 1.81k] ------------------ 170| 2.21k| || NULL == (root = config_root_setting(&cfg))) ------------------ | | 346| 1.81k| ((C)->root) ------------------ | Branch (170:12): [True: 0, False: 1.81k] ------------------ 171| 399| { 172| | // Parsing failed 173| 399| goto end; 174| 399| } 175| | 176| 1.81k| config_setting_t *setting = find_setting_recursive( 177| 1.81k| root, 178| 1.81k| (const char*) path_ptr, 179| 1.81k| fuzz_data->path_size 180| 1.81k| ); 181| | 182| 1.81k| if (NULL != setting) ------------------ | Branch (182:9): [True: 452, False: 1.36k] ------------------ 183| 452| { 184| 452| config_setting_get_elem(setting, config_setting_length(setting) - 1); 185| | 186| 452| switch (fuzz_data->lookup_type % (CONFIG_TYPE_LIST + 1)) { ------------------ | | 57| 452|#define CONFIG_TYPE_LIST 8 ------------------ 187| 53| case CONFIG_TYPE_FLOAT: ------------------ | | 53| 53|#define CONFIG_TYPE_FLOAT 4 ------------------ | Branch (187:13): [True: 53, False: 399] ------------------ 188| 53| config_setting_lookup_float(setting, path_data, 189| 53| (double*) scratch_mem); 190| 53| break; 191| 50| case CONFIG_TYPE_BOOL: ------------------ | | 55| 50|#define CONFIG_TYPE_BOOL 6 ------------------ | Branch (191:13): [True: 50, False: 402] ------------------ 192| 50| config_setting_lookup_bool(setting, path_data, 193| 50| (int*) scratch_mem); 194| 50| break; 195| 208| case CONFIG_TYPE_INT: ------------------ | | 51| 208|#define CONFIG_TYPE_INT 2 ------------------ | Branch (195:13): [True: 208, False: 244] ------------------ 196| 208| config_setting_lookup_int(setting, path_data, 197| 208| (int*) scratch_mem); 198| 208| break; 199| 56| case CONFIG_TYPE_INT64: ------------------ | | 52| 56|#define CONFIG_TYPE_INT64 3 ------------------ | Branch (199:13): [True: 56, False: 396] ------------------ 200| 56| config_setting_lookup_int64(setting, path_data, 201| 56| (long long *) scratch_mem); 202| 56| break; 203| 54| case CONFIG_TYPE_STRING: { ------------------ | | 54| 54|#define CONFIG_TYPE_STRING 5 ------------------ | Branch (203:13): [True: 54, False: 398] ------------------ 204| 54| const char *string_ptr = NULL; 205| 54| config_setting_lookup_string(setting, path_data, &string_ptr); 206| 54| break; 207| 0| } 208| 31| default: ------------------ | Branch (208:13): [True: 31, False: 421] ------------------ 209| 31| config_setting_lookup_const(setting, path_data); 210| 452| } 211| 452| } 212| | 213| 1.81k| if (NULL != (setting = config_setting_get_member(root, path_data))) ------------------ | Branch (213:9): [True: 427, False: 1.38k] ------------------ 214| 427| { 215| | // This setting exists, let's overwrite it 216| 427| config_setting_set_float(setting, 1.234); 217| 427| } 218| 1.38k| else { 219| | // This setting does not exist, create it 220| 1.38k| setting = config_setting_add(root, path_data, CONFIG_TYPE_FLOAT); ------------------ | | 53| 1.38k|#define CONFIG_TYPE_FLOAT 4 ------------------ 221| | 222| 1.38k| if (setting == NULL) ------------------ | Branch (222:13): [True: 517, False: 871] ------------------ 223| 517| { 224| 517| rc = -1; 225| 517| goto end; 226| 517| } 227| 871| config_setting_set_float(setting, 1.234); 228| 871| } 229| | 230| 1.29k| config_write(&cfg, dev_null); 231| 1.29k| config_setting_remove(root, path_data); 232| | 233| 1.29k| rc = 0; 234| | 235| 2.32k| end: 236| 2.32k| config_destroy(&cfg); 237| 2.32k| return rc; 238| 1.29k|} fuzz_data_content: 4| 2.21k|{ 5| 2.21k| *buff = fuzz_data->data; 6| | 7| | // Ensure the buffer is null terminated 8| 2.21k| (*buff)[fuzz_data->content_size] = '\0'; 9| 2.21k|} fuzz_data_path: 12| 2.21k|{ 13| 2.21k| *buff = fuzz_data->data + fuzz_data->content_size + 1; 14| | 15| | // Ensure the buffer is null terminated 16| 2.21k| (*buff)[fuzz_data->path_size] = '\0'; 17| 2.21k|} libconfig_yyerror: 112| 399|{ 113| 399| if(ctx->config->error_text) return; ------------------ | Branch (113:6): [True: 0, False: 399] ------------------ 114| 399| ctx->config->error_line = libconfig_yyget_lineno(scanner); 115| 399| ctx->config->error_text = s; 116| 399|} libconfig_yyparse: 1065| 2.21k|{ 1066| |/* Lookahead token kind. */ 1067| 2.21k|int yychar; 1068| | 1069| | 1070| |/* The semantic value of the lookahead symbol. */ 1071| |/* Default value used for initialization, for pacifying older GCCs 1072| | or non-GCC compilers. */ 1073| 2.21k|YY_INITIAL_VALUE (static YYSTYPE yyval_default;) ------------------ | | 476| 2.21k|# define YY_INITIAL_VALUE(Value) Value ------------------ 1074| 2.21k|YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); ------------------ | | 476| 2.21k|# define YY_INITIAL_VALUE(Value) Value ------------------ 1075| | 1076| | /* Number of syntax errors so far. */ 1077| 2.21k| int yynerrs = 0; 1078| | 1079| 2.21k| yy_state_fast_t yystate = 0; 1080| | /* Number of tokens to shift before error messages enabled. */ 1081| 2.21k| int yyerrstatus = 0; 1082| | 1083| | /* Refer to the stacks through separate pointers, to allow yyoverflow 1084| | to reallocate them elsewhere. */ 1085| | 1086| | /* Their size. */ 1087| 2.21k| YYPTRDIFF_T yystacksize = YYINITDEPTH; ------------------ | | 383| 2.21k|# define YYPTRDIFF_T __PTRDIFF_TYPE__ ------------------ YYPTRDIFF_T yystacksize = YYINITDEPTH; ------------------ | | 1004| 2.21k|# define YYINITDEPTH 200 ------------------ 1088| | 1089| | /* The state stack: array, bottom, top. */ 1090| 2.21k| yy_state_t yyssa[YYINITDEPTH]; 1091| 2.21k| yy_state_t *yyss = yyssa; 1092| 2.21k| yy_state_t *yyssp = yyss; 1093| | 1094| | /* The semantic value stack: array, bottom, top. */ 1095| 2.21k| YYSTYPE yyvsa[YYINITDEPTH]; 1096| 2.21k| YYSTYPE *yyvs = yyvsa; 1097| 2.21k| YYSTYPE *yyvsp = yyvs; 1098| | 1099| 2.21k| int yyn; 1100| | /* The return value of yyparse. */ 1101| 2.21k| int yyresult; 1102| | /* Lookahead symbol kind. */ 1103| 2.21k| yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; 1104| | /* The variables used to return semantic value and location from the 1105| | action routines. */ 1106| 2.21k| YYSTYPE yyval; 1107| | 1108| | 1109| | 1110| 2.21k|#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 1111| | 1112| | /* The number of symbols on the RHS of the reduced rule. 1113| | Keep to zero when no symbol should be popped. */ 1114| 2.21k| int yylen = 0; 1115| | 1116| 2.21k| YYDPRINTF ((stderr, "Starting parse\n")); ------------------ | | 995| 2.21k|# define YYDPRINTF(Args) ((void) 0) ------------------ 1117| | 1118| 2.21k| yychar = YYEMPTY; /* Cause a token to be read. */ ------------------ | | 191| 2.21k|#define YYEMPTY -2 ------------------ 1119| | 1120| 2.21k| goto yysetstate; 1121| | 1122| | 1123| |/*------------------------------------------------------------. 1124| || yynewstate -- push a new state, which is found in yystate. | 1125| |`------------------------------------------------------------*/ 1126| 381k|yynewstate: 1127| | /* In all cases, when you get here, the value and location stacks 1128| | have just been pushed. So pushing a state here evens the stacks. */ 1129| 381k| yyssp++; 1130| | 1131| | 1132| |/*--------------------------------------------------------------------. 1133| || yysetstate -- set current state (the top of the stack) to yystate. | 1134| |`--------------------------------------------------------------------*/ 1135| 383k|yysetstate: 1136| 383k| YYDPRINTF ((stderr, "Entering state %d\n", yystate)); ------------------ | | 995| 383k|# define YYDPRINTF(Args) ((void) 0) ------------------ 1137| 383k| YY_ASSERT (0 <= yystate && yystate < YYNSTATES); ------------------ | | 499| 383k|#define YY_ASSERT(E) ((void) (0 && (E))) | | ------------------ | | | Branch (499:31): [Folded, False: 383k] | | | Branch (499:37): [True: 0, False: 0] | | | Branch (499:37): [True: 0, False: 0] | | ------------------ ------------------ 1138| 383k| YY_IGNORE_USELESS_CAST_BEGIN 1139| 383k| *yyssp = YY_CAST (yy_state_t, yystate); ------------------ | | 126| 383k|# define YY_CAST(Type, Val) ((Type) (Val)) ------------------ 1140| 383k| YY_IGNORE_USELESS_CAST_END 1141| 383k| YY_STACK_PRINT (yyss, yyssp); 1142| | 1143| 383k| if (yyss + yystacksize - 1 <= yyssp) ------------------ | Branch (1143:7): [True: 172, False: 383k] ------------------ 1144| |#if !defined yyoverflow && !defined YYSTACK_RELOCATE 1145| | YYNOMEM; 1146| |#else 1147| 172| { 1148| | /* Get the current used size of the three stacks, in elements. */ 1149| 172| YYPTRDIFF_T yysize = yyssp - yyss + 1; ------------------ | | 383| 172|# define YYPTRDIFF_T __PTRDIFF_TYPE__ ------------------ 1150| | 1151| |# if defined yyoverflow 1152| | { 1153| | /* Give user a chance to reallocate the stack. Use copies of 1154| | these so that the &'s don't force the real ones into 1155| | memory. */ 1156| | yy_state_t *yyss1 = yyss; 1157| | YYSTYPE *yyvs1 = yyvs; 1158| | 1159| | /* Each stack pointer address is followed by the size of the 1160| | data in use in that stack, in bytes. This used to be a 1161| | conditional around just the two extra args, but that might 1162| | be undefined if yyoverflow is a macro. */ 1163| | yyoverflow (YY_("memory exhausted"), 1164| | &yyss1, yysize * YYSIZEOF (*yyssp), 1165| | &yyvs1, yysize * YYSIZEOF (*yyvsp), 1166| | &yystacksize); 1167| | yyss = yyss1; 1168| | yyvs = yyvs1; 1169| | } 1170| |# else /* defined YYSTACK_RELOCATE */ 1171| | /* Extend the stack our own way. */ 1172| 172| if (YYMAXDEPTH <= yystacksize) ------------------ | | 1015| 172|# define YYMAXDEPTH 10000 ------------------ | Branch (1172:11): [True: 0, False: 172] ------------------ 1173| 0| YYNOMEM; ------------------ | | 845| 0|#define YYNOMEM goto yyexhaustedlab ------------------ 1174| 172| yystacksize *= 2; 1175| 172| if (YYMAXDEPTH < yystacksize) ------------------ | | 1015| 172|# define YYMAXDEPTH 10000 ------------------ | Branch (1175:11): [True: 3, False: 169] ------------------ 1176| 3| yystacksize = YYMAXDEPTH; ------------------ | | 1015| 3|# define YYMAXDEPTH 10000 ------------------ 1177| | 1178| 172| { 1179| 172| yy_state_t *yyss1 = yyss; 1180| 172| union yyalloc *yyptr = 1181| 172| YY_CAST (union yyalloc *, ------------------ | | 126| 172|# define YY_CAST(Type, Val) ((Type) (Val)) ------------------ 1182| 172| YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); 1183| 172| if (! yyptr) ------------------ | Branch (1183:13): [True: 0, False: 172] ------------------ 1184| 0| YYNOMEM; ------------------ | | 845| 0|#define YYNOMEM goto yyexhaustedlab ------------------ 1185| 172| YYSTACK_RELOCATE (yyss_alloc, yyss); ------------------ | | 596| 172| do \ | | 597| 172| { \ | | 598| 172| YYPTRDIFF_T yynewbytes; \ | | ------------------ | | | | 383| 172|# define YYPTRDIFF_T __PTRDIFF_TYPE__ | | ------------------ | | 599| 172| YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ | | ------------------ | | | | 614| 172| __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) | | | | ------------------ | | | | | | 126| 172|# define YY_CAST(Type, Val) ((Type) (Val)) | | | | ------------------ | | ------------------ | | 600| 172| Stack = &yyptr->Stack_alloc; \ | | 601| 172| yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ | | ------------------ | | | | 416| 172|#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) | | | | ------------------ | | | | | | 126| 172|# define YY_CAST(Type, Val) ((Type) (Val)) | | | | ------------------ | | ------------------ | | yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ | | ------------------ | | | | 580| 172|# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) | | | | ------------------ | | | | | | 416| 172|#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) | | | | | | ------------------ | | | | | | | | 126| 172|# define YY_CAST(Type, Val) ((Type) (Val)) | | | | | | ------------------ | | | | ------------------ | | ------------------ | | 602| 172| yyptr += yynewbytes / YYSIZEOF (*yyptr); \ | | ------------------ | | | | 416| 172|#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) | | | | ------------------ | | | | | | 126| 172|# define YY_CAST(Type, Val) ((Type) (Val)) | | | | ------------------ | | ------------------ | | 603| 172| } \ | | 604| 172| while (0) | | ------------------ | | | Branch (604:12): [Folded, False: 172] | | ------------------ ------------------ 1186| 172| YYSTACK_RELOCATE (yyvs_alloc, yyvs); ------------------ | | 596| 172| do \ | | 597| 172| { \ | | 598| 172| YYPTRDIFF_T yynewbytes; \ | | ------------------ | | | | 383| 172|# define YYPTRDIFF_T __PTRDIFF_TYPE__ | | ------------------ | | 599| 172| YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ | | ------------------ | | | | 614| 172| __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) | | | | ------------------ | | | | | | 126| 172|# define YY_CAST(Type, Val) ((Type) (Val)) | | | | ------------------ | | ------------------ | | 600| 172| Stack = &yyptr->Stack_alloc; \ | | 601| 172| yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ | | ------------------ | | | | 416| 172|#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) | | | | ------------------ | | | | | | 126| 172|# define YY_CAST(Type, Val) ((Type) (Val)) | | | | ------------------ | | ------------------ | | yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ | | ------------------ | | | | 580| 172|# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) | | | | ------------------ | | | | | | 416| 172|#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) | | | | | | ------------------ | | | | | | | | 126| 172|# define YY_CAST(Type, Val) ((Type) (Val)) | | | | | | ------------------ | | | | ------------------ | | ------------------ | | 602| 172| yyptr += yynewbytes / YYSIZEOF (*yyptr); \ | | ------------------ | | | | 416| 172|#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) | | | | ------------------ | | | | | | 126| 172|# define YY_CAST(Type, Val) ((Type) (Val)) | | | | ------------------ | | ------------------ | | 603| 172| } \ | | 604| 172| while (0) | | ------------------ | | | Branch (604:12): [Folded, False: 172] | | ------------------ ------------------ 1187| 172|# undef YYSTACK_RELOCATE 1188| 172| if (yyss1 != yyssa) ------------------ | Branch (1188:13): [True: 108, False: 64] ------------------ 1189| 108| YYSTACK_FREE (yyss1); ------------------ | | 541| 108|# define YYSTACK_FREE YYFREE | | ------------------ | | | | 560| 108|# define YYFREE free | | ------------------ ------------------ 1190| 172| } 1191| 0|# endif 1192| | 1193| 0| yyssp = yyss + yysize - 1; 1194| 172| yyvsp = yyvs + yysize - 1; 1195| | 1196| 172| YY_IGNORE_USELESS_CAST_BEGIN 1197| 172| YYDPRINTF ((stderr, "Stack size increased to %ld\n", ------------------ | | 995| 172|# define YYDPRINTF(Args) ((void) 0) ------------------ 1198| 172| YY_CAST (long, yystacksize))); 1199| 172| YY_IGNORE_USELESS_CAST_END 1200| | 1201| 172| if (yyss + yystacksize - 1 <= yyssp) ------------------ | Branch (1201:11): [True: 0, False: 172] ------------------ 1202| 0| YYABORT; ------------------ | | 843| 0|#define YYABORT goto yyabortlab ------------------ 1203| 172| } 1204| 383k|#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ 1205| | 1206| | 1207| 383k| if (yystate == YYFINAL) ------------------ | | 629| 383k|#define YYFINAL 6 ------------------ | Branch (1207:7): [True: 1.81k, False: 381k] ------------------ 1208| 1.81k| YYACCEPT; ------------------ | | 842| 1.81k|#define YYACCEPT goto yyacceptlab ------------------ 1209| | 1210| 381k| goto yybackup; 1211| | 1212| | 1213| |/*-----------. 1214| || yybackup. | 1215| |`-----------*/ 1216| 381k|yybackup: 1217| | /* Do appropriate processing given the current state. Read a 1218| | lookahead token if we need one and don't already have one. */ 1219| | 1220| | /* First try to decide what to do without reference to lookahead token. */ 1221| 381k| yyn = yypact[yystate]; 1222| 381k| if (yypact_value_is_default (yyn)) ------------------ | | 735| 381k| ((Yyn) == YYPACT_NINF) | | ------------------ | | | | 732| 381k|#define YYPACT_NINF (-19) | | ------------------ | | | Branch (735:3): [True: 197k, False: 184k] | | ------------------ ------------------ 1223| 197k| goto yydefault; 1224| | 1225| | /* Not known => get a lookahead token if don't already have one. */ 1226| | 1227| | /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ 1228| 184k| if (yychar == YYEMPTY) ------------------ | | 191| 184k|#define YYEMPTY -2 ------------------ | Branch (1228:7): [True: 157k, False: 26.4k] ------------------ 1229| 157k| { 1230| 157k| YYDPRINTF ((stderr, "Reading a token\n")); ------------------ | | 995| 157k|# define YYDPRINTF(Args) ((void) 0) ------------------ 1231| 157k| yychar = yylex (&yylval, scanner); ------------------ | | 69| 157k|#define yylex libconfig_yylex ------------------ 1232| 157k| } 1233| | 1234| 184k| if (yychar <= YYEOF) ------------------ | | 192| 184k|#define YYEOF 0 ------------------ | Branch (1234:7): [True: 5.34k, False: 179k] ------------------ 1235| 5.34k| { 1236| 5.34k| yychar = YYEOF; ------------------ | | 192| 5.34k|#define YYEOF 0 ------------------ 1237| 5.34k| yytoken = YYSYMBOL_YYEOF; 1238| 5.34k| YYDPRINTF ((stderr, "Now at end of input.\n")); ------------------ | | 995| 5.34k|# define YYDPRINTF(Args) ((void) 0) ------------------ 1239| 5.34k| } 1240| 179k| else if (yychar == YYerror) ------------------ | | 193| 179k|#define YYerror 256 ------------------ | Branch (1240:12): [True: 0, False: 179k] ------------------ 1241| 0| { 1242| | /* The scanner already issued an error message, process directly 1243| | to error recovery. But do not keep the error token as 1244| | lookahead, it is too special and may lead us to an endless 1245| | loop in error recovery. */ 1246| 0| yychar = YYUNDEF; ------------------ | | 194| 0|#define YYUNDEF 257 ------------------ 1247| 0| yytoken = YYSYMBOL_YYerror; 1248| 0| goto yyerrlab1; 1249| 0| } 1250| 179k| else 1251| 179k| { 1252| 179k| yytoken = YYTRANSLATE (yychar); ------------------ | | 649| 179k| (0 <= (YYX) && (YYX) <= YYMAXUTOK \ | | ------------------ | | | | 643| 179k|#define YYMAXUTOK 281 | | ------------------ | | | Branch (649:4): [True: 179k, False: 0] | | | Branch (649:18): [True: 179k, False: 0] | | ------------------ | | 650| 179k| ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ | | ------------------ | | | | 126| 179k|# define YY_CAST(Type, Val) ((Type) (Val)) | | ------------------ | | 651| 179k| : YYSYMBOL_YYUNDEF) ------------------ 1253| 179k| YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 1254| 179k| } 1255| | 1256| | /* If the proper action on seeing token YYTOKEN is to reduce or to 1257| | detect an error, take that action. */ 1258| 184k| yyn += yytoken; 1259| 184k| if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) ------------------ | | 631| 182k|#define YYLAST 50 ------------------ | Branch (1259:7): [True: 1.48k, False: 182k] | Branch (1259:18): [True: 1.43k, False: 181k] | Branch (1259:34): [True: 23.9k, False: 157k] ------------------ 1260| 26.8k| goto yydefault; 1261| 157k| yyn = yytable[yyn]; 1262| 157k| if (yyn <= 0) ------------------ | Branch (1262:7): [True: 0, False: 157k] ------------------ 1263| 0| { 1264| 0| if (yytable_value_is_error (yyn)) ------------------ | | 740| 0| 0 | | ------------------ | | | Branch (740:3): [Folded, False: 0] | | ------------------ ------------------ 1265| 0| goto yyerrlab; 1266| 0| yyn = -yyn; 1267| 0| goto yyreduce; 1268| 0| } 1269| | 1270| | /* Count tokens shifted since error; after three, turn off error 1271| | status. */ 1272| 157k| if (yyerrstatus) ------------------ | Branch (1272:7): [True: 0, False: 157k] ------------------ 1273| 0| yyerrstatus--; 1274| | 1275| | /* Shift the lookahead token. */ 1276| 157k| YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 1277| 157k| yystate = yyn; 1278| 157k| YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1279| 157k| *++yyvsp = yylval; 1280| 157k| YY_IGNORE_MAYBE_UNINITIALIZED_END 1281| | 1282| | /* Discard the shifted token. */ 1283| 157k| yychar = YYEMPTY; ------------------ | | 191| 157k|#define YYEMPTY -2 ------------------ 1284| 157k| goto yynewstate; 1285| | 1286| | 1287| |/*-----------------------------------------------------------. 1288| || yydefault -- do the default action for the current state. | 1289| |`-----------------------------------------------------------*/ 1290| 224k|yydefault: 1291| 224k| yyn = yydefact[yystate]; 1292| 224k| if (yyn == 0) ------------------ | Branch (1292:7): [True: 349, False: 223k] ------------------ 1293| 349| goto yyerrlab; 1294| 223k| goto yyreduce; 1295| | 1296| | 1297| |/*-----------------------------. 1298| || yyreduce -- do a reduction. | 1299| |`-----------------------------*/ 1300| 223k|yyreduce: 1301| | /* yyn is the number of a rule to reduce with. */ 1302| 223k| yylen = yyr2[yyn]; 1303| | 1304| | /* If YYLEN is nonzero, implement the default value of the action: 1305| | '$$ = $1'. 1306| | 1307| | Otherwise, the following line sets YYVAL to garbage. 1308| | This behavior is undocumented and Bison 1309| | users should not rely upon it. Assigning to YYVAL 1310| | unconditionally makes the parser a bit smaller, and it avoids a 1311| | GCC warning that YYVAL may be used uninitialized. */ 1312| 223k| yyval = yyvsp[1-yylen]; 1313| | 1314| | 1315| 223k| YY_REDUCE_PRINT (yyn); 1316| 223k| switch (yyn) 1317| 223k| { 1318| 13.9k| case 11: /* $@1: %empty */ ------------------ | Branch (1318:3): [True: 13.9k, False: 209k] ------------------ 1319| 13.9k|#line 122 "grammar.y" 1320| 13.9k| { 1321| 13.9k| ctx->setting = config_setting_add(ctx->parent, (yyvsp[0].sval), CONFIG_TYPE_NONE); ------------------ | | 49| 13.9k|#define CONFIG_TYPE_NONE 0 ------------------ 1322| | 1323| 13.9k| if(ctx->setting == NULL) ------------------ | Branch (1323:8): [True: 18, False: 13.8k] ------------------ 1324| 18| { 1325| 18| libconfig_yyerror(scanner, ctx, scan_ctx, err_duplicate_setting); 1326| 18| YYABORT; ------------------ | | 843| 18|#define YYABORT goto yyabortlab ------------------ 1327| 18| } 1328| 13.8k| else 1329| 13.8k| { 1330| 13.8k| CAPTURE_PARSE_POS(ctx->setting); ------------------ | | 108| 13.8k| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1331| 13.8k| } 1332| 13.9k| } 1333| 13.8k|#line 1334 "grammar.c" 1334| 13.8k| break; 1335| | 1336| 13.8k| case 13: /* $@2: %empty */ ------------------ | Branch (1336:3): [True: 1.77k, False: 221k] ------------------ 1337| 1.77k|#line 141 "grammar.y" 1338| 1.77k| { 1339| 1.77k| if(IN_LIST()) ------------------ | | 98| 1.77k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 1.77k|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 1.77k, False: 0] | | | Branch (98:19): [True: 1.44k, False: 331] | | ------------------ ------------------ 1340| 1.44k| { 1341| 1.44k| ctx->parent = config_setting_add(ctx->parent, NULL, CONFIG_TYPE_ARRAY); ------------------ | | 56| 1.44k|#define CONFIG_TYPE_ARRAY 7 ------------------ 1342| 1.44k| CAPTURE_PARSE_POS(ctx->parent); ------------------ | | 108| 1.44k| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1343| 1.44k| } 1344| 331| else 1345| 331| { 1346| 331| ctx->setting->type = CONFIG_TYPE_ARRAY; ------------------ | | 56| 331|#define CONFIG_TYPE_ARRAY 7 ------------------ 1347| 331| ctx->parent = ctx->setting; 1348| 331| ctx->setting = NULL; 1349| 331| } 1350| 1.77k| } 1351| 1.77k|#line 1352 "grammar.c" 1352| 1.77k| break; 1353| | 1354| 1.70k| case 14: /* array: TOK_ARRAY_START $@2 simple_value_list_optional TOK_ARRAY_END */ ------------------ | Branch (1354:3): [True: 1.70k, False: 221k] ------------------ 1355| 1.70k|#line 156 "grammar.y" 1356| 1.70k| { 1357| 1.70k| if(ctx->parent) ------------------ | Branch (1357:8): [True: 1.70k, False: 0] ------------------ 1358| 1.70k| ctx->parent = ctx->parent->parent; 1359| 1.70k| } 1360| 1.70k|#line 1361 "grammar.c" 1361| 1.70k| break; 1362| | 1363| 48.1k| case 15: /* $@3: %empty */ ------------------ | Branch (1363:3): [True: 48.1k, False: 175k] ------------------ 1364| 48.1k|#line 164 "grammar.y" 1365| 48.1k| { 1366| 48.1k| if(IN_LIST()) ------------------ | | 98| 48.1k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 48.1k|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 48.1k, False: 0] | | | Branch (98:19): [True: 47.3k, False: 796] | | ------------------ ------------------ 1367| 47.3k| { 1368| 47.3k| ctx->parent = config_setting_add(ctx->parent, NULL, CONFIG_TYPE_LIST); ------------------ | | 57| 47.3k|#define CONFIG_TYPE_LIST 8 ------------------ 1369| 47.3k| CAPTURE_PARSE_POS(ctx->parent); ------------------ | | 108| 47.3k| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1370| 47.3k| } 1371| 796| else 1372| 796| { 1373| 796| ctx->setting->type = CONFIG_TYPE_LIST; ------------------ | | 57| 796|#define CONFIG_TYPE_LIST 8 ------------------ 1374| 796| ctx->parent = ctx->setting; 1375| 796| ctx->setting = NULL; 1376| 796| } 1377| 48.1k| } 1378| 48.1k|#line 1379 "grammar.c" 1379| 48.1k| break; 1380| | 1381| 1.56k| case 16: /* list: TOK_LIST_START $@3 value_list_optional TOK_LIST_END */ ------------------ | Branch (1381:3): [True: 1.56k, False: 222k] ------------------ 1382| 1.56k|#line 179 "grammar.y" 1383| 1.56k| { 1384| 1.56k| if(ctx->parent) ------------------ | Branch (1384:8): [True: 1.56k, False: 0] ------------------ 1385| 1.56k| ctx->parent = ctx->parent->parent; 1386| 1.56k| } 1387| 1.56k|#line 1388 "grammar.c" 1388| 1.56k| break; 1389| | 1390| 2.63k| case 21: /* string: TOK_STRING */ ------------------ | Branch (1390:3): [True: 2.63k, False: 221k] ------------------ 1391| 2.63k|#line 193 "grammar.y" 1392| 2.63k| { libconfig_parsectx_append_string(ctx, (yyvsp[0].sval)); free((yyvsp[0].sval)); } ------------------ | | 45| 2.63k| libconfig_strbuf_append_string(&((C)->string), (S)) ------------------ 1393| 2.63k|#line 1394 "grammar.c" 1394| 2.63k| break; 1395| | 1396| 1.04k| case 22: /* string: string TOK_STRING */ ------------------ | Branch (1396:3): [True: 1.04k, False: 222k] ------------------ 1397| 1.04k|#line 194 "grammar.y" 1398| 1.04k| { libconfig_parsectx_append_string(ctx, (yyvsp[0].sval)); free((yyvsp[0].sval)); } ------------------ | | 45| 1.04k| libconfig_strbuf_append_string(&((C)->string), (S)) ------------------ 1399| 1.04k|#line 1400 "grammar.c" 1400| 1.04k| break; 1401| | 1402| 1.40k| case 23: /* simple_value: TOK_BOOLEAN */ ------------------ | Branch (1402:3): [True: 1.40k, False: 222k] ------------------ 1403| 1.40k|#line 199 "grammar.y" 1404| 1.40k| { 1405| 1.40k| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 2.80k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 1.40k|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 1.40k, False: 0] | | | Branch (95:19): [True: 263, False: 1.14k] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 1.14k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 1.14k|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 1.14k, False: 0] | | | Branch (98:19): [True: 692, False: 449] | | ------------------ ------------------ 1406| 955| { 1407| 955| config_setting_t *e = config_setting_set_bool_elem(ctx->parent, -1, 1408| 955| (int)(yyvsp[0].ival)); 1409| | 1410| 955| if(! e) ------------------ | Branch (1410:10): [True: 3, False: 952] ------------------ 1411| 3| { 1412| 3| libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type); 1413| 3| YYABORT; ------------------ | | 843| 3|#define YYABORT goto yyabortlab ------------------ 1414| 3| } 1415| 952| else 1416| 952| { 1417| 952| CAPTURE_PARSE_POS(e); ------------------ | | 108| 952| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1418| 952| } 1419| 955| } 1420| 449| else 1421| 449| config_setting_set_bool(ctx->setting, (int)(yyvsp[0].ival)); 1422| 1.40k| } 1423| 1.40k|#line 1424 "grammar.c" 1424| 1.40k| break; 1425| | 1426| 6.66k| case 24: /* simple_value: TOK_INTEGER */ ------------------ | Branch (1426:3): [True: 6.66k, False: 216k] ------------------ 1427| 6.66k|#line 219 "grammar.y" 1428| 6.66k| { 1429| 6.66k| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 13.3k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 6.66k|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 6.66k, False: 0] | | | Branch (95:19): [True: 717, False: 5.94k] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 5.94k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 5.94k|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 5.94k, False: 0] | | | Branch (98:19): [True: 2.68k, False: 3.25k] | | ------------------ ------------------ 1430| 3.40k| { 1431| 3.40k| config_setting_t *e = config_setting_set_int_elem(ctx->parent, -1, (yyvsp[0].ival)); 1432| 3.40k| if(! e) ------------------ | Branch (1432:10): [True: 10, False: 3.39k] ------------------ 1433| 10| { 1434| 10| libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type); 1435| 10| YYABORT; ------------------ | | 843| 10|#define YYABORT goto yyabortlab ------------------ 1436| 10| } 1437| 3.39k| else 1438| 3.39k| { 1439| 3.39k| config_setting_set_format(e, CONFIG_FORMAT_DEFAULT); ------------------ | | 59| 3.39k|#define CONFIG_FORMAT_DEFAULT 0 ------------------ 1440| 3.39k| CAPTURE_PARSE_POS(e); ------------------ | | 108| 3.39k| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1441| 3.39k| } 1442| 3.40k| } 1443| 3.25k| else 1444| 3.25k| { 1445| 3.25k| config_setting_set_int(ctx->setting, (yyvsp[0].ival)); 1446| 3.25k| config_setting_set_format(ctx->setting, CONFIG_FORMAT_DEFAULT); ------------------ | | 59| 3.25k|#define CONFIG_FORMAT_DEFAULT 0 ------------------ 1447| 3.25k| } 1448| 6.66k| } 1449| 6.65k|#line 1450 "grammar.c" 1450| 6.65k| break; 1451| | 1452| 6.65k| case 25: /* simple_value: TOK_INTEGER64 */ ------------------ | Branch (1452:3): [True: 2.17k, False: 221k] ------------------ 1453| 2.17k|#line 241 "grammar.y" 1454| 2.17k| { 1455| 2.17k| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 4.34k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 2.17k|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 2.17k, False: 0] | | | Branch (95:19): [True: 887, False: 1.28k] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 1.28k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 1.28k|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 1.28k, False: 0] | | | Branch (98:19): [True: 711, False: 573] | | ------------------ ------------------ 1456| 1.59k| { 1457| 1.59k| config_setting_t *e = config_setting_set_int64_elem(ctx->parent, -1, (yyvsp[0].llval)); 1458| 1.59k| if(! e) ------------------ | Branch (1458:10): [True: 2, False: 1.59k] ------------------ 1459| 2| { 1460| 2| libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type); 1461| 2| YYABORT; ------------------ | | 843| 2|#define YYABORT goto yyabortlab ------------------ 1462| 2| } 1463| 1.59k| else 1464| 1.59k| { 1465| 1.59k| config_setting_set_format(e, CONFIG_FORMAT_DEFAULT); ------------------ | | 59| 1.59k|#define CONFIG_FORMAT_DEFAULT 0 ------------------ 1466| 1.59k| CAPTURE_PARSE_POS(e); ------------------ | | 108| 1.59k| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1467| 1.59k| } 1468| 1.59k| } 1469| 573| else 1470| 573| { 1471| 573| config_setting_set_int64(ctx->setting, (yyvsp[0].llval)); 1472| 573| config_setting_set_format(ctx->setting, CONFIG_FORMAT_DEFAULT); ------------------ | | 59| 573|#define CONFIG_FORMAT_DEFAULT 0 ------------------ 1473| 573| } 1474| 2.17k| } 1475| 2.16k|#line 1476 "grammar.c" 1476| 2.16k| break; 1477| | 1478| 2.16k| case 26: /* simple_value: TOK_HEX */ ------------------ | Branch (1478:3): [True: 1.82k, False: 221k] ------------------ 1479| 1.82k|#line 263 "grammar.y" 1480| 1.82k| { 1481| 1.82k| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 3.64k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 1.82k|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 1.82k, False: 0] | | | Branch (95:19): [True: 416, False: 1.40k] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 1.40k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 1.40k|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 1.40k, False: 0] | | | Branch (98:19): [True: 654, False: 751] | | ------------------ ------------------ 1482| 1.07k| { 1483| 1.07k| config_setting_t *e = config_setting_set_int_elem(ctx->parent, -1, (yyvsp[0].ival)); 1484| 1.07k| if(! e) ------------------ | Branch (1484:10): [True: 4, False: 1.06k] ------------------ 1485| 4| { 1486| 4| libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type); 1487| 4| YYABORT; ------------------ | | 843| 4|#define YYABORT goto yyabortlab ------------------ 1488| 4| } 1489| 1.06k| else 1490| 1.06k| { 1491| 1.06k| config_setting_set_format(e, CONFIG_FORMAT_HEX); ------------------ | | 60| 1.06k|#define CONFIG_FORMAT_HEX 1 ------------------ 1492| 1.06k| CAPTURE_PARSE_POS(e); ------------------ | | 108| 1.06k| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1493| 1.06k| } 1494| 1.07k| } 1495| 751| else 1496| 751| { 1497| 751| config_setting_set_int(ctx->setting, (yyvsp[0].ival)); 1498| 751| config_setting_set_format(ctx->setting, CONFIG_FORMAT_HEX); ------------------ | | 60| 751|#define CONFIG_FORMAT_HEX 1 ------------------ 1499| 751| } 1500| 1.82k| } 1501| 1.81k|#line 1502 "grammar.c" 1502| 1.81k| break; 1503| | 1504| 1.81k| case 27: /* simple_value: TOK_HEX64 */ ------------------ | Branch (1504:3): [True: 1.09k, False: 222k] ------------------ 1505| 1.09k|#line 285 "grammar.y" 1506| 1.09k| { 1507| 1.09k| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 2.18k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 1.09k|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 1.09k, False: 0] | | | Branch (95:19): [True: 340, False: 754] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 754| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 754|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 754, False: 0] | | | Branch (98:19): [True: 427, False: 327] | | ------------------ ------------------ 1508| 767| { 1509| 767| config_setting_t *e = config_setting_set_int64_elem(ctx->parent, -1, (yyvsp[0].llval)); 1510| 767| if(! e) ------------------ | Branch (1510:10): [True: 3, False: 764] ------------------ 1511| 3| { 1512| 3| libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type); 1513| 3| YYABORT; ------------------ | | 843| 3|#define YYABORT goto yyabortlab ------------------ 1514| 3| } 1515| 764| else 1516| 764| { 1517| 764| config_setting_set_format(e, CONFIG_FORMAT_HEX); ------------------ | | 60| 764|#define CONFIG_FORMAT_HEX 1 ------------------ 1518| 764| CAPTURE_PARSE_POS(e); ------------------ | | 108| 764| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1519| 764| } 1520| 767| } 1521| 327| else 1522| 327| { 1523| 327| config_setting_set_int64(ctx->setting, (yyvsp[0].llval)); 1524| 327| config_setting_set_format(ctx->setting, CONFIG_FORMAT_HEX); ------------------ | | 60| 327|#define CONFIG_FORMAT_HEX 1 ------------------ 1525| 327| } 1526| 1.09k| } 1527| 1.09k|#line 1528 "grammar.c" 1528| 1.09k| break; 1529| | 1530| 1.20k| case 28: /* simple_value: TOK_BIN */ ------------------ | Branch (1530:3): [True: 1.20k, False: 222k] ------------------ 1531| 1.20k|#line 307 "grammar.y" 1532| 1.20k| { 1533| 1.20k| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 2.41k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 1.20k|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 1.20k, False: 0] | | | Branch (95:19): [True: 684, False: 521] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 521| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 521|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 521, False: 0] | | | Branch (98:19): [True: 277, False: 244] | | ------------------ ------------------ 1534| 961| { 1535| 961| config_setting_t *e = config_setting_set_int_elem(ctx->parent, -1, (yyvsp[0].ival)); 1536| 961| if(! e) ------------------ | Branch (1536:10): [True: 2, False: 959] ------------------ 1537| 2| { 1538| 2| libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type); 1539| 2| YYABORT; ------------------ | | 843| 2|#define YYABORT goto yyabortlab ------------------ 1540| 2| } 1541| 959| else 1542| 959| { 1543| 959| config_setting_set_format(e, CONFIG_FORMAT_BIN); ------------------ | | 61| 959|#define CONFIG_FORMAT_BIN 2 ------------------ 1544| 959| CAPTURE_PARSE_POS(e); ------------------ | | 108| 959| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1545| 959| } 1546| 961| } 1547| 244| else 1548| 244| { 1549| 244| config_setting_set_int(ctx->setting, (yyvsp[0].ival)); 1550| 244| config_setting_set_format(ctx->setting, CONFIG_FORMAT_BIN); ------------------ | | 61| 244|#define CONFIG_FORMAT_BIN 2 ------------------ 1551| 244| } 1552| 1.20k| } 1553| 1.20k|#line 1554 "grammar.c" 1554| 1.20k| break; 1555| | 1556| 1.24k| case 29: /* simple_value: TOK_BIN64 */ ------------------ | Branch (1556:3): [True: 1.24k, False: 222k] ------------------ 1557| 1.24k|#line 329 "grammar.y" 1558| 1.24k| { 1559| 1.24k| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 2.48k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 1.24k|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 1.24k, False: 0] | | | Branch (95:19): [True: 363, False: 879] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 879| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 879|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 879, False: 0] | | | Branch (98:19): [True: 509, False: 370] | | ------------------ ------------------ 1560| 872| { 1561| 872| config_setting_t *e = config_setting_set_int64_elem(ctx->parent, -1, (yyvsp[0].llval)); 1562| 872| if(! e) ------------------ | Branch (1562:10): [True: 1, False: 871] ------------------ 1563| 1| { 1564| 1| libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type); 1565| 1| YYABORT; ------------------ | | 843| 1|#define YYABORT goto yyabortlab ------------------ 1566| 1| } 1567| 871| else 1568| 871| { 1569| 871| config_setting_set_format(e, CONFIG_FORMAT_BIN); ------------------ | | 61| 871|#define CONFIG_FORMAT_BIN 2 ------------------ 1570| 871| CAPTURE_PARSE_POS(e); ------------------ | | 108| 871| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1571| 871| } 1572| 872| } 1573| 370| else 1574| 370| { 1575| 370| config_setting_set_int64(ctx->setting, (yyvsp[0].llval)); 1576| 370| config_setting_set_format(ctx->setting, CONFIG_FORMAT_BIN); ------------------ | | 61| 370|#define CONFIG_FORMAT_BIN 2 ------------------ 1577| 370| } 1578| 1.24k| } 1579| 1.24k|#line 1580 "grammar.c" 1580| 1.24k| break; 1581| | 1582| 1.24k| case 30: /* simple_value: TOK_OCT */ ------------------ | Branch (1582:3): [True: 706, False: 222k] ------------------ 1583| 706|#line 351 "grammar.y" 1584| 706| { 1585| 706| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 1.41k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 706|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 706, False: 0] | | | Branch (95:19): [True: 211, False: 495] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 495| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 495|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 495, False: 0] | | | Branch (98:19): [True: 270, False: 225] | | ------------------ ------------------ 1586| 481| { 1587| 481| config_setting_t *e = config_setting_set_int_elem(ctx->parent, -1, (yyvsp[0].ival)); 1588| 481| if(! e) ------------------ | Branch (1588:10): [True: 1, False: 480] ------------------ 1589| 1| { 1590| 1| libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type); 1591| 1| YYABORT; ------------------ | | 843| 1|#define YYABORT goto yyabortlab ------------------ 1592| 1| } 1593| 480| else 1594| 480| { 1595| 480| config_setting_set_format(e, CONFIG_FORMAT_OCT); ------------------ | | 62| 480|#define CONFIG_FORMAT_OCT 3 ------------------ 1596| 480| CAPTURE_PARSE_POS(e); ------------------ | | 108| 480| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1597| 480| } 1598| 481| } 1599| 225| else 1600| 225| { 1601| 225| config_setting_set_int(ctx->setting, (yyvsp[0].ival)); 1602| 225| config_setting_set_format(ctx->setting, CONFIG_FORMAT_OCT); ------------------ | | 62| 225|#define CONFIG_FORMAT_OCT 3 ------------------ 1603| 225| } 1604| 706| } 1605| 705|#line 1606 "grammar.c" 1606| 705| break; 1607| | 1608| 705| case 31: /* simple_value: TOK_OCT64 */ ------------------ | Branch (1608:3): [True: 538, False: 223k] ------------------ 1609| 538|#line 373 "grammar.y" 1610| 538| { 1611| 538| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 1.07k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 538|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 538, False: 0] | | | Branch (95:19): [True: 205, False: 333] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 333| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 333|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 333, False: 0] | | | Branch (98:19): [True: 245, False: 88] | | ------------------ ------------------ 1612| 450| { 1613| 450| config_setting_t *e = config_setting_set_int64_elem(ctx->parent, -1, (yyvsp[0].llval)); 1614| 450| if(! e) ------------------ | Branch (1614:10): [True: 1, False: 449] ------------------ 1615| 1| { 1616| 1| libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type); 1617| 1| YYABORT; ------------------ | | 843| 1|#define YYABORT goto yyabortlab ------------------ 1618| 1| } 1619| 449| else 1620| 449| { 1621| 449| config_setting_set_format(e, CONFIG_FORMAT_OCT); ------------------ | | 62| 449|#define CONFIG_FORMAT_OCT 3 ------------------ 1622| 449| CAPTURE_PARSE_POS(e); ------------------ | | 108| 449| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1623| 449| } 1624| 450| } 1625| 88| else 1626| 88| { 1627| 88| config_setting_set_int64(ctx->setting, (yyvsp[0].llval)); 1628| 88| config_setting_set_format(ctx->setting, CONFIG_FORMAT_OCT); ------------------ | | 62| 88|#define CONFIG_FORMAT_OCT 3 ------------------ 1629| 88| } 1630| 538| } 1631| 537|#line 1632 "grammar.c" 1632| 537| break; 1633| | 1634| 14.5k| case 32: /* simple_value: TOK_FLOAT */ ------------------ | Branch (1634:3): [True: 14.5k, False: 209k] ------------------ 1635| 14.5k|#line 395 "grammar.y" 1636| 14.5k| { 1637| 14.5k| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 29.0k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 14.5k|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 14.5k, False: 0] | | | Branch (95:19): [True: 4.82k, False: 9.70k] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 9.70k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 9.70k|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 9.70k, False: 0] | | | Branch (98:19): [True: 8.14k, False: 1.55k] | | ------------------ ------------------ 1638| 12.9k| { 1639| 12.9k| config_setting_t *e = config_setting_set_float_elem(ctx->parent, -1, (yyvsp[0].fval)); 1640| 12.9k| if(! e) ------------------ | Branch (1640:10): [True: 4, False: 12.9k] ------------------ 1641| 4| { 1642| 4| libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type); 1643| 4| YYABORT; ------------------ | | 843| 4|#define YYABORT goto yyabortlab ------------------ 1644| 4| } 1645| 12.9k| else 1646| 12.9k| { 1647| 12.9k| CAPTURE_PARSE_POS(e); ------------------ | | 108| 12.9k| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1648| 12.9k| } 1649| 12.9k| } 1650| 1.55k| else 1651| 1.55k| config_setting_set_float(ctx->setting, (yyvsp[0].fval)); 1652| 14.5k| } 1653| 14.5k|#line 1654 "grammar.c" 1654| 14.5k| break; 1655| | 1656| 14.5k| case 33: /* simple_value: string */ ------------------ | Branch (1656:3): [True: 2.63k, False: 221k] ------------------ 1657| 2.63k|#line 413 "grammar.y" 1658| 2.63k| { 1659| 2.63k| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 5.27k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 2.63k|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 2.63k, False: 0] | | | Branch (95:19): [True: 1.44k, False: 1.18k] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 1.18k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 1.18k|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 1.18k, False: 0] | | | Branch (98:19): [True: 576, False: 612] | | ------------------ ------------------ 1660| 2.02k| { 1661| 2.02k| const char *s = libconfig_parsectx_take_string(ctx); ------------------ | | 47| 2.02k| libconfig_strbuf_release(&((C)->string)) ------------------ 1662| 2.02k| config_setting_t *e = config_setting_set_string_elem(ctx->parent, -1, s); 1663| 2.02k| __delete(s); ------------------ | | 38| 2.02k|#define __delete(P) free((void *)(P)) ------------------ 1664| | 1665| 2.02k| if(! e) ------------------ | Branch (1665:10): [True: 1, False: 2.02k] ------------------ 1666| 1| { 1667| 1| libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type); 1668| 1| YYABORT; ------------------ | | 843| 1|#define YYABORT goto yyabortlab ------------------ 1669| 1| } 1670| 2.02k| else 1671| 2.02k| { 1672| 2.02k| CAPTURE_PARSE_POS(e); ------------------ | | 108| 2.02k| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1673| 2.02k| } 1674| 2.02k| } 1675| 612| else 1676| 612| { 1677| 612| const char *s = libconfig_parsectx_take_string(ctx); ------------------ | | 47| 612| libconfig_strbuf_release(&((C)->string)) ------------------ 1678| 612| config_setting_set_string(ctx->setting, s); 1679| 612| __delete(s); ------------------ | | 38| 612|#define __delete(P) free((void *)(P)) ------------------ 1680| 612| } 1681| 2.63k| } 1682| 2.63k|#line 1683 "grammar.c" 1683| 2.63k| break; 1684| | 1685| 5.13k| case 44: /* $@4: %empty */ ------------------ | Branch (1685:3): [True: 5.13k, False: 218k] ------------------ 1686| 5.13k|#line 463 "grammar.y" 1687| 5.13k| { 1688| 5.13k| if(IN_LIST()) ------------------ | | 98| 5.13k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 5.13k|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 5.13k, False: 0] | | | Branch (98:19): [True: 896, False: 4.23k] | | ------------------ ------------------ 1689| 896| { 1690| 896| ctx->parent = config_setting_add(ctx->parent, NULL, CONFIG_TYPE_GROUP); ------------------ | | 50| 896|#define CONFIG_TYPE_GROUP 1 ------------------ 1691| 896| CAPTURE_PARSE_POS(ctx->parent); ------------------ | | 108| 896| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1692| 896| } 1693| 4.23k| else 1694| 4.23k| { 1695| 4.23k| ctx->setting->type = CONFIG_TYPE_GROUP; ------------------ | | 50| 4.23k|#define CONFIG_TYPE_GROUP 1 ------------------ 1696| 4.23k| ctx->parent = ctx->setting; 1697| 4.23k| ctx->setting = NULL; 1698| 4.23k| } 1699| 5.13k| } 1700| 5.13k|#line 1701 "grammar.c" 1701| 5.13k| break; 1702| | 1703| 4.00k| case 45: /* group: TOK_GROUP_START $@4 setting_list_optional TOK_GROUP_END */ ------------------ | Branch (1703:3): [True: 4.00k, False: 219k] ------------------ 1704| 4.00k|#line 478 "grammar.y" 1705| 4.00k| { 1706| 4.00k| if(ctx->parent) ------------------ | Branch (1706:8): [True: 4.00k, False: 0] ------------------ 1707| 4.00k| ctx->parent = ctx->parent->parent; 1708| 4.00k| } 1709| 4.00k|#line 1710 "grammar.c" 1710| 4.00k| break; 1711| | 1712| | 1713| 0|#line 1714 "grammar.c" 1714| | 1715| 109k| default: break; ------------------ | Branch (1715:7): [True: 109k, False: 113k] ------------------ 1716| 223k| } 1717| | /* User semantic actions sometimes alter yychar, and that requires 1718| | that yytoken be updated with the new translation. We take the 1719| | approach of translating immediately before every use of yytoken. 1720| | One alternative is translating here after every semantic action, 1721| | but that translation would be missed if the semantic action invokes 1722| | YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or 1723| | if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an 1724| | incorrect destructor might then be invoked immediately. In the 1725| | case of YYERROR or YYBACKUP, subsequent parser actions might lead 1726| | to an incorrect destructor call or verbose syntax error message 1727| | before the lookahead is translated. */ 1728| 223k| YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); 1729| | 1730| 223k| YYPOPSTACK (yylen); ------------------ | | 1110| 223k|#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) ------------------ 1731| 223k| yylen = 0; 1732| | 1733| 223k| *++yyvsp = yyval; 1734| | 1735| | /* Now 'shift' the result of the reduction. Determine what state 1736| | that goes to, based on the state we popped back to and the rule 1737| | number reduced by. */ 1738| 223k| { 1739| 223k| const int yylhs = yyr1[yyn] - YYNTOKENS; ------------------ | | 634| 223k|#define YYNTOKENS 27 ------------------ 1740| 223k| const int yyi = yypgoto[yylhs] + *yyssp; 1741| 223k| yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp ------------------ | | 631| 400k|#define YYLAST 50 ------------------ | Branch (1741:16): [True: 176k, False: 46.8k] | Branch (1741:28): [True: 176k, False: 0] | Branch (1741:45): [True: 45.7k, False: 131k] ------------------ 1742| 223k| ? yytable[yyi] 1743| 223k| : yydefgoto[yylhs]); 1744| 223k| } 1745| | 1746| 223k| goto yynewstate; 1747| | 1748| | 1749| |/*--------------------------------------. 1750| || yyerrlab -- here on detecting error. | 1751| |`--------------------------------------*/ 1752| 349|yyerrlab: 1753| | /* Make sure we have latest lookahead translation. See comments at 1754| | user semantic actions for why this is necessary. */ 1755| 349| yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); ------------------ | | 191| 349|#define YYEMPTY -2 ------------------ yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); ------------------ | | 649| 698| (0 <= (YYX) && (YYX) <= YYMAXUTOK \ | | ------------------ | | | | 643| 349|#define YYMAXUTOK 281 | | ------------------ | | | Branch (649:4): [True: 349, False: 0] | | | Branch (649:18): [True: 349, False: 0] | | ------------------ | | 650| 698| ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ | | ------------------ | | | | 126| 349|# define YY_CAST(Type, Val) ((Type) (Val)) | | ------------------ | | 651| 698| : YYSYMBOL_YYUNDEF) ------------------ | Branch (1755:13): [True: 0, False: 349] ------------------ 1756| | /* If not already recovering from an error, report this error. */ 1757| 349| if (!yyerrstatus) ------------------ | Branch (1757:7): [True: 349, False: 0] ------------------ 1758| 349| { 1759| 349| ++yynerrs; ------------------ | | 72| 349|#define yynerrs libconfig_yynerrs ------------------ 1760| 349| yyerror (scanner, ctx, scan_ctx, YY_("syntax error")); ------------------ | | 70| 349|#define yyerror libconfig_yyerror ------------------ yyerror (scanner, ctx, scan_ctx, YY_("syntax error")); ------------------ | | 433| 349|# define YY_(Msgid) Msgid ------------------ 1761| 349| } 1762| | 1763| 349| if (yyerrstatus == 3) ------------------ | Branch (1763:7): [True: 0, False: 349] ------------------ 1764| 0| { 1765| | /* If just tried and failed to reuse lookahead token after an 1766| | error, discard it. */ 1767| | 1768| 0| if (yychar <= YYEOF) ------------------ | | 192| 0|#define YYEOF 0 ------------------ | Branch (1768:11): [True: 0, False: 0] ------------------ 1769| 0| { 1770| | /* Return failure if at end of input. */ 1771| 0| if (yychar == YYEOF) ------------------ | | 192| 0|#define YYEOF 0 ------------------ | Branch (1771:15): [True: 0, False: 0] ------------------ 1772| 0| YYABORT; ------------------ | | 843| 0|#define YYABORT goto yyabortlab ------------------ 1773| 0| } 1774| 0| else 1775| 0| { 1776| 0| yydestruct ("Error: discarding", 1777| 0| yytoken, &yylval, scanner, ctx, scan_ctx); 1778| 0| yychar = YYEMPTY; ------------------ | | 191| 0|#define YYEMPTY -2 ------------------ 1779| 0| } 1780| 0| } 1781| | 1782| | /* Else will try to reuse lookahead token after shifting the error 1783| | token. */ 1784| 349| goto yyerrlab1; 1785| | 1786| | 1787| |/*---------------------------------------------------. 1788| || yyerrorlab -- error raised explicitly by YYERROR. | 1789| |`---------------------------------------------------*/ 1790| 349|yyerrorlab: 1791| | /* Pacify compilers when the user code never invokes YYERROR and the 1792| | label yyerrorlab therefore never appears in user code. */ 1793| 0| if (0) ------------------ | Branch (1793:7): [Folded, False: 0] ------------------ 1794| 0| YYERROR; ------------------ | | 844| 0|#define YYERROR goto yyerrorlab ------------------ 1795| 0| ++yynerrs; ------------------ | | 72| 0|#define yynerrs libconfig_yynerrs ------------------ 1796| | 1797| | /* Do not reclaim the symbols of the rule whose action triggered 1798| | this YYERROR. */ 1799| 0| YYPOPSTACK (yylen); ------------------ | | 1110| 0|#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) ------------------ 1800| 0| yylen = 0; 1801| 0| YY_STACK_PRINT (yyss, yyssp); 1802| 0| yystate = *yyssp; 1803| 0| goto yyerrlab1; 1804| | 1805| | 1806| |/*-------------------------------------------------------------. 1807| || yyerrlab1 -- common code for both syntax error and YYERROR. | 1808| |`-------------------------------------------------------------*/ 1809| 349|yyerrlab1: 1810| 349| yyerrstatus = 3; /* Each real token shifted decrements this. */ 1811| | 1812| | /* Pop stack until we find a state that shifts the error token. */ 1813| 349| for (;;) 1814| 98.7k| { 1815| 98.7k| yyn = yypact[yystate]; 1816| 98.7k| if (!yypact_value_is_default (yyn)) ------------------ | | 735| 98.7k| ((Yyn) == YYPACT_NINF) | | ------------------ | | | | 732| 98.7k|#define YYPACT_NINF (-19) | | ------------------ ------------------ | Branch (1816:11): [True: 50.2k, False: 48.4k] ------------------ 1817| 50.2k| { 1818| 50.2k| yyn += YYSYMBOL_YYerror; 1819| 50.2k| if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) ------------------ | | 631| 53.0k|#define YYLAST 50 ------------------ | Branch (1819:15): [True: 2.72k, False: 47.5k] | Branch (1819:27): [True: 2.72k, False: 0] | Branch (1819:44): [True: 0, False: 2.72k] ------------------ 1820| 0| { 1821| 0| yyn = yytable[yyn]; 1822| 0| if (0 < yyn) ------------------ | Branch (1822:19): [True: 0, False: 0] ------------------ 1823| 0| break; 1824| 0| } 1825| 50.2k| } 1826| | 1827| | /* Pop the current state because it cannot handle the error token. */ 1828| 98.7k| if (yyssp == yyss) ------------------ | Branch (1828:11): [True: 349, False: 98.3k] ------------------ 1829| 349| YYABORT; ------------------ | | 843| 349|#define YYABORT goto yyabortlab ------------------ 1830| | 1831| | 1832| 98.3k| yydestruct ("Error: popping", 1833| 98.3k| YY_ACCESSING_SYMBOL (yystate), yyvsp, scanner, ctx, scan_ctx); ------------------ | | 701| 98.3k|#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) | | ------------------ | | | | 126| 98.3k|# define YY_CAST(Type, Val) ((Type) (Val)) | | ------------------ ------------------ 1834| 98.3k| YYPOPSTACK (1); ------------------ | | 1110| 98.3k|#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) ------------------ 1835| 98.3k| yystate = *yyssp; 1836| 98.3k| YY_STACK_PRINT (yyss, yyssp); 1837| 98.3k| } 1838| | 1839| 0| YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1840| 0| *++yyvsp = yylval; 1841| 0| YY_IGNORE_MAYBE_UNINITIALIZED_END 1842| | 1843| | 1844| | /* Shift the error token. */ 1845| 0| YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); 1846| | 1847| 0| yystate = yyn; 1848| 0| goto yynewstate; 1849| | 1850| | 1851| |/*-------------------------------------. 1852| || yyacceptlab -- YYACCEPT comes here. | 1853| |`-------------------------------------*/ 1854| 1.81k|yyacceptlab: 1855| 1.81k| yyresult = 0; 1856| 1.81k| goto yyreturnlab; 1857| | 1858| | 1859| |/*-----------------------------------. 1860| || yyabortlab -- YYABORT comes here. | 1861| |`-----------------------------------*/ 1862| 399|yyabortlab: 1863| 399| yyresult = 1; 1864| 399| goto yyreturnlab; 1865| | 1866| | 1867| |/*-----------------------------------------------------------. 1868| || yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | 1869| |`-----------------------------------------------------------*/ 1870| 0|yyexhaustedlab: 1871| 0| yyerror (scanner, ctx, scan_ctx, YY_("memory exhausted")); ------------------ | | 70| 0|#define yyerror libconfig_yyerror ------------------ yyerror (scanner, ctx, scan_ctx, YY_("memory exhausted")); ------------------ | | 433| 0|# define YY_(Msgid) Msgid ------------------ 1872| 0| yyresult = 2; 1873| 0| goto yyreturnlab; 1874| | 1875| | 1876| |/*----------------------------------------------------------. 1877| || yyreturnlab -- parsing is finished, clean up and return. | 1878| |`----------------------------------------------------------*/ 1879| 2.21k|yyreturnlab: 1880| 2.21k| if (yychar != YYEMPTY) ------------------ | | 191| 2.21k|#define YYEMPTY -2 ------------------ | Branch (1880:7): [True: 350, False: 1.86k] ------------------ 1881| 350| { 1882| | /* Make sure we have latest lookahead translation. See comments at 1883| | user semantic actions for why this is necessary. */ 1884| 350| yytoken = YYTRANSLATE (yychar); ------------------ | | 649| 350| (0 <= (YYX) && (YYX) <= YYMAXUTOK \ | | ------------------ | | | | 643| 350|#define YYMAXUTOK 281 | | ------------------ | | | Branch (649:4): [True: 350, False: 0] | | | Branch (649:18): [True: 350, False: 0] | | ------------------ | | 650| 350| ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ | | ------------------ | | | | 126| 350|# define YY_CAST(Type, Val) ((Type) (Val)) | | ------------------ | | 651| 350| : YYSYMBOL_YYUNDEF) ------------------ 1885| 350| yydestruct ("Cleanup: discarding lookahead", 1886| 350| yytoken, &yylval, scanner, ctx, scan_ctx); 1887| 350| } 1888| | /* Do not reclaim the symbols of the rule whose action triggered 1889| | this YYABORT or YYACCEPT. */ 1890| 2.21k| YYPOPSTACK (yylen); ------------------ | | 1110| 2.21k|#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) ------------------ 1891| 2.21k| YY_STACK_PRINT (yyss, yyssp); 1892| 7.70k| while (yyssp != yyss) ------------------ | Branch (1892:10): [True: 5.48k, False: 2.21k] ------------------ 1893| 5.48k| { 1894| 5.48k| yydestruct ("Cleanup: popping", 1895| 5.48k| YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, scanner, ctx, scan_ctx); ------------------ | | 701| 5.48k|#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) | | ------------------ | | | | 126| 5.48k|# define YY_CAST(Type, Val) ((Type) (Val)) | | ------------------ ------------------ 1896| 5.48k| YYPOPSTACK (1); ------------------ | | 1110| 5.48k|#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) ------------------ 1897| 5.48k| } 1898| 2.21k|#ifndef yyoverflow 1899| 2.21k| if (yyss != yyssa) ------------------ | Branch (1899:7): [True: 64, False: 2.15k] ------------------ 1900| 64| YYSTACK_FREE (yyss); ------------------ | | 541| 64|# define YYSTACK_FREE YYFREE | | ------------------ | | | | 560| 64|# define YYFREE free | | ------------------ ------------------ 1901| 2.21k|#endif 1902| | 1903| 2.21k| return yyresult; 1904| 349|} grammar.c:capture_parse_pos: 102| 89.0k|{ 103| 89.0k| setting->line = (unsigned int)libconfig_yyget_lineno(scanner); 104| 89.0k| setting->file = libconfig_scanctx_current_filename(scan_ctx); 105| 89.0k|} grammar.c:yydestruct: 1030| 104k|{ 1031| 104k| YY_USE (yyvaluep); ------------------ | | 456| 104k|# define YY_USE(E) ((void) (E)) ------------------ 1032| 104k| YY_USE (scanner); ------------------ | | 456| 104k|# define YY_USE(E) ((void) (E)) ------------------ 1033| 104k| YY_USE (ctx); ------------------ | | 456| 104k|# define YY_USE(E) ((void) (E)) ------------------ 1034| 104k| YY_USE (scan_ctx); ------------------ | | 456| 104k|# define YY_USE(E) ((void) (E)) ------------------ 1035| 104k| if (!yymsg) ------------------ | Branch (1035:7): [True: 0, False: 104k] ------------------ 1036| 0| yymsg = "Deleting"; 1037| 104k| YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); 1038| | 1039| 104k| YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1040| 104k| switch (yykind) 1041| 104k| { 1042| 7| case YYSYMBOL_TOK_STRING: /* TOK_STRING */ ------------------ | Branch (1042:5): [True: 7, False: 104k] ------------------ 1043| 7|#line 95 "grammar.y" 1044| 7| { free(((*yyvaluep).sval)); } 1045| 7|#line 1046 "grammar.c" 1046| 7| break; 1047| | 1048| 104k| default: ------------------ | Branch (1048:7): [True: 104k, False: 7] ------------------ 1049| 104k| break; 1050| 104k| } 1051| 104k| YY_IGNORE_MAYBE_UNINITIALIZED_END 1052| 104k|} config_read_string: 619| 2.21k|{ 620| 2.21k| config_assert(config != NULL); 621| 2.21k| config_assert(str != NULL); 622| | 623| 2.21k| return(__config_read(config, NULL, NULL, str)); 624| 2.21k|} config_write: 665| 1.29k|{ 666| 1.29k| config_assert(config != NULL); 667| 1.29k| config_assert(stream != NULL); 668| | 669| 1.29k| __config_locale_override(); 670| | 671| 1.29k| __config_write_setting(config, config->root, stream, 0); 672| | 673| 1.29k| __config_locale_restore(); 674| 1.29k|} config_destroy: 760| 2.32k|{ 761| 2.32k| if(config == NULL) ------------------ | Branch (761:6): [True: 0, False: 2.32k] ------------------ 762| 0| return; 763| | 764| 2.32k| __config_setting_destroy(config->root); 765| 2.32k| libconfig_strvec_delete(config->filenames); 766| 2.32k| __delete(config->include_dir); ------------------ | | 38| 2.32k|#define __delete(P) free((void *)(P)) ------------------ 767| 2.32k| __zero(config); ------------------ | | 39| 2.32k|#define __zero(P) memset((void *)(P), 0, sizeof(*P)) ------------------ 768| 2.32k|} config_clear: 773| 4.53k|{ 774| 4.53k| config_assert(config != NULL); 775| | 776| | /* Destroy the root setting (recursively) and then create a new one. */ 777| 4.53k| __config_setting_destroy(config->root); 778| | 779| 4.53k| libconfig_strvec_delete(config->filenames); 780| 4.53k| config->filenames = NULL; 781| | 782| 4.53k| config->root = __new(config_setting_t); ------------------ | | 37| 4.53k|#define __new(T) (T *)libconfig_calloc(1, sizeof(T)) /* zeroed */ ------------------ 783| 4.53k| config->root->type = CONFIG_TYPE_GROUP; ------------------ | | 50| 4.53k|#define CONFIG_TYPE_GROUP 1 ------------------ 784| 4.53k| config->root->config = config; 785| 4.53k|} config_init: 827| 2.31k|{ 828| 2.31k| config_assert(config != NULL); 829| | 830| 2.31k| __zero(config); ------------------ | | 39| 2.31k|#define __zero(P) memset((void *)(P), 0, sizeof(*P)) ------------------ 831| 2.31k| config_clear(config); 832| | 833| | /* Set default options. */ 834| 2.31k| config->options = (CONFIG_OPTION_SEMICOLON_SEPARATORS ------------------ | | 65| 2.31k|#define CONFIG_OPTION_SEMICOLON_SEPARATORS 0x02 ------------------ 835| 2.31k| | CONFIG_OPTION_COLON_ASSIGNMENT_FOR_GROUPS ------------------ | | 66| 2.31k|#define CONFIG_OPTION_COLON_ASSIGNMENT_FOR_GROUPS 0x04 ------------------ 836| 2.31k| | CONFIG_OPTION_OPEN_BRACE_ON_SEPARATE_LINE); ------------------ | | 68| 2.31k|#define CONFIG_OPTION_OPEN_BRACE_ON_SEPARATE_LINE 0x10 ------------------ 837| 2.31k| config->tab_width = DEFAULT_TAB_WIDTH; ------------------ | | 52| 2.31k|#define DEFAULT_TAB_WIDTH 2 ------------------ 838| 2.31k| config->float_precision = DEFAULT_FLOAT_PRECISION; ------------------ | | 53| 2.31k|#define DEFAULT_FLOAT_PRECISION 6 ------------------ 839| 2.31k| config->include_fn = config_default_include_func; 840| 2.31k|} config_get_option: 875| 47.2k|{ 876| 47.2k| config_assert(config != NULL); 877| | 878| 47.2k| return((config->options & option) == option); 879| 47.2k|} config_setting_lookup_int: 1039| 208|{ 1040| 208| config_setting_t *member; 1041| | 1042| 208| config_assert(setting != NULL); 1043| 208| config_assert(value != NULL); 1044| | 1045| 208| member = config_setting_get_member(setting, name); 1046| 208| if(! member) ------------------ | Branch (1046:6): [True: 40, False: 168] ------------------ 1047| 40| return(CONFIG_FALSE); ------------------ | | 74| 40|#define CONFIG_FALSE (0) ------------------ 1048| | 1049| 168| return(__config_setting_get_int(member, value)); 1050| 208|} config_setting_lookup_int64: 1056| 56|{ 1057| 56| config_setting_t *member; 1058| | 1059| 56| config_assert(setting != NULL); 1060| 56| config_assert(name != NULL); 1061| 56| config_assert(value != NULL); 1062| | 1063| 56| member = config_setting_get_member(setting, name); 1064| 56| if(! member) ------------------ | Branch (1064:6): [True: 45, False: 11] ------------------ 1065| 45| return(CONFIG_FALSE); ------------------ | | 74| 45|#define CONFIG_FALSE (0) ------------------ 1066| | 1067| 11| return(__config_setting_get_int64(member, value)); 1068| 56|} config_setting_lookup_float: 1128| 53|{ 1129| 53| config_setting_t *member; 1130| | 1131| 53| config_assert(setting != NULL); 1132| 53| config_assert(name != NULL); 1133| 53| config_assert(value != NULL); 1134| | 1135| 53| member = config_setting_get_member(setting, name); 1136| 53| if(! member) ------------------ | Branch (1136:6): [True: 43, False: 10] ------------------ 1137| 43| return(CONFIG_FALSE); ------------------ | | 74| 43|#define CONFIG_FALSE (0) ------------------ 1138| | 1139| 10| return(__config_setting_get_float(member, value)); 1140| 53|} config_setting_lookup_string: 1146| 54|{ 1147| 54| config_setting_t *member; 1148| | 1149| 54| config_assert(setting != NULL); 1150| 54| config_assert(name != NULL); 1151| 54| config_assert(value != NULL); 1152| | 1153| 54| member = config_setting_get_member(setting, name); 1154| 54| if(! member) ------------------ | Branch (1154:6): [True: 47, False: 7] ------------------ 1155| 47| return(CONFIG_FALSE); ------------------ | | 74| 47|#define CONFIG_FALSE (0) ------------------ 1156| | 1157| 7| if(config_setting_type(member) != CONFIG_TYPE_STRING) ------------------ | | 274| 7| ((S)->type) ------------------ if(config_setting_type(member) != CONFIG_TYPE_STRING) ------------------ | | 54| 7|#define CONFIG_TYPE_STRING 5 ------------------ | Branch (1157:6): [True: 6, False: 1] ------------------ 1158| 6| return(CONFIG_FALSE); ------------------ | | 74| 6|#define CONFIG_FALSE (0) ------------------ 1159| | 1160| 1| *value = config_setting_get_string(member); 1161| 1| return(CONFIG_TRUE); ------------------ | | 73| 1|#define CONFIG_TRUE (1) ------------------ 1162| 7|} config_setting_lookup_bool: 1168| 50|{ 1169| 50| config_setting_t *member; 1170| | 1171| 50| config_assert(setting != NULL); 1172| 50| config_assert(name != NULL); 1173| 50| config_assert(value != NULL); 1174| | 1175| 50| member = config_setting_get_member(setting, name); 1176| 50| if(! member) ------------------ | Branch (1176:6): [True: 44, False: 6] ------------------ 1177| 44| return(CONFIG_FALSE); ------------------ | | 74| 44|#define CONFIG_FALSE (0) ------------------ 1178| | 1179| 6| if(config_setting_type(member) != CONFIG_TYPE_BOOL) ------------------ | | 274| 6| ((S)->type) ------------------ if(config_setting_type(member) != CONFIG_TYPE_BOOL) ------------------ | | 55| 6|#define CONFIG_TYPE_BOOL 6 ------------------ | Branch (1179:6): [True: 5, False: 1] ------------------ 1180| 5| return(CONFIG_FALSE); ------------------ | | 74| 5|#define CONFIG_FALSE (0) ------------------ 1181| | 1182| 1| *value = config_setting_get_bool(member); 1183| 1| return(CONFIG_TRUE); ------------------ | | 73| 1|#define CONFIG_TRUE (1) ------------------ 1184| 6|} config_setting_set_int: 1189| 10.3k|{ 1190| 10.3k| config_assert(setting != NULL); 1191| | 1192| 10.3k| switch(setting->type) 1193| 10.3k| { 1194| 4.47k| case CONFIG_TYPE_NONE: ------------------ | | 49| 4.47k|#define CONFIG_TYPE_NONE 0 ------------------ | Branch (1194:5): [True: 4.47k, False: 5.90k] ------------------ 1195| 4.47k| setting->type = CONFIG_TYPE_INT; ------------------ | | 51| 4.47k|#define CONFIG_TYPE_INT 2 ------------------ 1196| | /* fall through */ 1197| | 1198| 10.3k| case CONFIG_TYPE_INT: ------------------ | | 51| 10.3k|#define CONFIG_TYPE_INT 2 ------------------ | Branch (1198:5): [True: 5.90k, False: 4.47k] ------------------ 1199| 10.3k| setting->value.ival = value; 1200| 10.3k| return(CONFIG_TRUE); ------------------ | | 73| 10.3k|#define CONFIG_TRUE (1) ------------------ 1201| | 1202| 0| case CONFIG_TYPE_FLOAT: ------------------ | | 53| 0|#define CONFIG_TYPE_FLOAT 4 ------------------ | Branch (1202:5): [True: 0, False: 10.3k] ------------------ 1203| 0| if(config_get_auto_convert(setting->config)) ------------------ | | 271| 0| config_get_option((C), CONFIG_OPTION_AUTOCONVERT) | | ------------------ | | | | 64| 0|#define CONFIG_OPTION_AUTOCONVERT 0x01 | | ------------------ | | | Branch (271:3): [True: 0, False: 0] | | ------------------ ------------------ 1204| 0| { 1205| 0| setting->value.fval = (float)value; 1206| 0| return(CONFIG_TRUE); ------------------ | | 73| 0|#define CONFIG_TRUE (1) ------------------ 1207| 0| } 1208| 0| else 1209| 0| return(CONFIG_FALSE); ------------------ | | 74| 0|#define CONFIG_FALSE (0) ------------------ 1210| | 1211| 0| default: ------------------ | Branch (1211:5): [True: 0, False: 10.3k] ------------------ 1212| 0| return(CONFIG_FALSE); ------------------ | | 74| 0|#define CONFIG_FALSE (0) ------------------ 1213| 10.3k| } 1214| 10.3k|} config_setting_set_int64: 1219| 5.03k|{ 1220| 5.03k| config_assert(setting != NULL); 1221| | 1222| 5.03k| switch(setting->type) 1223| 5.03k| { 1224| 1.35k| case CONFIG_TYPE_NONE: ------------------ | | 49| 1.35k|#define CONFIG_TYPE_NONE 0 ------------------ | Branch (1224:5): [True: 1.35k, False: 3.68k] ------------------ 1225| 1.35k| setting->type = CONFIG_TYPE_INT64; ------------------ | | 52| 1.35k|#define CONFIG_TYPE_INT64 3 ------------------ 1226| | /* fall through */ 1227| | 1228| 5.03k| case CONFIG_TYPE_INT64: ------------------ | | 52| 5.03k|#define CONFIG_TYPE_INT64 3 ------------------ | Branch (1228:5): [True: 3.68k, False: 1.35k] ------------------ 1229| 5.03k| setting->value.llval = value; 1230| 5.03k| return(CONFIG_TRUE); ------------------ | | 73| 5.03k|#define CONFIG_TRUE (1) ------------------ 1231| | 1232| 0| case CONFIG_TYPE_INT: ------------------ | | 51| 0|#define CONFIG_TYPE_INT 2 ------------------ | Branch (1232:5): [True: 0, False: 5.03k] ------------------ 1233| 0| if((value >= INT32_MIN) && (value <= INT32_MAX)) ------------------ | Branch (1233:10): [True: 0, False: 0] | Branch (1233:34): [True: 0, False: 0] ------------------ 1234| 0| { 1235| 0| setting->value.ival = (int)value; 1236| 0| return(CONFIG_TRUE); ------------------ | | 73| 0|#define CONFIG_TRUE (1) ------------------ 1237| 0| } 1238| 0| else 1239| 0| return(CONFIG_FALSE); ------------------ | | 74| 0|#define CONFIG_FALSE (0) ------------------ 1240| | 1241| 0| case CONFIG_TYPE_FLOAT: ------------------ | | 53| 0|#define CONFIG_TYPE_FLOAT 4 ------------------ | Branch (1241:5): [True: 0, False: 5.03k] ------------------ 1242| 0| if(config_get_auto_convert(setting->config)) ------------------ | | 271| 0| config_get_option((C), CONFIG_OPTION_AUTOCONVERT) | | ------------------ | | | | 64| 0|#define CONFIG_OPTION_AUTOCONVERT 0x01 | | ------------------ | | | Branch (271:3): [True: 0, False: 0] | | ------------------ ------------------ 1243| 0| { 1244| 0| setting->value.fval = (float)value; 1245| 0| return(CONFIG_TRUE); ------------------ | | 73| 0|#define CONFIG_TRUE (1) ------------------ 1246| 0| } 1247| 0| else 1248| 0| return(CONFIG_FALSE); ------------------ | | 74| 0|#define CONFIG_FALSE (0) ------------------ 1249| | 1250| 0| default: ------------------ | Branch (1250:5): [True: 0, False: 5.03k] ------------------ 1251| 0| return(CONFIG_FALSE); ------------------ | | 74| 0|#define CONFIG_FALSE (0) ------------------ 1252| 5.03k| } 1253| 5.03k|} config_setting_set_float: 1258| 15.8k|{ 1259| 15.8k| config_assert(setting != NULL); 1260| | 1261| 15.8k| switch(setting->type) 1262| 15.8k| { 1263| 1.55k| case CONFIG_TYPE_NONE: ------------------ | | 49| 1.55k|#define CONFIG_TYPE_NONE 0 ------------------ | Branch (1263:5): [True: 1.55k, False: 14.2k] ------------------ 1264| 1.55k| setting->type = CONFIG_TYPE_FLOAT; ------------------ | | 53| 1.55k|#define CONFIG_TYPE_FLOAT 4 ------------------ 1265| | /* fall through */ 1266| | 1267| 15.3k| case CONFIG_TYPE_FLOAT: ------------------ | | 53| 15.3k|#define CONFIG_TYPE_FLOAT 4 ------------------ | Branch (1267:5): [True: 13.8k, False: 1.98k] ------------------ 1268| 15.3k| setting->value.fval = value; 1269| 15.3k| return(CONFIG_TRUE); ------------------ | | 73| 15.3k|#define CONFIG_TRUE (1) ------------------ 1270| | 1271| 10| case CONFIG_TYPE_INT: ------------------ | | 51| 10|#define CONFIG_TYPE_INT 2 ------------------ | Branch (1271:5): [True: 10, False: 15.8k] ------------------ 1272| 10| if(config_get_option(setting->config, CONFIG_OPTION_AUTOCONVERT)) ------------------ | | 64| 10|#define CONFIG_OPTION_AUTOCONVERT 0x01 ------------------ | Branch (1272:10): [True: 0, False: 10] ------------------ 1273| 0| { 1274| 0| setting->value.ival = (int)value; 1275| 0| return(CONFIG_TRUE); ------------------ | | 73| 0|#define CONFIG_TRUE (1) ------------------ 1276| 0| } 1277| 10| else 1278| 10| return(CONFIG_FALSE); ------------------ | | 74| 10|#define CONFIG_FALSE (0) ------------------ 1279| | 1280| 6| case CONFIG_TYPE_INT64: ------------------ | | 52| 6|#define CONFIG_TYPE_INT64 3 ------------------ | Branch (1280:5): [True: 6, False: 15.8k] ------------------ 1281| 6| if(config_get_option(setting->config, CONFIG_OPTION_AUTOCONVERT)) ------------------ | | 64| 6|#define CONFIG_OPTION_AUTOCONVERT 0x01 ------------------ | Branch (1281:10): [True: 0, False: 6] ------------------ 1282| 0| { 1283| 0| setting->value.llval = (long long)value; 1284| 0| return(CONFIG_TRUE); ------------------ | | 73| 0|#define CONFIG_TRUE (1) ------------------ 1285| 0| } 1286| 6| else 1287| 6| return(CONFIG_FALSE); ------------------ | | 74| 6|#define CONFIG_FALSE (0) ------------------ 1288| | 1289| 410| default: ------------------ | Branch (1289:5): [True: 410, False: 15.4k] ------------------ 1290| 410| return(CONFIG_FALSE); ------------------ | | 74| 410|#define CONFIG_FALSE (0) ------------------ 1291| 15.8k| } 1292| 15.8k|} config_setting_get_bool: 1297| 1|{ 1298| 1| config_assert(setting != NULL); 1299| | 1300| 1| return((setting->type == CONFIG_TYPE_BOOL) ? setting->value.ival : 0); ------------------ | | 55| 1|#define CONFIG_TYPE_BOOL 6 ------------------ | Branch (1300:10): [True: 1, False: 0] ------------------ 1301| 1|} config_setting_set_bool: 1323| 1.40k|{ 1324| 1.40k| config_assert(setting != NULL); 1325| | 1326| 1.40k| if(setting->type == CONFIG_TYPE_NONE) ------------------ | | 49| 1.40k|#define CONFIG_TYPE_NONE 0 ------------------ | Branch (1326:6): [True: 449, False: 952] ------------------ 1327| 449| setting->type = CONFIG_TYPE_BOOL; ------------------ | | 55| 449|#define CONFIG_TYPE_BOOL 6 ------------------ 1328| 952| else if(setting->type != CONFIG_TYPE_BOOL) ------------------ | | 55| 952|#define CONFIG_TYPE_BOOL 6 ------------------ | Branch (1328:11): [True: 0, False: 952] ------------------ 1329| 0| return(CONFIG_FALSE); ------------------ | | 74| 0|#define CONFIG_FALSE (0) ------------------ 1330| | 1331| 1.40k| setting->value.ival = value; 1332| 1.40k| return(CONFIG_TRUE); ------------------ | | 73| 1.40k|#define CONFIG_TRUE (1) ------------------ 1333| 1.40k|} config_setting_get_string: 1338| 1|{ 1339| 1| config_assert(setting != NULL); 1340| | 1341| 1| return((setting->type == CONFIG_TYPE_STRING) ? setting->value.sval : NULL); ------------------ | | 54| 1|#define CONFIG_TYPE_STRING 5 ------------------ | Branch (1341:10): [True: 1, False: 0] ------------------ 1342| 1|} config_setting_set_string: 1364| 2.63k|{ 1365| 2.63k| config_assert(setting != NULL); 1366| 2.63k| config_assert(value != NULL); 1367| | 1368| 2.63k| if(setting->type == CONFIG_TYPE_NONE) ------------------ | | 49| 2.63k|#define CONFIG_TYPE_NONE 0 ------------------ | Branch (1368:6): [True: 612, False: 2.02k] ------------------ 1369| 612| setting->type = CONFIG_TYPE_STRING; ------------------ | | 54| 612|#define CONFIG_TYPE_STRING 5 ------------------ 1370| 2.02k| else if(setting->type != CONFIG_TYPE_STRING) ------------------ | | 54| 2.02k|#define CONFIG_TYPE_STRING 5 ------------------ | Branch (1370:11): [True: 0, False: 2.02k] ------------------ 1371| 0| return(CONFIG_FALSE); ------------------ | | 74| 0|#define CONFIG_FALSE (0) ------------------ 1372| | 1373| 2.63k| if(setting->value.sval) ------------------ | Branch (1373:6): [True: 0, False: 2.63k] ------------------ 1374| 0| __delete(setting->value.sval); ------------------ | | 38| 0|#define __delete(P) free((void *)(P)) ------------------ 1375| | 1376| 2.63k| setting->value.sval = (value == NULL) ? NULL : strdup(value); ------------------ | Branch (1376:25): [True: 0, False: 2.63k] ------------------ 1377| | 1378| 2.63k| return(CONFIG_TRUE); ------------------ | | 73| 2.63k|#define CONFIG_TRUE (1) ------------------ 1379| 2.63k|} config_setting_set_format: 1384| 15.4k|{ 1385| 15.4k| config_assert(setting != NULL); 1386| | 1387| 15.4k| if(((setting->type != CONFIG_TYPE_INT) ------------------ | | 51| 15.4k|#define CONFIG_TYPE_INT 2 ------------------ | Branch (1387:7): [True: 5.03k, False: 10.3k] ------------------ 1388| 5.03k| && (setting->type != CONFIG_TYPE_INT64)) ------------------ | | 52| 5.03k|#define CONFIG_TYPE_INT64 3 ------------------ | Branch (1388:10): [True: 0, False: 5.03k] ------------------ 1389| 15.4k| || ((format != CONFIG_FORMAT_DEFAULT) ------------------ | | 59| 15.4k|#define CONFIG_FORMAT_DEFAULT 0 ------------------ | Branch (1389:10): [True: 6.59k, False: 8.82k] ------------------ 1390| 6.59k| && (format != CONFIG_FORMAT_HEX) ------------------ | | 60| 6.59k|#define CONFIG_FORMAT_HEX 1 ------------------ | Branch (1390:13): [True: 3.68k, False: 2.90k] ------------------ 1391| 3.68k| && (format != CONFIG_FORMAT_BIN))) ------------------ | | 61| 3.68k|#define CONFIG_FORMAT_BIN 2 ------------------ | Branch (1391:13): [True: 1.24k, False: 2.44k] ------------------ 1392| 1.24k| return(CONFIG_FALSE); ------------------ | | 74| 1.24k|#define CONFIG_FALSE (0) ------------------ 1393| | 1394| 14.1k| setting->format = format; 1395| | 1396| 14.1k| return(CONFIG_TRUE); ------------------ | | 73| 14.1k|#define CONFIG_TRUE (1) ------------------ 1397| 15.4k|} config_setting_get_format: 1402| 32.3k|{ 1403| 32.3k| config_assert(setting != NULL); 1404| | 1405| 32.3k| return(setting->format != 0 ? setting->format ------------------ | Branch (1405:10): [True: 3.42k, False: 28.8k] ------------------ 1406| 32.3k| : setting->config->default_format); 1407| 32.3k|} config_setting_lookup_const: 1413| 1.32k|{ 1414| 1.32k| const char *p = path; 1415| 1.32k| const config_setting_t *found = setting; 1416| | 1417| 1.32k| config_assert(setting != NULL); 1418| 1.32k| config_assert(path != NULL); 1419| | 1420| 2.63k| while(*p && found) ------------------ | Branch (1420:9): [True: 1.32k, False: 1.30k] | Branch (1420:15): [True: 1.32k, False: 0] ------------------ 1421| 1.32k| { 1422| 1.32k| if(strchr(PATH_TOKENS, *p)) ------------------ | | 50| 1.32k|#define PATH_TOKENS ":./" ------------------ | Branch (1422:8): [True: 0, False: 1.32k] ------------------ 1423| 0| ++p; 1424| | 1425| 1.32k| if(*p == '[') ------------------ | Branch (1425:8): [True: 0, False: 1.32k] ------------------ 1426| 0| { 1427| 0| char *q; 1428| 0| long index = strtol(++p, &q, 10); 1429| 0| if(*q != ']') ------------------ | Branch (1429:10): [True: 0, False: 0] ------------------ 1430| 0| return NULL; 1431| | 1432| 0| p = ++q; 1433| 0| found = config_setting_get_elem(found, index); 1434| 0| } 1435| 1.32k| else if(found->type == CONFIG_TYPE_GROUP) ------------------ | | 50| 1.32k|#define CONFIG_TYPE_GROUP 1 ------------------ | Branch (1435:13): [True: 1.30k, False: 21] ------------------ 1436| 1.30k| { 1437| 1.30k| const char *q = p; 1438| | 1439| 7.55k| while(*q && !strchr(PATH_TOKENS, *q)) ------------------ | | 50| 6.24k|#define PATH_TOKENS ":./" ------------------ | Branch (1439:13): [True: 6.24k, False: 1.30k] | Branch (1439:19): [True: 6.24k, False: 0] ------------------ 1440| 6.24k| ++q; 1441| | 1442| 1.30k| found = __config_list_search(found->value.list, p, (size_t)(q - p), 1443| 1.30k| NULL); 1444| 1.30k| p = q; 1445| 1.30k| } 1446| 21| else 1447| 21| break; 1448| 1.32k| } 1449| | 1450| 1.32k| return((*p || (found == setting)) ? NULL : found); ------------------ | Branch (1450:11): [True: 21, False: 1.30k] | Branch (1450:17): [True: 0, False: 1.30k] ------------------ 1451| 1.32k|} config_setting_lookup: 1457| 1.29k|{ 1458| 1.29k| config_assert(setting != NULL); 1459| 1.29k| config_assert(path != NULL); 1460| | 1461| 1.29k| return((config_setting_t *)config_setting_lookup_const(setting, path)); 1462| 1.29k|} config_setting_set_int_elem: 1601| 5.91k|{ 1602| 5.91k| config_setting_t *element = NULL; 1603| | 1604| 5.91k| config_assert(setting != NULL); 1605| | 1606| 5.91k| if((setting->type != CONFIG_TYPE_ARRAY) ------------------ | | 56| 5.91k|#define CONFIG_TYPE_ARRAY 7 ------------------ | Branch (1606:6): [True: 3.88k, False: 2.02k] ------------------ 1607| 3.88k| && (setting->type != CONFIG_TYPE_LIST)) ------------------ | | 57| 3.88k|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (1607:9): [True: 0, False: 3.88k] ------------------ 1608| 0| return(NULL); 1609| | 1610| 5.91k| if(idx < 0) ------------------ | Branch (1610:6): [True: 5.91k, False: 0] ------------------ 1611| 5.91k| { 1612| 5.91k| if(! __config_list_checktype(setting, CONFIG_TYPE_INT)) ------------------ | | 51| 5.91k|#define CONFIG_TYPE_INT 2 ------------------ | Branch (1612:8): [True: 17, False: 5.90k] ------------------ 1613| 17| return(NULL); 1614| | 1615| 5.90k| element = __config_setting_create(setting, NULL, CONFIG_TYPE_INT); ------------------ | | 51| 5.90k|#define CONFIG_TYPE_INT 2 ------------------ 1616| 5.90k| } 1617| 0| else 1618| 0| { 1619| 0| element = config_setting_get_elem(setting, idx); 1620| | 1621| 0| if(! element) ------------------ | Branch (1621:8): [True: 0, False: 0] ------------------ 1622| 0| return(NULL); 1623| 0| } 1624| | 1625| 5.90k| if(! config_setting_set_int(element, value)) ------------------ | Branch (1625:6): [True: 0, False: 5.90k] ------------------ 1626| 0| return(NULL); 1627| | 1628| 5.90k| return(element); 1629| 5.90k|} config_setting_set_int64_elem: 1649| 3.68k|{ 1650| 3.68k| config_setting_t *element = NULL; 1651| | 1652| 3.68k| config_assert(setting != NULL); 1653| | 1654| 3.68k| if((setting->type != CONFIG_TYPE_ARRAY) ------------------ | | 56| 3.68k|#define CONFIG_TYPE_ARRAY 7 ------------------ | Branch (1654:6): [True: 1.89k, False: 1.79k] ------------------ 1655| 1.89k| && (setting->type != CONFIG_TYPE_LIST)) ------------------ | | 57| 1.89k|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (1655:9): [True: 0, False: 1.89k] ------------------ 1656| 0| return(NULL); 1657| | 1658| 3.68k| if(idx < 0) ------------------ | Branch (1658:6): [True: 3.68k, False: 0] ------------------ 1659| 3.68k| { 1660| 3.68k| if(! __config_list_checktype(setting, CONFIG_TYPE_INT64)) ------------------ | | 52| 3.68k|#define CONFIG_TYPE_INT64 3 ------------------ | Branch (1660:8): [True: 7, False: 3.68k] ------------------ 1661| 7| return(NULL); 1662| | 1663| 3.68k| element = __config_setting_create(setting, NULL, CONFIG_TYPE_INT64); ------------------ | | 52| 3.68k|#define CONFIG_TYPE_INT64 3 ------------------ 1664| 3.68k| } 1665| 0| else 1666| 0| { 1667| 0| element = config_setting_get_elem(setting, idx); 1668| | 1669| 0| if(! element) ------------------ | Branch (1669:8): [True: 0, False: 0] ------------------ 1670| 0| return(NULL); 1671| 0| } 1672| | 1673| 3.68k| if(! config_setting_set_int64(element, value)) ------------------ | Branch (1673:6): [True: 0, False: 3.68k] ------------------ 1674| 0| return(NULL); 1675| | 1676| 3.68k| return(element); 1677| 3.68k|} config_setting_set_float_elem: 1696| 12.9k|{ 1697| 12.9k| config_setting_t *element = NULL; 1698| | 1699| 12.9k| config_assert(setting != NULL); 1700| | 1701| 12.9k| if((setting->type != CONFIG_TYPE_ARRAY) ------------------ | | 56| 12.9k|#define CONFIG_TYPE_ARRAY 7 ------------------ | Branch (1701:6): [True: 8.14k, False: 4.82k] ------------------ 1702| 8.14k| && (setting->type != CONFIG_TYPE_LIST)) ------------------ | | 57| 8.14k|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (1702:9): [True: 0, False: 8.14k] ------------------ 1703| 0| return(NULL); 1704| | 1705| 12.9k| if(idx < 0) ------------------ | Branch (1705:6): [True: 12.9k, False: 0] ------------------ 1706| 12.9k| { 1707| 12.9k| if(! __config_list_checktype(setting, CONFIG_TYPE_FLOAT)) ------------------ | | 53| 12.9k|#define CONFIG_TYPE_FLOAT 4 ------------------ | Branch (1707:8): [True: 4, False: 12.9k] ------------------ 1708| 4| return(NULL); 1709| | 1710| 12.9k| element = __config_setting_create(setting, NULL, CONFIG_TYPE_FLOAT); ------------------ | | 53| 12.9k|#define CONFIG_TYPE_FLOAT 4 ------------------ 1711| 12.9k| } 1712| 0| else 1713| 0| element = config_setting_get_elem(setting, idx); 1714| | 1715| 12.9k| if(! element) ------------------ | Branch (1715:6): [True: 0, False: 12.9k] ------------------ 1716| 0| return(NULL); 1717| | 1718| 12.9k| if(! config_setting_set_float(element, value)) ------------------ | Branch (1718:6): [True: 0, False: 12.9k] ------------------ 1719| 0| return(NULL); 1720| | 1721| 12.9k| return(element); 1722| 12.9k|} config_setting_set_bool_elem: 1747| 955|{ 1748| 955| config_setting_t *element = NULL; 1749| | 1750| 955| config_assert(setting != NULL); 1751| | 1752| 955| if((setting->type != CONFIG_TYPE_ARRAY) ------------------ | | 56| 955|#define CONFIG_TYPE_ARRAY 7 ------------------ | Branch (1752:6): [True: 692, False: 263] ------------------ 1753| 692| && (setting->type != CONFIG_TYPE_LIST)) ------------------ | | 57| 692|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (1753:9): [True: 0, False: 692] ------------------ 1754| 0| return(NULL); 1755| | 1756| 955| if(idx < 0) ------------------ | Branch (1756:6): [True: 955, False: 0] ------------------ 1757| 955| { 1758| 955| if(! __config_list_checktype(setting, CONFIG_TYPE_BOOL)) ------------------ | | 55| 955|#define CONFIG_TYPE_BOOL 6 ------------------ | Branch (1758:8): [True: 3, False: 952] ------------------ 1759| 3| return(NULL); 1760| | 1761| 952| element = __config_setting_create(setting, NULL, CONFIG_TYPE_BOOL); ------------------ | | 55| 952|#define CONFIG_TYPE_BOOL 6 ------------------ 1762| 952| } 1763| 0| else 1764| 0| element = config_setting_get_elem(setting, idx); 1765| | 1766| 952| if(! element) ------------------ | Branch (1766:6): [True: 0, False: 952] ------------------ 1767| 0| return(NULL); 1768| | 1769| 952| if(! config_setting_set_bool(element, value)) ------------------ | Branch (1769:6): [True: 0, False: 952] ------------------ 1770| 0| return(NULL); 1771| | 1772| 952| return(element); 1773| 952|} config_setting_set_string_elem: 1798| 2.02k|{ 1799| 2.02k| config_setting_t *element = NULL; 1800| | 1801| 2.02k| config_assert(setting != NULL); 1802| 2.02k| config_assert(value != NULL); 1803| | 1804| 2.02k| if((setting->type != CONFIG_TYPE_ARRAY) ------------------ | | 56| 2.02k|#define CONFIG_TYPE_ARRAY 7 ------------------ | Branch (1804:6): [True: 576, False: 1.44k] ------------------ 1805| 576| && (setting->type != CONFIG_TYPE_LIST)) ------------------ | | 57| 576|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (1805:9): [True: 0, False: 576] ------------------ 1806| 0| return(NULL); 1807| | 1808| 2.02k| if(idx < 0) ------------------ | Branch (1808:6): [True: 2.02k, False: 0] ------------------ 1809| 2.02k| { 1810| 2.02k| if(! __config_list_checktype(setting, CONFIG_TYPE_STRING)) ------------------ | | 54| 2.02k|#define CONFIG_TYPE_STRING 5 ------------------ | Branch (1810:8): [True: 1, False: 2.02k] ------------------ 1811| 1| return(NULL); 1812| | 1813| 2.02k| element = __config_setting_create(setting, NULL, CONFIG_TYPE_STRING); ------------------ | | 54| 2.02k|#define CONFIG_TYPE_STRING 5 ------------------ 1814| 2.02k| } 1815| 0| else 1816| 0| element = config_setting_get_elem(setting, idx); 1817| | 1818| 2.02k| if(! element) ------------------ | Branch (1818:6): [True: 0, False: 2.02k] ------------------ 1819| 0| return(NULL); 1820| | 1821| 2.02k| if(! config_setting_set_string(element, value)) ------------------ | Branch (1821:6): [True: 0, False: 2.02k] ------------------ 1822| 0| return(NULL); 1823| | 1824| 2.02k| return(element); 1825| 2.02k|} config_setting_get_elem: 1831| 33.8k|{ 1832| 33.8k| config_list_t *list; 1833| | 1834| 33.8k| config_assert(setting != NULL); 1835| | 1836| 33.8k| if(! config_setting_is_aggregate(setting)) ------------------ | Branch (1836:6): [True: 42, False: 33.8k] ------------------ 1837| 42| return(NULL); 1838| | 1839| 33.8k| list = setting->value.list; 1840| 33.8k| if(! list) ------------------ | Branch (1840:6): [True: 21, False: 33.8k] ------------------ 1841| 21| return(NULL); 1842| | 1843| 33.8k| if(idx >= list->length) ------------------ | Branch (1843:6): [True: 0, False: 33.8k] ------------------ 1844| 0| return(NULL); 1845| | 1846| 33.8k| return(list->elements[idx]); 1847| 33.8k|} config_setting_get_member: 1853| 66.6k|{ 1854| 66.6k| config_assert(setting != NULL); 1855| | 1856| 66.6k| if(setting->type != CONFIG_TYPE_GROUP) ------------------ | | 50| 66.6k|#define CONFIG_TYPE_GROUP 1 ------------------ | Branch (1856:6): [True: 49.7k, False: 16.9k] ------------------ 1857| 49.7k| return(NULL); 1858| | 1859| 16.9k| if(!name) ------------------ | Branch (1859:6): [True: 0, False: 16.9k] ------------------ 1860| 0| return(NULL); 1861| | 1862| 16.9k| return(__config_list_search(setting->value.list, name, strlen(name), NULL)); 1863| 16.9k|} config_setting_length: 1896| 7.62k|{ 1897| 7.62k| config_assert(setting != NULL); 1898| | 1899| 7.62k| if(! config_setting_is_aggregate(setting)) ------------------ | Branch (1899:6): [True: 42, False: 7.58k] ------------------ 1900| 42| return(0); 1901| | 1902| 7.58k| if(! setting->value.list) ------------------ | Branch (1902:6): [True: 1.80k, False: 5.78k] ------------------ 1903| 1.80k| return(0); 1904| | 1905| 5.78k| return(setting->value.list->length); 1906| 7.58k|} config_setting_add: 1921| 64.9k|{ 1922| 64.9k| if((type < CONFIG_TYPE_NONE) || (type > CONFIG_TYPE_LIST)) ------------------ | | 49| 64.9k|#define CONFIG_TYPE_NONE 0 ------------------ if((type < CONFIG_TYPE_NONE) || (type > CONFIG_TYPE_LIST)) ------------------ | | 57| 64.9k|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (1922:6): [True: 0, False: 64.9k] | Branch (1922:35): [True: 0, False: 64.9k] ------------------ 1923| 0| return(NULL); 1924| | 1925| 64.9k| if(! parent) ------------------ | Branch (1925:6): [True: 0, False: 64.9k] ------------------ 1926| 0| return(NULL); 1927| | 1928| 64.9k| if((parent->type == CONFIG_TYPE_ARRAY) && !__config_type_is_scalar(type)) ------------------ | | 56| 64.9k|#define CONFIG_TYPE_ARRAY 7 ------------------ | Branch (1928:6): [True: 0, False: 64.9k] | Branch (1928:45): [True: 0, False: 0] ------------------ 1929| 0| return(NULL); /* only scalars can be added to arrays */ 1930| | 1931| 64.9k| if((parent->type == CONFIG_TYPE_ARRAY) || (parent->type == CONFIG_TYPE_LIST)) ------------------ | | 56| 64.9k|#define CONFIG_TYPE_ARRAY 7 ------------------ if((parent->type == CONFIG_TYPE_ARRAY) || (parent->type == CONFIG_TYPE_LIST)) ------------------ | | 57| 64.9k|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (1931:6): [True: 0, False: 64.9k] | Branch (1931:45): [True: 49.6k, False: 15.2k] ------------------ 1932| 49.6k| name = NULL; 1933| | 1934| 64.9k| if(name) ------------------ | Branch (1934:6): [True: 15.2k, False: 49.6k] ------------------ 1935| 15.2k| { 1936| 15.2k| if(! __config_validate_name(name)) ------------------ | Branch (1936:8): [True: 517, False: 14.7k] ------------------ 1937| 517| return(NULL); 1938| 15.2k| } 1939| | 1940| 64.4k| if(config_setting_get_member(parent, name) != NULL) ------------------ | Branch (1940:6): [True: 18, False: 64.4k] ------------------ 1941| 18| { 1942| 18| if(config_get_option(parent->config, CONFIG_OPTION_ALLOW_OVERRIDES)) ------------------ | | 71| 18|#define CONFIG_OPTION_ALLOW_OVERRIDES 0x80 ------------------ | Branch (1942:8): [True: 0, False: 18] ------------------ 1943| 0| config_setting_remove(parent, name); 1944| 18| else 1945| 18| return(NULL); /* already exists */ 1946| 18| } 1947| | 1948| 64.4k| return(__config_setting_create(parent, name, type)); 1949| 64.4k|} config_setting_remove: 1954| 1.29k|{ 1955| 1.29k| unsigned int idx; 1956| 1.29k| config_setting_t *setting; 1957| 1.29k| const char *settingName; 1958| 1.29k| const char *lastFound; 1959| | 1960| 1.29k| if(! parent || !name) ------------------ | Branch (1960:6): [True: 0, False: 1.29k] | Branch (1960:18): [True: 0, False: 1.29k] ------------------ 1961| 0| return(CONFIG_FALSE); ------------------ | | 74| 0|#define CONFIG_FALSE (0) ------------------ 1962| | 1963| 1.29k| if(parent->type != CONFIG_TYPE_GROUP) ------------------ | | 50| 1.29k|#define CONFIG_TYPE_GROUP 1 ------------------ | Branch (1963:6): [True: 0, False: 1.29k] ------------------ 1964| 0| return(CONFIG_FALSE); ------------------ | | 74| 0|#define CONFIG_FALSE (0) ------------------ 1965| | 1966| 1.29k| setting = config_setting_lookup(parent, name); 1967| 1.29k| if(! setting) ------------------ | Branch (1967:6): [True: 0, False: 1.29k] ------------------ 1968| 0| return(CONFIG_FALSE); ------------------ | | 74| 0|#define CONFIG_FALSE (0) ------------------ 1969| | 1970| 1.29k| settingName = name; 1971| 1.29k| do 1972| 1.29k| { 1973| 1.29k| lastFound = settingName; 1974| 7.50k| while(settingName && !strchr(PATH_TOKENS, *settingName)) ------------------ | | 50| 7.50k|#define PATH_TOKENS ":./" ------------------ | Branch (1974:11): [True: 7.50k, False: 0] | Branch (1974:26): [True: 6.21k, False: 1.29k] ------------------ 1975| 6.21k| ++settingName; 1976| | 1977| 1.29k| if(*settingName == '\0') ------------------ | Branch (1977:8): [True: 1.29k, False: 0] ------------------ 1978| 1.29k| { 1979| 1.29k| settingName = lastFound; 1980| 1.29k| break; 1981| 1.29k| } 1982| | 1983| 1.29k| } 1984| 1.29k| while(*++settingName); ------------------ | Branch (1984:9): [True: 0, False: 0] ------------------ 1985| | 1986| 1.29k| if(!(setting = __config_list_search(setting->parent->value.list, settingName, ------------------ | Branch (1986:6): [True: 0, False: 1.29k] ------------------ 1987| 1.29k| strlen(settingName), &idx))) 1988| 0| return(CONFIG_FALSE); ------------------ | | 74| 0|#define CONFIG_FALSE (0) ------------------ 1989| | 1990| 1.29k| __config_list_remove(setting->parent->value.list, idx); 1991| 1.29k| __config_setting_destroy(setting); 1992| | 1993| 1.29k| return(CONFIG_TRUE); ------------------ | | 73| 1.29k|#define CONFIG_TRUE (1) ------------------ 1994| 1.29k|} config_setting_is_aggregate: 2088| 223k|{ 2089| 223k| config_assert(setting != NULL); 2090| | 2091| 223k| return((setting->type == CONFIG_TYPE_ARRAY) ------------------ | | 56| 223k|#define CONFIG_TYPE_ARRAY 7 ------------------ | Branch (2091:10): [True: 23.1k, False: 200k] ------------------ 2092| 200k| || (setting->type == CONFIG_TYPE_LIST) ------------------ | | 57| 200k|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (2092:13): [True: 130k, False: 69.2k] ------------------ 2093| 69.2k| || (setting->type == CONFIG_TYPE_GROUP)); ------------------ | | 50| 69.2k|#define CONFIG_TYPE_GROUP 1 ------------------ | Branch (2093:13): [True: 36.8k, False: 32.3k] ------------------ 2094| 223k|} libconfig.c:__config_read: 556| 2.21k|{ 557| 2.21k| yyscan_t scanner; 558| 2.21k| struct scan_context scan_ctx; 559| 2.21k| struct parse_context parse_ctx; 560| 2.21k| int r; 561| | 562| 2.21k| config_clear(config); 563| | 564| 2.21k| libconfig_parsectx_init(&parse_ctx); ------------------ | | 40| 2.21k| __zero(C) | | ------------------ | | | | 39| 2.21k|#define __zero(P) memset((void *)(P), 0, sizeof(*P)) | | ------------------ ------------------ 565| 2.21k| parse_ctx.config = config; 566| 2.21k| parse_ctx.parent = config->root; 567| 2.21k| parse_ctx.setting = config->root; 568| | 569| 2.21k| __config_locale_override(); 570| | 571| 2.21k| libconfig_scanctx_init(&scan_ctx, filename); 572| 2.21k| config->root->file = libconfig_scanctx_current_filename(&scan_ctx); 573| 2.21k| scan_ctx.config = config; 574| 2.21k| libconfig_yylex_init_extra(&scan_ctx, &scanner); 575| | 576| 2.21k| if(stream) ------------------ | Branch (576:6): [True: 0, False: 2.21k] ------------------ 577| 0| libconfig_yyrestart(stream, scanner); 578| 2.21k| else /* read from string */ 579| 2.21k| (void)libconfig_yy_scan_string(str, scanner); 580| | 581| 2.21k| libconfig_yyset_lineno(1, scanner); 582| 2.21k| r = libconfig_yyparse(scanner, &parse_ctx, &scan_ctx); 583| | 584| 2.21k| if(r != 0) ------------------ | Branch (584:6): [True: 399, False: 1.81k] ------------------ 585| 399| { 586| 399| YY_BUFFER_STATE buf; 587| | 588| 399| config->error_file = libconfig_scanctx_current_filename(&scan_ctx); 589| 399| config->error_type = CONFIG_ERR_PARSE; 590| | 591| | /* Unwind the include stack, freeing the buffers and closing the files. */ 592| 399| while((buf = (YY_BUFFER_STATE)libconfig_scanctx_pop_include(&scan_ctx)) ------------------ | Branch (592:11): [True: 0, False: 399] ------------------ 593| 399| != NULL) 594| 0| libconfig_yy_delete_buffer(buf, scanner); 595| 399| } 596| | 597| 2.21k| libconfig_yylex_destroy(scanner); 598| 2.21k| config->filenames = libconfig_scanctx_cleanup(&scan_ctx); 599| 2.21k| libconfig_parsectx_cleanup(&parse_ctx); ------------------ | | 42| 2.21k| __delete(libconfig_strbuf_release(&((C)->string))) | | ------------------ | | | | 38| 2.21k|#define __delete(P) free((void *)(P)) | | ------------------ ------------------ 600| | 601| 2.21k| __config_locale_restore(); 602| | 603| 2.21k| return(r == 0 ? CONFIG_TRUE : CONFIG_FALSE); ------------------ | | 73| 1.81k|#define CONFIG_TRUE (1) ------------------ return(r == 0 ? CONFIG_TRUE : CONFIG_FALSE); ------------------ | | 74| 399|#define CONFIG_FALSE (0) ------------------ | Branch (603:10): [True: 1.81k, False: 399] ------------------ 604| 2.21k|} libconfig.c:__config_locale_override: 100| 3.51k|{ 101| |#if defined(LIBCONFIG_WINDOWS_OS) && !defined(LIBCONFIG_MINGW_OS) 102| | 103| | _configthreadlocale(_ENABLE_PER_THREAD_LOCALE); 104| | setlocale(LC_NUMERIC, "C"); 105| | 106| |#elif defined(__APPLE__) 107| | 108| | locale_t loc = newlocale(LC_NUMERIC_MASK, "C", NULL); 109| | uselocale(loc); 110| | 111| |#elif ((defined HAVE_NEWLOCALE) && (defined HAVE_USELOCALE)) 112| | 113| 3.51k| locale_t loc = newlocale(LC_NUMERIC, "C", NULL); 114| 3.51k| uselocale(loc); 115| | 116| |#else 117| | 118| |#warning "No way to modify calling thread's locale!" 119| | 120| |#endif 121| 3.51k|} libconfig.c:__config_write_setting: 631| 10.9k|{ 632| 10.9k| char group_assign_char = config_get_option( ------------------ | Branch (632:28): [True: 10.9k, False: 0] ------------------ 633| 10.9k| config, CONFIG_OPTION_COLON_ASSIGNMENT_FOR_GROUPS) ? ':' : '='; ------------------ | | 66| 10.9k|#define CONFIG_OPTION_COLON_ASSIGNMENT_FOR_GROUPS 0x04 ------------------ 634| | 635| 10.9k| char nongroup_assign_char = config_get_option( ------------------ | Branch (635:31): [True: 0, False: 10.9k] ------------------ 636| 10.9k| config, CONFIG_OPTION_COLON_ASSIGNMENT_FOR_NON_GROUPS) ? ':' : '='; ------------------ | | 67| 10.9k|#define CONFIG_OPTION_COLON_ASSIGNMENT_FOR_NON_GROUPS 0x08 ------------------ 637| | 638| 10.9k| if(depth > 1) ------------------ | Branch (638:6): [True: 6.34k, False: 4.58k] ------------------ 639| 6.34k| __config_indent(stream, depth, config->tab_width); 640| | 641| | 642| 10.9k| if(setting->name) ------------------ | Branch (642:6): [True: 9.62k, False: 1.29k] ------------------ 643| 9.62k| { 644| 9.62k| fputs(setting->name, stream); 645| 9.62k| fprintf(stream, " %c ", ((setting->type == CONFIG_TYPE_GROUP) ------------------ | | 50| 9.62k|#define CONFIG_TYPE_GROUP 1 ------------------ | Branch (645:30): [True: 2.34k, False: 7.28k] ------------------ 646| 9.62k| ? group_assign_char 647| 9.62k| : nongroup_assign_char)); 648| 9.62k| } 649| | 650| 10.9k| __config_write_value(config, &(setting->value), setting->type, 651| 10.9k| config_setting_get_format(setting), depth, stream); 652| | 653| 10.9k| if(depth > 0) ------------------ | Branch (653:6): [True: 9.62k, False: 1.29k] ------------------ 654| 9.62k| { 655| 9.62k| if(config_get_option(config, CONFIG_OPTION_SEMICOLON_SEPARATORS)) ------------------ | | 65| 9.62k|#define CONFIG_OPTION_SEMICOLON_SEPARATORS 0x02 ------------------ | Branch (655:8): [True: 9.62k, False: 0] ------------------ 656| 9.62k| fputc(';', stream); 657| | 658| 9.62k| fputc('\n', stream); 659| 9.62k| } 660| 10.9k|} libconfig.c:__config_indent: 146| 10.7k|{ 147| 10.7k| if(w) ------------------ | Branch (147:6): [True: 10.7k, False: 0] ------------------ 148| 10.7k| fprintf(stream, "%*s", (depth - 1) * w, " "); 149| 0| else 150| 0| { 151| 0| int i; 152| 0| for(i = 0; i < (depth - 1); ++i) ------------------ | Branch (152:16): [True: 0, False: 0] ------------------ 153| 0| fputc('\t', stream); 154| 0| } 155| 10.7k|} libconfig.c:__config_write_value: 162| 32.3k|{ 163| | /* Long enough for 64-bit binary value + NULL terminator. */ 164| 32.3k| char value_buf[(sizeof(int64_t) * BITS_IN_BYTE) + 1]; 165| | 166| 32.3k| switch(type) 167| 32.3k| { 168| | /* boolean */ 169| 869| case CONFIG_TYPE_BOOL: ------------------ | | 55| 869|#define CONFIG_TYPE_BOOL 6 ------------------ | Branch (169:5): [True: 869, False: 31.4k] ------------------ 170| 869| fputs(value->ival ? "true" : "false", stream); ------------------ | Branch (170:13): [True: 736, False: 133] ------------------ 171| 869| break; 172| | 173| | /* int */ 174| 7.32k| case CONFIG_TYPE_INT: ------------------ | | 51| 7.32k|#define CONFIG_TYPE_INT 2 ------------------ | Branch (174:5): [True: 7.32k, False: 24.9k] ------------------ 175| 7.32k| switch(format) 176| 7.32k| { 177| 999| case CONFIG_FORMAT_HEX: ------------------ | | 60| 999|#define CONFIG_FORMAT_HEX 1 ------------------ | Branch (177:9): [True: 999, False: 6.32k] ------------------ 178| 999| fprintf(stream, "0x%X", value->ival); 179| 999| break; 180| | 181| 941| case CONFIG_FORMAT_BIN: ------------------ | | 61| 941|#define CONFIG_FORMAT_BIN 2 ------------------ | Branch (181:9): [True: 941, False: 6.38k] ------------------ 182| 941| { 183| | /* Once %b/%B become more widely supported, could feature test for them */ 184| 941| char *str = libconfig_format_bin(value->ival, value_buf); 185| 941| fprintf(stream, "0b%s", str); 186| 941| break; 187| 0| } 188| | 189| 0| case CONFIG_FORMAT_OCT: ------------------ | | 62| 0|#define CONFIG_FORMAT_OCT 3 ------------------ | Branch (189:9): [True: 0, False: 7.32k] ------------------ 190| 0| fprintf(stream, "0o%o", value->ival); 191| 0| break; 192| | 193| 5.38k| case CONFIG_FORMAT_DEFAULT: ------------------ | | 59| 5.38k|#define CONFIG_FORMAT_DEFAULT 0 ------------------ | Branch (193:9): [True: 5.38k, False: 1.94k] ------------------ 194| 5.38k| default: ------------------ | Branch (194:9): [True: 0, False: 7.32k] ------------------ 195| 5.38k| fprintf(stream, "%d", value->ival); 196| 5.38k| break; 197| 7.32k| } 198| 7.32k| break; 199| | 200| | /* 64-bit int */ 201| 7.32k| case CONFIG_TYPE_INT64: ------------------ | | 52| 2.99k|#define CONFIG_TYPE_INT64 3 ------------------ | Branch (201:5): [True: 2.99k, False: 29.3k] ------------------ 202| 2.99k| switch(format) 203| 2.99k| { 204| 548| case CONFIG_FORMAT_HEX: ------------------ | | 60| 548|#define CONFIG_FORMAT_HEX 1 ------------------ | Branch (204:9): [True: 548, False: 2.44k] ------------------ 205| 548| fprintf(stream, "0x" INT64_HEX_FMT "L", value->llval); 206| 548| break; 207| | 208| 936| case CONFIG_FORMAT_BIN: ------------------ | | 61| 936|#define CONFIG_FORMAT_BIN 2 ------------------ | Branch (208:9): [True: 936, False: 2.05k] ------------------ 209| 936| { 210| | /* Once %b/%B become more widely supported, could feature test for them */ 211| 936| char *str = libconfig_format_bin(value->llval, value_buf); 212| 936| fprintf(stream, "0b%sL", str); 213| 936| break; 214| 0| } 215| | 216| 0| case CONFIG_FORMAT_OCT: ------------------ | | 62| 0|#define CONFIG_FORMAT_OCT 3 ------------------ | Branch (216:9): [True: 0, False: 2.99k] ------------------ 217| 0| fprintf(stream, "0o%lloL", value->llval); 218| 0| break; 219| | 220| 1.50k| case CONFIG_FORMAT_DEFAULT: ------------------ | | 59| 1.50k|#define CONFIG_FORMAT_DEFAULT 0 ------------------ | Branch (220:9): [True: 1.50k, False: 1.48k] ------------------ 221| 1.50k| default: ------------------ | Branch (221:9): [True: 0, False: 2.99k] ------------------ 222| 1.50k| fprintf(stream, INT64_FMT "L", value->llval); ------------------ | | 95| 1.50k|#define INT64_FMT "%lld" ------------------ 223| 1.50k| break; 224| 2.99k| } 225| 2.99k| break; 226| | 227| | /* float */ 228| 12.7k| case CONFIG_TYPE_FLOAT: ------------------ | | 53| 12.7k|#define CONFIG_TYPE_FLOAT 4 ------------------ | Branch (228:5): [True: 12.7k, False: 19.5k] ------------------ 229| 12.7k| { 230| 12.7k| const int sci_ok = config_get_option( 231| 12.7k| config, CONFIG_OPTION_ALLOW_SCIENTIFIC_NOTATION); ------------------ | | 69| 12.7k|#define CONFIG_OPTION_ALLOW_SCIENTIFIC_NOTATION 0x20 ------------------ 232| 12.7k| libconfig_format_double(value->fval, config->float_precision, sci_ok, 233| 12.7k| value_buf, sizeof(value_buf)); 234| 12.7k| fputs(value_buf, stream); 235| 12.7k| break; 236| 2.99k| } 237| | 238| | /* string */ 239| 1.85k| case CONFIG_TYPE_STRING: ------------------ | | 54| 1.85k|#define CONFIG_TYPE_STRING 5 ------------------ | Branch (239:5): [True: 1.85k, False: 30.4k] ------------------ 240| 1.85k| { 241| 1.85k| char *p; 242| | 243| 1.85k| fputc('\"', stream); 244| | 245| 1.85k| if(value->sval) ------------------ | Branch (245:10): [True: 1.85k, False: 0] ------------------ 246| 1.85k| { 247| 10.0k| for(p = value->sval; *p; p++) ------------------ | Branch (247:30): [True: 8.16k, False: 1.85k] ------------------ 248| 8.16k| { 249| 8.16k| int c = (int)*p & 0xFF; 250| 8.16k| switch(c) 251| 8.16k| { 252| 478| case '\"': ------------------ | Branch (252:13): [True: 478, False: 7.68k] ------------------ 253| 984| case '\\': ------------------ | Branch (253:13): [True: 506, False: 7.65k] ------------------ 254| 984| fputc('\\', stream); 255| 984| fputc(c, stream); 256| 984| break; 257| | 258| 299| case '\n': ------------------ | Branch (258:13): [True: 299, False: 7.86k] ------------------ 259| 299| fputs("\\n", stream); 260| 299| break; 261| | 262| 297| case '\r': ------------------ | Branch (262:13): [True: 297, False: 7.86k] ------------------ 263| 297| fputs("\\r", stream); 264| 297| break; 265| | 266| 371| case '\f': ------------------ | Branch (266:13): [True: 371, False: 7.79k] ------------------ 267| 371| fputs("\\f", stream); 268| 371| break; 269| | 270| 406| case '\t': ------------------ | Branch (270:13): [True: 406, False: 7.75k] ------------------ 271| 406| fputs("\\t", stream); 272| 406| break; 273| | 274| 5.80k| default: ------------------ | Branch (274:13): [True: 5.80k, False: 2.35k] ------------------ 275| 5.80k| if(c >= ' ') ------------------ | Branch (275:18): [True: 5.07k, False: 731] ------------------ 276| 5.07k| fputc(c, stream); 277| 731| else 278| 731| fprintf(stream, "\\x%02X", c); 279| 8.16k| } 280| 8.16k| } 281| 1.85k| } 282| 1.85k| fputc('\"', stream); 283| 1.85k| break; 284| 1.85k| } 285| | 286| | /* list */ 287| 1.00k| case CONFIG_TYPE_LIST: ------------------ | | 57| 1.00k|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (287:5): [True: 1.00k, False: 31.3k] ------------------ 288| 1.00k| { 289| 1.00k| config_list_t *list = value->list; 290| | 291| 1.00k| fputs("( ", stream); 292| | 293| 1.00k| if(list) ------------------ | Branch (293:10): [True: 770, False: 232] ------------------ 294| 770| { 295| 770| int len = list->length; 296| 770| config_setting_t **s; 297| | 298| 14.2k| for(s = list->elements; len--; s++) ------------------ | Branch (298:33): [True: 13.5k, False: 770] ------------------ 299| 13.5k| { 300| 13.5k| __config_write_value(config, &((*s)->value), (*s)->type, 301| 13.5k| config_setting_get_format(*s), depth + 1, 302| 13.5k| stream); 303| | 304| 13.5k| if(len) ------------------ | Branch (304:14): [True: 12.7k, False: 770] ------------------ 305| 12.7k| fputc(',', stream); 306| | 307| 13.5k| fputc(' ', stream); 308| 13.5k| } 309| 770| } 310| | 311| 1.00k| fputc(')', stream); 312| 1.00k| break; 313| 1.85k| } 314| | 315| | /* array */ 316| 1.28k| case CONFIG_TYPE_ARRAY: ------------------ | | 56| 1.28k|#define CONFIG_TYPE_ARRAY 7 ------------------ | Branch (316:5): [True: 1.28k, False: 31.0k] ------------------ 317| 1.28k| { 318| 1.28k| config_list_t *list = value->list; 319| | 320| 1.28k| fputs("[ ", stream); 321| | 322| 1.28k| if(list) ------------------ | Branch (322:10): [True: 824, False: 456] ------------------ 323| 824| { 324| 824| int len = list->length; 325| 824| config_setting_t **s; 326| | 327| 8.69k| for(s = list->elements; len--; s++) ------------------ | Branch (327:33): [True: 7.87k, False: 824] ------------------ 328| 7.87k| { 329| 7.87k| __config_write_value(config, &((*s)->value), (*s)->type, 330| 7.87k| config_setting_get_format(*s), depth + 1, 331| 7.87k| stream); 332| | 333| 7.87k| if(len) ------------------ | Branch (333:14): [True: 7.05k, False: 824] ------------------ 334| 7.05k| fputc(',', stream); 335| | 336| 7.87k| fputc(' ', stream); 337| 7.87k| } 338| 824| } 339| | 340| 1.28k| fputc(']', stream); 341| 1.28k| break; 342| 1.85k| } 343| | 344| | /* group */ 345| 4.20k| case CONFIG_TYPE_GROUP: ------------------ | | 50| 4.20k|#define CONFIG_TYPE_GROUP 1 ------------------ | Branch (345:5): [True: 4.20k, False: 28.1k] ------------------ 346| 4.20k| { 347| 4.20k| config_list_t *list = value->list; 348| | 349| 4.20k| if(depth > 0) ------------------ | Branch (349:10): [True: 2.90k, False: 1.29k] ------------------ 350| 2.90k| { 351| 2.90k| if(config_get_option(config, CONFIG_OPTION_OPEN_BRACE_ON_SEPARATE_LINE)) ------------------ | | 68| 2.90k|#define CONFIG_OPTION_OPEN_BRACE_ON_SEPARATE_LINE 0x10 ------------------ | Branch (351:12): [True: 2.90k, False: 0] ------------------ 352| 2.90k| { 353| 2.90k| fputc('\n', stream); 354| | 355| 2.90k| if(depth > 1) ------------------ | Branch (355:14): [True: 2.22k, False: 676] ------------------ 356| 2.22k| __config_indent(stream, depth, config->tab_width); 357| 2.90k| } 358| | 359| 2.90k| fputs("{\n", stream); 360| 2.90k| } 361| | 362| 4.20k| if(list) ------------------ | Branch (362:10): [True: 3.51k, False: 685] ------------------ 363| 3.51k| { 364| 3.51k| int len = list->length; 365| 3.51k| config_setting_t **s; 366| | 367| 13.1k| for(s = list->elements; len--; s++) ------------------ | Branch (367:33): [True: 9.62k, False: 3.51k] ------------------ 368| 9.62k| __config_write_setting(config, *s, stream, depth + 1); 369| 3.51k| } 370| | 371| 4.20k| if(depth > 1) ------------------ | Branch (371:10): [True: 2.22k, False: 1.97k] ------------------ 372| 2.22k| __config_indent(stream, depth, config->tab_width); 373| | 374| 4.20k| if(depth > 0) ------------------ | Branch (374:10): [True: 2.90k, False: 1.29k] ------------------ 375| 2.90k| fputc('}', stream); 376| | 377| 4.20k| break; 378| 1.85k| } 379| | 380| 0| default: ------------------ | Branch (380:5): [True: 0, False: 32.3k] ------------------ 381| | /* this shouldn't happen, but handle it gracefully... */ 382| 0| fputs("???", stream); 383| 0| break; 384| 32.3k| } 385| 32.3k|} libconfig.c:__config_locale_restore: 126| 3.51k|{ 127| |#if defined(LIBCONFIG_WINDOWS_OS) && !defined(LIBCONFIG_MINGW_OS) 128| | 129| | _configthreadlocale(_DISABLE_PER_THREAD_LOCALE); 130| | 131| |#elif ((defined HAVE_USELOCALE) && (defined HAVE_FREELOCALE)) 132| | 133| 3.51k| locale_t loc = uselocale(LC_GLOBAL_LOCALE); 134| 3.51k| freelocale(loc); 135| | 136| |#else 137| | 138| |#warning "No way to modify calling thread's locale!" 139| | 140| |#endif 141| 3.51k|} libconfig.c:__config_setting_destroy: 458| 96.8k|{ 459| 96.8k| if(setting) ------------------ | Branch (459:6): [True: 94.4k, False: 2.32k] ------------------ 460| 94.4k| { 461| 94.4k| if(setting->name) ------------------ | Branch (461:8): [True: 14.7k, False: 79.7k] ------------------ 462| 14.7k| __delete(setting->name); ------------------ | | 38| 14.7k|#define __delete(P) free((void *)(P)) ------------------ 463| | 464| 94.4k| if(setting->type == CONFIG_TYPE_STRING) ------------------ | | 54| 94.4k|#define CONFIG_TYPE_STRING 5 ------------------ | Branch (464:8): [True: 2.63k, False: 91.8k] ------------------ 465| 2.63k| __delete(setting->value.sval); ------------------ | | 38| 2.63k|#define __delete(P) free((void *)(P)) ------------------ 466| | 467| 91.8k| else if(config_setting_is_aggregate(setting)) ------------------ | Branch (467:13): [True: 59.5k, False: 32.2k] ------------------ 468| 59.5k| { 469| 59.5k| if(setting->value.list) ------------------ | Branch (469:10): [True: 55.1k, False: 4.42k] ------------------ 470| 55.1k| __config_list_destroy(setting->value.list); 471| 59.5k| } 472| | 473| 94.4k| if(setting->hook && setting->config->destructor) ------------------ | Branch (473:8): [True: 0, False: 94.4k] | Branch (473:25): [True: 0, False: 0] ------------------ 474| 0| setting->config->destructor(setting->hook); 475| | 476| 94.4k| __delete(setting); ------------------ | | 38| 94.4k|#define __delete(P) free((void *)(P)) ------------------ 477| 94.4k| } 478| 96.8k|} libconfig.c:__config_list_destroy: 483| 55.1k|{ 484| 55.1k| config_setting_t **p; 485| 55.1k| unsigned int i; 486| | 487| 55.1k| if(! list) ------------------ | Branch (487:6): [True: 0, False: 55.1k] ------------------ 488| 0| return; 489| | 490| 55.1k| if(list->elements) ------------------ | Branch (490:6): [True: 55.1k, False: 0] ------------------ 491| 55.1k| { 492| 143k| for(p = list->elements, i = 0; i < list->length; p++, i++) ------------------ | Branch (492:36): [True: 88.6k, False: 55.1k] ------------------ 493| 88.6k| __config_setting_destroy(*p); 494| | 495| 55.1k| __delete(list->elements); ------------------ | | 38| 55.1k|#define __delete(P) free((void *)(P)) ------------------ 496| 55.1k| } 497| | 498| 55.1k| __delete(list); ------------------ | | 38| 55.1k|#define __delete(P) free((void *)(P)) ------------------ 499| 55.1k|} libconfig.c:__config_setting_get_int: 930| 168|{ 931| 168| switch(setting->type) 932| 168| { 933| 3| case CONFIG_TYPE_INT: ------------------ | | 51| 3|#define CONFIG_TYPE_INT 2 ------------------ | Branch (933:5): [True: 3, False: 165] ------------------ 934| 3| *value = setting->value.ival; 935| 3| return(CONFIG_TRUE); ------------------ | | 73| 3|#define CONFIG_TRUE (1) ------------------ 936| | 937| 157| case CONFIG_TYPE_INT64: ------------------ | | 52| 157|#define CONFIG_TYPE_INT64 3 ------------------ | Branch (937:5): [True: 157, False: 11] ------------------ 938| 157| if((setting->value.llval >= INT32_MIN) ------------------ | Branch (938:10): [True: 88, False: 69] ------------------ 939| 88| && (setting->value.llval <= INT32_MAX)) ------------------ | Branch (939:13): [True: 70, False: 18] ------------------ 940| 70| { 941| 70| *value = (int)(setting->value.llval); 942| 70| return(CONFIG_TRUE); ------------------ | | 73| 70|#define CONFIG_TRUE (1) ------------------ 943| 70| } 944| 87| else 945| 87| return(CONFIG_FALSE); ------------------ | | 74| 87|#define CONFIG_FALSE (0) ------------------ 946| | 947| 3| case CONFIG_TYPE_FLOAT: ------------------ | | 53| 3|#define CONFIG_TYPE_FLOAT 4 ------------------ | Branch (947:5): [True: 3, False: 165] ------------------ 948| 3| if(config_get_option(setting->config, CONFIG_OPTION_AUTOCONVERT)) ------------------ | | 64| 3|#define CONFIG_OPTION_AUTOCONVERT 0x01 ------------------ | Branch (948:10): [True: 0, False: 3] ------------------ 949| 0| { 950| 0| *value = (int)(setting->value.fval); 951| 0| return(CONFIG_TRUE); ------------------ | | 73| 0|#define CONFIG_TRUE (1) ------------------ 952| 0| } 953| 3| else 954| 3| return(CONFIG_FALSE); ------------------ | | 74| 3|#define CONFIG_FALSE (0) ------------------ 955| | 956| 5| default: ------------------ | Branch (956:5): [True: 5, False: 163] ------------------ 957| 5| return(CONFIG_FALSE); ------------------ | | 74| 5|#define CONFIG_FALSE (0) ------------------ 958| 168| } 959| 168|} libconfig.c:__config_setting_get_int64: 987| 11|{ 988| 11| switch(setting->type) 989| 11| { 990| 1| case CONFIG_TYPE_INT64: ------------------ | | 52| 1|#define CONFIG_TYPE_INT64 3 ------------------ | Branch (990:5): [True: 1, False: 10] ------------------ 991| 1| *value = setting->value.llval; 992| 1| return(CONFIG_TRUE); ------------------ | | 73| 1|#define CONFIG_TRUE (1) ------------------ 993| | 994| 3| case CONFIG_TYPE_INT: ------------------ | | 51| 3|#define CONFIG_TYPE_INT 2 ------------------ | Branch (994:5): [True: 3, False: 8] ------------------ 995| 3| *value = (long long)(setting->value.ival); 996| 3| return(CONFIG_TRUE); ------------------ | | 73| 3|#define CONFIG_TRUE (1) ------------------ 997| | 998| 4| case CONFIG_TYPE_FLOAT: ------------------ | | 53| 4|#define CONFIG_TYPE_FLOAT 4 ------------------ | Branch (998:5): [True: 4, False: 7] ------------------ 999| 4| if(config_get_option(setting->config, CONFIG_OPTION_AUTOCONVERT)) ------------------ | | 64| 4|#define CONFIG_OPTION_AUTOCONVERT 0x01 ------------------ | Branch (999:10): [True: 0, False: 4] ------------------ 1000| 0| { 1001| 0| *value = (long long)(setting->value.fval); 1002| 0| return(CONFIG_TRUE); ------------------ | | 73| 0|#define CONFIG_TRUE (1) ------------------ 1003| 0| } 1004| 4| else 1005| 4| return(CONFIG_FALSE); ------------------ | | 74| 4|#define CONFIG_FALSE (0) ------------------ 1006| | 1007| 3| default: ------------------ | Branch (1007:5): [True: 3, False: 8] ------------------ 1008| 3| return(CONFIG_FALSE); ------------------ | | 74| 3|#define CONFIG_FALSE (0) ------------------ 1009| 11| } 1010| 11|} libconfig.c:__config_setting_get_float: 1074| 10|{ 1075| 10| switch(setting->type) 1076| 10| { 1077| 4| case CONFIG_TYPE_FLOAT: ------------------ | | 53| 4|#define CONFIG_TYPE_FLOAT 4 ------------------ | Branch (1077:5): [True: 4, False: 6] ------------------ 1078| 4| *value = setting->value.fval; 1079| 4| return(CONFIG_TRUE); ------------------ | | 73| 4|#define CONFIG_TRUE (1) ------------------ 1080| | 1081| 3| case CONFIG_TYPE_INT: ------------------ | | 51| 3|#define CONFIG_TYPE_INT 2 ------------------ | Branch (1081:5): [True: 3, False: 7] ------------------ 1082| 3| if(config_get_auto_convert(setting->config)) ------------------ | | 271| 3| config_get_option((C), CONFIG_OPTION_AUTOCONVERT) | | ------------------ | | | | 64| 3|#define CONFIG_OPTION_AUTOCONVERT 0x01 | | ------------------ | | | Branch (271:3): [True: 0, False: 3] | | ------------------ ------------------ 1083| 0| { 1084| 0| *value = (double)(setting->value.ival); 1085| 0| return(CONFIG_TRUE); ------------------ | | 73| 0|#define CONFIG_TRUE (1) ------------------ 1086| 0| } 1087| 3| else 1088| 3| return(CONFIG_FALSE); ------------------ | | 74| 3|#define CONFIG_FALSE (0) ------------------ 1089| | 1090| 1| case CONFIG_TYPE_INT64: ------------------ | | 52| 1|#define CONFIG_TYPE_INT64 3 ------------------ | Branch (1090:5): [True: 1, False: 9] ------------------ 1091| 1| if(config_get_auto_convert(setting->config)) ------------------ | | 271| 1| config_get_option((C), CONFIG_OPTION_AUTOCONVERT) | | ------------------ | | | | 64| 1|#define CONFIG_OPTION_AUTOCONVERT 0x01 | | ------------------ | | | Branch (271:3): [True: 0, False: 1] | | ------------------ ------------------ 1092| 0| { 1093| 0| *value = (double)(setting->value.llval); 1094| 0| return(CONFIG_TRUE); ------------------ | | 73| 0|#define CONFIG_TRUE (1) ------------------ 1095| 0| } 1096| 1| else 1097| 1| return(CONFIG_FALSE); ------------------ | | 74| 1|#define CONFIG_FALSE (0) ------------------ 1098| | 1099| 2| default: ------------------ | Branch (1099:5): [True: 2, False: 8] ------------------ 1100| 2| return(CONFIG_FALSE); ------------------ | | 74| 2|#define CONFIG_FALSE (0) ------------------ 1101| 10| } 1102| 10|} libconfig.c:__config_list_search: 411| 19.5k|{ 412| 19.5k| config_setting_t **found = NULL; 413| 19.5k| unsigned int i; 414| | 415| 19.5k| if(! list || ! name) ------------------ | Branch (415:6): [True: 6.49k, False: 13.0k] | Branch (415:16): [True: 0, False: 13.0k] ------------------ 416| 6.49k| return(NULL); 417| | 418| 93.1k| for(i = 0, found = list->elements; i < list->length; i++, found++) ------------------ | Branch (418:38): [True: 83.3k, False: 9.83k] ------------------ 419| 83.3k| { 420| 83.3k| if(! (*found)->name) ------------------ | Branch (420:8): [True: 0, False: 83.3k] ------------------ 421| 0| continue; 422| | 423| 83.3k| if((strlen((*found)->name) == namelen) ------------------ | Branch (423:8): [True: 23.9k, False: 59.3k] ------------------ 424| 23.9k| && !strncmp(name, (*found)->name, namelen)) ------------------ | Branch (424:12): [True: 3.24k, False: 20.6k] ------------------ 425| 3.24k| { 426| 3.24k| if(idx) ------------------ | Branch (426:10): [True: 1.29k, False: 1.94k] ------------------ 427| 1.29k| *idx = i; 428| | 429| 3.24k| return(*found); 430| 3.24k| } 431| 83.3k| } 432| | 433| 9.83k| return(NULL); 434| 13.0k|} libconfig.c:__config_list_checktype: 504| 25.5k|{ 505| | /* if the array is empty, then it has no type yet */ 506| | 507| 25.5k| if(! setting->value.list) ------------------ | Branch (507:6): [True: 2.15k, False: 23.3k] ------------------ 508| 2.15k| return(CONFIG_TRUE); ------------------ | | 73| 2.15k|#define CONFIG_TRUE (1) ------------------ 509| | 510| 23.3k| if(setting->value.list->length == 0) ------------------ | Branch (510:6): [True: 0, False: 23.3k] ------------------ 511| 0| return(CONFIG_TRUE); ------------------ | | 73| 0|#define CONFIG_TRUE (1) ------------------ 512| | 513| | /* if it's a list, any type is allowed */ 514| | 515| 23.3k| if(setting->type == CONFIG_TYPE_LIST) ------------------ | | 57| 23.3k|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (515:6): [True: 14.2k, False: 9.09k] ------------------ 516| 14.2k| return(CONFIG_TRUE); ------------------ | | 73| 14.2k|#define CONFIG_TRUE (1) ------------------ 517| | 518| | /* otherwise the first element added determines the type of the array */ 519| | 520| 9.09k| return((setting->value.list->elements[0]->type == type) ------------------ | Branch (520:10): [True: 9.06k, False: 32] ------------------ 521| 9.09k| ? CONFIG_TRUE : CONFIG_FALSE); ------------------ | | 73| 9.06k|#define CONFIG_TRUE (1) ------------------ ? CONFIG_TRUE : CONFIG_FALSE); ------------------ | | 74| 32|#define CONFIG_FALSE (0) ------------------ 522| 23.3k|} libconfig.c:__config_setting_create: 901| 89.9k|{ 902| 89.9k| config_setting_t *setting; 903| 89.9k| config_list_t *list; 904| | 905| 89.9k| if(!config_setting_is_aggregate(parent)) ------------------ | Branch (905:6): [True: 0, False: 89.9k] ------------------ 906| 0| return(NULL); 907| | 908| 89.9k| setting = __new(config_setting_t); ------------------ | | 37| 89.9k|#define __new(T) (T *)libconfig_calloc(1, sizeof(T)) /* zeroed */ ------------------ 909| 89.9k| setting->parent = parent; 910| 89.9k| setting->name = (name == NULL) ? NULL : strdup(name); ------------------ | Branch (910:19): [True: 75.1k, False: 14.7k] ------------------ 911| 89.9k| setting->type = type; 912| 89.9k| setting->config = parent->config; 913| 89.9k| setting->hook = NULL; 914| 89.9k| setting->line = 0; 915| | 916| 89.9k| list = parent->value.list; 917| | 918| 89.9k| if(! list) ------------------ | Branch (918:6): [True: 55.1k, False: 34.8k] ------------------ 919| 55.1k| list = parent->value.list = __new(config_list_t); ------------------ | | 37| 55.1k|#define __new(T) (T *)libconfig_calloc(1, sizeof(T)) /* zeroed */ ------------------ 920| | 921| 89.9k| __config_list_add(list, setting); 922| | 923| 89.9k| return(setting); 924| 89.9k|} libconfig.c:__config_list_add: 390| 89.9k|{ 391| 89.9k| if((list->length % CHUNK_SIZE) == 0) ------------------ | | 51| 89.9k|#define CHUNK_SIZE 16 ------------------ | Branch (391:6): [True: 56.7k, False: 33.2k] ------------------ 392| 56.7k| { 393| 56.7k| list->elements = (config_setting_t **)libconfig_realloc( 394| 56.7k| list->elements, 395| 56.7k| (list->length + CHUNK_SIZE) * sizeof(config_setting_t *)); ------------------ | | 51| 56.7k|#define CHUNK_SIZE 16 ------------------ 396| 56.7k| } 397| | 398| 89.9k| list->elements[list->length] = setting; 399| 89.9k| list->length++; 400| 89.9k|} libconfig.c:__config_validate_name: 534| 15.2k|{ 535| 15.2k| const char *p = name; 536| | 537| 15.2k| if(*p == '\0') ------------------ | Branch (537:6): [True: 321, False: 14.9k] ------------------ 538| 321| return(CONFIG_FALSE); ------------------ | | 74| 321|#define CONFIG_FALSE (0) ------------------ 539| | 540| 14.9k| if(! isalpha((int)*p) && (*p != '*')) ------------------ | Branch (540:6): [True: 1.12k, False: 13.8k] | Branch (540:28): [True: 94, False: 1.03k] ------------------ 541| 94| return(CONFIG_FALSE); ------------------ | | 74| 94|#define CONFIG_FALSE (0) ------------------ 542| | 543| 84.3k| for(++p; *p; ++p) ------------------ | Branch (543:12): [True: 69.5k, False: 14.7k] ------------------ 544| 69.5k| { 545| 69.5k| if(! (isalpha((int)*p) || isdigit((int)*p) || strchr("*_-", (int)*p))) ------------------ | Branch (545:11): [True: 49.8k, False: 19.7k] | Branch (545:31): [True: 16.8k, False: 2.88k] | Branch (545:51): [True: 2.77k, False: 102] ------------------ 546| 102| return(CONFIG_FALSE); ------------------ | | 74| 102|#define CONFIG_FALSE (0) ------------------ 547| 69.5k| } 548| | 549| 14.7k| return(CONFIG_TRUE); ------------------ | | 73| 14.7k|#define CONFIG_TRUE (1) ------------------ 550| 14.8k|} libconfig.c:__config_list_remove: 439| 1.29k|{ 440| 1.29k| config_setting_t *removed = *(list->elements + idx); 441| 1.29k| int offset = (idx * sizeof(config_setting_t *)); 442| 1.29k| int len = list->length - 1 - idx; 443| 1.29k| char *base = (char *)list->elements + offset; 444| | 445| 1.29k| memmove(base, base + sizeof(config_setting_t *), 446| 1.29k| len * sizeof(config_setting_t *)); 447| | 448| 1.29k| list->length--; 449| | 450| | /* possibly realloc smaller? */ 451| | 452| 1.29k| return(removed); 453| 1.29k|} libconfig_scanctx_init: 40| 2.21k|{ 41| 2.21k| __zero(ctx); ------------------ | | 39| 2.21k|#define __zero(P) memset((void *)(P), 0, sizeof(*P)) ------------------ 42| 2.21k| if(top_filename) ------------------ | Branch (42:6): [True: 0, False: 2.21k] ------------------ 43| 0| { 44| 0| ctx->top_filename = strdup(top_filename); 45| 0| libconfig_strvec_append(&(ctx->filenames), ctx->top_filename); 46| 0| } 47| 2.21k|} libconfig_scanctx_cleanup: 52| 2.21k|{ 53| 2.21k| int i; 54| | 55| 2.21k| for(i = 0; i < ctx->stack_depth; ++i) ------------------ | Branch (55:14): [True: 0, False: 2.21k] ------------------ 56| 0| { 57| 0| struct include_stack_frame *frame = &(ctx->include_stack[i]); 58| | 59| 0| if(frame->current_stream) ------------------ | Branch (59:8): [True: 0, False: 0] ------------------ 60| 0| fclose(frame->current_stream); 61| | 62| 0| __delete(frame->files); ------------------ | | 38| 0|#define __delete(P) free((void *)(P)) ------------------ 63| 0| } 64| | 65| 2.21k| __delete(libconfig_strbuf_release(&(ctx->string))); ------------------ | | 38| 2.21k|#define __delete(P) free((void *)(P)) ------------------ 66| | 67| 2.21k| return(libconfig_strvec_release(&(ctx->filenames))); 68| 2.21k|} libconfig_scanctx_next_include_file: 125| 1.89k|{ 126| 1.89k| struct include_stack_frame *include_frame; 127| | 128| 1.89k| *error = NULL; 129| | 130| 1.89k| if(ctx->stack_depth == 0) ------------------ | Branch (130:6): [True: 1.89k, False: 0] ------------------ 131| 1.89k| return(NULL); 132| | 133| 0| include_frame = &(ctx->include_stack[ctx->stack_depth - 1]); 134| | 135| 0| if(include_frame->current_file) ------------------ | Branch (135:6): [True: 0, False: 0] ------------------ 136| 0| ++(include_frame->current_file); 137| 0| else 138| 0| include_frame->current_file = include_frame->files; 139| | 140| 0| if(include_frame->current_stream) ------------------ | Branch (140:6): [True: 0, False: 0] ------------------ 141| 0| { 142| 0| fclose(include_frame->current_stream); 143| 0| include_frame->current_stream = NULL; 144| 0| } 145| | 146| 0| if(!*(include_frame->current_file)) ------------------ | Branch (146:6): [True: 0, False: 0] ------------------ 147| 0| return(NULL); 148| | 149| 0| include_frame->current_stream = fopen(*(include_frame->current_file), "rt"); 150| 0| if(!include_frame->current_stream) ------------------ | Branch (150:6): [True: 0, False: 0] ------------------ 151| 0| *error = err_bad_include; 152| | 153| 0| return(include_frame->current_stream); 154| 0|} libconfig_scanctx_pop_include: 159| 2.29k|{ 160| 2.29k| struct include_stack_frame *frame; 161| | 162| 2.29k| if(ctx->stack_depth == 0) ------------------ | Branch (162:6): [True: 2.29k, False: 0] ------------------ 163| 2.29k| return(NULL); /* stack underflow */ 164| | 165| 0| frame = &(ctx->include_stack[--(ctx->stack_depth)]); 166| | 167| 0| __delete(frame->files); ------------------ | | 38| 0|#define __delete(P) free((void *)(P)) ------------------ 168| 0| frame->files = NULL; 169| | 170| 0| if(frame->current_stream) ------------------ | Branch (170:6): [True: 0, False: 0] ------------------ 171| 0| { 172| 0| fclose(frame->current_stream); 173| 0| frame->current_stream = NULL; 174| 0| } 175| | 176| 0| return(frame->parent_buffer); 177| 2.29k|} libconfig_scanctx_take_string: 182| 3.68k|{ 183| 3.68k| char *r = libconfig_strbuf_release(&(ctx->string)); 184| | 185| 3.68k| return(r ? r : strdup("")); ------------------ | Branch (185:10): [True: 1.23k, False: 2.45k] ------------------ 186| 3.68k|} libconfig_scanctx_current_filename: 191| 91.6k|{ 192| 91.6k| if(ctx->stack_depth > 0) ------------------ | Branch (192:6): [True: 0, False: 91.6k] ------------------ 193| 0| return(*(ctx->include_stack[ctx->stack_depth - 1].current_file)); 194| | 195| 91.6k| return(ctx->top_filename); 196| 91.6k|} libconfig_yylex: 1178| 157k|{ 1179| 157k| yy_state_type yy_current_state; 1180| 157k| char *yy_cp, *yy_bp; 1181| 157k| int yy_act; 1182| 157k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1183| | 1184| 157k| yylval = yylval_param; ------------------ | | 994| 157k| # define yylval yyg->yylval_r ------------------ 1185| | 1186| 157k| if ( !yyg->yy_init ) ------------------ | Branch (1186:7): [True: 2.21k, False: 155k] ------------------ 1187| 2.21k| { 1188| 2.21k| yyg->yy_init = 1; 1189| | 1190| |#ifdef YY_USER_INIT 1191| | YY_USER_INIT; 1192| |#endif 1193| | 1194| 2.21k| if ( ! yyg->yy_start ) ------------------ | Branch (1194:8): [True: 2.21k, False: 0] ------------------ 1195| 2.21k| yyg->yy_start = 1; /* first start state */ 1196| | 1197| 2.21k| if ( ! yyin ) ------------------ | | 344| 2.21k|#define yyin yyg->yyin_r ------------------ | Branch (1197:8): [True: 2.21k, False: 0] ------------------ 1198| 2.21k| yyin = stdin; ------------------ | | 344| 2.21k|#define yyin yyg->yyin_r ------------------ 1199| | 1200| 2.21k| if ( ! yyout ) ------------------ | | 345| 2.21k|#define yyout yyg->yyout_r ------------------ | Branch (1200:8): [True: 2.21k, False: 0] ------------------ 1201| 2.21k| yyout = stdout; ------------------ | | 345| 2.21k|#define yyout yyg->yyout_r ------------------ 1202| | 1203| 2.21k| if ( ! YY_CURRENT_BUFFER ) { ------------------ | | 509| 2.21k|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:29): [True: 2.21k, False: 0] | | ------------------ | | 510| 2.21k| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 2.21k| : NULL) ------------------ | Branch (1203:8): [True: 0, False: 2.21k] ------------------ 1204| 0| yyensure_buffer_stack (yyscanner); ------------------ | | 86| 0|#define yyensure_buffer_stack libconfig_yyensure_buffer_stack ------------------ 1205| 0| YY_CURRENT_BUFFER_LVALUE = ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 1206| 0| yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); ------------------ | | 20| 0|#define yy_create_buffer libconfig_yy_create_buffer ------------------ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); ------------------ | | 344| 0|#define yyin yyg->yyin_r ------------------ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); ------------------ | | 379| 0|#define YY_BUF_SIZE 16384 ------------------ 1207| 0| } 1208| | 1209| 2.21k| yy_load_buffer_state( yyscanner ); ------------------ | | 62| 2.21k|#define yy_load_buffer_state libconfig_yy_load_buffer_state ------------------ 1210| 2.21k| } 1211| | 1212| 157k| { 1213| 157k|#line 72 "scanner.l" 1214| | 1215| | 1216| 157k|#line 1217 "scanner.c" 1217| | 1218| 189k| while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ ------------------ | Branch (1218:23): [True: 189k, Folded] ------------------ 1219| 189k| { 1220| 189k| yy_cp = yyg->yy_c_buf_p; 1221| | 1222| | /* Support of yytext. */ 1223| 189k| *yy_cp = yyg->yy_hold_char; 1224| | 1225| | /* yy_bp points to the position in yy_ch_buf of the start of 1226| | * the current run. 1227| | */ 1228| 189k| yy_bp = yy_cp; 1229| | 1230| 189k| yy_current_state = yyg->yy_start; 1231| 189k| yy_current_state += YY_AT_BOL(); ------------------ | | 557| 189k|#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) | | ------------------ | | | | 515| 189k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ ------------------ 1232| 189k|yy_match: 1233| 189k| do 1234| 538k| { 1235| 538k| YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; ------------------ | | 334| 538k|#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) ------------------ 1236| 538k| if ( yy_accept[yy_current_state] ) ------------------ | Branch (1236:9): [True: 339k, False: 198k] ------------------ 1237| 339k| { 1238| 339k| yyg->yy_last_accepting_state = yy_current_state; 1239| 339k| yyg->yy_last_accepting_cpos = yy_cp; 1240| 339k| } 1241| 875k| while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) ------------------ | Branch (1241:12): [True: 336k, False: 538k] ------------------ 1242| 336k| { 1243| 336k| yy_current_state = (int) yy_def[yy_current_state]; 1244| 336k| if ( yy_current_state >= 214 ) ------------------ | Branch (1244:10): [True: 143k, False: 193k] ------------------ 1245| 143k| yy_c = yy_meta[yy_c]; 1246| 336k| } 1247| 538k| yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; 1248| 538k| ++yy_cp; 1249| 538k| } 1250| 538k| while ( yy_current_state != 213 ); ------------------ | Branch (1250:11): [True: 348k, False: 189k] ------------------ 1251| 189k| yy_cp = yyg->yy_last_accepting_cpos; 1252| 189k| yy_current_state = yyg->yy_last_accepting_state; 1253| | 1254| 191k|yy_find_action: 1255| 191k| yy_act = yy_accept[yy_current_state]; 1256| | 1257| 191k| YY_DO_BEFORE_ACTION; ------------------ | | 578| 191k| yyg->yytext_ptr = yy_bp; \ | | ------------------ | | | | 567| 191k|#define yytext_ptr yytext_r | | ------------------ | | 579| 191k| yyleng = (int) (yy_cp - yy_bp); \ | | ------------------ | | | | 347| 191k|#define yyleng yyg->yyleng_r | | ------------------ | | 580| 191k| yyg->yy_hold_char = *yy_cp; \ | | 581| 191k| *yy_cp = '\0'; \ | | 582| 191k| yyg->yy_c_buf_p = yy_cp; ------------------ 1258| | 1259| 191k| if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) ------------------ | | 584| 383k|#define YY_END_OF_BUFFER 49 ------------------ | Branch (1259:8): [True: 188k, False: 3.93k] | Branch (1259:38): [True: 7.42k, False: 180k] ------------------ 1260| 7.42k| { 1261| 7.42k| int yyl; 1262| 46.5k| for ( yyl = 0; yyl < yyleng; ++yyl ) ------------------ | | 347| 46.5k|#define yyleng yyg->yyleng_r ------------------ | Branch (1262:19): [True: 39.0k, False: 7.42k] ------------------ 1263| 39.0k| if ( yytext[yyl] == '\n' ) ------------------ | | 348| 39.0k|#define yytext yyg->yytext_r ------------------ | Branch (1263:10): [True: 3.27k, False: 35.8k] ------------------ 1264| | 1265| 3.27k| do{ yylineno++; ------------------ | | 349| 3.27k|#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) | | ------------------ | | | | 515| 3.27k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ ------------------ 1266| 3.27k| yycolumn=0; ------------------ | | 350| 3.27k|#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) | | ------------------ | | | | 515| 3.27k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ ------------------ 1267| 3.27k| }while(0) ------------------ | Branch (1267:12): [Folded, False: 3.27k] ------------------ 1268| 7.42k|; 1269| 7.42k| } 1270| | 1271| 193k|do_action: /* This label is used only to access EOF actions. */ 1272| | 1273| 193k| switch ( yy_act ) 1274| 193k| { /* beginning of action switch */ 1275| 28| case 0: /* must back up */ ------------------ | Branch (1275:4): [True: 28, False: 193k] ------------------ 1276| | /* undo the effects of YY_DO_BEFORE_ACTION */ 1277| 28| *yy_cp = yyg->yy_hold_char; 1278| 28| yy_cp = yyg->yy_last_accepting_cpos; 1279| 28| yy_current_state = yyg->yy_last_accepting_state; 1280| 28| goto yy_find_action; 1281| | 1282| 405|case 1: ------------------ | Branch (1282:1): [True: 405, False: 193k] ------------------ 1283| 405|YY_RULE_SETUP ------------------ | | 1170| 405| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 405|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 405, False: 0] | | ------------------ | | 1171| 405| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 405|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 405| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 405|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 405|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 405| YY_USER_ACTION ------------------ 1284| 405|#line 74 "scanner.l" 1285| 405|{ BEGIN SINGLE_LINE_COMMENT; } ------------------ | | 357| 405|#define BEGIN yyg->yy_start = 1 + 2 * ------------------ { BEGIN SINGLE_LINE_COMMENT; } ------------------ | | 939| 405|#define SINGLE_LINE_COMMENT 1 ------------------ 1286| 405| YY_BREAK ------------------ | | 1166| 405|#define YY_BREAK /*LINTED*/break; ------------------ 1287| 307|case 2: ------------------ | Branch (1287:1): [True: 307, False: 193k] ------------------ 1288| |/* rule 2 can match eol */ 1289| 307|YY_RULE_SETUP ------------------ | | 1170| 307| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 307|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 307, False: 0] | | ------------------ | | 1171| 307| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 307|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 307| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 307|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 307|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 307| YY_USER_ACTION ------------------ 1290| 307|#line 75 "scanner.l" 1291| 307|{ BEGIN INITIAL; } ------------------ | | 357| 307|#define BEGIN yyg->yy_start = 1 + 2 * ------------------ { BEGIN INITIAL; } ------------------ | | 938| 307|#define INITIAL 0 ------------------ 1292| 307| YY_BREAK ------------------ | | 1166| 307|#define YY_BREAK /*LINTED*/break; ------------------ 1293| 3.81k|case 3: ------------------ | Branch (1293:1): [True: 3.81k, False: 190k] ------------------ 1294| 3.81k|YY_RULE_SETUP ------------------ | | 1170| 3.81k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 3.81k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 3.81k, False: 0] | | ------------------ | | 1171| 3.81k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 3.81k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 3.81k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 3.81k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 3.81k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 3.81k| YY_USER_ACTION ------------------ 1295| 3.81k|#line 76 "scanner.l" 1296| 3.81k|{ /* ignore */ } 1297| 3.81k| YY_BREAK ------------------ | | 1166| 3.81k|#define YY_BREAK /*LINTED*/break; ------------------ 1298| 418|case 4: ------------------ | Branch (1298:1): [True: 418, False: 193k] ------------------ 1299| 418|YY_RULE_SETUP ------------------ | | 1170| 418| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 418|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 418, False: 0] | | ------------------ | | 1171| 418| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 418|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 418| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 418|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 418|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 418| YY_USER_ACTION ------------------ 1300| 418|#line 78 "scanner.l" 1301| 418|{ BEGIN MULTI_LINE_COMMENT; } ------------------ | | 357| 418|#define BEGIN yyg->yy_start = 1 + 2 * ------------------ { BEGIN MULTI_LINE_COMMENT; } ------------------ | | 940| 418|#define MULTI_LINE_COMMENT 2 ------------------ 1302| 418| YY_BREAK ------------------ | | 1166| 418|#define YY_BREAK /*LINTED*/break; ------------------ 1303| 389|case 5: ------------------ | Branch (1303:1): [True: 389, False: 193k] ------------------ 1304| 389|YY_RULE_SETUP ------------------ | | 1170| 389| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 389|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 389, False: 0] | | ------------------ | | 1171| 389| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 389|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 389| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 389|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 389|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 389| YY_USER_ACTION ------------------ 1305| 389|#line 79 "scanner.l" 1306| 389|{ BEGIN INITIAL; } ------------------ | | 357| 389|#define BEGIN yyg->yy_start = 1 + 2 * ------------------ { BEGIN INITIAL; } ------------------ | | 938| 389|#define INITIAL 0 ------------------ 1307| 389| YY_BREAK ------------------ | | 1166| 389|#define YY_BREAK /*LINTED*/break; ------------------ 1308| 7.02k|case 6: ------------------ | Branch (1308:1): [True: 7.02k, False: 186k] ------------------ 1309| 7.02k|YY_RULE_SETUP ------------------ | | 1170| 7.02k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 7.02k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 7.02k, False: 0] | | ------------------ | | 1171| 7.02k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 7.02k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 7.02k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 7.02k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 7.02k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 7.02k| YY_USER_ACTION ------------------ 1310| 7.02k|#line 80 "scanner.l" 1311| 7.02k|{ /* ignore */ } 1312| 7.02k| YY_BREAK ------------------ | | 1166| 7.02k|#define YY_BREAK /*LINTED*/break; ------------------ 1313| 445|case 7: ------------------ | Branch (1313:1): [True: 445, False: 193k] ------------------ 1314| |/* rule 7 can match eol */ 1315| 445|YY_RULE_SETUP ------------------ | | 1170| 445| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 445|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 445, False: 0] | | ------------------ | | 1171| 445| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 445|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 445| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 445|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 445|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 445| YY_USER_ACTION ------------------ 1316| 445|#line 81 "scanner.l" 1317| 445|{ /* ignore */ } 1318| 445| YY_BREAK ------------------ | | 1166| 445|#define YY_BREAK /*LINTED*/break; ------------------ 1319| 3.92k|case 8: ------------------ | Branch (1319:1): [True: 3.92k, False: 189k] ------------------ 1320| 3.92k|YY_RULE_SETUP ------------------ | | 1170| 3.92k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 3.92k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 3.92k, False: 0] | | ------------------ | | 1171| 3.92k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 3.92k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 3.92k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 3.92k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 3.92k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 3.92k| YY_USER_ACTION ------------------ 1321| 3.92k|#line 83 "scanner.l" 1322| 3.92k|{ BEGIN STRING; } ------------------ | | 357| 3.92k|#define BEGIN yyg->yy_start = 1 + 2 * ------------------ { BEGIN STRING; } ------------------ | | 941| 3.92k|#define STRING 3 ------------------ 1323| 3.92k| YY_BREAK ------------------ | | 1166| 3.92k|#define YY_BREAK /*LINTED*/break; ------------------ 1324| 3.67k|case 9: ------------------ | Branch (1324:1): [True: 3.67k, False: 190k] ------------------ 1325| |/* rule 9 can match eol */ 1326| 3.67k|YY_RULE_SETUP ------------------ | | 1170| 3.67k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 3.67k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 3.67k, False: 0] | | ------------------ | | 1171| 3.67k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 3.67k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 3.67k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 3.67k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 3.67k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 3.67k| YY_USER_ACTION ------------------ 1327| 3.67k|#line 84 "scanner.l" 1328| 3.67k|{ libconfig_scanctx_append_string(yyextra, yytext); } ------------------ | | 100| 3.67k| libconfig_strbuf_append_string(&((C)->string), (S)) ------------------ 1329| 3.67k| YY_BREAK ------------------ | | 1166| 3.67k|#define YY_BREAK /*LINTED*/break; ------------------ 1330| 210|case 10: ------------------ | Branch (1330:1): [True: 210, False: 193k] ------------------ 1331| 210|YY_RULE_SETUP ------------------ | | 1170| 210| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 210|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 210, False: 0] | | ------------------ | | 1171| 210| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 210|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 210| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 210|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 210|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 210| YY_USER_ACTION ------------------ 1332| 210|#line 85 "scanner.l" 1333| 210|{ libconfig_scanctx_append_char(yyextra, '\a'); } ------------------ | | 103| 210| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1334| 210| YY_BREAK ------------------ | | 1166| 210|#define YY_BREAK /*LINTED*/break; ------------------ 1335| 236|case 11: ------------------ | Branch (1335:1): [True: 236, False: 193k] ------------------ 1336| 236|YY_RULE_SETUP ------------------ | | 1170| 236| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 236|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 236, False: 0] | | ------------------ | | 1171| 236| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 236|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 236| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 236|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 236|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 236| YY_USER_ACTION ------------------ 1337| 236|#line 86 "scanner.l" 1338| 236|{ libconfig_scanctx_append_char(yyextra, '\b'); } ------------------ | | 103| 236| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1339| 236| YY_BREAK ------------------ | | 1166| 236|#define YY_BREAK /*LINTED*/break; ------------------ 1340| 313|case 12: ------------------ | Branch (1340:1): [True: 313, False: 193k] ------------------ 1341| 313|YY_RULE_SETUP ------------------ | | 1170| 313| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 313|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 313, False: 0] | | ------------------ | | 1171| 313| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 313|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 313| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 313|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 313|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 313| YY_USER_ACTION ------------------ 1342| 313|#line 87 "scanner.l" 1343| 313|{ libconfig_scanctx_append_char(yyextra, '\n'); } ------------------ | | 103| 313| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1344| 313| YY_BREAK ------------------ | | 1166| 313|#define YY_BREAK /*LINTED*/break; ------------------ 1345| 237|case 13: ------------------ | Branch (1345:1): [True: 237, False: 193k] ------------------ 1346| 237|YY_RULE_SETUP ------------------ | | 1170| 237| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 237|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 237, False: 0] | | ------------------ | | 1171| 237| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 237|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 237| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 237|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 237|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 237| YY_USER_ACTION ------------------ 1347| 237|#line 88 "scanner.l" 1348| 237|{ libconfig_scanctx_append_char(yyextra, '\r'); } ------------------ | | 103| 237| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1349| 237| YY_BREAK ------------------ | | 1166| 237|#define YY_BREAK /*LINTED*/break; ------------------ 1350| 676|case 14: ------------------ | Branch (1350:1): [True: 676, False: 193k] ------------------ 1351| 676|YY_RULE_SETUP ------------------ | | 1170| 676| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 676|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 676, False: 0] | | ------------------ | | 1171| 676| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 676|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 676| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 676|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 676|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 676| YY_USER_ACTION ------------------ 1352| 676|#line 89 "scanner.l" 1353| 676|{ libconfig_scanctx_append_char(yyextra, '\t'); } ------------------ | | 103| 676| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1354| 676| YY_BREAK ------------------ | | 1166| 676|#define YY_BREAK /*LINTED*/break; ------------------ 1355| 453|case 15: ------------------ | Branch (1355:1): [True: 453, False: 193k] ------------------ 1356| 453|YY_RULE_SETUP ------------------ | | 1170| 453| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 453|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 453, False: 0] | | ------------------ | | 1171| 453| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 453|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 453| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 453|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 453|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 453| YY_USER_ACTION ------------------ 1357| 453|#line 90 "scanner.l" 1358| 453|{ libconfig_scanctx_append_char(yyextra, '\v'); } ------------------ | | 103| 453| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1359| 453| YY_BREAK ------------------ | | 1166| 453|#define YY_BREAK /*LINTED*/break; ------------------ 1360| 350|case 16: ------------------ | Branch (1360:1): [True: 350, False: 193k] ------------------ 1361| 350|YY_RULE_SETUP ------------------ | | 1170| 350| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 350|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 350, False: 0] | | ------------------ | | 1171| 350| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 350|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 350| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 350|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 350|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 350| YY_USER_ACTION ------------------ 1362| 350|#line 91 "scanner.l" 1363| 350|{ libconfig_scanctx_append_char(yyextra, '\f'); } ------------------ | | 103| 350| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1364| 350| YY_BREAK ------------------ | | 1166| 350|#define YY_BREAK /*LINTED*/break; ------------------ 1365| 1.38k|case 17: ------------------ | Branch (1365:1): [True: 1.38k, False: 192k] ------------------ 1366| 1.38k|YY_RULE_SETUP ------------------ | | 1170| 1.38k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 1.38k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 1.38k, False: 0] | | ------------------ | | 1171| 1.38k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 1.38k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 1.38k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 1.38k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 1.38k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 1.38k| YY_USER_ACTION ------------------ 1367| 1.38k|#line 92 "scanner.l" 1368| 1.38k|{ libconfig_scanctx_append_char(yyextra, '\\'); } ------------------ | | 103| 1.38k| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1369| 1.38k| YY_BREAK ------------------ | | 1166| 1.38k|#define YY_BREAK /*LINTED*/break; ------------------ 1370| 592|case 18: ------------------ | Branch (1370:1): [True: 592, False: 193k] ------------------ 1371| 592|YY_RULE_SETUP ------------------ | | 1170| 592| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 592|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 592, False: 0] | | ------------------ | | 1171| 592| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 592|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 592| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 592|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 592|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 592| YY_USER_ACTION ------------------ 1372| 592|#line 93 "scanner.l" 1373| 592|{ libconfig_scanctx_append_char(yyextra, '\"'); } ------------------ | | 103| 592| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1374| 592| YY_BREAK ------------------ | | 1166| 592|#define YY_BREAK /*LINTED*/break; ------------------ 1375| 357|case 19: ------------------ | Branch (1375:1): [True: 357, False: 193k] ------------------ 1376| 357|YY_RULE_SETUP ------------------ | | 1170| 357| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 357|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 357, False: 0] | | ------------------ | | 1171| 357| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 357|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 357| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 357|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 357|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 357| YY_USER_ACTION ------------------ 1377| 357|#line 94 "scanner.l" 1378| 357|{ 1379| 357| char c = (char)(strtol(yytext + 2, NULL, 16) & 0xFF); ------------------ | | 348| 357|#define yytext yyg->yytext_r ------------------ 1380| 357| libconfig_scanctx_append_char(yyextra, c); ------------------ | | 103| 357| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1381| 357| } 1382| 357| YY_BREAK ------------------ | | 1166| 357|#define YY_BREAK /*LINTED*/break; ------------------ 1383| 1.24k|case 20: ------------------ | Branch (1383:1): [True: 1.24k, False: 192k] ------------------ 1384| 1.24k|YY_RULE_SETUP ------------------ | | 1170| 1.24k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 1.24k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 1.24k, False: 0] | | ------------------ | | 1171| 1.24k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 1.24k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 1.24k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 1.24k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 1.24k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 1.24k| YY_USER_ACTION ------------------ 1385| 1.24k|#line 98 "scanner.l" 1386| 1.24k|{ libconfig_scanctx_append_char(yyextra, '\\'); } ------------------ | | 103| 1.24k| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1387| 1.24k| YY_BREAK ------------------ | | 1166| 1.24k|#define YY_BREAK /*LINTED*/break; ------------------ 1388| 3.68k|case 21: ------------------ | Branch (1388:1): [True: 3.68k, False: 190k] ------------------ 1389| 3.68k|YY_RULE_SETUP ------------------ | | 1170| 3.68k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 3.68k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 3.68k, False: 0] | | ------------------ | | 1171| 3.68k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 3.68k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 3.68k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 3.68k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 3.68k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 3.68k| YY_USER_ACTION ------------------ 1390| 3.68k|#line 99 "scanner.l" 1391| 3.68k|{ 1392| 3.68k| yylval->sval = libconfig_scanctx_take_string(yyextra); ------------------ | | 994| 3.68k| # define yylval yyg->yylval_r ------------------ yylval->sval = libconfig_scanctx_take_string(yyextra); ------------------ | | 346| 3.68k|#define yyextra yyg->yyextra_r ------------------ 1393| 3.68k| BEGIN INITIAL; ------------------ | | 357| 3.68k|#define BEGIN yyg->yy_start = 1 + 2 * ------------------ BEGIN INITIAL; ------------------ | | 938| 3.68k|#define INITIAL 0 ------------------ 1394| 3.68k| return(TOK_STRING); ------------------ | | 99| 3.68k|#define TOK_STRING 268 ------------------ 1395| 0| } 1396| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1397| 0|case 22: ------------------ | Branch (1397:1): [True: 0, False: 193k] ------------------ 1398| 0|YY_RULE_SETUP ------------------ | | 1170| 0| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 0|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 0, False: 0] | | ------------------ | | 1171| 0| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 0| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 0|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 0|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 0| YY_USER_ACTION ------------------ 1399| 0|#line 105 "scanner.l" 1400| 0|{ BEGIN INCLUDE; } ------------------ | | 357| 0|#define BEGIN yyg->yy_start = 1 + 2 * ------------------ { BEGIN INCLUDE; } ------------------ | | 942| 0|#define INCLUDE 4 ------------------ 1401| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1402| 0|case 23: ------------------ | Branch (1402:1): [True: 0, False: 193k] ------------------ 1403| |/* rule 23 can match eol */ 1404| 0|YY_RULE_SETUP ------------------ | | 1170| 0| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 0|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 0, False: 0] | | ------------------ | | 1171| 0| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 0| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 0|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 0|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 0| YY_USER_ACTION ------------------ 1405| 0|#line 106 "scanner.l" 1406| 0|{ libconfig_scanctx_append_string(yyextra, yytext); } ------------------ | | 100| 0| libconfig_strbuf_append_string(&((C)->string), (S)) ------------------ 1407| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1408| 0|case 24: ------------------ | Branch (1408:1): [True: 0, False: 193k] ------------------ 1409| 0|YY_RULE_SETUP ------------------ | | 1170| 0| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 0|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 0, False: 0] | | ------------------ | | 1171| 0| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 0| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 0|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 0|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 0| YY_USER_ACTION ------------------ 1410| 0|#line 107 "scanner.l" 1411| 0|{ libconfig_scanctx_append_char(yyextra, '\\'); } ------------------ | | 103| 0| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1412| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1413| 0|case 25: ------------------ | Branch (1413:1): [True: 0, False: 193k] ------------------ 1414| 0|YY_RULE_SETUP ------------------ | | 1170| 0| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 0|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 0, False: 0] | | ------------------ | | 1171| 0| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 0| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 0|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 0|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 0| YY_USER_ACTION ------------------ 1415| 0|#line 108 "scanner.l" 1416| 0|{ libconfig_scanctx_append_char(yyextra, '\"'); } ------------------ | | 103| 0| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1417| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1418| 0|case 26: ------------------ | Branch (1418:1): [True: 0, False: 193k] ------------------ 1419| 0|YY_RULE_SETUP ------------------ | | 1170| 0| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 0|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 0, False: 0] | | ------------------ | | 1171| 0| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 0| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 0|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 0|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 0| YY_USER_ACTION ------------------ 1420| 0|#line 109 "scanner.l" 1421| 0|{ 1422| 0| const char *error = NULL; 1423| 0| const char *path = libconfig_scanctx_take_string(yyextra); ------------------ | | 346| 0|#define yyextra yyg->yyextra_r ------------------ 1424| 0| FILE *fp = libconfig_scanctx_push_include(yyextra, (void *)YY_CURRENT_BUFFER, ------------------ | | 346| 0|#define yyextra yyg->yyextra_r ------------------ FILE *fp = libconfig_scanctx_push_include(yyextra, (void *)YY_CURRENT_BUFFER, ------------------ | | 509| 0|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:29): [True: 0, False: 0] | | ------------------ | | 510| 0| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 0| : NULL) ------------------ 1425| 0| path, &error); 1426| 0| __delete(path); ------------------ | | 38| 0|#define __delete(P) free((void *)(P)) ------------------ 1427| | 1428| 0| if(fp) ------------------ | Branch (1428:6): [True: 0, False: 0] ------------------ 1429| 0| { 1430| 0| yyin = fp; ------------------ | | 344| 0|#define yyin yyg->yyin_r ------------------ 1431| 0| yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner), ------------------ | | 68| 0|#define yy_switch_to_buffer libconfig_yy_switch_to_buffer ------------------ yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner), ------------------ | | 20| 0|#define yy_create_buffer libconfig_yy_create_buffer ------------------ yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner), ------------------ | | 344| 0|#define yyin yyg->yyin_r ------------------ yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner), ------------------ | | 379| 0|#define YY_BUF_SIZE 16384 ------------------ 1432| 0| yyscanner); 1433| 0| } 1434| 0| else if(error) ------------------ | Branch (1434:11): [True: 0, False: 0] ------------------ 1435| 0| { 1436| 0| yyextra->config->error_text = error; ------------------ | | 346| 0|#define yyextra yyg->yyextra_r ------------------ 1437| 0| yyextra->config->error_file = libconfig_scanctx_current_filename(yyextra); ------------------ | | 346| 0|#define yyextra yyg->yyextra_r ------------------ yyextra->config->error_file = libconfig_scanctx_current_filename(yyextra); ------------------ | | 346| 0|#define yyextra yyg->yyextra_r ------------------ 1438| 0| yyextra->config->error_line = libconfig_yyget_lineno(yyscanner); ------------------ | | 346| 0|#define yyextra yyg->yyextra_r ------------------ 1439| 0| return TOK_ERROR; ------------------ | | 112| 0|#define TOK_ERROR 281 ------------------ 1440| 0| } 1441| 0| BEGIN INITIAL; ------------------ | | 357| 0|#define BEGIN yyg->yy_start = 1 + 2 * ------------------ BEGIN INITIAL; ------------------ | | 938| 0|#define INITIAL 0 ------------------ 1442| 0|} 1443| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1444| 2.99k|case 27: ------------------ | Branch (1444:1): [True: 2.99k, False: 190k] ------------------ 1445| |/* rule 27 can match eol */ 1446| 2.99k|YY_RULE_SETUP ------------------ | | 1170| 2.99k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 2.99k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 2.99k, False: 0] | | ------------------ | | 1171| 2.99k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 2.99k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 2.99k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 2.99k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 2.99k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 2.99k| YY_USER_ACTION ------------------ 1447| 2.99k|#line 132 "scanner.l" 1448| 2.99k|{ /* ignore */ } 1449| 2.99k| YY_BREAK ------------------ | | 1166| 2.99k|#define YY_BREAK /*LINTED*/break; ------------------ 1450| 2.50k|case 28: ------------------ | Branch (1450:1): [True: 2.50k, False: 191k] ------------------ 1451| 2.50k|YY_RULE_SETUP ------------------ | | 1170| 2.50k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 2.50k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 2.50k, False: 0] | | ------------------ | | 1171| 2.50k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 2.50k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 2.50k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 2.50k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 2.50k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 2.50k| YY_USER_ACTION ------------------ 1452| 2.50k|#line 133 "scanner.l" 1453| 2.50k|{ /* ignore */ } 1454| 2.50k| YY_BREAK ------------------ | | 1166| 2.50k|#define YY_BREAK /*LINTED*/break; ------------------ 1455| 13.8k|case 29: ------------------ | Branch (1455:1): [True: 13.8k, False: 180k] ------------------ 1456| 13.8k|YY_RULE_SETUP ------------------ | | 1170| 13.8k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 13.8k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 13.8k, False: 0] | | ------------------ | | 1171| 13.8k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 13.8k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 13.8k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 13.8k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 13.8k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 13.8k| YY_USER_ACTION ------------------ 1457| 13.8k|#line 135 "scanner.l" 1458| 13.8k|{ return(TOK_EQUALS); } ------------------ | | 101| 13.8k|#define TOK_EQUALS 270 ------------------ 1459| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1460| 29.5k|case 30: ------------------ | Branch (1460:1): [True: 29.5k, False: 164k] ------------------ 1461| 29.5k|YY_RULE_SETUP ------------------ | | 1170| 29.5k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 29.5k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 29.5k, False: 0] | | ------------------ | | 1171| 29.5k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 29.5k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 29.5k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 29.5k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 29.5k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 29.5k| YY_USER_ACTION ------------------ 1462| 29.5k|#line 136 "scanner.l" 1463| 29.5k|{ return(TOK_COMMA); } ------------------ | | 107| 29.5k|#define TOK_COMMA 276 ------------------ 1464| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1465| 5.13k|case 31: ------------------ | Branch (1465:1): [True: 5.13k, False: 188k] ------------------ 1466| 5.13k|YY_RULE_SETUP ------------------ | | 1170| 5.13k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 5.13k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 5.13k, False: 0] | | ------------------ | | 1171| 5.13k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 5.13k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 5.13k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 5.13k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 5.13k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 5.13k| YY_USER_ACTION ------------------ 1467| 5.13k|#line 137 "scanner.l" 1468| 5.13k|{ return(TOK_GROUP_START); } ------------------ | | 108| 5.13k|#define TOK_GROUP_START 277 ------------------ 1469| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1470| 4.01k|case 32: ------------------ | Branch (1470:1): [True: 4.01k, False: 189k] ------------------ 1471| 4.01k|YY_RULE_SETUP ------------------ | | 1170| 4.01k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 4.01k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 4.01k, False: 0] | | ------------------ | | 1171| 4.01k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 4.01k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 4.01k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 4.01k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 4.01k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 4.01k| YY_USER_ACTION ------------------ 1472| 4.01k|#line 138 "scanner.l" 1473| 4.01k|{ return(TOK_GROUP_END); } ------------------ | | 109| 4.01k|#define TOK_GROUP_END 278 ------------------ 1474| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1475| 1.00k|case 33: ------------------ | Branch (1475:1): [True: 1.00k, False: 192k] ------------------ 1476| 1.00k|YY_RULE_SETUP ------------------ | | 1170| 1.00k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 1.00k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 1.00k, False: 0] | | ------------------ | | 1171| 1.00k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 1.00k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 1.00k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 1.00k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 1.00k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 1.00k| YY_USER_ACTION ------------------ 1477| 1.00k|#line 139 "scanner.l" 1478| 1.00k|{ yylval->ival = 1; return(TOK_BOOLEAN); } ------------------ | | 994| 1.00k| # define yylval yyg->yylval_r ------------------ { yylval->ival = 1; return(TOK_BOOLEAN); } ------------------ | | 89| 1.00k|#define TOK_BOOLEAN 258 ------------------ 1479| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1480| 400|case 34: ------------------ | Branch (1480:1): [True: 400, False: 193k] ------------------ 1481| 400|YY_RULE_SETUP ------------------ | | 1170| 400| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 400|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 400, False: 0] | | ------------------ | | 1171| 400| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 400|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 400| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 400|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 400|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 400| YY_USER_ACTION ------------------ 1482| 400|#line 140 "scanner.l" 1483| 400|{ yylval->ival = 0; return(TOK_BOOLEAN); } ------------------ | | 994| 400| # define yylval yyg->yylval_r ------------------ { yylval->ival = 0; return(TOK_BOOLEAN); } ------------------ | | 89| 400|#define TOK_BOOLEAN 258 ------------------ 1484| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1485| 13.9k|case 35: ------------------ | Branch (1485:1): [True: 13.9k, False: 179k] ------------------ 1486| 13.9k|YY_RULE_SETUP ------------------ | | 1170| 13.9k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 13.9k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 13.9k, False: 0] | | ------------------ | | 1171| 13.9k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 13.9k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 13.9k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 13.9k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 13.9k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 13.9k| YY_USER_ACTION ------------------ 1487| 13.9k|#line 141 "scanner.l" 1488| 13.9k|{ yylval->sval = yytext; return(TOK_NAME); } ------------------ | | 994| 13.9k| # define yylval yyg->yylval_r ------------------ { yylval->sval = yytext; return(TOK_NAME); } ------------------ | | 348| 13.9k|#define yytext yyg->yytext_r ------------------ { yylval->sval = yytext; return(TOK_NAME); } ------------------ | | 100| 13.9k|#define TOK_NAME 269 ------------------ 1489| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1490| 14.5k|case 36: ------------------ | Branch (1490:1): [True: 14.5k, False: 179k] ------------------ 1491| 14.5k|YY_RULE_SETUP ------------------ | | 1170| 14.5k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 14.5k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 14.5k, False: 0] | | ------------------ | | 1171| 14.5k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 14.5k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 14.5k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 14.5k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 14.5k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 14.5k| YY_USER_ACTION ------------------ 1492| 14.5k|#line 142 "scanner.l" 1493| 14.5k|{ yylval->fval = atof(yytext); return(TOK_FLOAT); } ------------------ | | 994| 14.5k| # define yylval yyg->yylval_r ------------------ { yylval->fval = atof(yytext); return(TOK_FLOAT); } ------------------ | | 348| 14.5k|#define yytext yyg->yytext_r ------------------ { yylval->fval = atof(yytext); return(TOK_FLOAT); } ------------------ | | 98| 14.5k|#define TOK_FLOAT 267 ------------------ 1494| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1495| 7.25k|case 37: ------------------ | Branch (1495:1): [True: 7.25k, False: 186k] ------------------ 1496| 7.25k|YY_RULE_SETUP ------------------ | | 1170| 7.25k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 7.25k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 7.25k, False: 0] | | ------------------ | | 1171| 7.25k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 7.25k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 7.25k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 7.25k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 7.25k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 7.25k| YY_USER_ACTION ------------------ 1497| 7.25k|#line 143 "scanner.l" 1498| 7.25k|{ 1499| 7.25k| long long llval; 1500| 7.25k| int is_long; 1501| | 1502| 7.25k| if(!libconfig_parse_integer(yytext, 10, &llval, &is_long)) ------------------ | | 348| 7.25k|#define yytext yyg->yytext_r ------------------ | Branch (1502:24): [True: 6, False: 7.24k] ------------------ 1503| 6| return(TOK_ERROR); ------------------ | | 112| 6|#define TOK_ERROR 281 ------------------ 1504| | 1505| 7.24k| if(is_long) ------------------ | Branch (1505:24): [True: 529, False: 6.71k] ------------------ 1506| 529| { 1507| 529| yylval->llval = llval; ------------------ | | 994| 529| # define yylval yyg->yylval_r ------------------ 1508| 529| return(TOK_INTEGER64); ------------------ | | 94| 529|#define TOK_INTEGER64 263 ------------------ 1509| 529| } 1510| 6.71k| else 1511| 6.71k| { 1512| 6.71k| yylval->ival = (int)llval; ------------------ | | 994| 6.71k| # define yylval yyg->yylval_r ------------------ 1513| 6.71k| return(TOK_INTEGER); ------------------ | | 90| 6.71k|#define TOK_INTEGER 259 ------------------ 1514| 6.71k| } 1515| 7.24k| } 1516| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1517| 1.66k|case 38: ------------------ | Branch (1517:1): [True: 1.66k, False: 192k] ------------------ 1518| 1.66k|YY_RULE_SETUP ------------------ | | 1170| 1.66k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 1.66k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 1.66k, False: 0] | | ------------------ | | 1171| 1.66k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 1.66k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 1.66k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 1.66k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 1.66k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 1.66k| YY_USER_ACTION ------------------ 1519| 1.66k|#line 161 "scanner.l" 1520| 1.66k|{ 1521| 1.66k| int is_long; 1522| | 1523| 1.66k| if(!libconfig_parse_integer(yytext, 10, &(yylval->llval), ------------------ | | 348| 1.66k|#define yytext yyg->yytext_r ------------------ if(!libconfig_parse_integer(yytext, 10, &(yylval->llval), ------------------ | | 994| 1.66k| # define yylval yyg->yylval_r ------------------ | Branch (1523:24): [True: 3, False: 1.66k] ------------------ 1524| 1.66k| &is_long)) 1525| 3| return(TOK_ERROR); ------------------ | | 112| 3|#define TOK_ERROR 281 ------------------ 1526| | 1527| 1.66k| return(TOK_INTEGER64); ------------------ | | 94| 1.66k|#define TOK_INTEGER64 263 ------------------ 1528| 1.66k| } 1529| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1530| 2.45k|case 39: ------------------ | Branch (1530:1): [True: 2.45k, False: 191k] ------------------ 1531| 2.45k|YY_RULE_SETUP ------------------ | | 1170| 2.45k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 2.45k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 2.45k, False: 0] | | ------------------ | | 1171| 2.45k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 2.45k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 2.45k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 2.45k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 2.45k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 2.45k| YY_USER_ACTION ------------------ 1532| 2.45k|#line 170 "scanner.l" 1533| 2.45k|{ 1534| 2.45k| long long llval; 1535| 2.45k| int is_long; 1536| | 1537| 2.45k| if(!libconfig_parse_integer(yytext + 2, 2, &llval, &is_long)) ------------------ | | 348| 2.45k|#define yytext yyg->yytext_r ------------------ | Branch (1537:24): [True: 2, False: 2.44k] ------------------ 1538| 2| return(TOK_ERROR); ------------------ | | 112| 2|#define TOK_ERROR 281 ------------------ 1539| | 1540| 2.44k| if(is_long) ------------------ | Branch (1540:24): [True: 1.24k, False: 1.20k] ------------------ 1541| 1.24k| { 1542| 1.24k| yylval->llval = llval; ------------------ | | 994| 1.24k| # define yylval yyg->yylval_r ------------------ 1543| 1.24k| return(TOK_BIN64); ------------------ | | 96| 1.24k|#define TOK_BIN64 265 ------------------ 1544| 1.24k| } 1545| 1.20k| else 1546| 1.20k| { 1547| 1.20k| yylval->ival = (int)llval; ------------------ | | 994| 1.20k| # define yylval yyg->yylval_r ------------------ 1548| 1.20k| return(TOK_BIN); ------------------ | | 92| 1.20k|#define TOK_BIN 261 ------------------ 1549| 1.20k| } 1550| 2.44k| } 1551| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1552| 1.24k|case 40: ------------------ | Branch (1552:1): [True: 1.24k, False: 192k] ------------------ 1553| 1.24k|YY_RULE_SETUP ------------------ | | 1170| 1.24k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 1.24k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 1.24k, False: 0] | | ------------------ | | 1171| 1.24k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 1.24k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 1.24k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 1.24k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 1.24k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 1.24k| YY_USER_ACTION ------------------ 1554| 1.24k|#line 188 "scanner.l" 1555| 1.24k|{ 1556| 1.24k| long long llval; 1557| 1.24k| int is_long; 1558| | 1559| 1.24k| if(!libconfig_parse_integer(yytext + 2, 8, &llval, &is_long)) ------------------ | | 348| 1.24k|#define yytext yyg->yytext_r ------------------ | Branch (1559:24): [True: 0, False: 1.24k] ------------------ 1560| 0| return(TOK_ERROR); ------------------ | | 112| 0|#define TOK_ERROR 281 ------------------ 1561| | 1562| 1.24k| if(is_long) ------------------ | Branch (1562:24): [True: 538, False: 706] ------------------ 1563| 538| { 1564| 538| yylval->llval = llval; ------------------ | | 994| 538| # define yylval yyg->yylval_r ------------------ 1565| 538| return(TOK_OCT64); ------------------ | | 97| 538|#define TOK_OCT64 266 ------------------ 1566| 538| } 1567| 706| else 1568| 706| { 1569| 706| yylval->ival = (int)llval; ------------------ | | 994| 706| # define yylval yyg->yylval_r ------------------ 1570| 706| return(TOK_OCT); ------------------ | | 93| 706|#define TOK_OCT 262 ------------------ 1571| 706| } 1572| 1.24k| } 1573| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1574| 2.92k|case 41: ------------------ | Branch (1574:1): [True: 2.92k, False: 190k] ------------------ 1575| 2.92k|YY_RULE_SETUP ------------------ | | 1170| 2.92k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 2.92k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 2.92k, False: 0] | | ------------------ | | 1171| 2.92k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 2.92k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 2.92k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 2.92k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 2.92k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 2.92k| YY_USER_ACTION ------------------ 1576| 2.92k|#line 206 "scanner.l" 1577| 2.92k|{ 1578| 2.92k| long long llval; 1579| 2.92k| int is_long; 1580| | 1581| 2.92k| if(!libconfig_parse_integer(yytext + 2, 16, &llval, ------------------ | | 348| 2.92k|#define yytext yyg->yytext_r ------------------ | Branch (1581:24): [True: 2, False: 2.92k] ------------------ 1582| 2.92k| &is_long)) 1583| 2| return(TOK_ERROR); ------------------ | | 112| 2|#define TOK_ERROR 281 ------------------ 1584| | 1585| 2.92k| if(is_long) ------------------ | Branch (1585:24): [True: 1.09k, False: 1.82k] ------------------ 1586| 1.09k| { 1587| 1.09k| yylval->llval = llval; ------------------ | | 994| 1.09k| # define yylval yyg->yylval_r ------------------ 1588| 1.09k| return(TOK_HEX64); ------------------ | | 95| 1.09k|#define TOK_HEX64 264 ------------------ 1589| 1.09k| } 1590| 1.82k| else 1591| 1.82k| { 1592| 1.82k| yylval->ival = (int)llval; ------------------ | | 994| 1.82k| # define yylval yyg->yylval_r ------------------ 1593| 1.82k| return(TOK_HEX); ------------------ | | 91| 1.82k|#define TOK_HEX 260 ------------------ 1594| 1.82k| } 1595| 2.92k| } 1596| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1597| 1.77k|case 42: ------------------ | Branch (1597:1): [True: 1.77k, False: 192k] ------------------ 1598| 1.77k|YY_RULE_SETUP ------------------ | | 1170| 1.77k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 1.77k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 1.77k, False: 0] | | ------------------ | | 1171| 1.77k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 1.77k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 1.77k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 1.77k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 1.77k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 1.77k| YY_USER_ACTION ------------------ 1599| 1.77k|#line 225 "scanner.l" 1600| 1.77k|{ return(TOK_ARRAY_START); } ------------------ | | 103| 1.77k|#define TOK_ARRAY_START 272 ------------------ 1601| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1602| 1.70k|case 43: ------------------ | Branch (1602:1): [True: 1.70k, False: 192k] ------------------ 1603| 1.70k|YY_RULE_SETUP ------------------ | | 1170| 1.70k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 1.70k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 1.70k, False: 0] | | ------------------ | | 1171| 1.70k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 1.70k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 1.70k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 1.70k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 1.70k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 1.70k| YY_USER_ACTION ------------------ 1604| 1.70k|#line 226 "scanner.l" 1605| 1.70k|{ return(TOK_ARRAY_END); } ------------------ | | 104| 1.70k|#define TOK_ARRAY_END 273 ------------------ 1606| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1607| 48.1k|case 44: ------------------ | Branch (1607:1): [True: 48.1k, False: 145k] ------------------ 1608| 48.1k|YY_RULE_SETUP ------------------ | | 1170| 48.1k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 48.1k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 48.1k, False: 0] | | ------------------ | | 1171| 48.1k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 48.1k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 48.1k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 48.1k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 48.1k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 48.1k| YY_USER_ACTION ------------------ 1609| 48.1k|#line 227 "scanner.l" 1610| 48.1k|{ return(TOK_LIST_START); } ------------------ | | 105| 48.1k|#define TOK_LIST_START 274 ------------------ 1611| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1612| 1.57k|case 45: ------------------ | Branch (1612:1): [True: 1.57k, False: 192k] ------------------ 1613| 1.57k|YY_RULE_SETUP ------------------ | | 1170| 1.57k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 1.57k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 1.57k, False: 0] | | ------------------ | | 1171| 1.57k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 1.57k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 1.57k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 1.57k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 1.57k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 1.57k| YY_USER_ACTION ------------------ 1614| 1.57k|#line 228 "scanner.l" 1615| 1.57k|{ return(TOK_LIST_END); } ------------------ | | 106| 1.57k|#define TOK_LIST_END 275 ------------------ 1616| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1617| 1.11k|case 46: ------------------ | Branch (1617:1): [True: 1.11k, False: 192k] ------------------ 1618| 1.11k|YY_RULE_SETUP ------------------ | | 1170| 1.11k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 1.11k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 1.11k, False: 0] | | ------------------ | | 1171| 1.11k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 1.11k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 1.11k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 1.11k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 1.11k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 1.11k| YY_USER_ACTION ------------------ 1619| 1.11k|#line 229 "scanner.l" 1620| 1.11k|{ return(TOK_SEMICOLON); } ------------------ | | 110| 1.11k|#define TOK_SEMICOLON 279 ------------------ 1621| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1622| 98|case 47: ------------------ | Branch (1622:1): [True: 98, False: 193k] ------------------ 1623| 98|YY_RULE_SETUP ------------------ | | 1170| 98| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 98|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 98, False: 0] | | ------------------ | | 1171| 98| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 98|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 98| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 98|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 98|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 98| YY_USER_ACTION ------------------ 1624| 98|#line 230 "scanner.l" 1625| 98|{ return(TOK_GARBAGE); } ------------------ | | 111| 98|#define TOK_GARBAGE 280 ------------------ 1626| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1627| 1.53k|case YY_STATE_EOF(INITIAL): ------------------ | | 365| 1.53k|#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) | | ------------------ | | | | 584| 1.53k|#define YY_END_OF_BUFFER 49 | | ------------------ ------------------ | Branch (1627:1): [True: 1.53k, False: 192k] ------------------ 1628| 1.63k|case YY_STATE_EOF(SINGLE_LINE_COMMENT): ------------------ | | 365| 1.63k|#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) | | ------------------ | | | | 584| 1.63k|#define YY_END_OF_BUFFER 49 | | ------------------ ------------------ | Branch (1628:1): [True: 98, False: 193k] ------------------ 1629| 1.66k|case YY_STATE_EOF(MULTI_LINE_COMMENT): ------------------ | | 365| 1.66k|#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) | | ------------------ | | | | 584| 1.66k|#define YY_END_OF_BUFFER 49 | | ------------------ ------------------ | Branch (1629:1): [True: 29, False: 193k] ------------------ 1630| 1.89k|case YY_STATE_EOF(STRING): ------------------ | | 365| 1.89k|#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) | | ------------------ | | | | 584| 1.89k|#define YY_END_OF_BUFFER 49 | | ------------------ ------------------ | Branch (1630:1): [True: 234, False: 193k] ------------------ 1631| 1.89k|case YY_STATE_EOF(INCLUDE): ------------------ | | 365| 1.89k|#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) | | ------------------ | | | | 584| 1.89k|#define YY_END_OF_BUFFER 49 | | ------------------ ------------------ | Branch (1631:1): [True: 0, False: 193k] ------------------ 1632| 1.89k|#line 232 "scanner.l" 1633| 1.89k|{ 1634| 1.89k| const char *error = NULL; 1635| 1.89k| FILE *fp; 1636| | 1637| 1.89k| fp = libconfig_scanctx_next_include_file(yyextra, &error); ------------------ | | 346| 1.89k|#define yyextra yyg->yyextra_r ------------------ 1638| 1.89k| if(fp) ------------------ | Branch (1638:6): [True: 0, False: 1.89k] ------------------ 1639| 0| { 1640| 0| yyin = fp; ------------------ | | 344| 0|#define yyin yyg->yyin_r ------------------ 1641| 0| yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner); ------------------ | | 26| 0|#define yy_delete_buffer libconfig_yy_delete_buffer ------------------ yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner); ------------------ | | 509| 0|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:29): [True: 0, False: 0] | | ------------------ | | 510| 0| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 0| : NULL) ------------------ 1642| 0| yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner), ------------------ | | 68| 0|#define yy_switch_to_buffer libconfig_yy_switch_to_buffer ------------------ yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner), ------------------ | | 20| 0|#define yy_create_buffer libconfig_yy_create_buffer ------------------ yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner), ------------------ | | 344| 0|#define yyin yyg->yyin_r ------------------ yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner), ------------------ | | 379| 0|#define YY_BUF_SIZE 16384 ------------------ 1643| 0| yyscanner); 1644| 0| } 1645| 1.89k| else if(error) ------------------ | Branch (1645:11): [True: 0, False: 1.89k] ------------------ 1646| 0| { 1647| 0| yyextra->config->error_text = error; ------------------ | | 346| 0|#define yyextra yyg->yyextra_r ------------------ 1648| 0| yyextra->config->error_file = libconfig_scanctx_current_filename(yyextra); ------------------ | | 346| 0|#define yyextra yyg->yyextra_r ------------------ yyextra->config->error_file = libconfig_scanctx_current_filename(yyextra); ------------------ | | 346| 0|#define yyextra yyg->yyextra_r ------------------ 1649| 0| yyextra->config->error_line = libconfig_yyget_lineno(yyscanner); ------------------ | | 346| 0|#define yyextra yyg->yyextra_r ------------------ 1650| 0| return TOK_ERROR; ------------------ | | 112| 0|#define TOK_ERROR 281 ------------------ 1651| 0| } 1652| 1.89k| else 1653| 1.89k| { 1654| | /* No more files in the current include list. */ 1655| 1.89k| YY_BUFFER_STATE buf = (YY_BUFFER_STATE)libconfig_scanctx_pop_include(yyextra); ------------------ | | 346| 1.89k|#define yyextra yyg->yyextra_r ------------------ 1656| 1.89k| if(buf) ------------------ | Branch (1656:8): [True: 0, False: 1.89k] ------------------ 1657| 0| { 1658| 0| yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner); ------------------ | | 26| 0|#define yy_delete_buffer libconfig_yy_delete_buffer ------------------ yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner); ------------------ | | 509| 0|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:29): [True: 0, False: 0] | | ------------------ | | 510| 0| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 0| : NULL) ------------------ 1659| 0| yy_switch_to_buffer(buf, yyscanner); ------------------ | | 68| 0|#define yy_switch_to_buffer libconfig_yy_switch_to_buffer ------------------ 1660| 0| } 1661| 1.89k| else 1662| 1.89k| yyterminate(); ------------------ | | 1129| 1.89k|#define yyterminate() return YY_NULL | | ------------------ | | | | 329| 1.89k|#define YY_NULL 0 | | ------------------ ------------------ 1663| 1.89k| } 1664| 1.89k|} 1665| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1666| 0|case 48: ------------------ | Branch (1666:1): [True: 0, False: 193k] ------------------ 1667| 0|YY_RULE_SETUP ------------------ | | 1170| 0| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 0|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 0, False: 0] | | ------------------ | | 1171| 0| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 0| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 0|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 0|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 0| YY_USER_ACTION ------------------ 1668| 0|#line 265 "scanner.l" 1669| 0|ECHO; ------------------ | | 1085| 0|#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) | | ------------------ | | | | 348| 0|#define yytext yyg->yytext_r | | ------------------ | | #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) | | ------------------ | | | | 347| 0|#define yyleng yyg->yyleng_r | | ------------------ | | #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) | | ------------------ | | | | 345| 0|#define yyout yyg->yyout_r | | ------------------ | | | Branch (1085:23): [True: 0, False: 0] | | | Branch (1085:80): [Folded, False: 0] | | ------------------ ------------------ 1670| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1671| 0|#line 1672 "scanner.c" 1672| | 1673| 3.93k| case YY_END_OF_BUFFER: ------------------ | | 584| 3.93k|#define YY_END_OF_BUFFER 49 ------------------ | Branch (1673:2): [True: 3.93k, False: 189k] ------------------ 1674| 3.93k| { 1675| | /* Amount of text matched not including the EOB char. */ 1676| 3.93k| int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; ------------------ | | 567| 3.93k|#define yytext_ptr yytext_r ------------------ 1677| | 1678| | /* Undo the effects of YY_DO_BEFORE_ACTION. */ 1679| 3.93k| *yy_cp = yyg->yy_hold_char; 1680| 3.93k| YY_RESTORE_YY_MORE_OFFSET 1681| | 1682| 3.93k| if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) ------------------ | | 515| 3.93k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) ------------------ | | 486| 3.93k|#define YY_BUFFER_NEW 0 ------------------ | Branch (1682:8): [True: 2.04k, False: 1.88k] ------------------ 1683| 2.04k| { 1684| | /* We're scanning a new file or input source. It's 1685| | * possible that this happened because the user 1686| | * just pointed yyin at a new source and called 1687| | * yylex(). If so, then we have to assure 1688| | * consistency between YY_CURRENT_BUFFER and our 1689| | * globals. Here is the right place to do so, because 1690| | * this is the first action (other than possibly a 1691| | * back-up) that will match for the new input source. 1692| | */ 1693| 2.04k| yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; ------------------ | | 515| 2.04k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 1694| 2.04k| YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; ------------------ | | 515| 2.04k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; ------------------ | | 344| 2.04k|#define yyin yyg->yyin_r ------------------ 1695| 2.04k| YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; ------------------ | | 515| 2.04k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; ------------------ | | 487| 2.04k|#define YY_BUFFER_NORMAL 1 ------------------ 1696| 2.04k| } 1697| | 1698| | /* Note that here we test for yy_c_buf_p "<=" to the position 1699| | * of the first EOB in the buffer, since yy_c_buf_p will 1700| | * already have been incremented past the NUL character 1701| | * (since all states make transitions on EOB to the 1702| | * end-of-buffer state). Contrast this with the test 1703| | * in input(). 1704| | */ 1705| 3.93k| if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) ------------------ | | 515| 3.93k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ | Branch (1705:8): [True: 0, False: 3.93k] ------------------ 1706| 0| { /* This was really a NUL. */ 1707| 0| yy_state_type yy_next_state; 1708| | 1709| 0| yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; ------------------ | | 567| 0|#define yytext_ptr yytext_r ------------------ 1710| | 1711| 0| yy_current_state = yy_get_previous_state( yyscanner ); 1712| | 1713| | /* Okay, we're now positioned to make the NUL 1714| | * transition. We couldn't have 1715| | * yy_get_previous_state() go ahead and do it 1716| | * for us because it doesn't know how to deal 1717| | * with the possibility of jamming (and we don't 1718| | * want to build jamming into it because then it 1719| | * will run more slowly). 1720| | */ 1721| | 1722| 0| yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); 1723| | 1724| 0| yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; ------------------ | | 567| 0|#define yytext_ptr yytext_r ------------------ yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; ------------------ | | 888| 0|#define YY_MORE_ADJ 0 ------------------ 1725| | 1726| 0| if ( yy_next_state ) ------------------ | Branch (1726:9): [True: 0, False: 0] ------------------ 1727| 0| { 1728| | /* Consume the NUL. */ 1729| 0| yy_cp = ++yyg->yy_c_buf_p; 1730| 0| yy_current_state = yy_next_state; 1731| 0| goto yy_match; 1732| 0| } 1733| | 1734| 0| else 1735| 0| { 1736| 0| yy_cp = yyg->yy_last_accepting_cpos; 1737| 0| yy_current_state = yyg->yy_last_accepting_state; 1738| 0| goto yy_find_action; 1739| 0| } 1740| 0| } 1741| | 1742| 3.93k| else switch ( yy_get_next_buffer( yyscanner ) ) ------------------ | Branch (1742:17): [True: 3.93k, False: 0] ------------------ 1743| 3.93k| { 1744| 1.89k| case EOB_ACT_END_OF_FILE: ------------------ | | 398| 1.89k|#define EOB_ACT_END_OF_FILE 1 ------------------ | Branch (1744:4): [True: 1.89k, False: 2.03k] ------------------ 1745| 1.89k| { 1746| 1.89k| yyg->yy_did_buffer_switch_on_eof = 0; 1747| | 1748| 1.89k| if ( yywrap( yyscanner ) ) ------------------ | | 206| 1.89k|#define yywrap libconfig_yywrap | | ------------------ | | | | 561| 1.89k|#define libconfig_yywrap(yyscanner) (/*CONSTCOND*/1) | | | | ------------------ | | | | | Branch (561:37): [True: 1.89k, Folded] | | | | ------------------ | | ------------------ ------------------ 1749| 1.89k| { 1750| | /* Note: because we've taken care in 1751| | * yy_get_next_buffer() to have set up 1752| | * yytext, we can now set up 1753| | * yy_c_buf_p so that if some total 1754| | * hoser (like flex itself) wants to 1755| | * call the scanner after we return the 1756| | * YY_NULL, it'll still work - another 1757| | * YY_NULL will get returned. 1758| | */ 1759| 1.89k| yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; ------------------ | | 567| 1.89k|#define yytext_ptr yytext_r ------------------ yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; ------------------ | | 888| 1.89k|#define YY_MORE_ADJ 0 ------------------ 1760| | 1761| 1.89k| yy_act = YY_STATE_EOF(YY_START); ------------------ | | 365| 1.89k|#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) | | ------------------ | | | | 584| 1.89k|#define YY_END_OF_BUFFER 49 | | ------------------ ------------------ 1762| 1.89k| goto do_action; 1763| 1.89k| } 1764| | 1765| 0| else 1766| 0| { 1767| 0| if ( ! yyg->yy_did_buffer_switch_on_eof ) ------------------ | Branch (1767:11): [True: 0, False: 0] ------------------ 1768| 0| YY_NEW_FILE; ------------------ | | 367| 0|#define YY_NEW_FILE yyrestart( yyin , yyscanner ) | | ------------------ | | | | 98| 0|#define yyrestart libconfig_yyrestart | | ------------------ | | #define YY_NEW_FILE yyrestart( yyin , yyscanner ) | | ------------------ | | | | 344| 0|#define yyin yyg->yyin_r | | ------------------ ------------------ 1769| 0| } 1770| 0| break; 1771| 1.89k| } 1772| | 1773| 0| case EOB_ACT_CONTINUE_SCAN: ------------------ | | 397| 0|#define EOB_ACT_CONTINUE_SCAN 0 ------------------ | Branch (1773:4): [True: 0, False: 3.93k] ------------------ 1774| 0| yyg->yy_c_buf_p = 1775| 0| yyg->yytext_ptr + yy_amount_of_matched_text; ------------------ | | 567| 0|#define yytext_ptr yytext_r ------------------ 1776| | 1777| 0| yy_current_state = yy_get_previous_state( yyscanner ); 1778| | 1779| 0| yy_cp = yyg->yy_c_buf_p; 1780| 0| yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; ------------------ | | 567| 0|#define yytext_ptr yytext_r ------------------ yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; ------------------ | | 888| 0|#define YY_MORE_ADJ 0 ------------------ 1781| 0| goto yy_match; 1782| | 1783| 2.03k| case EOB_ACT_LAST_MATCH: ------------------ | | 399| 2.03k|#define EOB_ACT_LAST_MATCH 2 ------------------ | Branch (1783:4): [True: 2.03k, False: 1.89k] ------------------ 1784| 2.03k| yyg->yy_c_buf_p = 1785| 2.03k| &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; ------------------ | | 515| 2.03k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 1786| | 1787| 2.03k| yy_current_state = yy_get_previous_state( yyscanner ); 1788| | 1789| 2.03k| yy_cp = yyg->yy_c_buf_p; 1790| 2.03k| yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; ------------------ | | 567| 2.03k|#define yytext_ptr yytext_r ------------------ yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; ------------------ | | 888| 2.03k|#define YY_MORE_ADJ 0 ------------------ 1791| 2.03k| goto yy_find_action; 1792| 3.93k| } 1793| 0| break; 1794| 3.93k| } 1795| | 1796| 0| default: ------------------ | Branch (1796:2): [True: 0, False: 193k] ------------------ 1797| 0| YY_FATAL_ERROR( ------------------ | | 1139| 0|#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) ------------------ 1798| 193k| "fatal flex scanner internal error--no action found" ); 1799| 193k| } /* end of action switch */ 1800| 193k| } /* end of scanning one token */ 1801| 157k| } /* end of user's declarations */ 1802| 157k|} /* end of yylex */ libconfig_yy_switch_to_buffer: 2120| 2.21k|{ 2121| 2.21k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2122| | 2123| | /* TODO. We should be able to replace this entire function body 2124| | * with 2125| | * yypop_buffer_state(); 2126| | * yypush_buffer_state(new_buffer); 2127| | */ 2128| 2.21k| yyensure_buffer_stack (yyscanner); ------------------ | | 86| 2.21k|#define yyensure_buffer_stack libconfig_yyensure_buffer_stack ------------------ 2129| 2.21k| if ( YY_CURRENT_BUFFER == new_buffer ) ------------------ | | 509| 2.21k|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:29): [True: 2.21k, False: 0] | | ------------------ | | 510| 2.21k| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 2.21k| : NULL) ------------------ | Branch (2129:7): [True: 0, False: 2.21k] ------------------ 2130| 0| return; 2131| | 2132| 2.21k| if ( YY_CURRENT_BUFFER ) ------------------ | | 509| 2.21k|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:27): [True: 0, False: 2.21k] | | | Branch (509:29): [True: 2.21k, False: 0] | | ------------------ | | 510| 2.21k| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 2.21k| : NULL) ------------------ 2133| 0| { 2134| | /* Flush out information for old buffer. */ 2135| 0| *yyg->yy_c_buf_p = yyg->yy_hold_char; 2136| 0| YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 2137| 0| YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 2138| 0| } 2139| | 2140| 2.21k| YY_CURRENT_BUFFER_LVALUE = new_buffer; ------------------ | | 515| 2.21k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 2141| 2.21k| yy_load_buffer_state( yyscanner ); ------------------ | | 62| 2.21k|#define yy_load_buffer_state libconfig_yy_load_buffer_state ------------------ 2142| | 2143| | /* We don't actually know whether we did this switch during 2144| | * EOF (yywrap()) processing, but the only time this flag 2145| | * is looked at is after yywrap() is called, so it's safe 2146| | * to go ahead and always set it. 2147| | */ 2148| 2.21k| yyg->yy_did_buffer_switch_on_eof = 1; 2149| 2.21k|} libconfig_yy_delete_buffer: 2195| 2.21k|{ 2196| 2.21k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2197| | 2198| 2.21k| if ( ! b ) ------------------ | Branch (2198:7): [True: 0, False: 2.21k] ------------------ 2199| 0| return; 2200| | 2201| 2.21k| if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ ------------------ | | 509| 2.21k|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:29): [True: 2.21k, False: 0] | | ------------------ | | 510| 2.21k| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 2.21k| : NULL) ------------------ | Branch (2201:7): [True: 2.21k, False: 0] ------------------ 2202| 2.21k| YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; ------------------ | | 515| 2.21k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 2203| | 2204| 2.21k| if ( b->yy_is_our_buffer ) ------------------ | Branch (2204:7): [True: 2.21k, False: 0] ------------------ 2205| 2.21k| yyfree( (void *) b->yy_ch_buf , yyscanner ); ------------------ | | 236| 2.21k|#define yyfree libconfig_yyfree ------------------ 2206| | 2207| 2.21k| yyfree( (void *) b , yyscanner ); ------------------ | | 236| 2.21k|#define yyfree libconfig_yyfree ------------------ 2208| 2.21k|} libconfig_yypop_buffer_state: 2305| 2.21k|{ 2306| 2.21k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2307| 2.21k| if (!YY_CURRENT_BUFFER) ------------------ | | 509| 2.21k|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:29): [True: 2.21k, False: 0] | | ------------------ | | 510| 2.21k| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 2.21k| : NULL) ------------------ | Branch (2307:6): [True: 2.21k, False: 0] ------------------ 2308| 2.21k| return; 2309| | 2310| 0| yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); ------------------ | | 26| 0|#define yy_delete_buffer libconfig_yy_delete_buffer ------------------ yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); ------------------ | | 509| 0|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:29): [True: 0, False: 0] | | ------------------ | | 510| 0| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 0| : NULL) ------------------ 2311| 0| YY_CURRENT_BUFFER_LVALUE = NULL; ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 2312| 0| if (yyg->yy_buffer_stack_top > 0) ------------------ | Branch (2312:6): [True: 0, False: 0] ------------------ 2313| 0| --yyg->yy_buffer_stack_top; 2314| | 2315| 0| if (YY_CURRENT_BUFFER) { ------------------ | | 509| 0|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:27): [True: 0, False: 0] | | | Branch (509:29): [True: 0, False: 0] | | ------------------ | | 510| 0| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 0| : NULL) ------------------ 2316| 0| yy_load_buffer_state( yyscanner ); ------------------ | | 62| 0|#define yy_load_buffer_state libconfig_yy_load_buffer_state ------------------ 2317| 0| yyg->yy_did_buffer_switch_on_eof = 1; 2318| 0| } 2319| 0|} libconfig_yy_scan_buffer: 2375| 2.21k|{ 2376| 2.21k| YY_BUFFER_STATE b; 2377| | 2378| 2.21k| if ( size < 2 || ------------------ | Branch (2378:7): [True: 0, False: 2.21k] ------------------ 2379| 2.21k| base[size-2] != YY_END_OF_BUFFER_CHAR || ------------------ | | 368| 4.42k|#define YY_END_OF_BUFFER_CHAR 0 ------------------ | Branch (2379:7): [True: 0, False: 2.21k] ------------------ 2380| 2.21k| base[size-1] != YY_END_OF_BUFFER_CHAR ) ------------------ | | 368| 2.21k|#define YY_END_OF_BUFFER_CHAR 0 ------------------ | Branch (2380:7): [True: 0, False: 2.21k] ------------------ 2381| | /* They forgot to leave room for the EOB's. */ 2382| 0| return NULL; 2383| | 2384| 2.21k| b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); ------------------ | | 224| 2.21k|#define yyalloc libconfig_yyalloc ------------------ 2385| 2.21k| if ( ! b ) ------------------ | Branch (2385:7): [True: 0, False: 2.21k] ------------------ 2386| 0| YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); ------------------ | | 1139| 0|#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) ------------------ 2387| | 2388| 2.21k| b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ 2389| 2.21k| b->yy_buf_pos = b->yy_ch_buf = base; 2390| 2.21k| b->yy_is_our_buffer = 0; 2391| 2.21k| b->yy_input_file = NULL; 2392| 2.21k| b->yy_n_chars = b->yy_buf_size; 2393| 2.21k| b->yy_is_interactive = 0; 2394| 2.21k| b->yy_at_bol = 1; 2395| 2.21k| b->yy_fill_buffer = 0; 2396| 2.21k| b->yy_buffer_status = YY_BUFFER_NEW; ------------------ | | 486| 2.21k|#define YY_BUFFER_NEW 0 ------------------ 2397| | 2398| 2.21k| yy_switch_to_buffer( b , yyscanner ); ------------------ | | 68| 2.21k|#define yy_switch_to_buffer libconfig_yy_switch_to_buffer ------------------ 2399| | 2400| 2.21k| return b; 2401| 2.21k|} libconfig_yy_scan_string: 2412| 2.21k|{ 2413| | 2414| 2.21k| return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); ------------------ | | 44| 2.21k|#define yy_scan_bytes libconfig_yy_scan_bytes ------------------ 2415| 2.21k|} libconfig_yy_scan_bytes: 2425| 2.21k|{ 2426| 2.21k| YY_BUFFER_STATE b; 2427| 2.21k| char *buf; 2428| 2.21k| yy_size_t n; 2429| 2.21k| int i; 2430| | 2431| | /* Get memory for full buffer, including space for trailing EOB's. */ 2432| 2.21k| n = (yy_size_t) (_yybytes_len + 2); 2433| 2.21k| buf = (char *) yyalloc( n , yyscanner ); ------------------ | | 224| 2.21k|#define yyalloc libconfig_yyalloc ------------------ 2434| 2.21k| if ( ! buf ) ------------------ | Branch (2434:7): [True: 0, False: 2.21k] ------------------ 2435| 0| YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); ------------------ | | 1139| 0|#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) ------------------ 2436| | 2437| 354k| for ( i = 0; i < _yybytes_len; ++i ) ------------------ | Branch (2437:15): [True: 352k, False: 2.21k] ------------------ 2438| 352k| buf[i] = yybytes[i]; 2439| | 2440| 2.21k| buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; ------------------ | | 368| 2.21k|#define YY_END_OF_BUFFER_CHAR 0 ------------------ 2441| | 2442| 2.21k| b = yy_scan_buffer( buf, n , yyscanner); ------------------ | | 32| 2.21k|#define yy_scan_buffer libconfig_yy_scan_buffer ------------------ 2443| 2.21k| if ( ! b ) ------------------ | Branch (2443:7): [True: 0, False: 2.21k] ------------------ 2444| 0| YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); ------------------ | | 1139| 0|#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) ------------------ 2445| | 2446| | /* It's okay to grow etc. this buffer, and we should throw it 2447| | * away when we're done. 2448| | */ 2449| 2.21k| b->yy_is_our_buffer = 1; 2450| | 2451| 2.21k| return b; 2452| 2.21k|} libconfig_yyget_lineno: 2498| 89.4k|{ 2499| 89.4k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2500| | 2501| 89.4k| if (! YY_CURRENT_BUFFER) ------------------ | | 509| 89.4k|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:29): [True: 89.4k, False: 0] | | ------------------ | | 510| 89.4k| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 89.4k| : NULL) ------------------ | Branch (2501:13): [True: 0, False: 89.4k] ------------------ 2502| 0| return 0; 2503| | 2504| 89.4k| return yylineno; ------------------ | | 349| 89.4k|#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) | | ------------------ | | | | 515| 89.4k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ ------------------ 2505| 89.4k|} libconfig_yyset_extra: 2562| 4.42k|{ 2563| 4.42k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2564| 4.42k| yyextra = user_defined ; ------------------ | | 346| 4.42k|#define yyextra yyg->yyextra_r ------------------ 2565| 4.42k|} libconfig_yyset_lineno: 2572| 2.21k|{ 2573| 2.21k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2574| | 2575| | /* lineno is only valid if an input buffer exists. */ 2576| 2.21k| if (! YY_CURRENT_BUFFER ) ------------------ | | 509| 2.21k|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:29): [True: 2.21k, False: 0] | | ------------------ | | 510| 2.21k| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 2.21k| : NULL) ------------------ | Branch (2576:13): [True: 0, False: 2.21k] ------------------ 2577| 0| YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); ------------------ | | 1139| 0|#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) ------------------ 2578| | 2579| 2.21k| yylineno = _line_number; ------------------ | | 349| 2.21k|#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) | | ------------------ | | | | 515| 2.21k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ ------------------ 2580| 2.21k|} libconfig_yylex_init_extra: 2675| 2.21k|{ 2676| 2.21k| struct yyguts_t dummy_yyguts; 2677| | 2678| 2.21k| yyset_extra (yy_user_defined, &dummy_yyguts); ------------------ | | 140| 2.21k|#define yyset_extra libconfig_yyset_extra ------------------ 2679| | 2680| 2.21k| if (ptr_yy_globals == NULL){ ------------------ | Branch (2680:9): [True: 0, False: 2.21k] ------------------ 2681| 0| errno = EINVAL; 2682| 0| return 1; 2683| 0| } 2684| | 2685| 2.21k| *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); ------------------ | | 224| 2.21k|#define yyalloc libconfig_yyalloc ------------------ 2686| | 2687| 2.21k| if (*ptr_yy_globals == NULL){ ------------------ | Branch (2687:9): [True: 0, False: 2.21k] ------------------ 2688| 0| errno = ENOMEM; 2689| 0| return 1; 2690| 0| } 2691| | 2692| | /* By setting to 0xAA, we expose bugs in 2693| | yy_init_globals. Leave at 0x00 for releases. */ 2694| 2.21k| memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); 2695| | 2696| 2.21k| yyset_extra (yy_user_defined, *ptr_yy_globals); ------------------ | | 140| 2.21k|#define yyset_extra libconfig_yyset_extra ------------------ 2697| | 2698| 2.21k| return yy_init_globals ( *ptr_yy_globals ); 2699| 2.21k|} libconfig_yylex_destroy: 2736| 2.21k|{ 2737| 2.21k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2738| | 2739| | /* Pop the buffer stack, destroying each element. */ 2740| 4.42k| while(YY_CURRENT_BUFFER){ ------------------ | | 509| 4.42k|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:27): [True: 2.21k, False: 2.21k] | | | Branch (509:29): [True: 4.42k, False: 0] | | ------------------ | | 510| 4.42k| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 4.42k| : NULL) ------------------ 2741| 2.21k| yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); ------------------ | | 26| 2.21k|#define yy_delete_buffer libconfig_yy_delete_buffer ------------------ yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); ------------------ | | 509| 2.21k|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:29): [True: 2.21k, False: 0] | | ------------------ | | 510| 2.21k| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 2.21k| : NULL) ------------------ 2742| 2.21k| YY_CURRENT_BUFFER_LVALUE = NULL; ------------------ | | 515| 2.21k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 2743| 2.21k| yypop_buffer_state(yyscanner); ------------------ | | 80| 2.21k|#define yypop_buffer_state libconfig_yypop_buffer_state ------------------ 2744| 2.21k| } 2745| | 2746| | /* Destroy the stack itself. */ 2747| 2.21k| yyfree(yyg->yy_buffer_stack , yyscanner); ------------------ | | 236| 2.21k|#define yyfree libconfig_yyfree ------------------ 2748| 2.21k| yyg->yy_buffer_stack = NULL; 2749| | 2750| | /* Destroy the start condition stack. */ 2751| 2.21k| yyfree( yyg->yy_start_stack , yyscanner ); ------------------ | | 236| 2.21k|#define yyfree libconfig_yyfree ------------------ 2752| 2.21k| yyg->yy_start_stack = NULL; 2753| | 2754| | /* Reset the globals. This is important in a non-reentrant scanner so the next time 2755| | * yylex() is called, initialization will occur. */ 2756| 2.21k| yy_init_globals( yyscanner); 2757| | 2758| | /* Destroy the main struct (reentrant only). */ 2759| 2.21k| yyfree ( yyscanner , yyscanner ); ------------------ | | 236| 2.21k|#define yyfree libconfig_yyfree ------------------ 2760| | yyscanner = NULL; 2761| 2.21k| return 0; 2762| 2.21k|} libconfig_yyfree: 2792| 11.0k|{ 2793| 11.0k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2794| 11.0k| (void)yyg; 2795| 11.0k| free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ 2796| 11.0k|} libconfig_yyalloc: 2804| 8.85k|{ 2805| 8.85k| return(libconfig_malloc(bytes)); 2806| 8.85k|} scanner.c:yy_get_next_buffer: 1812| 3.93k|{ 1813| 3.93k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1814| 3.93k| char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; ------------------ | | 515| 3.93k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 1815| 3.93k| char *source = yyg->yytext_ptr; ------------------ | | 567| 3.93k|#define yytext_ptr yytext_r ------------------ 1816| 3.93k| int number_to_move, i; 1817| 3.93k| int ret_val; 1818| | 1819| 3.93k| if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) ------------------ | | 515| 3.93k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ | Branch (1819:7): [True: 0, False: 3.93k] ------------------ 1820| 0| YY_FATAL_ERROR( ------------------ | | 1139| 0|#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) ------------------ 1821| 3.93k| "fatal flex scanner internal error--end of buffer missed" ); 1822| | 1823| 3.93k| if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) ------------------ | | 515| 3.93k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ | Branch (1823:7): [True: 3.93k, False: 0] ------------------ 1824| 3.93k| { /* Don't try to fill the buffer, so this is an EOF. */ 1825| 3.93k| if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) ------------------ | | 567| 3.93k|#define yytext_ptr yytext_r ------------------ if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) ------------------ | | 888| 3.93k|#define YY_MORE_ADJ 0 ------------------ | Branch (1825:8): [True: 1.89k, False: 2.03k] ------------------ 1826| 1.89k| { 1827| | /* We matched a single character, the EOB, so 1828| | * treat this as a final EOF. 1829| | */ 1830| 1.89k| return EOB_ACT_END_OF_FILE; ------------------ | | 398| 1.89k|#define EOB_ACT_END_OF_FILE 1 ------------------ 1831| 1.89k| } 1832| | 1833| 2.03k| else 1834| 2.03k| { 1835| | /* We matched some text prior to the EOB, first 1836| | * process it. 1837| | */ 1838| 2.03k| return EOB_ACT_LAST_MATCH; ------------------ | | 399| 2.03k|#define EOB_ACT_LAST_MATCH 2 ------------------ 1839| 2.03k| } 1840| 3.93k| } 1841| | 1842| | /* Try to read more data. */ 1843| | 1844| | /* First move last chars to start of buffer. */ 1845| 0| number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); ------------------ | | 567| 0|#define yytext_ptr yytext_r ------------------ 1846| | 1847| 0| for ( i = 0; i < number_to_move; ++i ) ------------------ | Branch (1847:15): [True: 0, False: 0] ------------------ 1848| 0| *(dest++) = *(source++); 1849| | 1850| 0| if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) ------------------ | | 498| 0|#define YY_BUFFER_EOF_PENDING 2 ------------------ | Branch (1850:7): [True: 0, False: 0] ------------------ 1851| | /* don't do the read, it's not guaranteed to return an EOF, 1852| | * just force an EOF 1853| | */ 1854| 0| YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 1855| | 1856| 0| else 1857| 0| { 1858| 0| int num_to_read = 1859| 0| YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 1860| | 1861| 0| while ( num_to_read <= 0 ) ------------------ | Branch (1861:11): [True: 0, False: 0] ------------------ 1862| 0| { /* Not enough room in the buffer - grow it. */ 1863| | 1864| | /* just a shorter name for the current buffer */ 1865| 0| YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 1866| | 1867| 0| int yy_c_buf_p_offset = 1868| 0| (int) (yyg->yy_c_buf_p - b->yy_ch_buf); 1869| | 1870| 0| if ( b->yy_is_our_buffer ) ------------------ | Branch (1870:9): [True: 0, False: 0] ------------------ 1871| 0| { 1872| 0| int new_size = b->yy_buf_size * 2; 1873| | 1874| 0| if ( new_size <= 0 ) ------------------ | Branch (1874:10): [True: 0, False: 0] ------------------ 1875| 0| b->yy_buf_size += b->yy_buf_size / 8; 1876| 0| else 1877| 0| b->yy_buf_size *= 2; 1878| | 1879| 0| b->yy_ch_buf = (char *) 1880| | /* Include room in for 2 EOB chars. */ 1881| 0| yyrealloc( (void *) b->yy_ch_buf, ------------------ | | 230| 0|#define yyrealloc libconfig_yyrealloc ------------------ 1882| 0| (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); 1883| 0| } 1884| 0| else 1885| | /* Can't grow it, we don't own it. */ 1886| 0| b->yy_ch_buf = NULL; 1887| | 1888| 0| if ( ! b->yy_ch_buf ) ------------------ | Branch (1888:9): [True: 0, False: 0] ------------------ 1889| 0| YY_FATAL_ERROR( ------------------ | | 1139| 0|#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) ------------------ 1890| 0| "fatal error - scanner input buffer overflow" ); 1891| | 1892| 0| yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; 1893| | 1894| 0| num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 1895| 0| number_to_move - 1; 1896| | 1897| 0| } 1898| | 1899| 0| if ( num_to_read > YY_READ_BUF_SIZE ) ------------------ | | 1076| 0|#define YY_READ_BUF_SIZE 8192 ------------------ | Branch (1899:8): [True: 0, False: 0] ------------------ 1900| 0| num_to_read = YY_READ_BUF_SIZE; ------------------ | | 1076| 0|#define YY_READ_BUF_SIZE 8192 ------------------ 1901| | 1902| | /* Read in more data. */ 1903| 0| YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), ------------------ | | 1093| 0| if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ | | ------------------ | | | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | | Branch (1093:7): [True: 0, False: 0] | | ------------------ | | 1094| 0| { \ | | 1095| 0| int c = '*'; \ | | 1096| 0| int n; \ | | 1097| 0| for ( n = 0; n < max_size && \ | | ------------------ | | | Branch (1097:16): [True: 0, False: 0] | | ------------------ | | 1098| 0| (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ | | ------------------ | | | | 344| 0|#define yyin yyg->yyin_r | | ------------------ | | | Branch (1098:9): [True: 0, False: 0] | | | Branch (1098:38): [True: 0, False: 0] | | ------------------ | | 1099| 0| buf[n] = (char) c; \ | | 1100| 0| if ( c == '\n' ) \ | | ------------------ | | | Branch (1100:8): [True: 0, False: 0] | | ------------------ | | 1101| 0| buf[n++] = (char) c; \ | | 1102| 0| if ( c == EOF && ferror( yyin ) ) \ | | ------------------ | | | | 344| 0|#define yyin yyg->yyin_r | | ------------------ | | | Branch (1102:8): [True: 0, False: 0] | | | Branch (1102:20): [True: 0, False: 0] | | ------------------ | | 1103| 0| YY_FATAL_ERROR( "input in flex scanner failed" ); \ | | ------------------ | | | | 1139| 0|#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) | | ------------------ | | 1104| 0| result = n; \ | | 1105| 0| } \ | | 1106| 0| else \ | | 1107| 0| { \ | | 1108| 0| errno=0; \ | | 1109| 0| while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ | | ------------------ | | | | 344| 0|#define yyin yyg->yyin_r | | ------------------ | | while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ | | ------------------ | | | | 344| 0|#define yyin yyg->yyin_r | | ------------------ | | | Branch (1109:11): [True: 0, False: 0] | | | Branch (1109:78): [True: 0, False: 0] | | ------------------ | | 1110| 0| { \ | | 1111| 0| if( errno != EINTR) \ | | ------------------ | | | Branch (1111:8): [True: 0, False: 0] | | ------------------ | | 1112| 0| { \ | | 1113| 0| YY_FATAL_ERROR( "input in flex scanner failed" ); \ | | ------------------ | | | | 1139| 0|#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) | | ------------------ | | 1114| 0| break; \ | | 1115| 0| } \ | | 1116| 0| errno=0; \ | | 1117| 0| clearerr(yyin); \ | | ------------------ | | | | 344| 0|#define yyin yyg->yyin_r | | ------------------ | | 1118| 0| } \ | | 1119| 0| }\ ------------------ 1904| 0| yyg->yy_n_chars, num_to_read ); 1905| | 1906| 0| YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 1907| 0| } 1908| | 1909| 0| if ( yyg->yy_n_chars == 0 ) ------------------ | Branch (1909:7): [True: 0, False: 0] ------------------ 1910| 0| { 1911| 0| if ( number_to_move == YY_MORE_ADJ ) ------------------ | | 888| 0|#define YY_MORE_ADJ 0 ------------------ | Branch (1911:8): [True: 0, False: 0] ------------------ 1912| 0| { 1913| 0| ret_val = EOB_ACT_END_OF_FILE; ------------------ | | 398| 0|#define EOB_ACT_END_OF_FILE 1 ------------------ 1914| 0| yyrestart( yyin , yyscanner); ------------------ | | 98| 0|#define yyrestart libconfig_yyrestart ------------------ yyrestart( yyin , yyscanner); ------------------ | | 344| 0|#define yyin yyg->yyin_r ------------------ 1915| 0| } 1916| | 1917| 0| else 1918| 0| { 1919| 0| ret_val = EOB_ACT_LAST_MATCH; ------------------ | | 399| 0|#define EOB_ACT_LAST_MATCH 2 ------------------ 1920| 0| YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 1921| 0| YY_BUFFER_EOF_PENDING; ------------------ | | 498| 0|#define YY_BUFFER_EOF_PENDING 2 ------------------ 1922| 0| } 1923| 0| } 1924| | 1925| 0| else 1926| 0| ret_val = EOB_ACT_CONTINUE_SCAN; ------------------ | | 397| 0|#define EOB_ACT_CONTINUE_SCAN 0 ------------------ 1927| | 1928| 0| if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ | Branch (1928:6): [True: 0, False: 0] ------------------ 1929| | /* Extend the array by 50%, plus the number we really need. */ 1930| 0| int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); 1931| 0| YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( ------------------ | | 230| 0|#define yyrealloc libconfig_yyrealloc ------------------ 1932| 0| (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 1933| 0| if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ | Branch (1933:8): [True: 0, False: 0] ------------------ 1934| 0| YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); ------------------ | | 1139| 0|#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) ------------------ 1935| | /* "- 2" to take care of EOB's */ 1936| 0| YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 1937| 0| } 1938| | 1939| 0| yyg->yy_n_chars += number_to_move; 1940| 0| YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; ------------------ | | 368| 0|#define YY_END_OF_BUFFER_CHAR 0 ------------------ 1941| 0| YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; ------------------ | | 368| 0|#define YY_END_OF_BUFFER_CHAR 0 ------------------ 1942| | 1943| 0| yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; ------------------ | | 567| 0|#define yytext_ptr yytext_r ------------------ yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 1944| | 1945| 0| return ret_val; 1946| 0|} scanner.c:yy_get_previous_state: 1951| 2.03k|{ 1952| 2.03k| yy_state_type yy_current_state; 1953| 2.03k| char *yy_cp; 1954| 2.03k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1955| | 1956| 2.03k| yy_current_state = yyg->yy_start; 1957| 2.03k| yy_current_state += YY_AT_BOL(); ------------------ | | 557| 2.03k|#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) | | ------------------ | | | | 515| 2.03k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ ------------------ 1958| | 1959| 23.2k| for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) ------------------ | | 567| 2.03k|#define yytext_ptr yytext_r ------------------ for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) ------------------ | | 888| 2.03k|#define YY_MORE_ADJ 0 ------------------ | Branch (1959:47): [True: 21.2k, False: 2.03k] ------------------ 1960| 21.2k| { 1961| 21.2k| YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); ------------------ | | 334| 21.2k|#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) ------------------ | Branch (1961:19): [True: 21.2k, False: 0] ------------------ 1962| 21.2k| if ( yy_accept[yy_current_state] ) ------------------ | Branch (1962:8): [True: 18.9k, False: 2.31k] ------------------ 1963| 18.9k| { 1964| 18.9k| yyg->yy_last_accepting_state = yy_current_state; 1965| 18.9k| yyg->yy_last_accepting_cpos = yy_cp; 1966| 18.9k| } 1967| 35.9k| while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) ------------------ | Branch (1967:11): [True: 14.7k, False: 21.2k] ------------------ 1968| 14.7k| { 1969| 14.7k| yy_current_state = (int) yy_def[yy_current_state]; 1970| 14.7k| if ( yy_current_state >= 214 ) ------------------ | Branch (1970:9): [True: 14.6k, False: 134] ------------------ 1971| 14.6k| yy_c = yy_meta[yy_c]; 1972| 14.7k| } 1973| 21.2k| yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; 1974| 21.2k| } 1975| | 1976| 2.03k| return yy_current_state; 1977| 2.03k|} scanner.c:libconfig_yy_load_buffer_state: 2152| 4.42k|{ 2153| 4.42k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2154| 4.42k| yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; ------------------ | | 515| 4.42k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 2155| 4.42k| yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; ------------------ | | 567| 4.42k|#define yytext_ptr yytext_r ------------------ yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; ------------------ | | 515| 4.42k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 2156| 4.42k| yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; ------------------ | | 344| 4.42k|#define yyin yyg->yyin_r ------------------ yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; ------------------ | | 515| 4.42k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 2157| 4.42k| yyg->yy_hold_char = *yyg->yy_c_buf_p; 2158| 4.42k|} scanner.c:libconfig_yyensure_buffer_stack: 2325| 2.21k|{ 2326| 2.21k| yy_size_t num_to_alloc; 2327| 2.21k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2328| | 2329| 2.21k| if (!yyg->yy_buffer_stack) { ------------------ | Branch (2329:6): [True: 2.21k, False: 0] ------------------ 2330| | 2331| | /* First allocation is just for 2 elements, since we don't know if this 2332| | * scanner will even need a stack. We use 2 instead of 1 to avoid an 2333| | * immediate realloc on the next call. 2334| | */ 2335| 2.21k| num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ 2336| 2.21k| yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc ------------------ | | 224| 2.21k|#define yyalloc libconfig_yyalloc ------------------ 2337| 2.21k| (num_to_alloc * sizeof(struct yy_buffer_state*) 2338| 2.21k| , yyscanner); 2339| 2.21k| if ( ! yyg->yy_buffer_stack ) ------------------ | Branch (2339:8): [True: 0, False: 2.21k] ------------------ 2340| 0| YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); ------------------ | | 1139| 0|#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) ------------------ 2341| | 2342| 2.21k| memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); 2343| | 2344| 2.21k| yyg->yy_buffer_stack_max = num_to_alloc; 2345| 2.21k| yyg->yy_buffer_stack_top = 0; 2346| 2.21k| return; 2347| 2.21k| } 2348| | 2349| 0| if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ ------------------ | Branch (2349:6): [True: 0, False: 0] ------------------ 2350| | 2351| | /* Increase the buffer to prepare for a possible push. */ 2352| 0| yy_size_t grow_size = 8 /* arbitrary grow size */; 2353| | 2354| 0| num_to_alloc = yyg->yy_buffer_stack_max + grow_size; 2355| 0| yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc ------------------ | | 230| 0|#define yyrealloc libconfig_yyrealloc ------------------ 2356| 0| (yyg->yy_buffer_stack, 2357| 0| num_to_alloc * sizeof(struct yy_buffer_state*) 2358| 0| , yyscanner); 2359| 0| if ( ! yyg->yy_buffer_stack ) ------------------ | Branch (2359:8): [True: 0, False: 0] ------------------ 2360| 0| YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); ------------------ | | 1139| 0|#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) ------------------ 2361| | 2362| | /* zero only the new slots.*/ 2363| 0| memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); 2364| 0| yyg->yy_buffer_stack_max = num_to_alloc; 2365| 0| } 2366| 0|} scanner.c:yy_init_globals: 2702| 4.42k|{ 2703| 4.42k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2704| | /* Initialization is the same as for the non-reentrant scanner. 2705| | * This function is called from yylex_destroy(), so don't allocate here. 2706| | */ 2707| | 2708| 4.42k| yyg->yy_buffer_stack = NULL; 2709| 4.42k| yyg->yy_buffer_stack_top = 0; 2710| 4.42k| yyg->yy_buffer_stack_max = 0; 2711| 4.42k| yyg->yy_c_buf_p = NULL; 2712| 4.42k| yyg->yy_init = 0; 2713| 4.42k| yyg->yy_start = 0; 2714| | 2715| 4.42k| yyg->yy_start_stack_ptr = 0; 2716| 4.42k| yyg->yy_start_stack_depth = 0; 2717| 4.42k| yyg->yy_start_stack = NULL; 2718| | 2719| |/* Defined in main.c */ 2720| |#ifdef YY_STDINIT 2721| | yyin = stdin; 2722| | yyout = stdout; 2723| |#else 2724| 4.42k| yyin = NULL; ------------------ | | 344| 4.42k|#define yyin yyg->yyin_r ------------------ 2725| 4.42k| yyout = NULL; ------------------ | | 345| 4.42k|#define yyout yyg->yyout_r ------------------ 2726| 4.42k|#endif 2727| | 2728| | /* For future reference: Set errno on error, since we are called by 2729| | * yylex_init() 2730| | */ 2731| 4.42k| return 0; 2732| 4.42k|} libconfig_strbuf_ensure_capacity: 34| 13.4k|{ 35| 13.4k| static const size_t mask = ~(STRING_BLOCK_SIZE - 1); ------------------ | | 29| 13.4k|#define STRING_BLOCK_SIZE 64 ------------------ 36| | 37| 13.4k| size_t newlen = buf->length + len + 1; /* add 1 for NUL */ 38| 13.4k| if(newlen > buf->capacity) ------------------ | Branch (38:6): [True: 4.30k, False: 9.11k] ------------------ 39| 4.30k| { 40| 4.30k| buf->capacity = (newlen + (STRING_BLOCK_SIZE - 1)) & mask; ------------------ | | 29| 4.30k|#define STRING_BLOCK_SIZE 64 ------------------ 41| 4.30k| buf->string = (char *)libconfig_realloc(buf->string, buf->capacity); 42| 4.30k| } 43| 13.4k|} libconfig_strbuf_release: 48| 10.7k|{ 49| 10.7k| char *r = buf->string; 50| 10.7k| __zero(buf); ------------------ | | 39| 10.7k|#define __zero(P) memset((void *)(P), 0, sizeof(*P)) ------------------ 51| 10.7k| return(r); 52| 10.7k|} libconfig_strbuf_append_string: 57| 7.35k|{ 58| 7.35k| size_t len = strlen(s); 59| 7.35k| libconfig_strbuf_ensure_capacity(buf, len); 60| 7.35k| strcpy(buf->string + buf->length, s); 61| 7.35k| buf->length += len; 62| 7.35k|} libconfig_strbuf_append_char: 67| 6.06k|{ 68| 6.06k| libconfig_strbuf_ensure_capacity(buf, 1); 69| 6.06k| *(buf->string + buf->length) = c; 70| 6.06k| ++(buf->length); 71| 6.06k| *(buf->string + buf->length) = '\0'; 72| 6.06k|} libconfig_strvec_release: 51| 2.21k|{ 52| 2.21k| const char **r = vec->strings; 53| 2.21k| if(r) ------------------ | Branch (53:6): [True: 0, False: 2.21k] ------------------ 54| 0| *(vec->end) = NULL; 55| | 56| 2.21k| __zero(vec); ------------------ | | 39| 2.21k|#define __zero(P) memset((void *)(P), 0, sizeof(*P)) ------------------ 57| 2.21k| return(r); 58| 2.21k|} libconfig_strvec_delete: 63| 6.85k|{ 64| 6.85k| const char *const *p; 65| | 66| 6.85k| if(!vec) return; ------------------ | Branch (66:6): [True: 6.85k, False: 0] ------------------ 67| | 68| 0| for(p = vec; *p; ++p) ------------------ | Branch (68:16): [True: 0, False: 0] ------------------ 69| 0| __delete(*p); ------------------ | | 38| 0|#define __delete(P) free((void *)(P)) ------------------ 70| | 71| 0| __delete(vec); ------------------ | | 38| 0|#define __delete(P) free((void *)(P)) ------------------ 72| 0|} libconfig_malloc: 65| 9.02k|{ 66| 9.02k| void *ptr = malloc(size); 67| 9.02k| if(!ptr) ------------------ | Branch (67:6): [True: 0, False: 9.02k] ------------------ 68| 0| libconfig_fatal_error(__libconfig_malloc_failure_message); 69| | 70| 9.02k| return(ptr); 71| 9.02k|} libconfig_calloc: 76| 149k|{ 77| 149k| void *ptr = calloc(nmemb, size); 78| 149k| if(!ptr) ------------------ | Branch (78:6): [True: 0, False: 149k] ------------------ 79| 0| libconfig_fatal_error(__libconfig_malloc_failure_message); 80| | 81| 149k| return(ptr); 82| 149k|} libconfig_realloc: 87| 61.0k|{ 88| 61.0k| ptr = realloc(ptr, size); 89| 61.0k| if(!ptr) ------------------ | Branch (89:6): [True: 0, False: 61.0k] ------------------ 90| 0| libconfig_fatal_error(__libconfig_malloc_failure_message); 91| | 92| 61.0k| return(ptr); 93| 61.0k|} libconfig_parse_integer: 103| 15.5k|{ 104| 15.5k| char *endptr; 105| 15.5k| int errsave = errno; 106| | 107| 15.5k| errno = 0; 108| 15.5k| *val = strtoll(s, &endptr, base); 109| | 110| 15.5k| if((base != 10) && (*val > INT32_MAX) && (*val <= UINT32_MAX)) ------------------ | Branch (110:6): [True: 6.61k, False: 8.92k] | Branch (110:22): [True: 628, False: 5.98k] | Branch (110:44): [True: 252, False: 376] ------------------ 111| 252| *val = (long long)(int)*val; 112| | 113| 15.5k| *is_long = ((*val < INT32_MIN) || (*val > INT32_MAX)); ------------------ | Branch (113:15): [True: 454, False: 15.0k] | Branch (113:37): [True: 491, False: 14.5k] ------------------ 114| | 115| | /* Check for trailing L's. */ 116| 20.1k| while(!errno && *endptr == 'L') ------------------ | Branch (116:9): [True: 20.0k, False: 13] | Branch (116:19): [True: 4.56k, False: 15.5k] ------------------ 117| 4.56k| { 118| 4.56k| *is_long = 1; 119| 4.56k| ++endptr; 120| 4.56k| } 121| | 122| 15.5k| if(*endptr || errno) ------------------ | Branch (122:6): [True: 3, False: 15.5k] | Branch (122:17): [True: 10, False: 15.5k] ------------------ 123| 13| { 124| 13| errno = errsave; 125| 13| return(0); /* parse error */ 126| 13| } 127| 15.5k| errno = errsave; 128| | 129| 15.5k| return(1); 130| 15.5k|} libconfig_format_double: 136| 12.7k|{ 137| 12.7k| const char *fmt = sci_ok ? "%.*g" : "%.*f"; ------------------ | Branch (137:21): [True: 0, False: 12.7k] ------------------ 138| 12.7k| char *p, *q; 139| | 140| 12.7k| snprintf(buf, buflen - 3, fmt, precision, val); 141| | 142| | /* Check for exponent. */ 143| 12.7k| p = strchr(buf, 'e'); 144| 12.7k| if(p) return; ------------------ | Branch (144:6): [True: 0, False: 12.7k] ------------------ 145| | 146| | /* Check for decimal point. */ 147| 12.7k| p = strchr(buf, '.'); 148| 12.7k| if(!p) ------------------ | Branch (148:6): [True: 246, False: 12.5k] ------------------ 149| 246| { 150| | /* No decimal point. Add trailing ".0". */ 151| 246| strcat(buf, ".0"); 152| 246| } 153| 12.5k| else 154| 12.5k| { 155| | /* Remove any excess trailing 0's after decimal point. */ 156| 71.4k| for(q = buf + strlen(buf) - 1; q > p + 1; --q) ------------------ | Branch (156:36): [True: 60.0k, False: 11.4k] ------------------ 157| 60.0k| { 158| 60.0k| if(*q == '0') ------------------ | Branch (158:10): [True: 58.8k, False: 1.12k] ------------------ 159| 58.8k| *q = '\0'; 160| 1.12k| else 161| 1.12k| break; 162| 60.0k| } 163| 12.5k| } 164| 12.7k|} libconfig_format_bin: 172| 1.87k|{ 173| 1.87k| static const int num_bits = sizeof(val) * BITS_IN_BYTE; ------------------ | | 27| 1.87k|#define BITS_IN_BYTE 8 ------------------ 174| 1.87k| char *p = buf + num_bits; 175| 1.87k| char *first_bit = NULL; 176| | 177| 1.87k| *p = '\0'; 178| | 179| 122k| for(int i = 0; i < num_bits; ++i) ------------------ | Branch (179:18): [True: 120k, False: 1.87k] ------------------ 180| 120k| { 181| 120k| int x = val & 1; 182| 120k| val >>= 1; 183| 120k| *(--p) = '0' + x; 184| 120k| if(!first_bit || x) first_bit = p; ------------------ | Branch (184:8): [True: 1.87k, False: 118k] | Branch (184:22): [True: 591, False: 117k] ------------------ 185| 120k| } 186| | 187| 1.87k| return(first_bit); 188| 1.87k|}