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| 34.8k|{ 47| 34.8k| if (NULL == setting || NULL == name) ------------------ | Branch (47:9): [True: 0, False: 34.8k] | Branch (47:28): [True: 0, False: 34.8k] ------------------ 48| 0| { 49| 0| return NULL; 50| 0| } 51| | 52| | // Check if the current setting's name matches 53| 34.8k| const char *setting_name = config_setting_name(setting); ------------------ | | 290| 34.8k| ((S)->name) ------------------ 54| 34.8k| if (NULL != setting_name && strlen(setting_name) == name_len) { ------------------ | Branch (54:9): [True: 7.21k, False: 27.5k] | Branch (54:33): [True: 2.54k, False: 4.67k] ------------------ 55| 2.54k| if (strncmp(config_setting_name(setting), name, name_len) == 0) { ------------------ | | 290| 2.54k| ((S)->name) ------------------ | Branch (55:13): [True: 419, False: 2.12k] ------------------ 56| 419| return setting; 57| 419| } 58| 2.54k| } 59| | 60| | // If it's a group, iterate over its children recursively 61| 34.3k| if (config_setting_is_group(setting) || config_setting_is_array(setting) ------------------ | | 277| 68.7k| ((S)->type == CONFIG_TYPE_GROUP) | | ------------------ | | | | 50| 34.3k|#define CONFIG_TYPE_GROUP 1 | | ------------------ | | | Branch (277:3): [True: 4.12k, False: 30.2k] | | ------------------ ------------------ if (config_setting_is_group(setting) || config_setting_is_array(setting) ------------------ | | 279| 64.6k| ((S)->type == CONFIG_TYPE_ARRAY) | | ------------------ | | | | 56| 30.2k|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (279:3): [True: 1.50k, 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.56k, False: 27.1k] | | ------------------ ------------------ 63| 7.19k| { 64| 7.19k| int count = config_setting_length(setting); 65| 39.5k| for (int i = 0; i < count; ++i) ------------------ | Branch (65:25): [True: 33.0k, False: 6.50k] ------------------ 66| 33.0k| { 67| 33.0k| config_setting_t *child = config_setting_get_elem(setting, i); 68| 33.0k| config_setting_t *result = find_setting_recursive(child, name, name_len); 69| 33.0k| if (result != NULL) ------------------ | Branch (69:17): [True: 686, False: 32.3k] ------------------ 70| 686| { 71| 686| return result; // Return the found setting 72| 686| } 73| 33.0k| } 74| 7.19k| } 75| | 76| | // Return NULL if not found 77| 33.7k| return NULL; 78| 34.3k|} LLVMFuzzerTestOneInput: 129| 2.25k|{ 130| 2.25k| static FILE *dev_null; 131| 2.25k| uint8_t data_buff[MAX_BUFF_SIZE] = {0}; 132| 2.25k| uint8_t scratch_mem[sizeof(uint64_t)] = {0}; 133| 2.25k| config_t cfg = {0}; 134| 2.25k| uint8_t *config_ptr; 135| 2.25k| uint8_t *path_ptr; 136| 2.25k| config_setting_t *root; 137| 2.25k| int rc = -1; 138| | 139| 2.25k| fuzz_data_t *fuzz_data = (fuzz_data_t*) data_buff; 140| | 141| 2.25k| if (NULL == dev_null) ------------------ | Branch (141:9): [True: 1, False: 2.25k] ------------------ 142| 1| { 143| | // Only called once per process 144| 1| dev_null = open_null_file(); 145| 1| } 146| | 147| 2.25k| if (size < MIN_BUFF_SIZE || size > MAX_BUFF_SIZE) ------------------ | | 10| 4.51k|#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.24k|#define MAX_BUFF_SIZE sizeof(fuzz_data_t) + MAX_CONFIG_SIZE + MAX_PATH_SIZE + 2 | | ------------------ | | | | 8| 2.24k|#define MAX_CONFIG_SIZE 4096 | | ------------------ | | #define MAX_BUFF_SIZE sizeof(fuzz_data_t) + MAX_CONFIG_SIZE + MAX_PATH_SIZE + 2 | | ------------------ | | | | 9| 2.24k|#define MAX_PATH_SIZE 256 | | ------------------ ------------------ | Branch (147:9): [True: 7, False: 2.24k] | Branch (147:33): [True: 7, False: 2.24k] ------------------ 148| 14| { 149| | // Not enough bytes to be a fuzz_data_t 150| 14| rc = 0; 151| 14| goto end; 152| 14| } 153| | 154| | // Copy the data to a buffer that can be mutated 155| 2.24k| memcpy(data_buff, data, size); 156| | 157| 2.24k| config_init(&cfg); 158| | 159| 2.24k| if (fuzz_data->content_size > MAX_CONFIG_SIZE || ------------------ | | 8| 4.48k|#define MAX_CONFIG_SIZE 4096 ------------------ | Branch (159:9): [True: 35, False: 2.20k] ------------------ 160| 2.20k| fuzz_data->path_size > MAX_PATH_SIZE || ------------------ | | 9| 4.44k|#define MAX_PATH_SIZE 256 ------------------ | Branch (160:9): [True: 51, False: 2.15k] ------------------ 161| 2.15k| sizeof(fuzz_data_t) + fuzz_data->content_size + fuzz_data->path_size > size) { ------------------ | Branch (161:9): [True: 16, False: 2.13k] ------------------ 162| 102| goto end; 163| 102| } 164| 2.13k| fuzz_data_content(fuzz_data, &config_ptr); 165| 2.13k| fuzz_data_path(fuzz_data, &path_ptr); 166| 2.13k| const char *config_data = (const char *) config_ptr; 167| 2.13k| const char *path_data = (const char *) path_ptr; 168| | 169| 2.13k| if (CONFIG_TRUE != config_read_string(&cfg, config_data) ------------------ | | 73| 2.13k|#define CONFIG_TRUE (1) ------------------ | Branch (169:9): [True: 405, False: 1.73k] ------------------ 170| 2.13k| || NULL == (root = config_root_setting(&cfg))) ------------------ | | 346| 1.73k| ((C)->root) ------------------ | Branch (170:12): [True: 0, False: 1.73k] ------------------ 171| 405| { 172| | // Parsing failed 173| 405| goto end; 174| 405| } 175| | 176| 1.73k| config_setting_t *setting = find_setting_recursive( 177| 1.73k| root, 178| 1.73k| (const char*) path_ptr, 179| 1.73k| fuzz_data->path_size 180| 1.73k| ); 181| | 182| 1.73k| if (NULL != setting) ------------------ | Branch (182:9): [True: 419, False: 1.31k] ------------------ 183| 419| { 184| 419| config_setting_get_elem(setting, config_setting_length(setting) - 1); 185| | 186| 419| switch (fuzz_data->lookup_type % (CONFIG_TYPE_LIST + 1)) { ------------------ | | 57| 419|#define CONFIG_TYPE_LIST 8 ------------------ 187| 52| case CONFIG_TYPE_FLOAT: ------------------ | | 53| 52|#define CONFIG_TYPE_FLOAT 4 ------------------ | Branch (187:13): [True: 52, False: 367] ------------------ 188| 52| config_setting_lookup_float(setting, path_data, 189| 52| (double*) scratch_mem); 190| 52| break; 191| 50| case CONFIG_TYPE_BOOL: ------------------ | | 55| 50|#define CONFIG_TYPE_BOOL 6 ------------------ | Branch (191:13): [True: 50, False: 369] ------------------ 192| 50| config_setting_lookup_bool(setting, path_data, 193| 50| (int*) scratch_mem); 194| 50| break; 195| 179| case CONFIG_TYPE_INT: ------------------ | | 51| 179|#define CONFIG_TYPE_INT 2 ------------------ | Branch (195:13): [True: 179, False: 240] ------------------ 196| 179| config_setting_lookup_int(setting, path_data, 197| 179| (int*) scratch_mem); 198| 179| break; 199| 53| case CONFIG_TYPE_INT64: ------------------ | | 52| 53|#define CONFIG_TYPE_INT64 3 ------------------ | Branch (199:13): [True: 53, False: 366] ------------------ 200| 53| config_setting_lookup_int64(setting, path_data, 201| 53| (long long *) scratch_mem); 202| 53| break; 203| 53| case CONFIG_TYPE_STRING: { ------------------ | | 54| 53|#define CONFIG_TYPE_STRING 5 ------------------ | Branch (203:13): [True: 53, False: 366] ------------------ 204| 53| const char *string_ptr = NULL; 205| 53| config_setting_lookup_string(setting, path_data, &string_ptr); 206| 53| break; 207| 0| } 208| 32| default: ------------------ | Branch (208:13): [True: 32, False: 387] ------------------ 209| 32| config_setting_lookup_const(setting, path_data); 210| 419| } 211| 419| } 212| | 213| 1.73k| if (NULL != (setting = config_setting_get_member(root, path_data))) ------------------ | Branch (213:9): [True: 396, False: 1.33k] ------------------ 214| 396| { 215| | // This setting exists, let's overwrite it 216| 396| config_setting_set_float(setting, 1.234); 217| 396| } 218| 1.33k| else { 219| | // This setting does not exist, create it 220| 1.33k| setting = config_setting_add(root, path_data, CONFIG_TYPE_FLOAT); ------------------ | | 53| 1.33k|#define CONFIG_TYPE_FLOAT 4 ------------------ 221| | 222| 1.33k| if (setting == NULL) ------------------ | Branch (222:13): [True: 502, False: 836] ------------------ 223| 502| { 224| 502| rc = -1; 225| 502| goto end; 226| 502| } 227| 836| config_setting_set_float(setting, 1.234); 228| 836| } 229| | 230| 1.23k| config_write(&cfg, dev_null); 231| 1.23k| config_setting_remove(root, path_data); 232| | 233| 1.23k| rc = 0; 234| | 235| 2.25k| end: 236| 2.25k| config_destroy(&cfg); 237| 2.25k| return rc; 238| 1.23k|} fuzz_data_content: 4| 2.13k|{ 5| 2.13k| *buff = fuzz_data->data; 6| | 7| | // Ensure the buffer is null terminated 8| 2.13k| (*buff)[fuzz_data->content_size] = '\0'; 9| 2.13k|} fuzz_data_path: 12| 2.13k|{ 13| 2.13k| *buff = fuzz_data->data + fuzz_data->content_size + 1; 14| | 15| | // Ensure the buffer is null terminated 16| 2.13k| (*buff)[fuzz_data->path_size] = '\0'; 17| 2.13k|} libconfig_yyerror: 112| 405|{ 113| 405| if(ctx->config->error_text) return; ------------------ | Branch (113:6): [True: 0, False: 405] ------------------ 114| 405| ctx->config->error_line = libconfig_yyget_lineno(scanner); 115| 405| ctx->config->error_text = s; 116| 405|} libconfig_yyparse: 1065| 2.13k|{ 1066| |/* Lookahead token kind. */ 1067| 2.13k|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.13k|YY_INITIAL_VALUE (static YYSTYPE yyval_default;) ------------------ | | 476| 2.13k|# define YY_INITIAL_VALUE(Value) Value ------------------ 1074| 2.13k|YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); ------------------ | | 476| 2.13k|# define YY_INITIAL_VALUE(Value) Value ------------------ 1075| | 1076| | /* Number of syntax errors so far. */ 1077| 2.13k| int yynerrs = 0; 1078| | 1079| 2.13k| yy_state_fast_t yystate = 0; 1080| | /* Number of tokens to shift before error messages enabled. */ 1081| 2.13k| 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.13k| YYPTRDIFF_T yystacksize = YYINITDEPTH; ------------------ | | 383| 2.13k|# define YYPTRDIFF_T __PTRDIFF_TYPE__ ------------------ YYPTRDIFF_T yystacksize = YYINITDEPTH; ------------------ | | 1004| 2.13k|# define YYINITDEPTH 200 ------------------ 1088| | 1089| | /* The state stack: array, bottom, top. */ 1090| 2.13k| yy_state_t yyssa[YYINITDEPTH]; 1091| 2.13k| yy_state_t *yyss = yyssa; 1092| 2.13k| yy_state_t *yyssp = yyss; 1093| | 1094| | /* The semantic value stack: array, bottom, top. */ 1095| 2.13k| YYSTYPE yyvsa[YYINITDEPTH]; 1096| 2.13k| YYSTYPE *yyvs = yyvsa; 1097| 2.13k| YYSTYPE *yyvsp = yyvs; 1098| | 1099| 2.13k| int yyn; 1100| | /* The return value of yyparse. */ 1101| 2.13k| int yyresult; 1102| | /* Lookahead symbol kind. */ 1103| 2.13k| yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; 1104| | /* The variables used to return semantic value and location from the 1105| | action routines. */ 1106| 2.13k| YYSTYPE yyval; 1107| | 1108| | 1109| | 1110| 2.13k|#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.13k| int yylen = 0; 1115| | 1116| 2.13k| YYDPRINTF ((stderr, "Starting parse\n")); ------------------ | | 995| 2.13k|# define YYDPRINTF(Args) ((void) 0) ------------------ 1117| | 1118| 2.13k| yychar = YYEMPTY; /* Cause a token to be read. */ ------------------ | | 191| 2.13k|#define YYEMPTY -2 ------------------ 1119| | 1120| 2.13k| goto yysetstate; 1121| | 1122| | 1123| |/*------------------------------------------------------------. 1124| || yynewstate -- push a new state, which is found in yystate. | 1125| |`------------------------------------------------------------*/ 1126| 373k|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| 373k| yyssp++; 1130| | 1131| | 1132| |/*--------------------------------------------------------------------. 1133| || yysetstate -- set current state (the top of the stack) to yystate. | 1134| |`--------------------------------------------------------------------*/ 1135| 375k|yysetstate: 1136| 375k| YYDPRINTF ((stderr, "Entering state %d\n", yystate)); ------------------ | | 995| 375k|# define YYDPRINTF(Args) ((void) 0) ------------------ 1137| 375k| YY_ASSERT (0 <= yystate && yystate < YYNSTATES); ------------------ | | 499| 375k|#define YY_ASSERT(E) ((void) (0 && (E))) | | ------------------ | | | Branch (499:31): [Folded, False: 375k] | | | Branch (499:37): [True: 0, False: 0] | | | Branch (499:37): [True: 0, False: 0] | | ------------------ ------------------ 1138| 375k| YY_IGNORE_USELESS_CAST_BEGIN 1139| 375k| *yyssp = YY_CAST (yy_state_t, yystate); ------------------ | | 126| 375k|# define YY_CAST(Type, Val) ((Type) (Val)) ------------------ 1140| 375k| YY_IGNORE_USELESS_CAST_END 1141| 375k| YY_STACK_PRINT (yyss, yyssp); 1142| | 1143| 375k| if (yyss + yystacksize - 1 <= yyssp) ------------------ | Branch (1143:7): [True: 160, False: 375k] ------------------ 1144| |#if !defined yyoverflow && !defined YYSTACK_RELOCATE 1145| | YYNOMEM; 1146| |#else 1147| 160| { 1148| | /* Get the current used size of the three stacks, in elements. */ 1149| 160| YYPTRDIFF_T yysize = yyssp - yyss + 1; ------------------ | | 383| 160|# 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| 160| if (YYMAXDEPTH <= yystacksize) ------------------ | | 1015| 160|# define YYMAXDEPTH 10000 ------------------ | Branch (1172:11): [True: 0, False: 160] ------------------ 1173| 0| YYNOMEM; ------------------ | | 845| 0|#define YYNOMEM goto yyexhaustedlab ------------------ 1174| 160| yystacksize *= 2; 1175| 160| if (YYMAXDEPTH < yystacksize) ------------------ | | 1015| 160|# define YYMAXDEPTH 10000 ------------------ | Branch (1175:11): [True: 3, False: 157] ------------------ 1176| 3| yystacksize = YYMAXDEPTH; ------------------ | | 1015| 3|# define YYMAXDEPTH 10000 ------------------ 1177| | 1178| 160| { 1179| 160| yy_state_t *yyss1 = yyss; 1180| 160| union yyalloc *yyptr = 1181| 160| YY_CAST (union yyalloc *, ------------------ | | 126| 160|# define YY_CAST(Type, Val) ((Type) (Val)) ------------------ 1182| 160| YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); 1183| 160| if (! yyptr) ------------------ | Branch (1183:13): [True: 0, False: 160] ------------------ 1184| 0| YYNOMEM; ------------------ | | 845| 0|#define YYNOMEM goto yyexhaustedlab ------------------ 1185| 160| YYSTACK_RELOCATE (yyss_alloc, yyss); ------------------ | | 596| 160| do \ | | 597| 160| { \ | | 598| 160| YYPTRDIFF_T yynewbytes; \ | | ------------------ | | | | 383| 160|# define YYPTRDIFF_T __PTRDIFF_TYPE__ | | ------------------ | | 599| 160| YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ | | ------------------ | | | | 614| 160| __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) | | | | ------------------ | | | | | | 126| 160|# define YY_CAST(Type, Val) ((Type) (Val)) | | | | ------------------ | | ------------------ | | 600| 160| Stack = &yyptr->Stack_alloc; \ | | 601| 160| yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ | | ------------------ | | | | 416| 160|#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) | | | | ------------------ | | | | | | 126| 160|# define YY_CAST(Type, Val) ((Type) (Val)) | | | | ------------------ | | ------------------ | | yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ | | ------------------ | | | | 580| 160|# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) | | | | ------------------ | | | | | | 416| 160|#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) | | | | | | ------------------ | | | | | | | | 126| 160|# define YY_CAST(Type, Val) ((Type) (Val)) | | | | | | ------------------ | | | | ------------------ | | ------------------ | | 602| 160| yyptr += yynewbytes / YYSIZEOF (*yyptr); \ | | ------------------ | | | | 416| 160|#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) | | | | ------------------ | | | | | | 126| 160|# define YY_CAST(Type, Val) ((Type) (Val)) | | | | ------------------ | | ------------------ | | 603| 160| } \ | | 604| 160| while (0) | | ------------------ | | | Branch (604:12): [Folded, False: 160] | | ------------------ ------------------ 1186| 160| YYSTACK_RELOCATE (yyvs_alloc, yyvs); ------------------ | | 596| 160| do \ | | 597| 160| { \ | | 598| 160| YYPTRDIFF_T yynewbytes; \ | | ------------------ | | | | 383| 160|# define YYPTRDIFF_T __PTRDIFF_TYPE__ | | ------------------ | | 599| 160| YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ | | ------------------ | | | | 614| 160| __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) | | | | ------------------ | | | | | | 126| 160|# define YY_CAST(Type, Val) ((Type) (Val)) | | | | ------------------ | | ------------------ | | 600| 160| Stack = &yyptr->Stack_alloc; \ | | 601| 160| yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ | | ------------------ | | | | 416| 160|#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) | | | | ------------------ | | | | | | 126| 160|# define YY_CAST(Type, Val) ((Type) (Val)) | | | | ------------------ | | ------------------ | | yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ | | ------------------ | | | | 580| 160|# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) | | | | ------------------ | | | | | | 416| 160|#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) | | | | | | ------------------ | | | | | | | | 126| 160|# define YY_CAST(Type, Val) ((Type) (Val)) | | | | | | ------------------ | | | | ------------------ | | ------------------ | | 602| 160| yyptr += yynewbytes / YYSIZEOF (*yyptr); \ | | ------------------ | | | | 416| 160|#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) | | | | ------------------ | | | | | | 126| 160|# define YY_CAST(Type, Val) ((Type) (Val)) | | | | ------------------ | | ------------------ | | 603| 160| } \ | | 604| 160| while (0) | | ------------------ | | | Branch (604:12): [Folded, False: 160] | | ------------------ ------------------ 1187| 160|# undef YYSTACK_RELOCATE 1188| 160| if (yyss1 != yyssa) ------------------ | Branch (1188:13): [True: 101, False: 59] ------------------ 1189| 101| YYSTACK_FREE (yyss1); ------------------ | | 541| 101|# define YYSTACK_FREE YYFREE | | ------------------ | | | | 560| 101|# define YYFREE free | | ------------------ ------------------ 1190| 160| } 1191| 0|# endif 1192| | 1193| 0| yyssp = yyss + yysize - 1; 1194| 160| yyvsp = yyvs + yysize - 1; 1195| | 1196| 160| YY_IGNORE_USELESS_CAST_BEGIN 1197| 160| YYDPRINTF ((stderr, "Stack size increased to %ld\n", ------------------ | | 995| 160|# define YYDPRINTF(Args) ((void) 0) ------------------ 1198| 160| YY_CAST (long, yystacksize))); 1199| 160| YY_IGNORE_USELESS_CAST_END 1200| | 1201| 160| if (yyss + yystacksize - 1 <= yyssp) ------------------ | Branch (1201:11): [True: 0, False: 160] ------------------ 1202| 0| YYABORT; ------------------ | | 843| 0|#define YYABORT goto yyabortlab ------------------ 1203| 160| } 1204| 375k|#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ 1205| | 1206| | 1207| 375k| if (yystate == YYFINAL) ------------------ | | 629| 375k|#define YYFINAL 6 ------------------ | Branch (1207:7): [True: 1.73k, False: 373k] ------------------ 1208| 1.73k| YYACCEPT; ------------------ | | 842| 1.73k|#define YYACCEPT goto yyacceptlab ------------------ 1209| | 1210| 373k| goto yybackup; 1211| | 1212| | 1213| |/*-----------. 1214| || yybackup. | 1215| |`-----------*/ 1216| 373k|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| 373k| yyn = yypact[yystate]; 1222| 373k| if (yypact_value_is_default (yyn)) ------------------ | | 735| 373k| ((Yyn) == YYPACT_NINF) | | ------------------ | | | | 732| 373k|#define YYPACT_NINF (-19) | | ------------------ | | | Branch (735:3): [True: 193k, False: 180k] | | ------------------ ------------------ 1223| 193k| 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| 180k| if (yychar == YYEMPTY) ------------------ | | 191| 180k|#define YYEMPTY -2 ------------------ | Branch (1228:7): [True: 154k, False: 26.0k] ------------------ 1229| 154k| { 1230| 154k| YYDPRINTF ((stderr, "Reading a token\n")); ------------------ | | 995| 154k|# define YYDPRINTF(Args) ((void) 0) ------------------ 1231| 154k| yychar = yylex (&yylval, scanner); ------------------ | | 69| 154k|#define yylex libconfig_yylex ------------------ 1232| 154k| } 1233| | 1234| 180k| if (yychar <= YYEOF) ------------------ | | 192| 180k|#define YYEOF 0 ------------------ | Branch (1234:7): [True: 5.12k, False: 175k] ------------------ 1235| 5.12k| { 1236| 5.12k| yychar = YYEOF; ------------------ | | 192| 5.12k|#define YYEOF 0 ------------------ 1237| 5.12k| yytoken = YYSYMBOL_YYEOF; 1238| 5.12k| YYDPRINTF ((stderr, "Now at end of input.\n")); ------------------ | | 995| 5.12k|# define YYDPRINTF(Args) ((void) 0) ------------------ 1239| 5.12k| } 1240| 175k| else if (yychar == YYerror) ------------------ | | 193| 175k|#define YYerror 256 ------------------ | Branch (1240:12): [True: 0, False: 175k] ------------------ 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| 175k| else 1251| 175k| { 1252| 175k| yytoken = YYTRANSLATE (yychar); ------------------ | | 649| 175k| (0 <= (YYX) && (YYX) <= YYMAXUTOK \ | | ------------------ | | | | 643| 175k|#define YYMAXUTOK 281 | | ------------------ | | | Branch (649:4): [True: 175k, False: 0] | | | Branch (649:18): [True: 175k, False: 0] | | ------------------ | | 650| 175k| ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ | | ------------------ | | | | 126| 175k|# define YY_CAST(Type, Val) ((Type) (Val)) | | ------------------ | | 651| 175k| : YYSYMBOL_YYUNDEF) ------------------ 1253| 175k| YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 1254| 175k| } 1255| | 1256| | /* If the proper action on seeing token YYTOKEN is to reduce or to 1257| | detect an error, take that action. */ 1258| 180k| yyn += yytoken; 1259| 180k| if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) ------------------ | | 631| 179k|#define YYLAST 50 ------------------ | Branch (1259:7): [True: 1.39k, False: 179k] | Branch (1259:18): [True: 1.60k, False: 177k] | Branch (1259:34): [True: 23.4k, False: 154k] ------------------ 1260| 26.4k| goto yydefault; 1261| 154k| yyn = yytable[yyn]; 1262| 154k| if (yyn <= 0) ------------------ | Branch (1262:7): [True: 0, False: 154k] ------------------ 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| 154k| if (yyerrstatus) ------------------ | Branch (1272:7): [True: 0, False: 154k] ------------------ 1273| 0| yyerrstatus--; 1274| | 1275| | /* Shift the lookahead token. */ 1276| 154k| YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 1277| 154k| yystate = yyn; 1278| 154k| YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1279| 154k| *++yyvsp = yylval; 1280| 154k| YY_IGNORE_MAYBE_UNINITIALIZED_END 1281| | 1282| | /* Discard the shifted token. */ 1283| 154k| yychar = YYEMPTY; ------------------ | | 191| 154k|#define YYEMPTY -2 ------------------ 1284| 154k| goto yynewstate; 1285| | 1286| | 1287| |/*-----------------------------------------------------------. 1288| || yydefault -- do the default action for the current state. | 1289| |`-----------------------------------------------------------*/ 1290| 219k|yydefault: 1291| 219k| yyn = yydefact[yystate]; 1292| 219k| if (yyn == 0) ------------------ | Branch (1292:7): [True: 358, False: 219k] ------------------ 1293| 358| goto yyerrlab; 1294| 219k| goto yyreduce; 1295| | 1296| | 1297| |/*-----------------------------. 1298| || yyreduce -- do a reduction. | 1299| |`-----------------------------*/ 1300| 219k|yyreduce: 1301| | /* yyn is the number of a rule to reduce with. */ 1302| 219k| 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| 219k| yyval = yyvsp[1-yylen]; 1313| | 1314| | 1315| 219k| YY_REDUCE_PRINT (yyn); 1316| 219k| switch (yyn) 1317| 219k| { 1318| 13.7k| case 11: /* $@1: %empty */ ------------------ | Branch (1318:3): [True: 13.7k, False: 205k] ------------------ 1319| 13.7k|#line 122 "grammar.y" 1320| 13.7k| { 1321| 13.7k| ctx->setting = config_setting_add(ctx->parent, (yyvsp[0].sval), CONFIG_TYPE_NONE); ------------------ | | 49| 13.7k|#define CONFIG_TYPE_NONE 0 ------------------ 1322| | 1323| 13.7k| if(ctx->setting == NULL) ------------------ | Branch (1323:8): [True: 19, False: 13.7k] ------------------ 1324| 19| { 1325| 19| libconfig_yyerror(scanner, ctx, scan_ctx, err_duplicate_setting); 1326| 19| YYABORT; ------------------ | | 843| 19|#define YYABORT goto yyabortlab ------------------ 1327| 19| } 1328| 13.7k| else 1329| 13.7k| { 1330| 13.7k| CAPTURE_PARSE_POS(ctx->setting); ------------------ | | 108| 13.7k| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1331| 13.7k| } 1332| 13.7k| } 1333| 13.7k|#line 1334 "grammar.c" 1334| 13.7k| break; 1335| | 1336| 13.7k| case 13: /* $@2: %empty */ ------------------ | Branch (1336:3): [True: 1.71k, False: 217k] ------------------ 1337| 1.71k|#line 141 "grammar.y" 1338| 1.71k| { 1339| 1.71k| if(IN_LIST()) ------------------ | | 98| 1.71k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 1.71k|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 1.71k, False: 0] | | | Branch (98:19): [True: 1.37k, False: 342] | | ------------------ ------------------ 1340| 1.37k| { 1341| 1.37k| ctx->parent = config_setting_add(ctx->parent, NULL, CONFIG_TYPE_ARRAY); ------------------ | | 56| 1.37k|#define CONFIG_TYPE_ARRAY 7 ------------------ 1342| 1.37k| CAPTURE_PARSE_POS(ctx->parent); ------------------ | | 108| 1.37k| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1343| 1.37k| } 1344| 342| else 1345| 342| { 1346| 342| ctx->setting->type = CONFIG_TYPE_ARRAY; ------------------ | | 56| 342|#define CONFIG_TYPE_ARRAY 7 ------------------ 1347| 342| ctx->parent = ctx->setting; 1348| 342| ctx->setting = NULL; 1349| 342| } 1350| 1.71k| } 1351| 1.71k|#line 1352 "grammar.c" 1352| 1.71k| break; 1353| | 1354| 1.64k| case 14: /* array: TOK_ARRAY_START $@2 simple_value_list_optional TOK_ARRAY_END */ ------------------ | Branch (1354:3): [True: 1.64k, False: 217k] ------------------ 1355| 1.64k|#line 156 "grammar.y" 1356| 1.64k| { 1357| 1.64k| if(ctx->parent) ------------------ | Branch (1357:8): [True: 1.64k, False: 0] ------------------ 1358| 1.64k| ctx->parent = ctx->parent->parent; 1359| 1.64k| } 1360| 1.64k|#line 1361 "grammar.c" 1361| 1.64k| break; 1362| | 1363| 46.0k| case 15: /* $@3: %empty */ ------------------ | Branch (1363:3): [True: 46.0k, False: 173k] ------------------ 1364| 46.0k|#line 164 "grammar.y" 1365| 46.0k| { 1366| 46.0k| if(IN_LIST()) ------------------ | | 98| 46.0k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 46.0k|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 46.0k, False: 0] | | | Branch (98:19): [True: 45.2k, False: 807] | | ------------------ ------------------ 1367| 45.2k| { 1368| 45.2k| ctx->parent = config_setting_add(ctx->parent, NULL, CONFIG_TYPE_LIST); ------------------ | | 57| 45.2k|#define CONFIG_TYPE_LIST 8 ------------------ 1369| 45.2k| CAPTURE_PARSE_POS(ctx->parent); ------------------ | | 108| 45.2k| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1370| 45.2k| } 1371| 807| else 1372| 807| { 1373| 807| ctx->setting->type = CONFIG_TYPE_LIST; ------------------ | | 57| 807|#define CONFIG_TYPE_LIST 8 ------------------ 1374| 807| ctx->parent = ctx->setting; 1375| 807| ctx->setting = NULL; 1376| 807| } 1377| 46.0k| } 1378| 46.0k|#line 1379 "grammar.c" 1379| 46.0k| break; 1380| | 1381| 1.80k| case 16: /* list: TOK_LIST_START $@3 value_list_optional TOK_LIST_END */ ------------------ | Branch (1381:3): [True: 1.80k, False: 217k] ------------------ 1382| 1.80k|#line 179 "grammar.y" 1383| 1.80k| { 1384| 1.80k| if(ctx->parent) ------------------ | Branch (1384:8): [True: 1.80k, False: 0] ------------------ 1385| 1.80k| ctx->parent = ctx->parent->parent; 1386| 1.80k| } 1387| 1.80k|#line 1388 "grammar.c" 1388| 1.80k| break; 1389| | 1390| 2.01k| case 21: /* string: TOK_STRING */ ------------------ | Branch (1390:3): [True: 2.01k, False: 217k] ------------------ 1391| 2.01k|#line 193 "grammar.y" 1392| 2.01k| { libconfig_parsectx_append_string(ctx, (yyvsp[0].sval)); free((yyvsp[0].sval)); } ------------------ | | 45| 2.01k| libconfig_strbuf_append_string(&((C)->string), (S)) ------------------ 1393| 2.01k|#line 1394 "grammar.c" 1394| 2.01k| break; 1395| | 1396| 1.01k| case 22: /* string: string TOK_STRING */ ------------------ | Branch (1396:3): [True: 1.01k, False: 218k] ------------------ 1397| 1.01k|#line 194 "grammar.y" 1398| 1.01k| { libconfig_parsectx_append_string(ctx, (yyvsp[0].sval)); free((yyvsp[0].sval)); } ------------------ | | 45| 1.01k| libconfig_strbuf_append_string(&((C)->string), (S)) ------------------ 1399| 1.01k|#line 1400 "grammar.c" 1400| 1.01k| break; 1401| | 1402| 1.52k| case 23: /* simple_value: TOK_BOOLEAN */ ------------------ | Branch (1402:3): [True: 1.52k, False: 217k] ------------------ 1403| 1.52k|#line 199 "grammar.y" 1404| 1.52k| { 1405| 1.52k| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 3.05k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 1.52k|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 1.52k, False: 0] | | | Branch (95:19): [True: 412, False: 1.11k] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 1.11k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 1.11k|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 1.11k, False: 0] | | | Branch (98:19): [True: 704, False: 409] | | ------------------ ------------------ 1406| 1.11k| { 1407| 1.11k| config_setting_t *e = config_setting_set_bool_elem(ctx->parent, -1, 1408| 1.11k| (int)(yyvsp[0].ival)); 1409| | 1410| 1.11k| if(! e) ------------------ | Branch (1410:10): [True: 3, False: 1.11k] ------------------ 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| 1.11k| else 1416| 1.11k| { 1417| 1.11k| CAPTURE_PARSE_POS(e); ------------------ | | 108| 1.11k| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1418| 1.11k| } 1419| 1.11k| } 1420| 409| else 1421| 409| config_setting_set_bool(ctx->setting, (int)(yyvsp[0].ival)); 1422| 1.52k| } 1423| 1.52k|#line 1424 "grammar.c" 1424| 1.52k| break; 1425| | 1426| 6.88k| case 24: /* simple_value: TOK_INTEGER */ ------------------ | Branch (1426:3): [True: 6.88k, False: 212k] ------------------ 1427| 6.88k|#line 219 "grammar.y" 1428| 6.88k| { 1429| 6.88k| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 13.7k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 6.88k|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 6.88k, False: 0] | | | Branch (95:19): [True: 879, False: 6.00k] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 6.00k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 6.00k|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 6.00k, False: 0] | | | Branch (98:19): [True: 2.67k, False: 3.33k] | | ------------------ ------------------ 1430| 3.55k| { 1431| 3.55k| config_setting_t *e = config_setting_set_int_elem(ctx->parent, -1, (yyvsp[0].ival)); 1432| 3.55k| if(! e) ------------------ | Branch (1432:10): [True: 7, False: 3.54k] ------------------ 1433| 7| { 1434| 7| libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type); 1435| 7| YYABORT; ------------------ | | 843| 7|#define YYABORT goto yyabortlab ------------------ 1436| 7| } 1437| 3.54k| else 1438| 3.54k| { 1439| 3.54k| config_setting_set_format(e, CONFIG_FORMAT_DEFAULT); ------------------ | | 59| 3.54k|#define CONFIG_FORMAT_DEFAULT 0 ------------------ 1440| 3.54k| CAPTURE_PARSE_POS(e); ------------------ | | 108| 3.54k| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1441| 3.54k| } 1442| 3.55k| } 1443| 3.33k| else 1444| 3.33k| { 1445| 3.33k| config_setting_set_int(ctx->setting, (yyvsp[0].ival)); 1446| 3.33k| config_setting_set_format(ctx->setting, CONFIG_FORMAT_DEFAULT); ------------------ | | 59| 3.33k|#define CONFIG_FORMAT_DEFAULT 0 ------------------ 1447| 3.33k| } 1448| 6.88k| } 1449| 6.87k|#line 1450 "grammar.c" 1450| 6.87k| break; 1451| | 1452| 6.87k| case 25: /* simple_value: TOK_INTEGER64 */ ------------------ | Branch (1452:3): [True: 2.21k, False: 217k] ------------------ 1453| 2.21k|#line 241 "grammar.y" 1454| 2.21k| { 1455| 2.21k| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 4.42k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 2.21k|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 2.21k, False: 0] | | | Branch (95:19): [True: 865, False: 1.34k] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 1.34k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 1.34k|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 1.34k, False: 0] | | | Branch (98:19): [True: 712, False: 636] | | ------------------ ------------------ 1456| 1.57k| { 1457| 1.57k| config_setting_t *e = config_setting_set_int64_elem(ctx->parent, -1, (yyvsp[0].llval)); 1458| 1.57k| if(! e) ------------------ | Branch (1458:10): [True: 3, False: 1.57k] ------------------ 1459| 3| { 1460| 3| libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type); 1461| 3| YYABORT; ------------------ | | 843| 3|#define YYABORT goto yyabortlab ------------------ 1462| 3| } 1463| 1.57k| else 1464| 1.57k| { 1465| 1.57k| config_setting_set_format(e, CONFIG_FORMAT_DEFAULT); ------------------ | | 59| 1.57k|#define CONFIG_FORMAT_DEFAULT 0 ------------------ 1466| 1.57k| CAPTURE_PARSE_POS(e); ------------------ | | 108| 1.57k| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1467| 1.57k| } 1468| 1.57k| } 1469| 636| else 1470| 636| { 1471| 636| config_setting_set_int64(ctx->setting, (yyvsp[0].llval)); 1472| 636| config_setting_set_format(ctx->setting, CONFIG_FORMAT_DEFAULT); ------------------ | | 59| 636|#define CONFIG_FORMAT_DEFAULT 0 ------------------ 1473| 636| } 1474| 2.21k| } 1475| 2.21k|#line 1476 "grammar.c" 1476| 2.21k| break; 1477| | 1478| 2.21k| case 26: /* simple_value: TOK_HEX */ ------------------ | Branch (1478:3): [True: 1.75k, False: 217k] ------------------ 1479| 1.75k|#line 263 "grammar.y" 1480| 1.75k| { 1481| 1.75k| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 3.50k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 1.75k|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 1.75k, False: 0] | | | Branch (95:19): [True: 388, False: 1.36k] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 1.36k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 1.36k|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 1.36k, False: 0] | | | Branch (98:19): [True: 596, False: 769] | | ------------------ ------------------ 1482| 984| { 1483| 984| config_setting_t *e = config_setting_set_int_elem(ctx->parent, -1, (yyvsp[0].ival)); 1484| 984| if(! e) ------------------ | Branch (1484:10): [True: 2, False: 982] ------------------ 1485| 2| { 1486| 2| libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type); 1487| 2| YYABORT; ------------------ | | 843| 2|#define YYABORT goto yyabortlab ------------------ 1488| 2| } 1489| 982| else 1490| 982| { 1491| 982| config_setting_set_format(e, CONFIG_FORMAT_HEX); ------------------ | | 60| 982|#define CONFIG_FORMAT_HEX 1 ------------------ 1492| 982| CAPTURE_PARSE_POS(e); ------------------ | | 108| 982| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1493| 982| } 1494| 984| } 1495| 769| else 1496| 769| { 1497| 769| config_setting_set_int(ctx->setting, (yyvsp[0].ival)); 1498| 769| config_setting_set_format(ctx->setting, CONFIG_FORMAT_HEX); ------------------ | | 60| 769|#define CONFIG_FORMAT_HEX 1 ------------------ 1499| 769| } 1500| 1.75k| } 1501| 1.75k|#line 1502 "grammar.c" 1502| 1.75k| break; 1503| | 1504| 1.75k| case 27: /* simple_value: TOK_HEX64 */ ------------------ | Branch (1504:3): [True: 1.10k, False: 218k] ------------------ 1505| 1.10k|#line 285 "grammar.y" 1506| 1.10k| { 1507| 1.10k| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 2.20k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 1.10k|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 1.10k, False: 0] | | | Branch (95:19): [True: 360, False: 740] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 740| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 740|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 740, False: 0] | | | Branch (98:19): [True: 427, False: 313] | | ------------------ ------------------ 1508| 787| { 1509| 787| config_setting_t *e = config_setting_set_int64_elem(ctx->parent, -1, (yyvsp[0].llval)); 1510| 787| if(! e) ------------------ | Branch (1510:10): [True: 2, False: 785] ------------------ 1511| 2| { 1512| 2| libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type); 1513| 2| YYABORT; ------------------ | | 843| 2|#define YYABORT goto yyabortlab ------------------ 1514| 2| } 1515| 785| else 1516| 785| { 1517| 785| config_setting_set_format(e, CONFIG_FORMAT_HEX); ------------------ | | 60| 785|#define CONFIG_FORMAT_HEX 1 ------------------ 1518| 785| CAPTURE_PARSE_POS(e); ------------------ | | 108| 785| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1519| 785| } 1520| 787| } 1521| 313| else 1522| 313| { 1523| 313| config_setting_set_int64(ctx->setting, (yyvsp[0].llval)); 1524| 313| config_setting_set_format(ctx->setting, CONFIG_FORMAT_HEX); ------------------ | | 60| 313|#define CONFIG_FORMAT_HEX 1 ------------------ 1525| 313| } 1526| 1.10k| } 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: 218k] ------------------ 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: 702, False: 506] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 506| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 506|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 506, False: 0] | | | Branch (98:19): [True: 267, False: 239] | | ------------------ ------------------ 1534| 969| { 1535| 969| config_setting_t *e = config_setting_set_int_elem(ctx->parent, -1, (yyvsp[0].ival)); 1536| 969| if(! e) ------------------ | Branch (1536:10): [True: 1, False: 968] ------------------ 1537| 1| { 1538| 1| libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type); 1539| 1| YYABORT; ------------------ | | 843| 1|#define YYABORT goto yyabortlab ------------------ 1540| 1| } 1541| 968| else 1542| 968| { 1543| 968| config_setting_set_format(e, CONFIG_FORMAT_BIN); ------------------ | | 61| 968|#define CONFIG_FORMAT_BIN 2 ------------------ 1544| 968| CAPTURE_PARSE_POS(e); ------------------ | | 108| 968| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1545| 968| } 1546| 969| } 1547| 239| else 1548| 239| { 1549| 239| config_setting_set_int(ctx->setting, (yyvsp[0].ival)); 1550| 239| config_setting_set_format(ctx->setting, CONFIG_FORMAT_BIN); ------------------ | | 61| 239|#define CONFIG_FORMAT_BIN 2 ------------------ 1551| 239| } 1552| 1.20k| } 1553| 1.20k|#line 1554 "grammar.c" 1554| 1.20k| break; 1555| | 1556| 1.20k| case 29: /* simple_value: TOK_BIN64 */ ------------------ | Branch (1556:3): [True: 1.09k, False: 218k] ------------------ 1557| 1.09k|#line 329 "grammar.y" 1558| 1.09k| { 1559| 1.09k| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 2.19k| (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: 362, False: 733] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 733| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 733|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 733, False: 0] | | | Branch (98:19): [True: 413, False: 320] | | ------------------ ------------------ 1560| 775| { 1561| 775| config_setting_t *e = config_setting_set_int64_elem(ctx->parent, -1, (yyvsp[0].llval)); 1562| 775| if(! e) ------------------ | Branch (1562:10): [True: 2, False: 773] ------------------ 1563| 2| { 1564| 2| libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type); 1565| 2| YYABORT; ------------------ | | 843| 2|#define YYABORT goto yyabortlab ------------------ 1566| 2| } 1567| 773| else 1568| 773| { 1569| 773| config_setting_set_format(e, CONFIG_FORMAT_BIN); ------------------ | | 61| 773|#define CONFIG_FORMAT_BIN 2 ------------------ 1570| 773| CAPTURE_PARSE_POS(e); ------------------ | | 108| 773| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1571| 773| } 1572| 775| } 1573| 320| else 1574| 320| { 1575| 320| config_setting_set_int64(ctx->setting, (yyvsp[0].llval)); 1576| 320| config_setting_set_format(ctx->setting, CONFIG_FORMAT_BIN); ------------------ | | 61| 320|#define CONFIG_FORMAT_BIN 2 ------------------ 1577| 320| } 1578| 1.09k| } 1579| 1.09k|#line 1580 "grammar.c" 1580| 1.09k| break; 1581| | 1582| 1.09k| case 30: /* simple_value: TOK_OCT */ ------------------ | Branch (1582:3): [True: 854, False: 218k] ------------------ 1583| 854|#line 351 "grammar.y" 1584| 854| { 1585| 854| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 1.70k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 854|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 854, False: 0] | | | Branch (95:19): [True: 367, False: 487] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 487| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 487|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 487, False: 0] | | | Branch (98:19): [True: 271, False: 216] | | ------------------ ------------------ 1586| 638| { 1587| 638| config_setting_t *e = config_setting_set_int_elem(ctx->parent, -1, (yyvsp[0].ival)); 1588| 638| if(! e) ------------------ | Branch (1588:10): [True: 3, False: 635] ------------------ 1589| 3| { 1590| 3| libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type); 1591| 3| YYABORT; ------------------ | | 843| 3|#define YYABORT goto yyabortlab ------------------ 1592| 3| } 1593| 635| else 1594| 635| { 1595| 635| config_setting_set_format(e, CONFIG_FORMAT_OCT); ------------------ | | 62| 635|#define CONFIG_FORMAT_OCT 3 ------------------ 1596| 635| CAPTURE_PARSE_POS(e); ------------------ | | 108| 635| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1597| 635| } 1598| 638| } 1599| 216| else 1600| 216| { 1601| 216| config_setting_set_int(ctx->setting, (yyvsp[0].ival)); 1602| 216| config_setting_set_format(ctx->setting, CONFIG_FORMAT_OCT); ------------------ | | 62| 216|#define CONFIG_FORMAT_OCT 3 ------------------ 1603| 216| } 1604| 854| } 1605| 851|#line 1606 "grammar.c" 1606| 851| break; 1607| | 1608| 851| case 31: /* simple_value: TOK_OCT64 */ ------------------ | Branch (1608:3): [True: 548, False: 218k] ------------------ 1609| 548|#line 373 "grammar.y" 1610| 548| { 1611| 548| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 1.09k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 548|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 548, False: 0] | | | Branch (95:19): [True: 212, False: 336] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 336| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 336|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 336, False: 0] | | | Branch (98:19): [True: 239, False: 97] | | ------------------ ------------------ 1612| 451| { 1613| 451| config_setting_t *e = config_setting_set_int64_elem(ctx->parent, -1, (yyvsp[0].llval)); 1614| 451| if(! e) ------------------ | Branch (1614:10): [True: 1, False: 450] ------------------ 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| 450| else 1620| 450| { 1621| 450| config_setting_set_format(e, CONFIG_FORMAT_OCT); ------------------ | | 62| 450|#define CONFIG_FORMAT_OCT 3 ------------------ 1622| 450| CAPTURE_PARSE_POS(e); ------------------ | | 108| 450| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1623| 450| } 1624| 451| } 1625| 97| else 1626| 97| { 1627| 97| config_setting_set_int64(ctx->setting, (yyvsp[0].llval)); 1628| 97| config_setting_set_format(ctx->setting, CONFIG_FORMAT_OCT); ------------------ | | 62| 97|#define CONFIG_FORMAT_OCT 3 ------------------ 1629| 97| } 1630| 548| } 1631| 547|#line 1632 "grammar.c" 1632| 547| break; 1633| | 1634| 14.3k| case 32: /* simple_value: TOK_FLOAT */ ------------------ | Branch (1634:3): [True: 14.3k, False: 205k] ------------------ 1635| 14.3k|#line 395 "grammar.y" 1636| 14.3k| { 1637| 14.3k| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 28.6k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 14.3k|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 14.3k, False: 0] | | | Branch (95:19): [True: 4.84k, False: 9.48k] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 9.48k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 9.48k|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 9.48k, False: 0] | | | Branch (98:19): [True: 7.88k, False: 1.60k] | | ------------------ ------------------ 1638| 12.7k| { 1639| 12.7k| config_setting_t *e = config_setting_set_float_elem(ctx->parent, -1, (yyvsp[0].fval)); 1640| 12.7k| if(! e) ------------------ | Branch (1640:10): [True: 3, False: 12.7k] ------------------ 1641| 3| { 1642| 3| libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type); 1643| 3| YYABORT; ------------------ | | 843| 3|#define YYABORT goto yyabortlab ------------------ 1644| 3| } 1645| 12.7k| else 1646| 12.7k| { 1647| 12.7k| CAPTURE_PARSE_POS(e); ------------------ | | 108| 12.7k| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1648| 12.7k| } 1649| 12.7k| } 1650| 1.60k| else 1651| 1.60k| config_setting_set_float(ctx->setting, (yyvsp[0].fval)); 1652| 14.3k| } 1653| 14.3k|#line 1654 "grammar.c" 1654| 14.3k| break; 1655| | 1656| 14.3k| case 33: /* simple_value: string */ ------------------ | Branch (1656:3): [True: 2.01k, False: 217k] ------------------ 1657| 2.01k|#line 413 "grammar.y" 1658| 2.01k| { 1659| 2.01k| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 4.03k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 2.01k|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 2.01k, False: 0] | | | Branch (95:19): [True: 809, False: 1.20k] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 1.20k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 1.20k|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 1.20k, False: 0] | | | Branch (98:19): [True: 584, False: 625] | | ------------------ ------------------ 1660| 1.39k| { 1661| 1.39k| const char *s = libconfig_parsectx_take_string(ctx); ------------------ | | 47| 1.39k| libconfig_strbuf_release(&((C)->string)) ------------------ 1662| 1.39k| config_setting_t *e = config_setting_set_string_elem(ctx->parent, -1, s); 1663| 1.39k| __delete(s); ------------------ | | 38| 1.39k|#define __delete(P) free((void *)(P)) ------------------ 1664| | 1665| 1.39k| if(! e) ------------------ | Branch (1665:10): [True: 1, False: 1.39k] ------------------ 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| 1.39k| else 1671| 1.39k| { 1672| 1.39k| CAPTURE_PARSE_POS(e); ------------------ | | 108| 1.39k| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1673| 1.39k| } 1674| 1.39k| } 1675| 625| else 1676| 625| { 1677| 625| const char *s = libconfig_parsectx_take_string(ctx); ------------------ | | 47| 625| libconfig_strbuf_release(&((C)->string)) ------------------ 1678| 625| config_setting_set_string(ctx->setting, s); 1679| 625| __delete(s); ------------------ | | 38| 625|#define __delete(P) free((void *)(P)) ------------------ 1680| 625| } 1681| 2.01k| } 1682| 2.01k|#line 1683 "grammar.c" 1683| 2.01k| break; 1684| | 1685| 4.88k| case 44: /* $@4: %empty */ ------------------ | Branch (1685:3): [True: 4.88k, False: 214k] ------------------ 1686| 4.88k|#line 463 "grammar.y" 1687| 4.88k| { 1688| 4.88k| if(IN_LIST()) ------------------ | | 98| 4.88k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 4.88k|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 4.88k, False: 0] | | | Branch (98:19): [True: 883, False: 4.00k] | | ------------------ ------------------ 1689| 883| { 1690| 883| ctx->parent = config_setting_add(ctx->parent, NULL, CONFIG_TYPE_GROUP); ------------------ | | 50| 883|#define CONFIG_TYPE_GROUP 1 ------------------ 1691| 883| CAPTURE_PARSE_POS(ctx->parent); ------------------ | | 108| 883| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1692| 883| } 1693| 4.00k| else 1694| 4.00k| { 1695| 4.00k| ctx->setting->type = CONFIG_TYPE_GROUP; ------------------ | | 50| 4.00k|#define CONFIG_TYPE_GROUP 1 ------------------ 1696| 4.00k| ctx->parent = ctx->setting; 1697| 4.00k| ctx->setting = NULL; 1698| 4.00k| } 1699| 4.88k| } 1700| 4.88k|#line 1701 "grammar.c" 1701| 4.88k| break; 1702| | 1703| 3.85k| case 45: /* group: TOK_GROUP_START $@4 setting_list_optional TOK_GROUP_END */ ------------------ | Branch (1703:3): [True: 3.85k, False: 215k] ------------------ 1704| 3.85k|#line 478 "grammar.y" 1705| 3.85k| { 1706| 3.85k| if(ctx->parent) ------------------ | Branch (1706:8): [True: 3.85k, False: 0] ------------------ 1707| 3.85k| ctx->parent = ctx->parent->parent; 1708| 3.85k| } 1709| 3.85k|#line 1710 "grammar.c" 1710| 3.85k| break; 1711| | 1712| | 1713| 0|#line 1714 "grammar.c" 1714| | 1715| 109k| default: break; ------------------ | Branch (1715:7): [True: 109k, False: 110k] ------------------ 1716| 219k| } 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| 219k| YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); 1729| | 1730| 219k| YYPOPSTACK (yylen); ------------------ | | 1110| 219k|#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) ------------------ 1731| 219k| yylen = 0; 1732| | 1733| 219k| *++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| 219k| { 1739| 219k| const int yylhs = yyr1[yyn] - YYNTOKENS; ------------------ | | 634| 219k|#define YYNTOKENS 27 ------------------ 1740| 219k| const int yyi = yypgoto[yylhs] + *yyssp; 1741| 219k| yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp ------------------ | | 631| 392k|#define YYLAST 50 ------------------ | Branch (1741:16): [True: 172k, False: 46.6k] | Branch (1741:28): [True: 172k, False: 0] | Branch (1741:45): [True: 45.4k, False: 127k] ------------------ 1742| 219k| ? yytable[yyi] 1743| 219k| : yydefgoto[yylhs]); 1744| 219k| } 1745| | 1746| 219k| goto yynewstate; 1747| | 1748| | 1749| |/*--------------------------------------. 1750| || yyerrlab -- here on detecting error. | 1751| |`--------------------------------------*/ 1752| 358|yyerrlab: 1753| | /* Make sure we have latest lookahead translation. See comments at 1754| | user semantic actions for why this is necessary. */ 1755| 358| yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); ------------------ | | 191| 358|#define YYEMPTY -2 ------------------ yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); ------------------ | | 649| 716| (0 <= (YYX) && (YYX) <= YYMAXUTOK \ | | ------------------ | | | | 643| 358|#define YYMAXUTOK 281 | | ------------------ | | | Branch (649:4): [True: 358, False: 0] | | | Branch (649:18): [True: 358, False: 0] | | ------------------ | | 650| 716| ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ | | ------------------ | | | | 126| 358|# define YY_CAST(Type, Val) ((Type) (Val)) | | ------------------ | | 651| 716| : YYSYMBOL_YYUNDEF) ------------------ | Branch (1755:13): [True: 0, False: 358] ------------------ 1756| | /* If not already recovering from an error, report this error. */ 1757| 358| if (!yyerrstatus) ------------------ | Branch (1757:7): [True: 358, False: 0] ------------------ 1758| 358| { 1759| 358| ++yynerrs; ------------------ | | 72| 358|#define yynerrs libconfig_yynerrs ------------------ 1760| 358| yyerror (scanner, ctx, scan_ctx, YY_("syntax error")); ------------------ | | 70| 358|#define yyerror libconfig_yyerror ------------------ yyerror (scanner, ctx, scan_ctx, YY_("syntax error")); ------------------ | | 433| 358|# define YY_(Msgid) Msgid ------------------ 1761| 358| } 1762| | 1763| 358| if (yyerrstatus == 3) ------------------ | Branch (1763:7): [True: 0, False: 358] ------------------ 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| 358| goto yyerrlab1; 1785| | 1786| | 1787| |/*---------------------------------------------------. 1788| || yyerrorlab -- error raised explicitly by YYERROR. | 1789| |`---------------------------------------------------*/ 1790| 358|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| 358|yyerrlab1: 1810| 358| yyerrstatus = 3; /* Each real token shifted decrements this. */ 1811| | 1812| | /* Pop stack until we find a state that shifts the error token. */ 1813| 358| for (;;) 1814| 93.6k| { 1815| 93.6k| yyn = yypact[yystate]; 1816| 93.6k| if (!yypact_value_is_default (yyn)) ------------------ | | 735| 93.6k| ((Yyn) == YYPACT_NINF) | | ------------------ | | | | 732| 93.6k|#define YYPACT_NINF (-19) | | ------------------ ------------------ | Branch (1816:11): [True: 47.6k, False: 45.9k] ------------------ 1817| 47.6k| { 1818| 47.6k| yyn += YYSYMBOL_YYerror; 1819| 47.6k| if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) ------------------ | | 631| 50.2k|#define YYLAST 50 ------------------ | Branch (1819:15): [True: 2.53k, False: 45.1k] | Branch (1819:27): [True: 2.53k, False: 0] | Branch (1819:44): [True: 0, False: 2.53k] ------------------ 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| 47.6k| } 1826| | 1827| | /* Pop the current state because it cannot handle the error token. */ 1828| 93.6k| if (yyssp == yyss) ------------------ | Branch (1828:11): [True: 358, False: 93.2k] ------------------ 1829| 358| YYABORT; ------------------ | | 843| 358|#define YYABORT goto yyabortlab ------------------ 1830| | 1831| | 1832| 93.2k| yydestruct ("Error: popping", 1833| 93.2k| YY_ACCESSING_SYMBOL (yystate), yyvsp, scanner, ctx, scan_ctx); ------------------ | | 701| 93.2k|#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) | | ------------------ | | | | 126| 93.2k|# define YY_CAST(Type, Val) ((Type) (Val)) | | ------------------ ------------------ 1834| 93.2k| YYPOPSTACK (1); ------------------ | | 1110| 93.2k|#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) ------------------ 1835| 93.2k| yystate = *yyssp; 1836| 93.2k| YY_STACK_PRINT (yyss, yyssp); 1837| 93.2k| } 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.73k|yyacceptlab: 1855| 1.73k| yyresult = 0; 1856| 1.73k| goto yyreturnlab; 1857| | 1858| | 1859| |/*-----------------------------------. 1860| || yyabortlab -- YYABORT comes here. | 1861| |`-----------------------------------*/ 1862| 405|yyabortlab: 1863| 405| yyresult = 1; 1864| 405| 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.13k|yyreturnlab: 1880| 2.13k| if (yychar != YYEMPTY) ------------------ | | 191| 2.13k|#define YYEMPTY -2 ------------------ | Branch (1880:7): [True: 359, False: 1.78k] ------------------ 1881| 359| { 1882| | /* Make sure we have latest lookahead translation. See comments at 1883| | user semantic actions for why this is necessary. */ 1884| 359| yytoken = YYTRANSLATE (yychar); ------------------ | | 649| 359| (0 <= (YYX) && (YYX) <= YYMAXUTOK \ | | ------------------ | | | | 643| 359|#define YYMAXUTOK 281 | | ------------------ | | | Branch (649:4): [True: 359, False: 0] | | | Branch (649:18): [True: 359, False: 0] | | ------------------ | | 650| 359| ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ | | ------------------ | | | | 126| 359|# define YY_CAST(Type, Val) ((Type) (Val)) | | ------------------ | | 651| 359| : YYSYMBOL_YYUNDEF) ------------------ 1885| 359| yydestruct ("Cleanup: discarding lookahead", 1886| 359| yytoken, &yylval, scanner, ctx, scan_ctx); 1887| 359| } 1888| | /* Do not reclaim the symbols of the rule whose action triggered 1889| | this YYABORT or YYACCEPT. */ 1890| 2.13k| YYPOPSTACK (yylen); ------------------ | | 1110| 2.13k|#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) ------------------ 1891| 2.13k| YY_STACK_PRINT (yyss, yyssp); 1892| 7.39k| while (yyssp != yyss) ------------------ | Branch (1892:10): [True: 5.25k, False: 2.13k] ------------------ 1893| 5.25k| { 1894| 5.25k| yydestruct ("Cleanup: popping", 1895| 5.25k| YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, scanner, ctx, scan_ctx); ------------------ | | 701| 5.25k|#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) | | ------------------ | | | | 126| 5.25k|# define YY_CAST(Type, Val) ((Type) (Val)) | | ------------------ ------------------ 1896| 5.25k| YYPOPSTACK (1); ------------------ | | 1110| 5.25k|#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) ------------------ 1897| 5.25k| } 1898| 2.13k|#ifndef yyoverflow 1899| 2.13k| if (yyss != yyssa) ------------------ | Branch (1899:7): [True: 59, False: 2.08k] ------------------ 1900| 59| YYSTACK_FREE (yyss); ------------------ | | 541| 59|# define YYSTACK_FREE YYFREE | | ------------------ | | | | 560| 59|# define YYFREE free | | ------------------ ------------------ 1901| 2.13k|#endif 1902| | 1903| 2.13k| return yyresult; 1904| 358|} grammar.c:capture_parse_pos: 102| 86.1k|{ 103| 86.1k| setting->line = (unsigned int)libconfig_yyget_lineno(scanner); 104| 86.1k| setting->file = libconfig_scanctx_current_filename(scan_ctx); 105| 86.1k|} grammar.c:yydestruct: 1030| 98.8k|{ 1031| 98.8k| YY_USE (yyvaluep); ------------------ | | 456| 98.8k|# define YY_USE(E) ((void) (E)) ------------------ 1032| 98.8k| YY_USE (scanner); ------------------ | | 456| 98.8k|# define YY_USE(E) ((void) (E)) ------------------ 1033| 98.8k| YY_USE (ctx); ------------------ | | 456| 98.8k|# define YY_USE(E) ((void) (E)) ------------------ 1034| 98.8k| YY_USE (scan_ctx); ------------------ | | 456| 98.8k|# define YY_USE(E) ((void) (E)) ------------------ 1035| 98.8k| if (!yymsg) ------------------ | Branch (1035:7): [True: 0, False: 98.8k] ------------------ 1036| 0| yymsg = "Deleting"; 1037| 98.8k| YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); 1038| | 1039| 98.8k| YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1040| 98.8k| switch (yykind) 1041| 98.8k| { 1042| 7| case YYSYMBOL_TOK_STRING: /* TOK_STRING */ ------------------ | Branch (1042:5): [True: 7, False: 98.8k] ------------------ 1043| 7|#line 95 "grammar.y" 1044| 7| { free(((*yyvaluep).sval)); } 1045| 7|#line 1046 "grammar.c" 1046| 7| break; 1047| | 1048| 98.8k| default: ------------------ | Branch (1048:7): [True: 98.8k, False: 7] ------------------ 1049| 98.8k| break; 1050| 98.8k| } 1051| 98.8k| YY_IGNORE_MAYBE_UNINITIALIZED_END 1052| 98.8k|} config_read_string: 619| 2.13k|{ 620| 2.13k| config_assert(config != NULL); 621| 2.13k| config_assert(str != NULL); 622| | 623| 2.13k| return(__config_read(config, NULL, NULL, str)); 624| 2.13k|} config_write: 665| 1.23k|{ 666| 1.23k| config_assert(config != NULL); 667| 1.23k| config_assert(stream != NULL); 668| | 669| 1.23k| __config_locale_override(); 670| | 671| 1.23k| __config_write_setting(config, config->root, stream, 0); 672| | 673| 1.23k| __config_locale_restore(); 674| 1.23k|} config_destroy: 760| 2.25k|{ 761| 2.25k| if(config == NULL) ------------------ | Branch (761:6): [True: 0, False: 2.25k] ------------------ 762| 0| return; 763| | 764| 2.25k| __config_setting_destroy(config->root); 765| 2.25k| libconfig_strvec_delete(config->filenames); 766| 2.25k| __delete(config->include_dir); ------------------ | | 38| 2.25k|#define __delete(P) free((void *)(P)) ------------------ 767| 2.25k| __zero(config); ------------------ | | 39| 2.25k|#define __zero(P) memset((void *)(P), 0, sizeof(*P)) ------------------ 768| 2.25k|} config_clear: 773| 4.38k|{ 774| 4.38k| config_assert(config != NULL); 775| | 776| | /* Destroy the root setting (recursively) and then create a new one. */ 777| 4.38k| __config_setting_destroy(config->root); 778| | 779| 4.38k| libconfig_strvec_delete(config->filenames); 780| 4.38k| config->filenames = NULL; 781| | 782| 4.38k| config->root = __new(config_setting_t); ------------------ | | 37| 4.38k|#define __new(T) (T *)libconfig_calloc(1, sizeof(T)) /* zeroed */ ------------------ 783| 4.38k| config->root->type = CONFIG_TYPE_GROUP; ------------------ | | 50| 4.38k|#define CONFIG_TYPE_GROUP 1 ------------------ 784| 4.38k| config->root->config = config; 785| 4.38k|} config_init: 827| 2.24k|{ 828| 2.24k| config_assert(config != NULL); 829| | 830| 2.24k| __zero(config); ------------------ | | 39| 2.24k|#define __zero(P) memset((void *)(P), 0, sizeof(*P)) ------------------ 831| 2.24k| config_clear(config); 832| | 833| | /* Set default options. */ 834| 2.24k| config->options = (CONFIG_OPTION_SEMICOLON_SEPARATORS ------------------ | | 65| 2.24k|#define CONFIG_OPTION_SEMICOLON_SEPARATORS 0x02 ------------------ 835| 2.24k| | CONFIG_OPTION_COLON_ASSIGNMENT_FOR_GROUPS ------------------ | | 66| 2.24k|#define CONFIG_OPTION_COLON_ASSIGNMENT_FOR_GROUPS 0x04 ------------------ 836| 2.24k| | CONFIG_OPTION_OPEN_BRACE_ON_SEPARATE_LINE); ------------------ | | 68| 2.24k|#define CONFIG_OPTION_OPEN_BRACE_ON_SEPARATE_LINE 0x10 ------------------ 837| 2.24k| config->tab_width = DEFAULT_TAB_WIDTH; ------------------ | | 52| 2.24k|#define DEFAULT_TAB_WIDTH 2 ------------------ 838| 2.24k| config->float_precision = DEFAULT_FLOAT_PRECISION; ------------------ | | 53| 2.24k|#define DEFAULT_FLOAT_PRECISION 6 ------------------ 839| 2.24k| config->include_fn = config_default_include_func; 840| 2.24k|} config_get_option: 875| 47.5k|{ 876| 47.5k| config_assert(config != NULL); 877| | 878| 47.5k| return((config->options & option) == option); 879| 47.5k|} config_setting_lookup_int: 1039| 179|{ 1040| 179| config_setting_t *member; 1041| | 1042| 179| config_assert(setting != NULL); 1043| 179| config_assert(value != NULL); 1044| | 1045| 179| member = config_setting_get_member(setting, name); 1046| 179| if(! member) ------------------ | Branch (1046:6): [True: 40, False: 139] ------------------ 1047| 40| return(CONFIG_FALSE); ------------------ | | 74| 40|#define CONFIG_FALSE (0) ------------------ 1048| | 1049| 139| return(__config_setting_get_int(member, value)); 1050| 179|} config_setting_lookup_int64: 1056| 53|{ 1057| 53| config_setting_t *member; 1058| | 1059| 53| config_assert(setting != NULL); 1060| 53| config_assert(name != NULL); 1061| 53| config_assert(value != NULL); 1062| | 1063| 53| member = config_setting_get_member(setting, name); 1064| 53| if(! member) ------------------ | Branch (1064:6): [True: 44, False: 9] ------------------ 1065| 44| return(CONFIG_FALSE); ------------------ | | 74| 44|#define CONFIG_FALSE (0) ------------------ 1066| | 1067| 9| return(__config_setting_get_int64(member, value)); 1068| 53|} config_setting_lookup_float: 1128| 52|{ 1129| 52| config_setting_t *member; 1130| | 1131| 52| config_assert(setting != NULL); 1132| 52| config_assert(name != NULL); 1133| 52| config_assert(value != NULL); 1134| | 1135| 52| member = config_setting_get_member(setting, name); 1136| 52| if(! member) ------------------ | Branch (1136:6): [True: 42, False: 10] ------------------ 1137| 42| return(CONFIG_FALSE); ------------------ | | 74| 42|#define CONFIG_FALSE (0) ------------------ 1138| | 1139| 10| return(__config_setting_get_float(member, value)); 1140| 52|} config_setting_lookup_string: 1146| 53|{ 1147| 53| config_setting_t *member; 1148| | 1149| 53| config_assert(setting != NULL); 1150| 53| config_assert(name != NULL); 1151| 53| config_assert(value != NULL); 1152| | 1153| 53| member = config_setting_get_member(setting, name); 1154| 53| if(! member) ------------------ | Branch (1154:6): [True: 47, False: 6] ------------------ 1155| 47| return(CONFIG_FALSE); ------------------ | | 74| 47|#define CONFIG_FALSE (0) ------------------ 1156| | 1157| 6| if(config_setting_type(member) != CONFIG_TYPE_STRING) ------------------ | | 274| 6| ((S)->type) ------------------ if(config_setting_type(member) != CONFIG_TYPE_STRING) ------------------ | | 54| 6|#define CONFIG_TYPE_STRING 5 ------------------ | Branch (1157:6): [True: 5, False: 1] ------------------ 1158| 5| return(CONFIG_FALSE); ------------------ | | 74| 5|#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| 6|} 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.6k|{ 1190| 10.6k| config_assert(setting != NULL); 1191| | 1192| 10.6k| switch(setting->type) 1193| 10.6k| { 1194| 4.55k| case CONFIG_TYPE_NONE: ------------------ | | 49| 4.55k|#define CONFIG_TYPE_NONE 0 ------------------ | Branch (1194:5): [True: 4.55k, False: 6.13k] ------------------ 1195| 4.55k| setting->type = CONFIG_TYPE_INT; ------------------ | | 51| 4.55k|#define CONFIG_TYPE_INT 2 ------------------ 1196| | /* fall through */ 1197| | 1198| 10.6k| case CONFIG_TYPE_INT: ------------------ | | 51| 10.6k|#define CONFIG_TYPE_INT 2 ------------------ | Branch (1198:5): [True: 6.13k, False: 4.55k] ------------------ 1199| 10.6k| setting->value.ival = value; 1200| 10.6k| return(CONFIG_TRUE); ------------------ | | 73| 10.6k|#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.6k] ------------------ 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.6k] ------------------ 1212| 0| return(CONFIG_FALSE); ------------------ | | 74| 0|#define CONFIG_FALSE (0) ------------------ 1213| 10.6k| } 1214| 10.6k|} config_setting_set_int64: 1219| 4.94k|{ 1220| 4.94k| config_assert(setting != NULL); 1221| | 1222| 4.94k| switch(setting->type) 1223| 4.94k| { 1224| 1.36k| case CONFIG_TYPE_NONE: ------------------ | | 49| 1.36k|#define CONFIG_TYPE_NONE 0 ------------------ | Branch (1224:5): [True: 1.36k, False: 3.58k] ------------------ 1225| 1.36k| setting->type = CONFIG_TYPE_INT64; ------------------ | | 52| 1.36k|#define CONFIG_TYPE_INT64 3 ------------------ 1226| | /* fall through */ 1227| | 1228| 4.94k| case CONFIG_TYPE_INT64: ------------------ | | 52| 4.94k|#define CONFIG_TYPE_INT64 3 ------------------ | Branch (1228:5): [True: 3.58k, False: 1.36k] ------------------ 1229| 4.94k| setting->value.llval = value; 1230| 4.94k| return(CONFIG_TRUE); ------------------ | | 73| 4.94k|#define CONFIG_TRUE (1) ------------------ 1231| | 1232| 0| case CONFIG_TYPE_INT: ------------------ | | 51| 0|#define CONFIG_TYPE_INT 2 ------------------ | Branch (1232:5): [True: 0, False: 4.94k] ------------------ 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: 4.94k] ------------------ 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: 4.94k] ------------------ 1251| 0| return(CONFIG_FALSE); ------------------ | | 74| 0|#define CONFIG_FALSE (0) ------------------ 1252| 4.94k| } 1253| 4.94k|} config_setting_set_float: 1258| 15.5k|{ 1259| 15.5k| config_assert(setting != NULL); 1260| | 1261| 15.5k| switch(setting->type) 1262| 15.5k| { 1263| 1.60k| case CONFIG_TYPE_NONE: ------------------ | | 49| 1.60k|#define CONFIG_TYPE_NONE 0 ------------------ | Branch (1263:5): [True: 1.60k, False: 13.9k] ------------------ 1264| 1.60k| setting->type = CONFIG_TYPE_FLOAT; ------------------ | | 53| 1.60k|#define CONFIG_TYPE_FLOAT 4 ------------------ 1265| | /* fall through */ 1266| | 1267| 15.1k| case CONFIG_TYPE_FLOAT: ------------------ | | 53| 15.1k|#define CONFIG_TYPE_FLOAT 4 ------------------ | Branch (1267:5): [True: 13.5k, False: 1.99k] ------------------ 1268| 15.1k| setting->value.fval = value; 1269| 15.1k| return(CONFIG_TRUE); ------------------ | | 73| 15.1k|#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.5k] ------------------ 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| 7| case CONFIG_TYPE_INT64: ------------------ | | 52| 7|#define CONFIG_TYPE_INT64 3 ------------------ | Branch (1280:5): [True: 7, False: 15.5k] ------------------ 1281| 7| if(config_get_option(setting->config, CONFIG_OPTION_AUTOCONVERT)) ------------------ | | 64| 7|#define CONFIG_OPTION_AUTOCONVERT 0x01 ------------------ | Branch (1281:10): [True: 0, False: 7] ------------------ 1282| 0| { 1283| 0| setting->value.llval = (long long)value; 1284| 0| return(CONFIG_TRUE); ------------------ | | 73| 0|#define CONFIG_TRUE (1) ------------------ 1285| 0| } 1286| 7| else 1287| 7| return(CONFIG_FALSE); ------------------ | | 74| 7|#define CONFIG_FALSE (0) ------------------ 1288| | 1289| 377| default: ------------------ | Branch (1289:5): [True: 377, False: 15.1k] ------------------ 1290| 377| return(CONFIG_FALSE); ------------------ | | 74| 377|#define CONFIG_FALSE (0) ------------------ 1291| 15.5k| } 1292| 15.5k|} 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.52k|{ 1324| 1.52k| config_assert(setting != NULL); 1325| | 1326| 1.52k| if(setting->type == CONFIG_TYPE_NONE) ------------------ | | 49| 1.52k|#define CONFIG_TYPE_NONE 0 ------------------ | Branch (1326:6): [True: 409, False: 1.11k] ------------------ 1327| 409| setting->type = CONFIG_TYPE_BOOL; ------------------ | | 55| 409|#define CONFIG_TYPE_BOOL 6 ------------------ 1328| 1.11k| else if(setting->type != CONFIG_TYPE_BOOL) ------------------ | | 55| 1.11k|#define CONFIG_TYPE_BOOL 6 ------------------ | Branch (1328:11): [True: 0, False: 1.11k] ------------------ 1329| 0| return(CONFIG_FALSE); ------------------ | | 74| 0|#define CONFIG_FALSE (0) ------------------ 1330| | 1331| 1.52k| setting->value.ival = value; 1332| 1.52k| return(CONFIG_TRUE); ------------------ | | 73| 1.52k|#define CONFIG_TRUE (1) ------------------ 1333| 1.52k|} 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.01k|{ 1365| 2.01k| config_assert(setting != NULL); 1366| 2.01k| config_assert(value != NULL); 1367| | 1368| 2.01k| if(setting->type == CONFIG_TYPE_NONE) ------------------ | | 49| 2.01k|#define CONFIG_TYPE_NONE 0 ------------------ | Branch (1368:6): [True: 625, False: 1.39k] ------------------ 1369| 625| setting->type = CONFIG_TYPE_STRING; ------------------ | | 54| 625|#define CONFIG_TYPE_STRING 5 ------------------ 1370| 1.39k| else if(setting->type != CONFIG_TYPE_STRING) ------------------ | | 54| 1.39k|#define CONFIG_TYPE_STRING 5 ------------------ | Branch (1370:11): [True: 0, False: 1.39k] ------------------ 1371| 0| return(CONFIG_FALSE); ------------------ | | 74| 0|#define CONFIG_FALSE (0) ------------------ 1372| | 1373| 2.01k| if(setting->value.sval) ------------------ | Branch (1373:6): [True: 0, False: 2.01k] ------------------ 1374| 0| __delete(setting->value.sval); ------------------ | | 38| 0|#define __delete(P) free((void *)(P)) ------------------ 1375| | 1376| 2.01k| setting->value.sval = (value == NULL) ? NULL : strdup(value); ------------------ | Branch (1376:25): [True: 0, False: 2.01k] ------------------ 1377| | 1378| 2.01k| return(CONFIG_TRUE); ------------------ | | 73| 2.01k|#define CONFIG_TRUE (1) ------------------ 1379| 2.01k|} config_setting_set_format: 1384| 15.6k|{ 1385| 15.6k| config_assert(setting != NULL); 1386| | 1387| 15.6k| if(((setting->type != CONFIG_TYPE_INT) ------------------ | | 51| 15.6k|#define CONFIG_TYPE_INT 2 ------------------ | Branch (1387:7): [True: 4.94k, False: 10.6k] ------------------ 1388| 4.94k| && (setting->type != CONFIG_TYPE_INT64)) ------------------ | | 52| 4.94k|#define CONFIG_TYPE_INT64 3 ------------------ | Branch (1388:10): [True: 0, False: 4.94k] ------------------ 1389| 15.6k| || ((format != CONFIG_FORMAT_DEFAULT) ------------------ | | 59| 15.6k|#define CONFIG_FORMAT_DEFAULT 0 ------------------ | Branch (1389:10): [True: 6.54k, False: 9.08k] ------------------ 1390| 6.54k| && (format != CONFIG_FORMAT_HEX) ------------------ | | 60| 6.54k|#define CONFIG_FORMAT_HEX 1 ------------------ | Branch (1390:13): [True: 3.69k, False: 2.84k] ------------------ 1391| 3.69k| && (format != CONFIG_FORMAT_BIN))) ------------------ | | 61| 3.69k|#define CONFIG_FORMAT_BIN 2 ------------------ | Branch (1391:13): [True: 1.39k, False: 2.30k] ------------------ 1392| 1.39k| return(CONFIG_FALSE); ------------------ | | 74| 1.39k|#define CONFIG_FALSE (0) ------------------ 1393| | 1394| 14.2k| setting->format = format; 1395| | 1396| 14.2k| return(CONFIG_TRUE); ------------------ | | 73| 14.2k|#define CONFIG_TRUE (1) ------------------ 1397| 15.6k|} config_setting_get_format: 1402| 32.2k|{ 1403| 32.2k| config_assert(setting != NULL); 1404| | 1405| 32.2k| return(setting->format != 0 ? setting->format ------------------ | Branch (1405:10): [True: 3.14k, False: 29.0k] ------------------ 1406| 32.2k| : setting->config->default_format); 1407| 32.2k|} config_setting_lookup_const: 1413| 1.26k|{ 1414| 1.26k| const char *p = path; 1415| 1.26k| const config_setting_t *found = setting; 1416| | 1417| 1.26k| config_assert(setting != NULL); 1418| 1.26k| config_assert(path != NULL); 1419| | 1420| 2.50k| while(*p && found) ------------------ | Branch (1420:9): [True: 1.26k, False: 1.24k] | Branch (1420:15): [True: 1.26k, False: 0] ------------------ 1421| 1.26k| { 1422| 1.26k| if(strchr(PATH_TOKENS, *p)) ------------------ | | 50| 1.26k|#define PATH_TOKENS ":./" ------------------ | Branch (1422:8): [True: 0, False: 1.26k] ------------------ 1423| 0| ++p; 1424| | 1425| 1.26k| if(*p == '[') ------------------ | Branch (1425:8): [True: 0, False: 1.26k] ------------------ 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.26k| else if(found->type == CONFIG_TYPE_GROUP) ------------------ | | 50| 1.26k|#define CONFIG_TYPE_GROUP 1 ------------------ | Branch (1435:13): [True: 1.24k, False: 19] ------------------ 1436| 1.24k| { 1437| 1.24k| const char *q = p; 1438| | 1439| 7.78k| while(*q && !strchr(PATH_TOKENS, *q)) ------------------ | | 50| 6.53k|#define PATH_TOKENS ":./" ------------------ | Branch (1439:13): [True: 6.53k, False: 1.24k] | Branch (1439:19): [True: 6.53k, False: 0] ------------------ 1440| 6.53k| ++q; 1441| | 1442| 1.24k| found = __config_list_search(found->value.list, p, (size_t)(q - p), 1443| 1.24k| NULL); 1444| 1.24k| p = q; 1445| 1.24k| } 1446| 19| else 1447| 19| break; 1448| 1.26k| } 1449| | 1450| 1.26k| return((*p || (found == setting)) ? NULL : found); ------------------ | Branch (1450:11): [True: 19, False: 1.24k] | Branch (1450:17): [True: 0, False: 1.24k] ------------------ 1451| 1.26k|} config_setting_lookup: 1457| 1.23k|{ 1458| 1.23k| config_assert(setting != NULL); 1459| 1.23k| config_assert(path != NULL); 1460| | 1461| 1.23k| return((config_setting_t *)config_setting_lookup_const(setting, path)); 1462| 1.23k|} config_setting_set_int_elem: 1601| 6.14k|{ 1602| 6.14k| config_setting_t *element = NULL; 1603| | 1604| 6.14k| config_assert(setting != NULL); 1605| | 1606| 6.14k| if((setting->type != CONFIG_TYPE_ARRAY) ------------------ | | 56| 6.14k|#define CONFIG_TYPE_ARRAY 7 ------------------ | Branch (1606:6): [True: 3.80k, False: 2.33k] ------------------ 1607| 3.80k| && (setting->type != CONFIG_TYPE_LIST)) ------------------ | | 57| 3.80k|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (1607:9): [True: 0, False: 3.80k] ------------------ 1608| 0| return(NULL); 1609| | 1610| 6.14k| if(idx < 0) ------------------ | Branch (1610:6): [True: 6.14k, False: 0] ------------------ 1611| 6.14k| { 1612| 6.14k| if(! __config_list_checktype(setting, CONFIG_TYPE_INT)) ------------------ | | 51| 6.14k|#define CONFIG_TYPE_INT 2 ------------------ | Branch (1612:8): [True: 13, False: 6.13k] ------------------ 1613| 13| return(NULL); 1614| | 1615| 6.13k| element = __config_setting_create(setting, NULL, CONFIG_TYPE_INT); ------------------ | | 51| 6.13k|#define CONFIG_TYPE_INT 2 ------------------ 1616| 6.13k| } 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| 6.13k| if(! config_setting_set_int(element, value)) ------------------ | Branch (1625:6): [True: 0, False: 6.13k] ------------------ 1626| 0| return(NULL); 1627| | 1628| 6.13k| return(element); 1629| 6.13k|} config_setting_set_int64_elem: 1649| 3.59k|{ 1650| 3.59k| config_setting_t *element = NULL; 1651| | 1652| 3.59k| config_assert(setting != NULL); 1653| | 1654| 3.59k| if((setting->type != CONFIG_TYPE_ARRAY) ------------------ | | 56| 3.59k|#define CONFIG_TYPE_ARRAY 7 ------------------ | Branch (1654:6): [True: 1.79k, False: 1.79k] ------------------ 1655| 1.79k| && (setting->type != CONFIG_TYPE_LIST)) ------------------ | | 57| 1.79k|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (1655:9): [True: 0, False: 1.79k] ------------------ 1656| 0| return(NULL); 1657| | 1658| 3.59k| if(idx < 0) ------------------ | Branch (1658:6): [True: 3.59k, False: 0] ------------------ 1659| 3.59k| { 1660| 3.59k| if(! __config_list_checktype(setting, CONFIG_TYPE_INT64)) ------------------ | | 52| 3.59k|#define CONFIG_TYPE_INT64 3 ------------------ | Branch (1660:8): [True: 8, False: 3.58k] ------------------ 1661| 8| return(NULL); 1662| | 1663| 3.58k| element = __config_setting_create(setting, NULL, CONFIG_TYPE_INT64); ------------------ | | 52| 3.58k|#define CONFIG_TYPE_INT64 3 ------------------ 1664| 3.58k| } 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.58k| if(! config_setting_set_int64(element, value)) ------------------ | Branch (1673:6): [True: 0, False: 3.58k] ------------------ 1674| 0| return(NULL); 1675| | 1676| 3.58k| return(element); 1677| 3.58k|} config_setting_set_float_elem: 1696| 12.7k|{ 1697| 12.7k| config_setting_t *element = NULL; 1698| | 1699| 12.7k| config_assert(setting != NULL); 1700| | 1701| 12.7k| if((setting->type != CONFIG_TYPE_ARRAY) ------------------ | | 56| 12.7k|#define CONFIG_TYPE_ARRAY 7 ------------------ | Branch (1701:6): [True: 7.88k, False: 4.84k] ------------------ 1702| 7.88k| && (setting->type != CONFIG_TYPE_LIST)) ------------------ | | 57| 7.88k|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (1702:9): [True: 0, False: 7.88k] ------------------ 1703| 0| return(NULL); 1704| | 1705| 12.7k| if(idx < 0) ------------------ | Branch (1705:6): [True: 12.7k, False: 0] ------------------ 1706| 12.7k| { 1707| 12.7k| if(! __config_list_checktype(setting, CONFIG_TYPE_FLOAT)) ------------------ | | 53| 12.7k|#define CONFIG_TYPE_FLOAT 4 ------------------ | Branch (1707:8): [True: 3, False: 12.7k] ------------------ 1708| 3| return(NULL); 1709| | 1710| 12.7k| element = __config_setting_create(setting, NULL, CONFIG_TYPE_FLOAT); ------------------ | | 53| 12.7k|#define CONFIG_TYPE_FLOAT 4 ------------------ 1711| 12.7k| } 1712| 0| else 1713| 0| element = config_setting_get_elem(setting, idx); 1714| | 1715| 12.7k| if(! element) ------------------ | Branch (1715:6): [True: 0, False: 12.7k] ------------------ 1716| 0| return(NULL); 1717| | 1718| 12.7k| if(! config_setting_set_float(element, value)) ------------------ | Branch (1718:6): [True: 0, False: 12.7k] ------------------ 1719| 0| return(NULL); 1720| | 1721| 12.7k| return(element); 1722| 12.7k|} config_setting_set_bool_elem: 1747| 1.11k|{ 1748| 1.11k| config_setting_t *element = NULL; 1749| | 1750| 1.11k| config_assert(setting != NULL); 1751| | 1752| 1.11k| if((setting->type != CONFIG_TYPE_ARRAY) ------------------ | | 56| 1.11k|#define CONFIG_TYPE_ARRAY 7 ------------------ | Branch (1752:6): [True: 704, False: 412] ------------------ 1753| 704| && (setting->type != CONFIG_TYPE_LIST)) ------------------ | | 57| 704|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (1753:9): [True: 0, False: 704] ------------------ 1754| 0| return(NULL); 1755| | 1756| 1.11k| if(idx < 0) ------------------ | Branch (1756:6): [True: 1.11k, False: 0] ------------------ 1757| 1.11k| { 1758| 1.11k| if(! __config_list_checktype(setting, CONFIG_TYPE_BOOL)) ------------------ | | 55| 1.11k|#define CONFIG_TYPE_BOOL 6 ------------------ | Branch (1758:8): [True: 3, False: 1.11k] ------------------ 1759| 3| return(NULL); 1760| | 1761| 1.11k| element = __config_setting_create(setting, NULL, CONFIG_TYPE_BOOL); ------------------ | | 55| 1.11k|#define CONFIG_TYPE_BOOL 6 ------------------ 1762| 1.11k| } 1763| 0| else 1764| 0| element = config_setting_get_elem(setting, idx); 1765| | 1766| 1.11k| if(! element) ------------------ | Branch (1766:6): [True: 0, False: 1.11k] ------------------ 1767| 0| return(NULL); 1768| | 1769| 1.11k| if(! config_setting_set_bool(element, value)) ------------------ | Branch (1769:6): [True: 0, False: 1.11k] ------------------ 1770| 0| return(NULL); 1771| | 1772| 1.11k| return(element); 1773| 1.11k|} config_setting_set_string_elem: 1798| 1.39k|{ 1799| 1.39k| config_setting_t *element = NULL; 1800| | 1801| 1.39k| config_assert(setting != NULL); 1802| 1.39k| config_assert(value != NULL); 1803| | 1804| 1.39k| if((setting->type != CONFIG_TYPE_ARRAY) ------------------ | | 56| 1.39k|#define CONFIG_TYPE_ARRAY 7 ------------------ | Branch (1804:6): [True: 584, False: 809] ------------------ 1805| 584| && (setting->type != CONFIG_TYPE_LIST)) ------------------ | | 57| 584|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (1805:9): [True: 0, False: 584] ------------------ 1806| 0| return(NULL); 1807| | 1808| 1.39k| if(idx < 0) ------------------ | Branch (1808:6): [True: 1.39k, False: 0] ------------------ 1809| 1.39k| { 1810| 1.39k| if(! __config_list_checktype(setting, CONFIG_TYPE_STRING)) ------------------ | | 54| 1.39k|#define CONFIG_TYPE_STRING 5 ------------------ | Branch (1810:8): [True: 1, False: 1.39k] ------------------ 1811| 1| return(NULL); 1812| | 1813| 1.39k| element = __config_setting_create(setting, NULL, CONFIG_TYPE_STRING); ------------------ | | 54| 1.39k|#define CONFIG_TYPE_STRING 5 ------------------ 1814| 1.39k| } 1815| 0| else 1816| 0| element = config_setting_get_elem(setting, idx); 1817| | 1818| 1.39k| if(! element) ------------------ | Branch (1818:6): [True: 0, False: 1.39k] ------------------ 1819| 0| return(NULL); 1820| | 1821| 1.39k| if(! config_setting_set_string(element, value)) ------------------ | Branch (1821:6): [True: 0, False: 1.39k] ------------------ 1822| 0| return(NULL); 1823| | 1824| 1.39k| return(element); 1825| 1.39k|} config_setting_get_elem: 1831| 33.4k|{ 1832| 33.4k| config_list_t *list; 1833| | 1834| 33.4k| config_assert(setting != NULL); 1835| | 1836| 33.4k| if(! config_setting_is_aggregate(setting)) ------------------ | Branch (1836:6): [True: 40, False: 33.4k] ------------------ 1837| 40| return(NULL); 1838| | 1839| 33.4k| list = setting->value.list; 1840| 33.4k| if(! list) ------------------ | Branch (1840:6): [True: 20, False: 33.4k] ------------------ 1841| 20| return(NULL); 1842| | 1843| 33.4k| if(idx >= list->length) ------------------ | Branch (1843:6): [True: 0, False: 33.4k] ------------------ 1844| 0| return(NULL); 1845| | 1846| 33.4k| return(list->elements[idx]); 1847| 33.4k|} config_setting_get_member: 1853| 64.2k|{ 1854| 64.2k| config_assert(setting != NULL); 1855| | 1856| 64.2k| if(setting->type != CONFIG_TYPE_GROUP) ------------------ | | 50| 64.2k|#define CONFIG_TYPE_GROUP 1 ------------------ | Branch (1856:6): [True: 47.5k, False: 16.7k] ------------------ 1857| 47.5k| return(NULL); 1858| | 1859| 16.7k| if(!name) ------------------ | Branch (1859:6): [True: 0, False: 16.7k] ------------------ 1860| 0| return(NULL); 1861| | 1862| 16.7k| return(__config_list_search(setting->value.list, name, strlen(name), NULL)); 1863| 16.7k|} config_setting_length: 1896| 7.61k|{ 1897| 7.61k| config_assert(setting != NULL); 1898| | 1899| 7.61k| if(! config_setting_is_aggregate(setting)) ------------------ | Branch (1899:6): [True: 40, False: 7.57k] ------------------ 1900| 40| return(0); 1901| | 1902| 7.57k| if(! setting->value.list) ------------------ | Branch (1902:6): [True: 1.86k, False: 5.71k] ------------------ 1903| 1.86k| return(0); 1904| | 1905| 5.71k| return(setting->value.list->length); 1906| 7.57k|} config_setting_add: 1921| 62.6k|{ 1922| 62.6k| if((type < CONFIG_TYPE_NONE) || (type > CONFIG_TYPE_LIST)) ------------------ | | 49| 62.6k|#define CONFIG_TYPE_NONE 0 ------------------ if((type < CONFIG_TYPE_NONE) || (type > CONFIG_TYPE_LIST)) ------------------ | | 57| 62.6k|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (1922:6): [True: 0, False: 62.6k] | Branch (1922:35): [True: 0, False: 62.6k] ------------------ 1923| 0| return(NULL); 1924| | 1925| 62.6k| if(! parent) ------------------ | Branch (1925:6): [True: 0, False: 62.6k] ------------------ 1926| 0| return(NULL); 1927| | 1928| 62.6k| if((parent->type == CONFIG_TYPE_ARRAY) && !__config_type_is_scalar(type)) ------------------ | | 56| 62.6k|#define CONFIG_TYPE_ARRAY 7 ------------------ | Branch (1928:6): [True: 0, False: 62.6k] | Branch (1928:45): [True: 0, False: 0] ------------------ 1929| 0| return(NULL); /* only scalars can be added to arrays */ 1930| | 1931| 62.6k| if((parent->type == CONFIG_TYPE_ARRAY) || (parent->type == CONFIG_TYPE_LIST)) ------------------ | | 56| 62.6k|#define CONFIG_TYPE_ARRAY 7 ------------------ if((parent->type == CONFIG_TYPE_ARRAY) || (parent->type == CONFIG_TYPE_LIST)) ------------------ | | 57| 62.6k|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (1931:6): [True: 0, False: 62.6k] | Branch (1931:45): [True: 47.4k, False: 15.1k] ------------------ 1932| 47.4k| name = NULL; 1933| | 1934| 62.6k| if(name) ------------------ | Branch (1934:6): [True: 15.1k, False: 47.4k] ------------------ 1935| 15.1k| { 1936| 15.1k| if(! __config_validate_name(name)) ------------------ | Branch (1936:8): [True: 502, False: 14.6k] ------------------ 1937| 502| return(NULL); 1938| 15.1k| } 1939| | 1940| 62.1k| if(config_setting_get_member(parent, name) != NULL) ------------------ | Branch (1940:6): [True: 19, False: 62.0k] ------------------ 1941| 19| { 1942| 19| if(config_get_option(parent->config, CONFIG_OPTION_ALLOW_OVERRIDES)) ------------------ | | 71| 19|#define CONFIG_OPTION_ALLOW_OVERRIDES 0x80 ------------------ | Branch (1942:8): [True: 0, False: 19] ------------------ 1943| 0| config_setting_remove(parent, name); 1944| 19| else 1945| 19| return(NULL); /* already exists */ 1946| 19| } 1947| | 1948| 62.0k| return(__config_setting_create(parent, name, type)); 1949| 62.1k|} config_setting_remove: 1954| 1.23k|{ 1955| 1.23k| unsigned int idx; 1956| 1.23k| config_setting_t *setting; 1957| 1.23k| const char *settingName; 1958| 1.23k| const char *lastFound; 1959| | 1960| 1.23k| if(! parent || !name) ------------------ | Branch (1960:6): [True: 0, False: 1.23k] | Branch (1960:18): [True: 0, False: 1.23k] ------------------ 1961| 0| return(CONFIG_FALSE); ------------------ | | 74| 0|#define CONFIG_FALSE (0) ------------------ 1962| | 1963| 1.23k| if(parent->type != CONFIG_TYPE_GROUP) ------------------ | | 50| 1.23k|#define CONFIG_TYPE_GROUP 1 ------------------ | Branch (1963:6): [True: 0, False: 1.23k] ------------------ 1964| 0| return(CONFIG_FALSE); ------------------ | | 74| 0|#define CONFIG_FALSE (0) ------------------ 1965| | 1966| 1.23k| setting = config_setting_lookup(parent, name); 1967| 1.23k| if(! setting) ------------------ | Branch (1967:6): [True: 0, False: 1.23k] ------------------ 1968| 0| return(CONFIG_FALSE); ------------------ | | 74| 0|#define CONFIG_FALSE (0) ------------------ 1969| | 1970| 1.23k| settingName = name; 1971| 1.23k| do 1972| 1.23k| { 1973| 1.23k| lastFound = settingName; 1974| 7.71k| while(settingName && !strchr(PATH_TOKENS, *settingName)) ------------------ | | 50| 7.71k|#define PATH_TOKENS ":./" ------------------ | Branch (1974:11): [True: 7.71k, False: 0] | Branch (1974:26): [True: 6.48k, False: 1.23k] ------------------ 1975| 6.48k| ++settingName; 1976| | 1977| 1.23k| if(*settingName == '\0') ------------------ | Branch (1977:8): [True: 1.23k, False: 0] ------------------ 1978| 1.23k| { 1979| 1.23k| settingName = lastFound; 1980| 1.23k| break; 1981| 1.23k| } 1982| | 1983| 1.23k| } 1984| 1.23k| while(*++settingName); ------------------ | Branch (1984:9): [True: 0, False: 0] ------------------ 1985| | 1986| 1.23k| if(!(setting = __config_list_search(setting->parent->value.list, settingName, ------------------ | Branch (1986:6): [True: 0, False: 1.23k] ------------------ 1987| 1.23k| strlen(settingName), &idx))) 1988| 0| return(CONFIG_FALSE); ------------------ | | 74| 0|#define CONFIG_FALSE (0) ------------------ 1989| | 1990| 1.23k| __config_list_remove(setting->parent->value.list, idx); 1991| 1.23k| __config_setting_destroy(setting); 1992| | 1993| 1.23k| return(CONFIG_TRUE); ------------------ | | 73| 1.23k|#define CONFIG_TRUE (1) ------------------ 1994| 1.23k|} config_setting_is_aggregate: 2088| 217k|{ 2089| 217k| config_assert(setting != NULL); 2090| | 2091| 217k| return((setting->type == CONFIG_TYPE_ARRAY) ------------------ | | 56| 217k|#define CONFIG_TYPE_ARRAY 7 ------------------ | Branch (2091:10): [True: 22.6k, False: 194k] ------------------ 2092| 194k| || (setting->type == CONFIG_TYPE_LIST) ------------------ | | 57| 194k|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (2092:13): [True: 126k, False: 68.4k] ------------------ 2093| 68.4k| || (setting->type == CONFIG_TYPE_GROUP)); ------------------ | | 50| 68.4k|#define CONFIG_TYPE_GROUP 1 ------------------ | Branch (2093:13): [True: 35.9k, False: 32.4k] ------------------ 2094| 217k|} libconfig.c:__config_read: 556| 2.13k|{ 557| 2.13k| yyscan_t scanner; 558| 2.13k| struct scan_context scan_ctx; 559| 2.13k| struct parse_context parse_ctx; 560| 2.13k| int r; 561| | 562| 2.13k| config_clear(config); 563| | 564| 2.13k| libconfig_parsectx_init(&parse_ctx); ------------------ | | 40| 2.13k| __zero(C) | | ------------------ | | | | 39| 2.13k|#define __zero(P) memset((void *)(P), 0, sizeof(*P)) | | ------------------ ------------------ 565| 2.13k| parse_ctx.config = config; 566| 2.13k| parse_ctx.parent = config->root; 567| 2.13k| parse_ctx.setting = config->root; 568| | 569| 2.13k| __config_locale_override(); 570| | 571| 2.13k| libconfig_scanctx_init(&scan_ctx, filename); 572| 2.13k| config->root->file = libconfig_scanctx_current_filename(&scan_ctx); 573| 2.13k| scan_ctx.config = config; 574| 2.13k| libconfig_yylex_init_extra(&scan_ctx, &scanner); 575| | 576| 2.13k| if(stream) ------------------ | Branch (576:6): [True: 0, False: 2.13k] ------------------ 577| 0| libconfig_yyrestart(stream, scanner); 578| 2.13k| else /* read from string */ 579| 2.13k| (void)libconfig_yy_scan_string(str, scanner); 580| | 581| 2.13k| libconfig_yyset_lineno(1, scanner); 582| 2.13k| r = libconfig_yyparse(scanner, &parse_ctx, &scan_ctx); 583| | 584| 2.13k| if(r != 0) ------------------ | Branch (584:6): [True: 405, False: 1.73k] ------------------ 585| 405| { 586| 405| YY_BUFFER_STATE buf; 587| | 588| 405| config->error_file = libconfig_scanctx_current_filename(&scan_ctx); 589| 405| config->error_type = CONFIG_ERR_PARSE; 590| | 591| | /* Unwind the include stack, freeing the buffers and closing the files. */ 592| 405| while((buf = (YY_BUFFER_STATE)libconfig_scanctx_pop_include(&scan_ctx)) ------------------ | Branch (592:11): [True: 0, False: 405] ------------------ 593| 405| != NULL) 594| 0| libconfig_yy_delete_buffer(buf, scanner); 595| 405| } 596| | 597| 2.13k| libconfig_yylex_destroy(scanner); 598| 2.13k| config->filenames = libconfig_scanctx_cleanup(&scan_ctx); 599| 2.13k| libconfig_parsectx_cleanup(&parse_ctx); ------------------ | | 42| 2.13k| __delete(libconfig_strbuf_release(&((C)->string))) | | ------------------ | | | | 38| 2.13k|#define __delete(P) free((void *)(P)) | | ------------------ ------------------ 600| | 601| 2.13k| __config_locale_restore(); 602| | 603| 2.13k| return(r == 0 ? CONFIG_TRUE : CONFIG_FALSE); ------------------ | | 73| 1.73k|#define CONFIG_TRUE (1) ------------------ return(r == 0 ? CONFIG_TRUE : CONFIG_FALSE); ------------------ | | 74| 405|#define CONFIG_FALSE (0) ------------------ | Branch (603:10): [True: 1.73k, False: 405] ------------------ 604| 2.13k|} libconfig.c:__config_locale_override: 100| 3.37k|{ 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.37k| locale_t loc = newlocale(LC_NUMERIC, "C", NULL); 114| 3.37k| uselocale(loc); 115| | 116| |#else 117| | 118| |#warning "No way to modify calling thread's locale!" 119| | 120| |#endif 121| 3.37k|} libconfig.c:__config_write_setting: 631| 10.8k|{ 632| 10.8k| char group_assign_char = config_get_option( ------------------ | Branch (632:28): [True: 10.8k, False: 0] ------------------ 633| 10.8k| config, CONFIG_OPTION_COLON_ASSIGNMENT_FOR_GROUPS) ? ':' : '='; ------------------ | | 66| 10.8k|#define CONFIG_OPTION_COLON_ASSIGNMENT_FOR_GROUPS 0x04 ------------------ 634| | 635| 10.8k| char nongroup_assign_char = config_get_option( ------------------ | Branch (635:31): [True: 0, False: 10.8k] ------------------ 636| 10.8k| config, CONFIG_OPTION_COLON_ASSIGNMENT_FOR_NON_GROUPS) ? ':' : '='; ------------------ | | 67| 10.8k|#define CONFIG_OPTION_COLON_ASSIGNMENT_FOR_NON_GROUPS 0x08 ------------------ 637| | 638| 10.8k| if(depth > 1) ------------------ | Branch (638:6): [True: 6.31k, False: 4.57k] ------------------ 639| 6.31k| __config_indent(stream, depth, config->tab_width); 640| | 641| | 642| 10.8k| if(setting->name) ------------------ | Branch (642:6): [True: 9.65k, False: 1.23k] ------------------ 643| 9.65k| { 644| 9.65k| fputs(setting->name, stream); 645| 9.65k| fprintf(stream, " %c ", ((setting->type == CONFIG_TYPE_GROUP) ------------------ | | 50| 9.65k|#define CONFIG_TYPE_GROUP 1 ------------------ | Branch (645:30): [True: 2.23k, False: 7.42k] ------------------ 646| 9.65k| ? group_assign_char 647| 9.65k| : nongroup_assign_char)); 648| 9.65k| } 649| | 650| 10.8k| __config_write_value(config, &(setting->value), setting->type, 651| 10.8k| config_setting_get_format(setting), depth, stream); 652| | 653| 10.8k| if(depth > 0) ------------------ | Branch (653:6): [True: 9.65k, False: 1.23k] ------------------ 654| 9.65k| { 655| 9.65k| if(config_get_option(config, CONFIG_OPTION_SEMICOLON_SEPARATORS)) ------------------ | | 65| 9.65k|#define CONFIG_OPTION_SEMICOLON_SEPARATORS 0x02 ------------------ | Branch (655:8): [True: 9.65k, False: 0] ------------------ 656| 9.65k| fputc(';', stream); 657| | 658| 9.65k| fputc('\n', stream); 659| 9.65k| } 660| 10.8k|} libconfig.c:__config_indent: 146| 10.5k|{ 147| 10.5k| if(w) ------------------ | Branch (147:6): [True: 10.5k, False: 0] ------------------ 148| 10.5k| 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.5k|} libconfig.c:__config_write_value: 162| 32.2k|{ 163| | /* Long enough for 64-bit binary value + NULL terminator. */ 164| 32.2k| char value_buf[(sizeof(int64_t) * BITS_IN_BYTE) + 1]; 165| | 166| 32.2k| switch(type) 167| 32.2k| { 168| | /* boolean */ 169| 966| case CONFIG_TYPE_BOOL: ------------------ | | 55| 966|#define CONFIG_TYPE_BOOL 6 ------------------ | Branch (169:5): [True: 966, False: 31.2k] ------------------ 170| 966| fputs(value->ival ? "true" : "false", stream); ------------------ | Branch (170:13): [True: 842, False: 124] ------------------ 171| 966| break; 172| | 173| | /* int */ 174| 7.42k| case CONFIG_TYPE_INT: ------------------ | | 51| 7.42k|#define CONFIG_TYPE_INT 2 ------------------ | Branch (174:5): [True: 7.42k, False: 24.7k] ------------------ 175| 7.42k| switch(format) 176| 7.42k| { 177| 982| case CONFIG_FORMAT_HEX: ------------------ | | 60| 982|#define CONFIG_FORMAT_HEX 1 ------------------ | Branch (177:9): [True: 982, False: 6.44k] ------------------ 178| 982| fprintf(stream, "0x%X", value->ival); 179| 982| break; 180| | 181| 855| case CONFIG_FORMAT_BIN: ------------------ | | 61| 855|#define CONFIG_FORMAT_BIN 2 ------------------ | Branch (181:9): [True: 855, False: 6.57k] ------------------ 182| 855| { 183| | /* Once %b/%B become more widely supported, could feature test for them */ 184| 855| char *str = libconfig_format_bin(value->ival, value_buf); 185| 855| fprintf(stream, "0b%s", str); 186| 855| break; 187| 0| } 188| | 189| 0| case CONFIG_FORMAT_OCT: ------------------ | | 62| 0|#define CONFIG_FORMAT_OCT 3 ------------------ | Branch (189:9): [True: 0, False: 7.42k] ------------------ 190| 0| fprintf(stream, "0o%o", value->ival); 191| 0| break; 192| | 193| 5.59k| case CONFIG_FORMAT_DEFAULT: ------------------ | | 59| 5.59k|#define CONFIG_FORMAT_DEFAULT 0 ------------------ | Branch (193:9): [True: 5.59k, False: 1.83k] ------------------ 194| 5.59k| default: ------------------ | Branch (194:9): [True: 0, False: 7.42k] ------------------ 195| 5.59k| fprintf(stream, "%d", value->ival); 196| 5.59k| break; 197| 7.42k| } 198| 7.42k| break; 199| | 200| | /* 64-bit int */ 201| 7.42k| case CONFIG_TYPE_INT64: ------------------ | | 52| 3.09k|#define CONFIG_TYPE_INT64 3 ------------------ | Branch (201:5): [True: 3.09k, False: 29.1k] ------------------ 202| 3.09k| switch(format) 203| 3.09k| { 204| 517| case CONFIG_FORMAT_HEX: ------------------ | | 60| 517|#define CONFIG_FORMAT_HEX 1 ------------------ | Branch (204:9): [True: 517, False: 2.57k] ------------------ 205| 517| fprintf(stream, "0x" INT64_HEX_FMT "L", value->llval); 206| 517| break; 207| | 208| 791| case CONFIG_FORMAT_BIN: ------------------ | | 61| 791|#define CONFIG_FORMAT_BIN 2 ------------------ | Branch (208:9): [True: 791, False: 2.30k] ------------------ 209| 791| { 210| | /* Once %b/%B become more widely supported, could feature test for them */ 211| 791| char *str = libconfig_format_bin(value->llval, value_buf); 212| 791| fprintf(stream, "0b%sL", str); 213| 791| break; 214| 0| } 215| | 216| 0| case CONFIG_FORMAT_OCT: ------------------ | | 62| 0|#define CONFIG_FORMAT_OCT 3 ------------------ | Branch (216:9): [True: 0, False: 3.09k] ------------------ 217| 0| fprintf(stream, "0o%lloL", value->llval); 218| 0| break; 219| | 220| 1.78k| case CONFIG_FORMAT_DEFAULT: ------------------ | | 59| 1.78k|#define CONFIG_FORMAT_DEFAULT 0 ------------------ | Branch (220:9): [True: 1.78k, False: 1.30k] ------------------ 221| 1.78k| default: ------------------ | Branch (221:9): [True: 0, False: 3.09k] ------------------ 222| 1.78k| fprintf(stream, INT64_FMT "L", value->llval); ------------------ | | 95| 1.78k|#define INT64_FMT "%lld" ------------------ 223| 1.78k| break; 224| 3.09k| } 225| 3.09k| break; 226| | 227| | /* float */ 228| 13.2k| case CONFIG_TYPE_FLOAT: ------------------ | | 53| 13.2k|#define CONFIG_TYPE_FLOAT 4 ------------------ | Branch (228:5): [True: 13.2k, False: 18.9k] ------------------ 229| 13.2k| { 230| 13.2k| const int sci_ok = config_get_option( 231| 13.2k| config, CONFIG_OPTION_ALLOW_SCIENTIFIC_NOTATION); ------------------ | | 69| 13.2k|#define CONFIG_OPTION_ALLOW_SCIENTIFIC_NOTATION 0x20 ------------------ 232| 13.2k| libconfig_format_double(value->fval, config->float_precision, sci_ok, 233| 13.2k| value_buf, sizeof(value_buf)); 234| 13.2k| fputs(value_buf, stream); 235| 13.2k| break; 236| 3.09k| } 237| | 238| | /* string */ 239| 1.24k| case CONFIG_TYPE_STRING: ------------------ | | 54| 1.24k|#define CONFIG_TYPE_STRING 5 ------------------ | Branch (239:5): [True: 1.24k, False: 30.9k] ------------------ 240| 1.24k| { 241| 1.24k| char *p; 242| | 243| 1.24k| fputc('\"', stream); 244| | 245| 1.24k| if(value->sval) ------------------ | Branch (245:10): [True: 1.24k, False: 0] ------------------ 246| 1.24k| { 247| 6.28k| for(p = value->sval; *p; p++) ------------------ | Branch (247:30): [True: 5.03k, False: 1.24k] ------------------ 248| 5.03k| { 249| 5.03k| int c = (int)*p & 0xFF; 250| 5.03k| switch(c) 251| 5.03k| { 252| 448| case '\"': ------------------ | Branch (252:13): [True: 448, False: 4.58k] ------------------ 253| 842| case '\\': ------------------ | Branch (253:13): [True: 394, False: 4.64k] ------------------ 254| 842| fputc('\\', stream); 255| 842| fputc(c, stream); 256| 842| break; 257| | 258| 381| case '\n': ------------------ | Branch (258:13): [True: 381, False: 4.65k] ------------------ 259| 381| fputs("\\n", stream); 260| 381| break; 261| | 262| 342| case '\r': ------------------ | Branch (262:13): [True: 342, False: 4.69k] ------------------ 263| 342| fputs("\\r", stream); 264| 342| break; 265| | 266| 353| case '\f': ------------------ | Branch (266:13): [True: 353, False: 4.68k] ------------------ 267| 353| fputs("\\f", stream); 268| 353| break; 269| | 270| 328| case '\t': ------------------ | Branch (270:13): [True: 328, False: 4.70k] ------------------ 271| 328| fputs("\\t", stream); 272| 328| break; 273| | 274| 2.78k| default: ------------------ | Branch (274:13): [True: 2.78k, False: 2.24k] ------------------ 275| 2.78k| if(c >= ' ') ------------------ | Branch (275:18): [True: 2.13k, False: 654] ------------------ 276| 2.13k| fputc(c, stream); 277| 654| else 278| 654| fprintf(stream, "\\x%02X", c); 279| 5.03k| } 280| 5.03k| } 281| 1.24k| } 282| 1.24k| fputc('\"', stream); 283| 1.24k| break; 284| 1.24k| } 285| | 286| | /* list */ 287| 1.01k| case CONFIG_TYPE_LIST: ------------------ | | 57| 1.01k|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (287:5): [True: 1.01k, False: 31.1k] ------------------ 288| 1.01k| { 289| 1.01k| config_list_t *list = value->list; 290| | 291| 1.01k| fputs("( ", stream); 292| | 293| 1.01k| if(list) ------------------ | Branch (293:10): [True: 775, False: 244] ------------------ 294| 775| { 295| 775| int len = list->length; 296| 775| config_setting_t **s; 297| | 298| 14.4k| for(s = list->elements; len--; s++) ------------------ | Branch (298:33): [True: 13.7k, False: 775] ------------------ 299| 13.7k| { 300| 13.7k| __config_write_value(config, &((*s)->value), (*s)->type, 301| 13.7k| config_setting_get_format(*s), depth + 1, 302| 13.7k| stream); 303| | 304| 13.7k| if(len) ------------------ | Branch (304:14): [True: 12.9k, False: 775] ------------------ 305| 12.9k| fputc(',', stream); 306| | 307| 13.7k| fputc(' ', stream); 308| 13.7k| } 309| 775| } 310| | 311| 1.01k| fputc(')', stream); 312| 1.01k| break; 313| 1.24k| } 314| | 315| | /* array */ 316| 1.17k| case CONFIG_TYPE_ARRAY: ------------------ | | 56| 1.17k|#define CONFIG_TYPE_ARRAY 7 ------------------ | Branch (316:5): [True: 1.17k, False: 31.0k] ------------------ 317| 1.17k| { 318| 1.17k| config_list_t *list = value->list; 319| | 320| 1.17k| fputs("[ ", stream); 321| | 322| 1.17k| if(list) ------------------ | Branch (322:10): [True: 726, False: 446] ------------------ 323| 726| { 324| 726| int len = list->length; 325| 726| config_setting_t **s; 326| | 327| 8.32k| for(s = list->elements; len--; s++) ------------------ | Branch (327:33): [True: 7.60k, False: 726] ------------------ 328| 7.60k| { 329| 7.60k| __config_write_value(config, &((*s)->value), (*s)->type, 330| 7.60k| config_setting_get_format(*s), depth + 1, 331| 7.60k| stream); 332| | 333| 7.60k| if(len) ------------------ | Branch (333:14): [True: 6.87k, False: 726] ------------------ 334| 6.87k| fputc(',', stream); 335| | 336| 7.60k| fputc(' ', stream); 337| 7.60k| } 338| 726| } 339| | 340| 1.17k| fputc(']', stream); 341| 1.17k| break; 342| 1.24k| } 343| | 344| | /* group */ 345| 3.98k| case CONFIG_TYPE_GROUP: ------------------ | | 50| 3.98k|#define CONFIG_TYPE_GROUP 1 ------------------ | Branch (345:5): [True: 3.98k, False: 28.2k] ------------------ 346| 3.98k| { 347| 3.98k| config_list_t *list = value->list; 348| | 349| 3.98k| if(depth > 0) ------------------ | Branch (349:10): [True: 2.75k, False: 1.23k] ------------------ 350| 2.75k| { 351| 2.75k| if(config_get_option(config, CONFIG_OPTION_OPEN_BRACE_ON_SEPARATE_LINE)) ------------------ | | 68| 2.75k|#define CONFIG_OPTION_OPEN_BRACE_ON_SEPARATE_LINE 0x10 ------------------ | Branch (351:12): [True: 2.75k, False: 0] ------------------ 352| 2.75k| { 353| 2.75k| fputc('\n', stream); 354| | 355| 2.75k| if(depth > 1) ------------------ | Branch (355:14): [True: 2.09k, False: 658] ------------------ 356| 2.09k| __config_indent(stream, depth, config->tab_width); 357| 2.75k| } 358| | 359| 2.75k| fputs("{\n", stream); 360| 2.75k| } 361| | 362| 3.98k| if(list) ------------------ | Branch (362:10): [True: 3.36k, False: 626] ------------------ 363| 3.36k| { 364| 3.36k| int len = list->length; 365| 3.36k| config_setting_t **s; 366| | 367| 13.0k| for(s = list->elements; len--; s++) ------------------ | Branch (367:33): [True: 9.65k, False: 3.36k] ------------------ 368| 9.65k| __config_write_setting(config, *s, stream, depth + 1); 369| 3.36k| } 370| | 371| 3.98k| if(depth > 1) ------------------ | Branch (371:10): [True: 2.09k, False: 1.89k] ------------------ 372| 2.09k| __config_indent(stream, depth, config->tab_width); 373| | 374| 3.98k| if(depth > 0) ------------------ | Branch (374:10): [True: 2.75k, False: 1.23k] ------------------ 375| 2.75k| fputc('}', stream); 376| | 377| 3.98k| break; 378| 1.24k| } 379| | 380| 0| default: ------------------ | Branch (380:5): [True: 0, False: 32.2k] ------------------ 381| | /* this shouldn't happen, but handle it gracefully... */ 382| 0| fputs("???", stream); 383| 0| break; 384| 32.2k| } 385| 32.2k|} libconfig.c:__config_locale_restore: 126| 3.37k|{ 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.37k| locale_t loc = uselocale(LC_GLOBAL_LOCALE); 134| 3.37k| freelocale(loc); 135| | 136| |#else 137| | 138| |#warning "No way to modify calling thread's locale!" 139| | 140| |#endif 141| 3.37k|} libconfig.c:__config_setting_destroy: 458| 93.6k|{ 459| 93.6k| if(setting) ------------------ | Branch (459:6): [True: 91.3k, False: 2.25k] ------------------ 460| 91.3k| { 461| 91.3k| if(setting->name) ------------------ | Branch (461:8): [True: 14.6k, False: 76.7k] ------------------ 462| 14.6k| __delete(setting->name); ------------------ | | 38| 14.6k|#define __delete(P) free((void *)(P)) ------------------ 463| | 464| 91.3k| if(setting->type == CONFIG_TYPE_STRING) ------------------ | | 54| 91.3k|#define CONFIG_TYPE_STRING 5 ------------------ | Branch (464:8): [True: 2.01k, False: 89.3k] ------------------ 465| 2.01k| __delete(setting->value.sval); ------------------ | | 38| 2.01k|#define __delete(P) free((void *)(P)) ------------------ 466| | 467| 89.3k| else if(config_setting_is_aggregate(setting)) ------------------ | Branch (467:13): [True: 56.9k, False: 32.3k] ------------------ 468| 56.9k| { 469| 56.9k| if(setting->value.list) ------------------ | Branch (469:10): [True: 52.5k, False: 4.45k] ------------------ 470| 52.5k| __config_list_destroy(setting->value.list); 471| 56.9k| } 472| | 473| 91.3k| if(setting->hook && setting->config->destructor) ------------------ | Branch (473:8): [True: 0, False: 91.3k] | Branch (473:25): [True: 0, False: 0] ------------------ 474| 0| setting->config->destructor(setting->hook); 475| | 476| 91.3k| __delete(setting); ------------------ | | 38| 91.3k|#define __delete(P) free((void *)(P)) ------------------ 477| 91.3k| } 478| 93.6k|} libconfig.c:__config_list_destroy: 483| 52.5k|{ 484| 52.5k| config_setting_t **p; 485| 52.5k| unsigned int i; 486| | 487| 52.5k| if(! list) ------------------ | Branch (487:6): [True: 0, False: 52.5k] ------------------ 488| 0| return; 489| | 490| 52.5k| if(list->elements) ------------------ | Branch (490:6): [True: 52.5k, False: 0] ------------------ 491| 52.5k| { 492| 138k| for(p = list->elements, i = 0; i < list->length; p++, i++) ------------------ | Branch (492:36): [True: 85.7k, False: 52.5k] ------------------ 493| 85.7k| __config_setting_destroy(*p); 494| | 495| 52.5k| __delete(list->elements); ------------------ | | 38| 52.5k|#define __delete(P) free((void *)(P)) ------------------ 496| 52.5k| } 497| | 498| 52.5k| __delete(list); ------------------ | | 38| 52.5k|#define __delete(P) free((void *)(P)) ------------------ 499| 52.5k|} libconfig.c:__config_setting_get_int: 930| 139|{ 931| 139| switch(setting->type) 932| 139| { 933| 3| case CONFIG_TYPE_INT: ------------------ | | 51| 3|#define CONFIG_TYPE_INT 2 ------------------ | Branch (933:5): [True: 3, False: 136] ------------------ 934| 3| *value = setting->value.ival; 935| 3| return(CONFIG_TRUE); ------------------ | | 73| 3|#define CONFIG_TRUE (1) ------------------ 936| | 937| 129| case CONFIG_TYPE_INT64: ------------------ | | 52| 129|#define CONFIG_TYPE_INT64 3 ------------------ | Branch (937:5): [True: 129, False: 10] ------------------ 938| 129| if((setting->value.llval >= INT32_MIN) ------------------ | Branch (938:10): [True: 71, False: 58] ------------------ 939| 71| && (setting->value.llval <= INT32_MAX)) ------------------ | Branch (939:13): [True: 54, False: 17] ------------------ 940| 54| { 941| 54| *value = (int)(setting->value.llval); 942| 54| return(CONFIG_TRUE); ------------------ | | 73| 54|#define CONFIG_TRUE (1) ------------------ 943| 54| } 944| 75| else 945| 75| return(CONFIG_FALSE); ------------------ | | 74| 75|#define CONFIG_FALSE (0) ------------------ 946| | 947| 3| case CONFIG_TYPE_FLOAT: ------------------ | | 53| 3|#define CONFIG_TYPE_FLOAT 4 ------------------ | Branch (947:5): [True: 3, False: 136] ------------------ 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| 4| default: ------------------ | Branch (956:5): [True: 4, False: 135] ------------------ 957| 4| return(CONFIG_FALSE); ------------------ | | 74| 4|#define CONFIG_FALSE (0) ------------------ 958| 139| } 959| 139|} libconfig.c:__config_setting_get_int64: 987| 9|{ 988| 9| switch(setting->type) 989| 9| { 990| 1| case CONFIG_TYPE_INT64: ------------------ | | 52| 1|#define CONFIG_TYPE_INT64 3 ------------------ | Branch (990:5): [True: 1, False: 8] ------------------ 991| 1| *value = setting->value.llval; 992| 1| return(CONFIG_TRUE); ------------------ | | 73| 1|#define CONFIG_TRUE (1) ------------------ 993| | 994| 2| case CONFIG_TYPE_INT: ------------------ | | 51| 2|#define CONFIG_TYPE_INT 2 ------------------ | Branch (994:5): [True: 2, False: 7] ------------------ 995| 2| *value = (long long)(setting->value.ival); 996| 2| return(CONFIG_TRUE); ------------------ | | 73| 2|#define CONFIG_TRUE (1) ------------------ 997| | 998| 4| case CONFIG_TYPE_FLOAT: ------------------ | | 53| 4|#define CONFIG_TYPE_FLOAT 4 ------------------ | Branch (998:5): [True: 4, False: 5] ------------------ 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| 2| default: ------------------ | Branch (1007:5): [True: 2, False: 7] ------------------ 1008| 2| return(CONFIG_FALSE); ------------------ | | 74| 2|#define CONFIG_FALSE (0) ------------------ 1009| 9| } 1010| 9|} 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.1k|{ 412| 19.1k| config_setting_t **found = NULL; 413| 19.1k| unsigned int i; 414| | 415| 19.1k| if(! list || ! name) ------------------ | Branch (415:6): [True: 6.18k, False: 13.0k] | Branch (415:16): [True: 0, False: 13.0k] ------------------ 416| 6.18k| return(NULL); 417| | 418| 92.6k| for(i = 0, found = list->elements; i < list->length; i++, found++) ------------------ | Branch (418:38): [True: 82.7k, False: 9.95k] ------------------ 419| 82.7k| { 420| 82.7k| if(! (*found)->name) ------------------ | Branch (420:8): [True: 0, False: 82.7k] ------------------ 421| 0| continue; 422| | 423| 82.7k| if((strlen((*found)->name) == namelen) ------------------ | Branch (423:8): [True: 23.3k, False: 59.4k] ------------------ 424| 23.3k| && !strncmp(name, (*found)->name, namelen)) ------------------ | Branch (424:12): [True: 3.05k, False: 20.2k] ------------------ 425| 3.05k| { 426| 3.05k| if(idx) ------------------ | Branch (426:10): [True: 1.23k, False: 1.82k] ------------------ 427| 1.23k| *idx = i; 428| | 429| 3.05k| return(*found); 430| 3.05k| } 431| 82.7k| } 432| | 433| 9.95k| return(NULL); 434| 13.0k|} libconfig.c:__config_list_checktype: 504| 24.9k|{ 505| | /* if the array is empty, then it has no type yet */ 506| | 507| 24.9k| if(! setting->value.list) ------------------ | Branch (507:6): [True: 2.18k, False: 22.7k] ------------------ 508| 2.18k| return(CONFIG_TRUE); ------------------ | | 73| 2.18k|#define CONFIG_TRUE (1) ------------------ 509| | 510| 22.7k| if(setting->value.list->length == 0) ------------------ | Branch (510:6): [True: 0, False: 22.7k] ------------------ 511| 0| return(CONFIG_TRUE); ------------------ | | 73| 0|#define CONFIG_TRUE (1) ------------------ 512| | 513| | /* if it's a list, any type is allowed */ 514| | 515| 22.7k| if(setting->type == CONFIG_TYPE_LIST) ------------------ | | 57| 22.7k|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (515:6): [True: 13.7k, False: 9.04k] ------------------ 516| 13.7k| return(CONFIG_TRUE); ------------------ | | 73| 13.7k|#define CONFIG_TRUE (1) ------------------ 517| | 518| | /* otherwise the first element added determines the type of the array */ 519| | 520| 9.04k| return((setting->value.list->elements[0]->type == type) ------------------ | Branch (520:10): [True: 9.01k, False: 28] ------------------ 521| 9.04k| ? CONFIG_TRUE : CONFIG_FALSE); ------------------ | | 73| 9.01k|#define CONFIG_TRUE (1) ------------------ ? CONFIG_TRUE : CONFIG_FALSE); ------------------ | | 74| 28|#define CONFIG_FALSE (0) ------------------ 522| 22.7k|} libconfig.c:__config_setting_create: 901| 87.0k|{ 902| 87.0k| config_setting_t *setting; 903| 87.0k| config_list_t *list; 904| | 905| 87.0k| if(!config_setting_is_aggregate(parent)) ------------------ | Branch (905:6): [True: 0, False: 87.0k] ------------------ 906| 0| return(NULL); 907| | 908| 87.0k| setting = __new(config_setting_t); ------------------ | | 37| 87.0k|#define __new(T) (T *)libconfig_calloc(1, sizeof(T)) /* zeroed */ ------------------ 909| 87.0k| setting->parent = parent; 910| 87.0k| setting->name = (name == NULL) ? NULL : strdup(name); ------------------ | Branch (910:19): [True: 72.4k, False: 14.6k] ------------------ 911| 87.0k| setting->type = type; 912| 87.0k| setting->config = parent->config; 913| 87.0k| setting->hook = NULL; 914| 87.0k| setting->line = 0; 915| | 916| 87.0k| list = parent->value.list; 917| | 918| 87.0k| if(! list) ------------------ | Branch (918:6): [True: 52.5k, False: 34.4k] ------------------ 919| 52.5k| list = parent->value.list = __new(config_list_t); ------------------ | | 37| 52.5k|#define __new(T) (T *)libconfig_calloc(1, sizeof(T)) /* zeroed */ ------------------ 920| | 921| 87.0k| __config_list_add(list, setting); 922| | 923| 87.0k| return(setting); 924| 87.0k|} libconfig.c:__config_list_add: 390| 87.0k|{ 391| 87.0k| if((list->length % CHUNK_SIZE) == 0) ------------------ | | 51| 87.0k|#define CHUNK_SIZE 16 ------------------ | Branch (391:6): [True: 54.1k, False: 32.9k] ------------------ 392| 54.1k| { 393| 54.1k| list->elements = (config_setting_t **)libconfig_realloc( 394| 54.1k| list->elements, 395| 54.1k| (list->length + CHUNK_SIZE) * sizeof(config_setting_t *)); ------------------ | | 51| 54.1k|#define CHUNK_SIZE 16 ------------------ 396| 54.1k| } 397| | 398| 87.0k| list->elements[list->length] = setting; 399| 87.0k| list->length++; 400| 87.0k|} libconfig.c:__config_validate_name: 534| 15.1k|{ 535| 15.1k| const char *p = name; 536| | 537| 15.1k| if(*p == '\0') ------------------ | Branch (537:6): [True: 334, False: 14.8k] ------------------ 538| 334| return(CONFIG_FALSE); ------------------ | | 74| 334|#define CONFIG_FALSE (0) ------------------ 539| | 540| 14.8k| if(! isalpha((int)*p) && (*p != '*')) ------------------ | Branch (540:6): [True: 1.07k, False: 13.7k] | Branch (540:28): [True: 87, False: 990] ------------------ 541| 87| return(CONFIG_FALSE); ------------------ | | 74| 87|#define CONFIG_FALSE (0) ------------------ 542| | 543| 87.4k| for(++p; *p; ++p) ------------------ | Branch (543:12): [True: 72.8k, False: 14.6k] ------------------ 544| 72.8k| { 545| 72.8k| if(! (isalpha((int)*p) || isdigit((int)*p) || strchr("*_-", (int)*p))) ------------------ | Branch (545:11): [True: 47.5k, False: 25.3k] | Branch (545:31): [True: 22.2k, False: 3.10k] | Branch (545:51): [True: 3.02k, False: 81] ------------------ 546| 81| return(CONFIG_FALSE); ------------------ | | 74| 81|#define CONFIG_FALSE (0) ------------------ 547| 72.8k| } 548| | 549| 14.6k| return(CONFIG_TRUE); ------------------ | | 73| 14.6k|#define CONFIG_TRUE (1) ------------------ 550| 14.7k|} libconfig.c:__config_list_remove: 439| 1.23k|{ 440| 1.23k| config_setting_t *removed = *(list->elements + idx); 441| 1.23k| int offset = (idx * sizeof(config_setting_t *)); 442| 1.23k| int len = list->length - 1 - idx; 443| 1.23k| char *base = (char *)list->elements + offset; 444| | 445| 1.23k| memmove(base, base + sizeof(config_setting_t *), 446| 1.23k| len * sizeof(config_setting_t *)); 447| | 448| 1.23k| list->length--; 449| | 450| | /* possibly realloc smaller? */ 451| | 452| 1.23k| return(removed); 453| 1.23k|} libconfig_scanctx_init: 40| 2.13k|{ 41| 2.13k| __zero(ctx); ------------------ | | 39| 2.13k|#define __zero(P) memset((void *)(P), 0, sizeof(*P)) ------------------ 42| 2.13k| if(top_filename) ------------------ | Branch (42:6): [True: 0, False: 2.13k] ------------------ 43| 0| { 44| 0| ctx->top_filename = strdup(top_filename); 45| 0| libconfig_strvec_append(&(ctx->filenames), ctx->top_filename); 46| 0| } 47| 2.13k|} libconfig_scanctx_cleanup: 52| 2.13k|{ 53| 2.13k| int i; 54| | 55| 2.13k| for(i = 0; i < ctx->stack_depth; ++i) ------------------ | Branch (55:14): [True: 0, False: 2.13k] ------------------ 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.13k| __delete(libconfig_strbuf_release(&(ctx->string))); ------------------ | | 38| 2.13k|#define __delete(P) free((void *)(P)) ------------------ 66| | 67| 2.13k| return(libconfig_strvec_release(&(ctx->filenames))); 68| 2.13k|} libconfig_scanctx_next_include_file: 125| 1.83k|{ 126| 1.83k| struct include_stack_frame *include_frame; 127| | 128| 1.83k| *error = NULL; 129| | 130| 1.83k| if(ctx->stack_depth == 0) ------------------ | Branch (130:6): [True: 1.83k, False: 0] ------------------ 131| 1.83k| 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.23k|{ 160| 2.23k| struct include_stack_frame *frame; 161| | 162| 2.23k| if(ctx->stack_depth == 0) ------------------ | Branch (162:6): [True: 2.23k, False: 0] ------------------ 163| 2.23k| 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.23k|} libconfig_scanctx_take_string: 182| 3.04k|{ 183| 3.04k| char *r = libconfig_strbuf_release(&(ctx->string)); 184| | 185| 3.04k| return(r ? r : strdup("")); ------------------ | Branch (185:10): [True: 1.08k, False: 1.96k] ------------------ 186| 3.04k|} libconfig_scanctx_current_filename: 191| 88.7k|{ 192| 88.7k| if(ctx->stack_depth > 0) ------------------ | Branch (192:6): [True: 0, False: 88.7k] ------------------ 193| 0| return(*(ctx->include_stack[ctx->stack_depth - 1].current_file)); 194| | 195| 88.7k| return(ctx->top_filename); 196| 88.7k|} libconfig_yylex: 1178| 154k|{ 1179| 154k| yy_state_type yy_current_state; 1180| 154k| char *yy_cp, *yy_bp; 1181| 154k| int yy_act; 1182| 154k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1183| | 1184| 154k| yylval = yylval_param; ------------------ | | 994| 154k| # define yylval yyg->yylval_r ------------------ 1185| | 1186| 154k| if ( !yyg->yy_init ) ------------------ | Branch (1186:7): [True: 2.13k, False: 152k] ------------------ 1187| 2.13k| { 1188| 2.13k| yyg->yy_init = 1; 1189| | 1190| |#ifdef YY_USER_INIT 1191| | YY_USER_INIT; 1192| |#endif 1193| | 1194| 2.13k| if ( ! yyg->yy_start ) ------------------ | Branch (1194:8): [True: 2.13k, False: 0] ------------------ 1195| 2.13k| yyg->yy_start = 1; /* first start state */ 1196| | 1197| 2.13k| if ( ! yyin ) ------------------ | | 344| 2.13k|#define yyin yyg->yyin_r ------------------ | Branch (1197:8): [True: 2.13k, False: 0] ------------------ 1198| 2.13k| yyin = stdin; ------------------ | | 344| 2.13k|#define yyin yyg->yyin_r ------------------ 1199| | 1200| 2.13k| if ( ! yyout ) ------------------ | | 345| 2.13k|#define yyout yyg->yyout_r ------------------ | Branch (1200:8): [True: 2.13k, False: 0] ------------------ 1201| 2.13k| yyout = stdout; ------------------ | | 345| 2.13k|#define yyout yyg->yyout_r ------------------ 1202| | 1203| 2.13k| if ( ! YY_CURRENT_BUFFER ) { ------------------ | | 509| 2.13k|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:29): [True: 2.13k, False: 0] | | ------------------ | | 510| 2.13k| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 2.13k| : NULL) ------------------ | Branch (1203:8): [True: 0, False: 2.13k] ------------------ 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.13k| yy_load_buffer_state( yyscanner ); ------------------ | | 62| 2.13k|#define yy_load_buffer_state libconfig_yy_load_buffer_state ------------------ 1210| 2.13k| } 1211| | 1212| 154k| { 1213| 154k|#line 72 "scanner.l" 1214| | 1215| | 1216| 154k|#line 1217 "scanner.c" 1217| | 1218| 187k| while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ ------------------ | Branch (1218:23): [True: 187k, Folded] ------------------ 1219| 187k| { 1220| 187k| yy_cp = yyg->yy_c_buf_p; 1221| | 1222| | /* Support of yytext. */ 1223| 187k| *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| 187k| yy_bp = yy_cp; 1229| | 1230| 187k| yy_current_state = yyg->yy_start; 1231| 187k| yy_current_state += YY_AT_BOL(); ------------------ | | 557| 187k|#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) | | ------------------ | | | | 515| 187k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ ------------------ 1232| 187k|yy_match: 1233| 187k| 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: 341k, False: 196k] ------------------ 1237| 341k| { 1238| 341k| yyg->yy_last_accepting_state = yy_current_state; 1239| 341k| yyg->yy_last_accepting_cpos = yy_cp; 1240| 341k| } 1241| 876k| while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) ------------------ | Branch (1241:12): [True: 338k, False: 538k] ------------------ 1242| 338k| { 1243| 338k| yy_current_state = (int) yy_def[yy_current_state]; 1244| 338k| if ( yy_current_state >= 214 ) ------------------ | Branch (1244:10): [True: 146k, False: 191k] ------------------ 1245| 146k| yy_c = yy_meta[yy_c]; 1246| 338k| } 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: 350k, False: 187k] ------------------ 1251| 187k| yy_cp = yyg->yy_last_accepting_cpos; 1252| 187k| yy_current_state = yyg->yy_last_accepting_state; 1253| | 1254| 189k|yy_find_action: 1255| 189k| yy_act = yy_accept[yy_current_state]; 1256| | 1257| 189k| YY_DO_BEFORE_ACTION; ------------------ | | 578| 189k| yyg->yytext_ptr = yy_bp; \ | | ------------------ | | | | 567| 189k|#define yytext_ptr yytext_r | | ------------------ | | 579| 189k| yyleng = (int) (yy_cp - yy_bp); \ | | ------------------ | | | | 347| 189k|#define yyleng yyg->yyleng_r | | ------------------ | | 580| 189k| yyg->yy_hold_char = *yy_cp; \ | | 581| 189k| *yy_cp = '\0'; \ | | 582| 189k| yyg->yy_c_buf_p = yy_cp; ------------------ 1258| | 1259| 189k| if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) ------------------ | | 584| 379k|#define YY_END_OF_BUFFER 49 ------------------ | Branch (1259:8): [True: 186k, False: 3.80k] | Branch (1259:38): [True: 6.84k, False: 179k] ------------------ 1260| 6.84k| { 1261| 6.84k| int yyl; 1262| 43.2k| for ( yyl = 0; yyl < yyleng; ++yyl ) ------------------ | | 347| 43.2k|#define yyleng yyg->yyleng_r ------------------ | Branch (1262:19): [True: 36.4k, False: 6.84k] ------------------ 1263| 36.4k| if ( yytext[yyl] == '\n' ) ------------------ | | 348| 36.4k|#define yytext yyg->yytext_r ------------------ | Branch (1263:10): [True: 3.46k, False: 32.9k] ------------------ 1264| | 1265| 3.46k| do{ yylineno++; ------------------ | | 349| 3.46k|#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) | | ------------------ | | | | 515| 3.46k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ ------------------ 1266| 3.46k| yycolumn=0; ------------------ | | 350| 3.46k|#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) | | ------------------ | | | | 515| 3.46k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ ------------------ 1267| 3.46k| }while(0) ------------------ | Branch (1267:12): [Folded, False: 3.46k] ------------------ 1268| 6.84k|; 1269| 6.84k| } 1270| | 1271| 191k|do_action: /* This label is used only to access EOF actions. */ 1272| | 1273| 191k| switch ( yy_act ) 1274| 191k| { /* beginning of action switch */ 1275| 29| case 0: /* must back up */ ------------------ | Branch (1275:4): [True: 29, False: 191k] ------------------ 1276| | /* undo the effects of YY_DO_BEFORE_ACTION */ 1277| 29| *yy_cp = yyg->yy_hold_char; 1278| 29| yy_cp = yyg->yy_last_accepting_cpos; 1279| 29| yy_current_state = yyg->yy_last_accepting_state; 1280| 29| goto yy_find_action; 1281| | 1282| 455|case 1: ------------------ | Branch (1282:1): [True: 455, False: 191k] ------------------ 1283| 455|YY_RULE_SETUP ------------------ | | 1170| 455| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 455|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 455, False: 0] | | ------------------ | | 1171| 455| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 455|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 455| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 455|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 455|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 455| YY_USER_ACTION ------------------ 1284| 455|#line 74 "scanner.l" 1285| 455|{ BEGIN SINGLE_LINE_COMMENT; } ------------------ | | 357| 455|#define BEGIN yyg->yy_start = 1 + 2 * ------------------ { BEGIN SINGLE_LINE_COMMENT; } ------------------ | | 939| 455|#define SINGLE_LINE_COMMENT 1 ------------------ 1286| 455| YY_BREAK ------------------ | | 1166| 455|#define YY_BREAK /*LINTED*/break; ------------------ 1287| 360|case 2: ------------------ | Branch (1287:1): [True: 360, False: 191k] ------------------ 1288| |/* rule 2 can match eol */ 1289| 360|YY_RULE_SETUP ------------------ | | 1170| 360| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 360|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 360, False: 0] | | ------------------ | | 1171| 360| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 360|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 360| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 360|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 360|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 360| YY_USER_ACTION ------------------ 1290| 360|#line 75 "scanner.l" 1291| 360|{ BEGIN INITIAL; } ------------------ | | 357| 360|#define BEGIN yyg->yy_start = 1 + 2 * ------------------ { BEGIN INITIAL; } ------------------ | | 938| 360|#define INITIAL 0 ------------------ 1292| 360| YY_BREAK ------------------ | | 1166| 360|#define YY_BREAK /*LINTED*/break; ------------------ 1293| 4.68k|case 3: ------------------ | Branch (1293:1): [True: 4.68k, False: 187k] ------------------ 1294| 4.68k|YY_RULE_SETUP ------------------ | | 1170| 4.68k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 4.68k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 4.68k, False: 0] | | ------------------ | | 1171| 4.68k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 4.68k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 4.68k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 4.68k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 4.68k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 4.68k| YY_USER_ACTION ------------------ 1295| 4.68k|#line 76 "scanner.l" 1296| 4.68k|{ /* ignore */ } 1297| 4.68k| YY_BREAK ------------------ | | 1166| 4.68k|#define YY_BREAK /*LINTED*/break; ------------------ 1298| 424|case 4: ------------------ | Branch (1298:1): [True: 424, False: 191k] ------------------ 1299| 424|YY_RULE_SETUP ------------------ | | 1170| 424| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 424|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 424, False: 0] | | ------------------ | | 1171| 424| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 424|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 424| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 424|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 424|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 424| YY_USER_ACTION ------------------ 1300| 424|#line 78 "scanner.l" 1301| 424|{ BEGIN MULTI_LINE_COMMENT; } ------------------ | | 357| 424|#define BEGIN yyg->yy_start = 1 + 2 * ------------------ { BEGIN MULTI_LINE_COMMENT; } ------------------ | | 940| 424|#define MULTI_LINE_COMMENT 2 ------------------ 1302| 424| YY_BREAK ------------------ | | 1166| 424|#define YY_BREAK /*LINTED*/break; ------------------ 1303| 392|case 5: ------------------ | Branch (1303:1): [True: 392, False: 191k] ------------------ 1304| 392|YY_RULE_SETUP ------------------ | | 1170| 392| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 392|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 392, False: 0] | | ------------------ | | 1171| 392| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 392|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 392| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 392|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 392|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 392| YY_USER_ACTION ------------------ 1305| 392|#line 79 "scanner.l" 1306| 392|{ BEGIN INITIAL; } ------------------ | | 357| 392|#define BEGIN yyg->yy_start = 1 + 2 * ------------------ { BEGIN INITIAL; } ------------------ | | 938| 392|#define INITIAL 0 ------------------ 1307| 392| YY_BREAK ------------------ | | 1166| 392|#define YY_BREAK /*LINTED*/break; ------------------ 1308| 9.25k|case 6: ------------------ | Branch (1308:1): [True: 9.25k, False: 182k] ------------------ 1309| 9.25k|YY_RULE_SETUP ------------------ | | 1170| 9.25k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 9.25k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 9.25k, False: 0] | | ------------------ | | 1171| 9.25k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 9.25k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 9.25k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 9.25k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 9.25k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 9.25k| YY_USER_ACTION ------------------ 1310| 9.25k|#line 80 "scanner.l" 1311| 9.25k|{ /* ignore */ } 1312| 9.25k| YY_BREAK ------------------ | | 1166| 9.25k|#define YY_BREAK /*LINTED*/break; ------------------ 1313| 535|case 7: ------------------ | Branch (1313:1): [True: 535, False: 191k] ------------------ 1314| |/* rule 7 can match eol */ 1315| 535|YY_RULE_SETUP ------------------ | | 1170| 535| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 535|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 535, False: 0] | | ------------------ | | 1171| 535| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 535|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 535| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 535|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 535|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 535| YY_USER_ACTION ------------------ 1316| 535|#line 81 "scanner.l" 1317| 535|{ /* ignore */ } 1318| 535| YY_BREAK ------------------ | | 1166| 535|#define YY_BREAK /*LINTED*/break; ------------------ 1319| 3.27k|case 8: ------------------ | Branch (1319:1): [True: 3.27k, False: 188k] ------------------ 1320| 3.27k|YY_RULE_SETUP ------------------ | | 1170| 3.27k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 3.27k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 3.27k, False: 0] | | ------------------ | | 1171| 3.27k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 3.27k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 3.27k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 3.27k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 3.27k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 3.27k| YY_USER_ACTION ------------------ 1321| 3.27k|#line 83 "scanner.l" 1322| 3.27k|{ BEGIN STRING; } ------------------ | | 357| 3.27k|#define BEGIN yyg->yy_start = 1 + 2 * ------------------ { BEGIN STRING; } ------------------ | | 941| 3.27k|#define STRING 3 ------------------ 1323| 3.27k| YY_BREAK ------------------ | | 1166| 3.27k|#define YY_BREAK /*LINTED*/break; ------------------ 1324| 3.18k|case 9: ------------------ | Branch (1324:1): [True: 3.18k, False: 188k] ------------------ 1325| |/* rule 9 can match eol */ 1326| 3.18k|YY_RULE_SETUP ------------------ | | 1170| 3.18k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 3.18k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 3.18k, False: 0] | | ------------------ | | 1171| 3.18k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 3.18k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 3.18k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 3.18k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 3.18k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 3.18k| YY_USER_ACTION ------------------ 1327| 3.18k|#line 84 "scanner.l" 1328| 3.18k|{ libconfig_scanctx_append_string(yyextra, yytext); } ------------------ | | 100| 3.18k| libconfig_strbuf_append_string(&((C)->string), (S)) ------------------ 1329| 3.18k| YY_BREAK ------------------ | | 1166| 3.18k|#define YY_BREAK /*LINTED*/break; ------------------ 1330| 242|case 10: ------------------ | Branch (1330:1): [True: 242, False: 191k] ------------------ 1331| 242|YY_RULE_SETUP ------------------ | | 1170| 242| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 242|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 242, False: 0] | | ------------------ | | 1171| 242| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 242|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 242| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 242|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 242|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 242| YY_USER_ACTION ------------------ 1332| 242|#line 85 "scanner.l" 1333| 242|{ libconfig_scanctx_append_char(yyextra, '\a'); } ------------------ | | 103| 242| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1334| 242| YY_BREAK ------------------ | | 1166| 242|#define YY_BREAK /*LINTED*/break; ------------------ 1335| 260|case 11: ------------------ | Branch (1335:1): [True: 260, False: 191k] ------------------ 1336| 260|YY_RULE_SETUP ------------------ | | 1170| 260| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 260|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 260, False: 0] | | ------------------ | | 1171| 260| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 260|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 260| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 260|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 260|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 260| YY_USER_ACTION ------------------ 1337| 260|#line 86 "scanner.l" 1338| 260|{ libconfig_scanctx_append_char(yyextra, '\b'); } ------------------ | | 103| 260| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1339| 260| YY_BREAK ------------------ | | 1166| 260|#define YY_BREAK /*LINTED*/break; ------------------ 1340| 330|case 12: ------------------ | Branch (1340:1): [True: 330, False: 191k] ------------------ 1341| 330|YY_RULE_SETUP ------------------ | | 1170| 330| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 330|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 330, False: 0] | | ------------------ | | 1171| 330| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 330|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 330| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 330|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 330|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 330| YY_USER_ACTION ------------------ 1342| 330|#line 87 "scanner.l" 1343| 330|{ libconfig_scanctx_append_char(yyextra, '\n'); } ------------------ | | 103| 330| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1344| 330| YY_BREAK ------------------ | | 1166| 330|#define YY_BREAK /*LINTED*/break; ------------------ 1345| 203|case 13: ------------------ | Branch (1345:1): [True: 203, False: 191k] ------------------ 1346| 203|YY_RULE_SETUP ------------------ | | 1170| 203| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 203|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 203, False: 0] | | ------------------ | | 1171| 203| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 203|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 203| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 203|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 203|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 203| YY_USER_ACTION ------------------ 1347| 203|#line 88 "scanner.l" 1348| 203|{ libconfig_scanctx_append_char(yyextra, '\r'); } ------------------ | | 103| 203| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1349| 203| YY_BREAK ------------------ | | 1166| 203|#define YY_BREAK /*LINTED*/break; ------------------ 1350| 301|case 14: ------------------ | Branch (1350:1): [True: 301, False: 191k] ------------------ 1351| 301|YY_RULE_SETUP ------------------ | | 1170| 301| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 301|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 301, False: 0] | | ------------------ | | 1171| 301| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 301|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 301| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 301|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 301|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 301| YY_USER_ACTION ------------------ 1352| 301|#line 89 "scanner.l" 1353| 301|{ libconfig_scanctx_append_char(yyextra, '\t'); } ------------------ | | 103| 301| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1354| 301| YY_BREAK ------------------ | | 1166| 301|#define YY_BREAK /*LINTED*/break; ------------------ 1355| 338|case 15: ------------------ | Branch (1355:1): [True: 338, False: 191k] ------------------ 1356| 338|YY_RULE_SETUP ------------------ | | 1170| 338| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 338|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 338, False: 0] | | ------------------ | | 1171| 338| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 338|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 338| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 338|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 338|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 338| YY_USER_ACTION ------------------ 1357| 338|#line 90 "scanner.l" 1358| 338|{ libconfig_scanctx_append_char(yyextra, '\v'); } ------------------ | | 103| 338| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1359| 338| YY_BREAK ------------------ | | 1166| 338|#define YY_BREAK /*LINTED*/break; ------------------ 1360| 329|case 16: ------------------ | Branch (1360:1): [True: 329, False: 191k] ------------------ 1361| 329|YY_RULE_SETUP ------------------ | | 1170| 329| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 329|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 329, False: 0] | | ------------------ | | 1171| 329| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 329|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 329| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 329|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 329|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 329| YY_USER_ACTION ------------------ 1362| 329|#line 91 "scanner.l" 1363| 329|{ libconfig_scanctx_append_char(yyextra, '\f'); } ------------------ | | 103| 329| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1364| 329| YY_BREAK ------------------ | | 1166| 329|#define YY_BREAK /*LINTED*/break; ------------------ 1365| 1.22k|case 17: ------------------ | Branch (1365:1): [True: 1.22k, False: 190k] ------------------ 1366| 1.22k|YY_RULE_SETUP ------------------ | | 1170| 1.22k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 1.22k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 1.22k, False: 0] | | ------------------ | | 1171| 1.22k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 1.22k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 1.22k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 1.22k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 1.22k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 1.22k| YY_USER_ACTION ------------------ 1367| 1.22k|#line 92 "scanner.l" 1368| 1.22k|{ libconfig_scanctx_append_char(yyextra, '\\'); } ------------------ | | 103| 1.22k| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1369| 1.22k| YY_BREAK ------------------ | | 1166| 1.22k|#define YY_BREAK /*LINTED*/break; ------------------ 1370| 542|case 18: ------------------ | Branch (1370:1): [True: 542, False: 191k] ------------------ 1371| 542|YY_RULE_SETUP ------------------ | | 1170| 542| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 542|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 542, False: 0] | | ------------------ | | 1171| 542| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 542|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 542| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 542|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 542|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 542| YY_USER_ACTION ------------------ 1372| 542|#line 93 "scanner.l" 1373| 542|{ libconfig_scanctx_append_char(yyextra, '\"'); } ------------------ | | 103| 542| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1374| 542| YY_BREAK ------------------ | | 1166| 542|#define YY_BREAK /*LINTED*/break; ------------------ 1375| 506|case 19: ------------------ | Branch (1375:1): [True: 506, False: 191k] ------------------ 1376| 506|YY_RULE_SETUP ------------------ | | 1170| 506| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 506|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 506, False: 0] | | ------------------ | | 1171| 506| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 506|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 506| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 506|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 506|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 506| YY_USER_ACTION ------------------ 1377| 506|#line 94 "scanner.l" 1378| 506|{ 1379| 506| char c = (char)(strtol(yytext + 2, NULL, 16) & 0xFF); ------------------ | | 348| 506|#define yytext yyg->yytext_r ------------------ 1380| 506| libconfig_scanctx_append_char(yyextra, c); ------------------ | | 103| 506| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1381| 506| } 1382| 506| YY_BREAK ------------------ | | 1166| 506|#define YY_BREAK /*LINTED*/break; ------------------ 1383| 1.11k|case 20: ------------------ | Branch (1383:1): [True: 1.11k, False: 190k] ------------------ 1384| 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 ------------------ 1385| 1.11k|#line 98 "scanner.l" 1386| 1.11k|{ libconfig_scanctx_append_char(yyextra, '\\'); } ------------------ | | 103| 1.11k| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1387| 1.11k| YY_BREAK ------------------ | | 1166| 1.11k|#define YY_BREAK /*LINTED*/break; ------------------ 1388| 3.04k|case 21: ------------------ | Branch (1388:1): [True: 3.04k, False: 188k] ------------------ 1389| 3.04k|YY_RULE_SETUP ------------------ | | 1170| 3.04k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 3.04k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 3.04k, False: 0] | | ------------------ | | 1171| 3.04k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 3.04k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 3.04k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 3.04k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 3.04k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 3.04k| YY_USER_ACTION ------------------ 1390| 3.04k|#line 99 "scanner.l" 1391| 3.04k|{ 1392| 3.04k| yylval->sval = libconfig_scanctx_take_string(yyextra); ------------------ | | 994| 3.04k| # define yylval yyg->yylval_r ------------------ yylval->sval = libconfig_scanctx_take_string(yyextra); ------------------ | | 346| 3.04k|#define yyextra yyg->yyextra_r ------------------ 1393| 3.04k| BEGIN INITIAL; ------------------ | | 357| 3.04k|#define BEGIN yyg->yy_start = 1 + 2 * ------------------ BEGIN INITIAL; ------------------ | | 938| 3.04k|#define INITIAL 0 ------------------ 1394| 3.04k| return(TOK_STRING); ------------------ | | 99| 3.04k|#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: 191k] ------------------ 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: 191k] ------------------ 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: 191k] ------------------ 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: 191k] ------------------ 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: 191k] ------------------ 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.76k|case 27: ------------------ | Branch (1444:1): [True: 2.76k, False: 189k] ------------------ 1445| |/* rule 27 can match eol */ 1446| 2.76k|YY_RULE_SETUP ------------------ | | 1170| 2.76k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 2.76k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 2.76k, False: 0] | | ------------------ | | 1171| 2.76k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 2.76k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 2.76k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 2.76k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 2.76k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 2.76k| YY_USER_ACTION ------------------ 1447| 2.76k|#line 132 "scanner.l" 1448| 2.76k|{ /* ignore */ } 1449| 2.76k| YY_BREAK ------------------ | | 1166| 2.76k|#define YY_BREAK /*LINTED*/break; ------------------ 1450| 2.72k|case 28: ------------------ | Branch (1450:1): [True: 2.72k, False: 189k] ------------------ 1451| 2.72k|YY_RULE_SETUP ------------------ | | 1170| 2.72k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 2.72k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 2.72k, False: 0] | | ------------------ | | 1171| 2.72k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 2.72k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 2.72k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 2.72k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 2.72k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 2.72k| YY_USER_ACTION ------------------ 1452| 2.72k|#line 133 "scanner.l" 1453| 2.72k|{ /* ignore */ } 1454| 2.72k| YY_BREAK ------------------ | | 1166| 2.72k|#define YY_BREAK /*LINTED*/break; ------------------ 1455| 13.7k|case 29: ------------------ | Branch (1455:1): [True: 13.7k, False: 178k] ------------------ 1456| 13.7k|YY_RULE_SETUP ------------------ | | 1170| 13.7k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 13.7k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 13.7k, False: 0] | | ------------------ | | 1171| 13.7k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 13.7k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 13.7k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 13.7k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 13.7k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 13.7k| YY_USER_ACTION ------------------ 1457| 13.7k|#line 135 "scanner.l" 1458| 13.7k|{ return(TOK_EQUALS); } ------------------ | | 101| 13.7k|#define TOK_EQUALS 270 ------------------ 1459| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1460| 29.3k|case 30: ------------------ | Branch (1460:1): [True: 29.3k, False: 162k] ------------------ 1461| 29.3k|YY_RULE_SETUP ------------------ | | 1170| 29.3k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 29.3k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 29.3k, False: 0] | | ------------------ | | 1171| 29.3k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 29.3k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 29.3k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 29.3k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 29.3k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 29.3k| YY_USER_ACTION ------------------ 1462| 29.3k|#line 136 "scanner.l" 1463| 29.3k|{ return(TOK_COMMA); } ------------------ | | 107| 29.3k|#define TOK_COMMA 276 ------------------ 1464| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1465| 4.88k|case 31: ------------------ | Branch (1465:1): [True: 4.88k, False: 186k] ------------------ 1466| 4.88k|YY_RULE_SETUP ------------------ | | 1170| 4.88k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 4.88k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 4.88k, False: 0] | | ------------------ | | 1171| 4.88k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 4.88k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 4.88k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 4.88k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 4.88k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 4.88k| YY_USER_ACTION ------------------ 1467| 4.88k|#line 137 "scanner.l" 1468| 4.88k|{ return(TOK_GROUP_START); } ------------------ | | 108| 4.88k|#define TOK_GROUP_START 277 ------------------ 1469| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1470| 3.85k|case 32: ------------------ | Branch (1470:1): [True: 3.85k, False: 187k] ------------------ 1471| 3.85k|YY_RULE_SETUP ------------------ | | 1170| 3.85k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 3.85k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 3.85k, False: 0] | | ------------------ | | 1171| 3.85k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 3.85k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 3.85k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 3.85k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 3.85k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 3.85k| YY_USER_ACTION ------------------ 1472| 3.85k|#line 138 "scanner.l" 1473| 3.85k|{ return(TOK_GROUP_END); } ------------------ | | 109| 3.85k|#define TOK_GROUP_END 278 ------------------ 1474| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1475| 1.13k|case 33: ------------------ | Branch (1475:1): [True: 1.13k, False: 190k] ------------------ 1476| 1.13k|YY_RULE_SETUP ------------------ | | 1170| 1.13k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 1.13k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 1.13k, False: 0] | | ------------------ | | 1171| 1.13k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 1.13k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 1.13k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 1.13k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 1.13k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 1.13k| YY_USER_ACTION ------------------ 1477| 1.13k|#line 139 "scanner.l" 1478| 1.13k|{ yylval->ival = 1; return(TOK_BOOLEAN); } ------------------ | | 994| 1.13k| # define yylval yyg->yylval_r ------------------ { yylval->ival = 1; return(TOK_BOOLEAN); } ------------------ | | 89| 1.13k|#define TOK_BOOLEAN 258 ------------------ 1479| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1480| 387|case 34: ------------------ | Branch (1480:1): [True: 387, False: 191k] ------------------ 1481| 387|YY_RULE_SETUP ------------------ | | 1170| 387| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 387|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 387, False: 0] | | ------------------ | | 1171| 387| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 387|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 387| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 387|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 387|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 387| YY_USER_ACTION ------------------ 1482| 387|#line 140 "scanner.l" 1483| 387|{ yylval->ival = 0; return(TOK_BOOLEAN); } ------------------ | | 994| 387| # define yylval yyg->yylval_r ------------------ { yylval->ival = 0; return(TOK_BOOLEAN); } ------------------ | | 89| 387|#define TOK_BOOLEAN 258 ------------------ 1484| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1485| 13.8k|case 35: ------------------ | Branch (1485:1): [True: 13.8k, False: 177k] ------------------ 1486| 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 ------------------ 1487| 13.8k|#line 141 "scanner.l" 1488| 13.8k|{ yylval->sval = yytext; return(TOK_NAME); } ------------------ | | 994| 13.8k| # define yylval yyg->yylval_r ------------------ { yylval->sval = yytext; return(TOK_NAME); } ------------------ | | 348| 13.8k|#define yytext yyg->yytext_r ------------------ { yylval->sval = yytext; return(TOK_NAME); } ------------------ | | 100| 13.8k|#define TOK_NAME 269 ------------------ 1489| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1490| 14.3k|case 36: ------------------ | Branch (1490:1): [True: 14.3k, False: 177k] ------------------ 1491| 14.3k|YY_RULE_SETUP ------------------ | | 1170| 14.3k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 14.3k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 14.3k, False: 0] | | ------------------ | | 1171| 14.3k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 14.3k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 14.3k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 14.3k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 14.3k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 14.3k| YY_USER_ACTION ------------------ 1492| 14.3k|#line 142 "scanner.l" 1493| 14.3k|{ yylval->fval = atof(yytext); return(TOK_FLOAT); } ------------------ | | 994| 14.3k| # define yylval yyg->yylval_r ------------------ { yylval->fval = atof(yytext); return(TOK_FLOAT); } ------------------ | | 348| 14.3k|#define yytext yyg->yytext_r ------------------ { yylval->fval = atof(yytext); return(TOK_FLOAT); } ------------------ | | 98| 14.3k|#define TOK_FLOAT 267 ------------------ 1494| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1495| 7.33k|case 37: ------------------ | Branch (1495:1): [True: 7.33k, False: 184k] ------------------ 1496| 7.33k|YY_RULE_SETUP ------------------ | | 1170| 7.33k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 7.33k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 7.33k, False: 0] | | ------------------ | | 1171| 7.33k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 7.33k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 7.33k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 7.33k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 7.33k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 7.33k| YY_USER_ACTION ------------------ 1497| 7.33k|#line 143 "scanner.l" 1498| 7.33k|{ 1499| 7.33k| long long llval; 1500| 7.33k| int is_long; 1501| | 1502| 7.33k| if(!libconfig_parse_integer(yytext, 10, &llval, &is_long)) ------------------ | | 348| 7.33k|#define yytext yyg->yytext_r ------------------ | Branch (1502:24): [True: 6, False: 7.33k] ------------------ 1503| 6| return(TOK_ERROR); ------------------ | | 112| 6|#define TOK_ERROR 281 ------------------ 1504| | 1505| 7.33k| if(is_long) ------------------ | Branch (1505:24): [True: 388, False: 6.94k] ------------------ 1506| 388| { 1507| 388| yylval->llval = llval; ------------------ | | 994| 388| # define yylval yyg->yylval_r ------------------ 1508| 388| return(TOK_INTEGER64); ------------------ | | 94| 388|#define TOK_INTEGER64 263 ------------------ 1509| 388| } 1510| 6.94k| else 1511| 6.94k| { 1512| 6.94k| yylval->ival = (int)llval; ------------------ | | 994| 6.94k| # define yylval yyg->yylval_r ------------------ 1513| 6.94k| return(TOK_INTEGER); ------------------ | | 90| 6.94k|#define TOK_INTEGER 259 ------------------ 1514| 6.94k| } 1515| 7.33k| } 1516| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1517| 1.85k|case 38: ------------------ | Branch (1517:1): [True: 1.85k, False: 189k] ------------------ 1518| 1.85k|YY_RULE_SETUP ------------------ | | 1170| 1.85k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 1.85k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 1.85k, False: 0] | | ------------------ | | 1171| 1.85k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 1.85k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 1.85k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 1.85k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 1.85k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 1.85k| YY_USER_ACTION ------------------ 1519| 1.85k|#line 161 "scanner.l" 1520| 1.85k|{ 1521| 1.85k| int is_long; 1522| | 1523| 1.85k| if(!libconfig_parse_integer(yytext, 10, &(yylval->llval), ------------------ | | 348| 1.85k|#define yytext yyg->yytext_r ------------------ if(!libconfig_parse_integer(yytext, 10, &(yylval->llval), ------------------ | | 994| 1.85k| # define yylval yyg->yylval_r ------------------ | Branch (1523:24): [True: 2, False: 1.85k] ------------------ 1524| 1.85k| &is_long)) 1525| 2| return(TOK_ERROR); ------------------ | | 112| 2|#define TOK_ERROR 281 ------------------ 1526| | 1527| 1.85k| return(TOK_INTEGER64); ------------------ | | 94| 1.85k|#define TOK_INTEGER64 263 ------------------ 1528| 1.85k| } 1529| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1530| 2.30k|case 39: ------------------ | Branch (1530:1): [True: 2.30k, False: 189k] ------------------ 1531| 2.30k|YY_RULE_SETUP ------------------ | | 1170| 2.30k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 2.30k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 2.30k, False: 0] | | ------------------ | | 1171| 2.30k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 2.30k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 2.30k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 2.30k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 2.30k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 2.30k| YY_USER_ACTION ------------------ 1532| 2.30k|#line 170 "scanner.l" 1533| 2.30k|{ 1534| 2.30k| long long llval; 1535| 2.30k| int is_long; 1536| | 1537| 2.30k| if(!libconfig_parse_integer(yytext + 2, 2, &llval, &is_long)) ------------------ | | 348| 2.30k|#define yytext yyg->yytext_r ------------------ | Branch (1537:24): [True: 2, False: 2.30k] ------------------ 1538| 2| return(TOK_ERROR); ------------------ | | 112| 2|#define TOK_ERROR 281 ------------------ 1539| | 1540| 2.30k| if(is_long) ------------------ | Branch (1540:24): [True: 1.09k, False: 1.20k] ------------------ 1541| 1.09k| { 1542| 1.09k| yylval->llval = llval; ------------------ | | 994| 1.09k| # define yylval yyg->yylval_r ------------------ 1543| 1.09k| return(TOK_BIN64); ------------------ | | 96| 1.09k|#define TOK_BIN64 265 ------------------ 1544| 1.09k| } 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.30k| } 1551| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1552| 1.40k|case 40: ------------------ | Branch (1552:1): [True: 1.40k, False: 190k] ------------------ 1553| 1.40k|YY_RULE_SETUP ------------------ | | 1170| 1.40k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 1.40k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 1.40k, False: 0] | | ------------------ | | 1171| 1.40k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 1.40k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 1.40k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 1.40k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 1.40k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 1.40k| YY_USER_ACTION ------------------ 1554| 1.40k|#line 188 "scanner.l" 1555| 1.40k|{ 1556| 1.40k| long long llval; 1557| 1.40k| int is_long; 1558| | 1559| 1.40k| if(!libconfig_parse_integer(yytext + 2, 8, &llval, &is_long)) ------------------ | | 348| 1.40k|#define yytext yyg->yytext_r ------------------ | Branch (1559:24): [True: 0, False: 1.40k] ------------------ 1560| 0| return(TOK_ERROR); ------------------ | | 112| 0|#define TOK_ERROR 281 ------------------ 1561| | 1562| 1.40k| if(is_long) ------------------ | Branch (1562:24): [True: 549, False: 854] ------------------ 1563| 549| { 1564| 549| yylval->llval = llval; ------------------ | | 994| 549| # define yylval yyg->yylval_r ------------------ 1565| 549| return(TOK_OCT64); ------------------ | | 97| 549|#define TOK_OCT64 266 ------------------ 1566| 549| } 1567| 854| else 1568| 854| { 1569| 854| yylval->ival = (int)llval; ------------------ | | 994| 854| # define yylval yyg->yylval_r ------------------ 1570| 854| return(TOK_OCT); ------------------ | | 93| 854|#define TOK_OCT 262 ------------------ 1571| 854| } 1572| 1.40k| } 1573| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1574| 2.85k|case 41: ------------------ | Branch (1574:1): [True: 2.85k, False: 188k] ------------------ 1575| 2.85k|YY_RULE_SETUP ------------------ | | 1170| 2.85k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 2.85k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 2.85k, False: 0] | | ------------------ | | 1171| 2.85k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 2.85k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 2.85k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 2.85k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 2.85k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 2.85k| YY_USER_ACTION ------------------ 1576| 2.85k|#line 206 "scanner.l" 1577| 2.85k|{ 1578| 2.85k| long long llval; 1579| 2.85k| int is_long; 1580| | 1581| 2.85k| if(!libconfig_parse_integer(yytext + 2, 16, &llval, ------------------ | | 348| 2.85k|#define yytext yyg->yytext_r ------------------ | Branch (1581:24): [True: 1, False: 2.85k] ------------------ 1582| 2.85k| &is_long)) 1583| 1| return(TOK_ERROR); ------------------ | | 112| 1|#define TOK_ERROR 281 ------------------ 1584| | 1585| 2.85k| if(is_long) ------------------ | Branch (1585:24): [True: 1.10k, False: 1.75k] ------------------ 1586| 1.10k| { 1587| 1.10k| yylval->llval = llval; ------------------ | | 994| 1.10k| # define yylval yyg->yylval_r ------------------ 1588| 1.10k| return(TOK_HEX64); ------------------ | | 95| 1.10k|#define TOK_HEX64 264 ------------------ 1589| 1.10k| } 1590| 1.75k| else 1591| 1.75k| { 1592| 1.75k| yylval->ival = (int)llval; ------------------ | | 994| 1.75k| # define yylval yyg->yylval_r ------------------ 1593| 1.75k| return(TOK_HEX); ------------------ | | 91| 1.75k|#define TOK_HEX 260 ------------------ 1594| 1.75k| } 1595| 2.85k| } 1596| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1597| 1.71k|case 42: ------------------ | Branch (1597:1): [True: 1.71k, False: 190k] ------------------ 1598| 1.71k|YY_RULE_SETUP ------------------ | | 1170| 1.71k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 1.71k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 1.71k, False: 0] | | ------------------ | | 1171| 1.71k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 1.71k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 1.71k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 1.71k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 1.71k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 1.71k| YY_USER_ACTION ------------------ 1599| 1.71k|#line 225 "scanner.l" 1600| 1.71k|{ return(TOK_ARRAY_START); } ------------------ | | 103| 1.71k|#define TOK_ARRAY_START 272 ------------------ 1601| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1602| 1.64k|case 43: ------------------ | Branch (1602:1): [True: 1.64k, False: 190k] ------------------ 1603| 1.64k|YY_RULE_SETUP ------------------ | | 1170| 1.64k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 1.64k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 1.64k, False: 0] | | ------------------ | | 1171| 1.64k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 1.64k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 1.64k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 1.64k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 1.64k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 1.64k| YY_USER_ACTION ------------------ 1604| 1.64k|#line 226 "scanner.l" 1605| 1.64k|{ return(TOK_ARRAY_END); } ------------------ | | 104| 1.64k|#define TOK_ARRAY_END 273 ------------------ 1606| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1607| 46.0k|case 44: ------------------ | Branch (1607:1): [True: 46.0k, False: 145k] ------------------ 1608| 46.0k|YY_RULE_SETUP ------------------ | | 1170| 46.0k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 46.0k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 46.0k, False: 0] | | ------------------ | | 1171| 46.0k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 46.0k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 46.0k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 46.0k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 46.0k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 46.0k| YY_USER_ACTION ------------------ 1609| 46.0k|#line 227 "scanner.l" 1610| 46.0k|{ return(TOK_LIST_START); } ------------------ | | 105| 46.0k|#define TOK_LIST_START 274 ------------------ 1611| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1612| 1.80k|case 45: ------------------ | Branch (1612:1): [True: 1.80k, False: 189k] ------------------ 1613| 1.80k|YY_RULE_SETUP ------------------ | | 1170| 1.80k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 1.80k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 1.80k, False: 0] | | ------------------ | | 1171| 1.80k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 1.80k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 1.80k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 1.80k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 1.80k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 1.80k| YY_USER_ACTION ------------------ 1614| 1.80k|#line 228 "scanner.l" 1615| 1.80k|{ return(TOK_LIST_END); } ------------------ | | 106| 1.80k|#define TOK_LIST_END 275 ------------------ 1616| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1617| 1.10k|case 46: ------------------ | Branch (1617:1): [True: 1.10k, False: 190k] ------------------ 1618| 1.10k|YY_RULE_SETUP ------------------ | | 1170| 1.10k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 1.10k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 1.10k, False: 0] | | ------------------ | | 1171| 1.10k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 1.10k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 1.10k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 1.10k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 1.10k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 1.10k| YY_USER_ACTION ------------------ 1619| 1.10k|#line 229 "scanner.l" 1620| 1.10k|{ return(TOK_SEMICOLON); } ------------------ | | 110| 1.10k|#define TOK_SEMICOLON 279 ------------------ 1621| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1622| 86|case 47: ------------------ | Branch (1622:1): [True: 86, False: 191k] ------------------ 1623| 86|YY_RULE_SETUP ------------------ | | 1170| 86| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 86|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 86, False: 0] | | ------------------ | | 1171| 86| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 86|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 86| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 86|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 86|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 86| YY_USER_ACTION ------------------ 1624| 86|#line 230 "scanner.l" 1625| 86|{ return(TOK_GARBAGE); } ------------------ | | 111| 86|#define TOK_GARBAGE 280 ------------------ 1626| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1627| 1.47k|case YY_STATE_EOF(INITIAL): ------------------ | | 365| 1.47k|#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) | | ------------------ | | | | 584| 1.47k|#define YY_END_OF_BUFFER 49 | | ------------------ ------------------ | Branch (1627:1): [True: 1.47k, False: 190k] ------------------ 1628| 1.57k|case YY_STATE_EOF(SINGLE_LINE_COMMENT): ------------------ | | 365| 1.57k|#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) | | ------------------ | | | | 584| 1.57k|#define YY_END_OF_BUFFER 49 | | ------------------ ------------------ | Branch (1628:1): [True: 95, False: 191k] ------------------ 1629| 1.60k|case YY_STATE_EOF(MULTI_LINE_COMMENT): ------------------ | | 365| 1.60k|#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) | | ------------------ | | | | 584| 1.60k|#define YY_END_OF_BUFFER 49 | | ------------------ ------------------ | Branch (1629:1): [True: 32, False: 191k] ------------------ 1630| 1.83k|case YY_STATE_EOF(STRING): ------------------ | | 365| 1.83k|#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) | | ------------------ | | | | 584| 1.83k|#define YY_END_OF_BUFFER 49 | | ------------------ ------------------ | Branch (1630:1): [True: 230, False: 191k] ------------------ 1631| 1.83k|case YY_STATE_EOF(INCLUDE): ------------------ | | 365| 1.83k|#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) | | ------------------ | | | | 584| 1.83k|#define YY_END_OF_BUFFER 49 | | ------------------ ------------------ | Branch (1631:1): [True: 0, False: 191k] ------------------ 1632| 1.83k|#line 232 "scanner.l" 1633| 1.83k|{ 1634| 1.83k| const char *error = NULL; 1635| 1.83k| FILE *fp; 1636| | 1637| 1.83k| fp = libconfig_scanctx_next_include_file(yyextra, &error); ------------------ | | 346| 1.83k|#define yyextra yyg->yyextra_r ------------------ 1638| 1.83k| if(fp) ------------------ | Branch (1638:6): [True: 0, False: 1.83k] ------------------ 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.83k| else if(error) ------------------ | Branch (1645:11): [True: 0, False: 1.83k] ------------------ 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.83k| else 1653| 1.83k| { 1654| | /* No more files in the current include list. */ 1655| 1.83k| YY_BUFFER_STATE buf = (YY_BUFFER_STATE)libconfig_scanctx_pop_include(yyextra); ------------------ | | 346| 1.83k|#define yyextra yyg->yyextra_r ------------------ 1656| 1.83k| if(buf) ------------------ | Branch (1656:8): [True: 0, False: 1.83k] ------------------ 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.83k| else 1662| 1.83k| yyterminate(); ------------------ | | 1129| 1.83k|#define yyterminate() return YY_NULL | | ------------------ | | | | 329| 1.83k|#define YY_NULL 0 | | ------------------ ------------------ 1663| 1.83k| } 1664| 1.83k|} 1665| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1666| 0|case 48: ------------------ | Branch (1666:1): [True: 0, False: 191k] ------------------ 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.80k| case YY_END_OF_BUFFER: ------------------ | | 584| 3.80k|#define YY_END_OF_BUFFER 49 ------------------ | Branch (1673:2): [True: 3.80k, False: 187k] ------------------ 1674| 3.80k| { 1675| | /* Amount of text matched not including the EOB char. */ 1676| 3.80k| int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; ------------------ | | 567| 3.80k|#define yytext_ptr yytext_r ------------------ 1677| | 1678| | /* Undo the effects of YY_DO_BEFORE_ACTION. */ 1679| 3.80k| *yy_cp = yyg->yy_hold_char; 1680| 3.80k| YY_RESTORE_YY_MORE_OFFSET 1681| | 1682| 3.80k| if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) ------------------ | | 515| 3.80k|#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.80k|#define YY_BUFFER_NEW 0 ------------------ | Branch (1682:8): [True: 1.98k, False: 1.82k] ------------------ 1683| 1.98k| { 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| 1.98k| yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; ------------------ | | 515| 1.98k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 1694| 1.98k| YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; ------------------ | | 515| 1.98k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; ------------------ | | 344| 1.98k|#define yyin yyg->yyin_r ------------------ 1695| 1.98k| YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; ------------------ | | 515| 1.98k|#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| 1.98k|#define YY_BUFFER_NORMAL 1 ------------------ 1696| 1.98k| } 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.80k| if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) ------------------ | | 515| 3.80k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ | Branch (1705:8): [True: 0, False: 3.80k] ------------------ 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.80k| else switch ( yy_get_next_buffer( yyscanner ) ) ------------------ | Branch (1742:17): [True: 3.80k, False: 0] ------------------ 1743| 3.80k| { 1744| 1.83k| case EOB_ACT_END_OF_FILE: ------------------ | | 398| 1.83k|#define EOB_ACT_END_OF_FILE 1 ------------------ | Branch (1744:4): [True: 1.83k, False: 1.97k] ------------------ 1745| 1.83k| { 1746| 1.83k| yyg->yy_did_buffer_switch_on_eof = 0; 1747| | 1748| 1.83k| if ( yywrap( yyscanner ) ) ------------------ | | 206| 1.83k|#define yywrap libconfig_yywrap | | ------------------ | | | | 561| 1.83k|#define libconfig_yywrap(yyscanner) (/*CONSTCOND*/1) | | | | ------------------ | | | | | Branch (561:37): [True: 1.83k, Folded] | | | | ------------------ | | ------------------ ------------------ 1749| 1.83k| { 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.83k| yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; ------------------ | | 567| 1.83k|#define yytext_ptr yytext_r ------------------ yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; ------------------ | | 888| 1.83k|#define YY_MORE_ADJ 0 ------------------ 1760| | 1761| 1.83k| yy_act = YY_STATE_EOF(YY_START); ------------------ | | 365| 1.83k|#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) | | ------------------ | | | | 584| 1.83k|#define YY_END_OF_BUFFER 49 | | ------------------ ------------------ 1762| 1.83k| goto do_action; 1763| 1.83k| } 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.83k| } 1772| | 1773| 0| case EOB_ACT_CONTINUE_SCAN: ------------------ | | 397| 0|#define EOB_ACT_CONTINUE_SCAN 0 ------------------ | Branch (1773:4): [True: 0, False: 3.80k] ------------------ 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| 1.97k| case EOB_ACT_LAST_MATCH: ------------------ | | 399| 1.97k|#define EOB_ACT_LAST_MATCH 2 ------------------ | Branch (1783:4): [True: 1.97k, False: 1.83k] ------------------ 1784| 1.97k| yyg->yy_c_buf_p = 1785| 1.97k| &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; ------------------ | | 515| 1.97k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 1786| | 1787| 1.97k| yy_current_state = yy_get_previous_state( yyscanner ); 1788| | 1789| 1.97k| yy_cp = yyg->yy_c_buf_p; 1790| 1.97k| yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; ------------------ | | 567| 1.97k|#define yytext_ptr yytext_r ------------------ yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; ------------------ | | 888| 1.97k|#define YY_MORE_ADJ 0 ------------------ 1791| 1.97k| goto yy_find_action; 1792| 3.80k| } 1793| 0| break; 1794| 3.80k| } 1795| | 1796| 0| default: ------------------ | Branch (1796:2): [True: 0, False: 191k] ------------------ 1797| 0| YY_FATAL_ERROR( ------------------ | | 1139| 0|#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) ------------------ 1798| 191k| "fatal flex scanner internal error--no action found" ); 1799| 191k| } /* end of action switch */ 1800| 191k| } /* end of scanning one token */ 1801| 154k| } /* end of user's declarations */ 1802| 154k|} /* end of yylex */ libconfig_yy_switch_to_buffer: 2120| 2.13k|{ 2121| 2.13k| 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.13k| yyensure_buffer_stack (yyscanner); ------------------ | | 86| 2.13k|#define yyensure_buffer_stack libconfig_yyensure_buffer_stack ------------------ 2129| 2.13k| if ( YY_CURRENT_BUFFER == new_buffer ) ------------------ | | 509| 2.13k|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:29): [True: 2.13k, False: 0] | | ------------------ | | 510| 2.13k| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 2.13k| : NULL) ------------------ | Branch (2129:7): [True: 0, False: 2.13k] ------------------ 2130| 0| return; 2131| | 2132| 2.13k| if ( YY_CURRENT_BUFFER ) ------------------ | | 509| 2.13k|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:27): [True: 0, False: 2.13k] | | | Branch (509:29): [True: 2.13k, False: 0] | | ------------------ | | 510| 2.13k| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 2.13k| : 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.13k| YY_CURRENT_BUFFER_LVALUE = new_buffer; ------------------ | | 515| 2.13k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 2141| 2.13k| yy_load_buffer_state( yyscanner ); ------------------ | | 62| 2.13k|#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.13k| yyg->yy_did_buffer_switch_on_eof = 1; 2149| 2.13k|} libconfig_yy_delete_buffer: 2195| 2.13k|{ 2196| 2.13k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2197| | 2198| 2.13k| if ( ! b ) ------------------ | Branch (2198:7): [True: 0, False: 2.13k] ------------------ 2199| 0| return; 2200| | 2201| 2.13k| if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ ------------------ | | 509| 2.13k|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:29): [True: 2.13k, False: 0] | | ------------------ | | 510| 2.13k| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 2.13k| : NULL) ------------------ | Branch (2201:7): [True: 2.13k, False: 0] ------------------ 2202| 2.13k| YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; ------------------ | | 515| 2.13k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 2203| | 2204| 2.13k| if ( b->yy_is_our_buffer ) ------------------ | Branch (2204:7): [True: 2.13k, False: 0] ------------------ 2205| 2.13k| yyfree( (void *) b->yy_ch_buf , yyscanner ); ------------------ | | 236| 2.13k|#define yyfree libconfig_yyfree ------------------ 2206| | 2207| 2.13k| yyfree( (void *) b , yyscanner ); ------------------ | | 236| 2.13k|#define yyfree libconfig_yyfree ------------------ 2208| 2.13k|} libconfig_yypop_buffer_state: 2305| 2.13k|{ 2306| 2.13k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2307| 2.13k| if (!YY_CURRENT_BUFFER) ------------------ | | 509| 2.13k|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:29): [True: 2.13k, False: 0] | | ------------------ | | 510| 2.13k| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 2.13k| : NULL) ------------------ | Branch (2307:6): [True: 2.13k, False: 0] ------------------ 2308| 2.13k| 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.13k|{ 2376| 2.13k| YY_BUFFER_STATE b; 2377| | 2378| 2.13k| if ( size < 2 || ------------------ | Branch (2378:7): [True: 0, False: 2.13k] ------------------ 2379| 2.13k| base[size-2] != YY_END_OF_BUFFER_CHAR || ------------------ | | 368| 4.27k|#define YY_END_OF_BUFFER_CHAR 0 ------------------ | Branch (2379:7): [True: 0, False: 2.13k] ------------------ 2380| 2.13k| base[size-1] != YY_END_OF_BUFFER_CHAR ) ------------------ | | 368| 2.13k|#define YY_END_OF_BUFFER_CHAR 0 ------------------ | Branch (2380:7): [True: 0, False: 2.13k] ------------------ 2381| | /* They forgot to leave room for the EOB's. */ 2382| 0| return NULL; 2383| | 2384| 2.13k| b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); ------------------ | | 224| 2.13k|#define yyalloc libconfig_yyalloc ------------------ 2385| 2.13k| if ( ! b ) ------------------ | Branch (2385:7): [True: 0, False: 2.13k] ------------------ 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.13k| b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ 2389| 2.13k| b->yy_buf_pos = b->yy_ch_buf = base; 2390| 2.13k| b->yy_is_our_buffer = 0; 2391| 2.13k| b->yy_input_file = NULL; 2392| 2.13k| b->yy_n_chars = b->yy_buf_size; 2393| 2.13k| b->yy_is_interactive = 0; 2394| 2.13k| b->yy_at_bol = 1; 2395| 2.13k| b->yy_fill_buffer = 0; 2396| 2.13k| b->yy_buffer_status = YY_BUFFER_NEW; ------------------ | | 486| 2.13k|#define YY_BUFFER_NEW 0 ------------------ 2397| | 2398| 2.13k| yy_switch_to_buffer( b , yyscanner ); ------------------ | | 68| 2.13k|#define yy_switch_to_buffer libconfig_yy_switch_to_buffer ------------------ 2399| | 2400| 2.13k| return b; 2401| 2.13k|} libconfig_yy_scan_string: 2412| 2.13k|{ 2413| | 2414| 2.13k| return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); ------------------ | | 44| 2.13k|#define yy_scan_bytes libconfig_yy_scan_bytes ------------------ 2415| 2.13k|} libconfig_yy_scan_bytes: 2425| 2.13k|{ 2426| 2.13k| YY_BUFFER_STATE b; 2427| 2.13k| char *buf; 2428| 2.13k| yy_size_t n; 2429| 2.13k| int i; 2430| | 2431| | /* Get memory for full buffer, including space for trailing EOB's. */ 2432| 2.13k| n = (yy_size_t) (_yybytes_len + 2); 2433| 2.13k| buf = (char *) yyalloc( n , yyscanner ); ------------------ | | 224| 2.13k|#define yyalloc libconfig_yyalloc ------------------ 2434| 2.13k| if ( ! buf ) ------------------ | Branch (2434:7): [True: 0, False: 2.13k] ------------------ 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| 357k| for ( i = 0; i < _yybytes_len; ++i ) ------------------ | Branch (2437:15): [True: 355k, False: 2.13k] ------------------ 2438| 355k| buf[i] = yybytes[i]; 2439| | 2440| 2.13k| buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; ------------------ | | 368| 2.13k|#define YY_END_OF_BUFFER_CHAR 0 ------------------ 2441| | 2442| 2.13k| b = yy_scan_buffer( buf, n , yyscanner); ------------------ | | 32| 2.13k|#define yy_scan_buffer libconfig_yy_scan_buffer ------------------ 2443| 2.13k| if ( ! b ) ------------------ | Branch (2443:7): [True: 0, False: 2.13k] ------------------ 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.13k| b->yy_is_our_buffer = 1; 2450| | 2451| 2.13k| return b; 2452| 2.13k|} libconfig_yyget_lineno: 2498| 86.5k|{ 2499| 86.5k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2500| | 2501| 86.5k| if (! YY_CURRENT_BUFFER) ------------------ | | 509| 86.5k|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:29): [True: 86.5k, False: 0] | | ------------------ | | 510| 86.5k| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 86.5k| : NULL) ------------------ | Branch (2501:13): [True: 0, False: 86.5k] ------------------ 2502| 0| return 0; 2503| | 2504| 86.5k| return yylineno; ------------------ | | 349| 86.5k|#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) | | ------------------ | | | | 515| 86.5k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ ------------------ 2505| 86.5k|} libconfig_yyset_extra: 2562| 4.27k|{ 2563| 4.27k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2564| 4.27k| yyextra = user_defined ; ------------------ | | 346| 4.27k|#define yyextra yyg->yyextra_r ------------------ 2565| 4.27k|} libconfig_yyset_lineno: 2572| 2.13k|{ 2573| 2.13k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2574| | 2575| | /* lineno is only valid if an input buffer exists. */ 2576| 2.13k| if (! YY_CURRENT_BUFFER ) ------------------ | | 509| 2.13k|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:29): [True: 2.13k, False: 0] | | ------------------ | | 510| 2.13k| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 2.13k| : NULL) ------------------ | Branch (2576:13): [True: 0, False: 2.13k] ------------------ 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.13k| yylineno = _line_number; ------------------ | | 349| 2.13k|#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) | | ------------------ | | | | 515| 2.13k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ ------------------ 2580| 2.13k|} libconfig_yylex_init_extra: 2675| 2.13k|{ 2676| 2.13k| struct yyguts_t dummy_yyguts; 2677| | 2678| 2.13k| yyset_extra (yy_user_defined, &dummy_yyguts); ------------------ | | 140| 2.13k|#define yyset_extra libconfig_yyset_extra ------------------ 2679| | 2680| 2.13k| if (ptr_yy_globals == NULL){ ------------------ | Branch (2680:9): [True: 0, False: 2.13k] ------------------ 2681| 0| errno = EINVAL; 2682| 0| return 1; 2683| 0| } 2684| | 2685| 2.13k| *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); ------------------ | | 224| 2.13k|#define yyalloc libconfig_yyalloc ------------------ 2686| | 2687| 2.13k| if (*ptr_yy_globals == NULL){ ------------------ | Branch (2687:9): [True: 0, False: 2.13k] ------------------ 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.13k| memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); 2695| | 2696| 2.13k| yyset_extra (yy_user_defined, *ptr_yy_globals); ------------------ | | 140| 2.13k|#define yyset_extra libconfig_yyset_extra ------------------ 2697| | 2698| 2.13k| return yy_init_globals ( *ptr_yy_globals ); 2699| 2.13k|} libconfig_yylex_destroy: 2736| 2.13k|{ 2737| 2.13k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2738| | 2739| | /* Pop the buffer stack, destroying each element. */ 2740| 4.27k| while(YY_CURRENT_BUFFER){ ------------------ | | 509| 4.27k|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:27): [True: 2.13k, False: 2.13k] | | | Branch (509:29): [True: 4.27k, False: 0] | | ------------------ | | 510| 4.27k| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 4.27k| : NULL) ------------------ 2741| 2.13k| yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); ------------------ | | 26| 2.13k|#define yy_delete_buffer libconfig_yy_delete_buffer ------------------ yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); ------------------ | | 509| 2.13k|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:29): [True: 2.13k, False: 0] | | ------------------ | | 510| 2.13k| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 2.13k| : NULL) ------------------ 2742| 2.13k| YY_CURRENT_BUFFER_LVALUE = NULL; ------------------ | | 515| 2.13k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 2743| 2.13k| yypop_buffer_state(yyscanner); ------------------ | | 80| 2.13k|#define yypop_buffer_state libconfig_yypop_buffer_state ------------------ 2744| 2.13k| } 2745| | 2746| | /* Destroy the stack itself. */ 2747| 2.13k| yyfree(yyg->yy_buffer_stack , yyscanner); ------------------ | | 236| 2.13k|#define yyfree libconfig_yyfree ------------------ 2748| 2.13k| yyg->yy_buffer_stack = NULL; 2749| | 2750| | /* Destroy the start condition stack. */ 2751| 2.13k| yyfree( yyg->yy_start_stack , yyscanner ); ------------------ | | 236| 2.13k|#define yyfree libconfig_yyfree ------------------ 2752| 2.13k| 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.13k| yy_init_globals( yyscanner); 2757| | 2758| | /* Destroy the main struct (reentrant only). */ 2759| 2.13k| yyfree ( yyscanner , yyscanner ); ------------------ | | 236| 2.13k|#define yyfree libconfig_yyfree ------------------ 2760| | yyscanner = NULL; 2761| 2.13k| return 0; 2762| 2.13k|} libconfig_yyfree: 2792| 10.6k|{ 2793| 10.6k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2794| 10.6k| (void)yyg; 2795| 10.6k| free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ 2796| 10.6k|} libconfig_yyalloc: 2804| 8.55k|{ 2805| 8.55k| return(libconfig_malloc(bytes)); 2806| 8.55k|} scanner.c:yy_get_next_buffer: 1812| 3.80k|{ 1813| 3.80k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1814| 3.80k| char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; ------------------ | | 515| 3.80k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 1815| 3.80k| char *source = yyg->yytext_ptr; ------------------ | | 567| 3.80k|#define yytext_ptr yytext_r ------------------ 1816| 3.80k| int number_to_move, i; 1817| 3.80k| int ret_val; 1818| | 1819| 3.80k| if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) ------------------ | | 515| 3.80k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ | Branch (1819:7): [True: 0, False: 3.80k] ------------------ 1820| 0| YY_FATAL_ERROR( ------------------ | | 1139| 0|#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) ------------------ 1821| 3.80k| "fatal flex scanner internal error--end of buffer missed" ); 1822| | 1823| 3.80k| if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) ------------------ | | 515| 3.80k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ | Branch (1823:7): [True: 3.80k, False: 0] ------------------ 1824| 3.80k| { /* Don't try to fill the buffer, so this is an EOF. */ 1825| 3.80k| if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) ------------------ | | 567| 3.80k|#define yytext_ptr yytext_r ------------------ if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) ------------------ | | 888| 3.80k|#define YY_MORE_ADJ 0 ------------------ | Branch (1825:8): [True: 1.83k, False: 1.97k] ------------------ 1826| 1.83k| { 1827| | /* We matched a single character, the EOB, so 1828| | * treat this as a final EOF. 1829| | */ 1830| 1.83k| return EOB_ACT_END_OF_FILE; ------------------ | | 398| 1.83k|#define EOB_ACT_END_OF_FILE 1 ------------------ 1831| 1.83k| } 1832| | 1833| 1.97k| else 1834| 1.97k| { 1835| | /* We matched some text prior to the EOB, first 1836| | * process it. 1837| | */ 1838| 1.97k| return EOB_ACT_LAST_MATCH; ------------------ | | 399| 1.97k|#define EOB_ACT_LAST_MATCH 2 ------------------ 1839| 1.97k| } 1840| 3.80k| } 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| 1.97k|{ 1952| 1.97k| yy_state_type yy_current_state; 1953| 1.97k| char *yy_cp; 1954| 1.97k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1955| | 1956| 1.97k| yy_current_state = yyg->yy_start; 1957| 1.97k| yy_current_state += YY_AT_BOL(); ------------------ | | 557| 1.97k|#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) | | ------------------ | | | | 515| 1.97k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ ------------------ 1958| | 1959| 25.3k| for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) ------------------ | | 567| 1.97k|#define yytext_ptr yytext_r ------------------ for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) ------------------ | | 888| 1.97k|#define YY_MORE_ADJ 0 ------------------ | Branch (1959:47): [True: 23.4k, False: 1.97k] ------------------ 1960| 23.4k| { 1961| 23.4k| YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); ------------------ | | 334| 23.4k|#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) ------------------ | Branch (1961:19): [True: 23.4k, False: 0] ------------------ 1962| 23.4k| if ( yy_accept[yy_current_state] ) ------------------ | Branch (1962:8): [True: 21.1k, False: 2.24k] ------------------ 1963| 21.1k| { 1964| 21.1k| yyg->yy_last_accepting_state = yy_current_state; 1965| 21.1k| yyg->yy_last_accepting_cpos = yy_cp; 1966| 21.1k| } 1967| 39.1k| while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) ------------------ | Branch (1967:11): [True: 15.7k, False: 23.4k] ------------------ 1968| 15.7k| { 1969| 15.7k| yy_current_state = (int) yy_def[yy_current_state]; 1970| 15.7k| if ( yy_current_state >= 214 ) ------------------ | Branch (1970:9): [True: 15.5k, False: 138] ------------------ 1971| 15.5k| yy_c = yy_meta[yy_c]; 1972| 15.7k| } 1973| 23.4k| yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; 1974| 23.4k| } 1975| | 1976| 1.97k| return yy_current_state; 1977| 1.97k|} scanner.c:libconfig_yy_load_buffer_state: 2152| 4.27k|{ 2153| 4.27k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2154| 4.27k| yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; ------------------ | | 515| 4.27k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 2155| 4.27k| yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; ------------------ | | 567| 4.27k|#define yytext_ptr yytext_r ------------------ yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; ------------------ | | 515| 4.27k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 2156| 4.27k| yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; ------------------ | | 344| 4.27k|#define yyin yyg->yyin_r ------------------ yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; ------------------ | | 515| 4.27k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 2157| 4.27k| yyg->yy_hold_char = *yyg->yy_c_buf_p; 2158| 4.27k|} scanner.c:libconfig_yyensure_buffer_stack: 2325| 2.13k|{ 2326| 2.13k| yy_size_t num_to_alloc; 2327| 2.13k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2328| | 2329| 2.13k| if (!yyg->yy_buffer_stack) { ------------------ | Branch (2329:6): [True: 2.13k, 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.13k| num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ 2336| 2.13k| yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc ------------------ | | 224| 2.13k|#define yyalloc libconfig_yyalloc ------------------ 2337| 2.13k| (num_to_alloc * sizeof(struct yy_buffer_state*) 2338| 2.13k| , yyscanner); 2339| 2.13k| if ( ! yyg->yy_buffer_stack ) ------------------ | Branch (2339:8): [True: 0, False: 2.13k] ------------------ 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.13k| memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); 2343| | 2344| 2.13k| yyg->yy_buffer_stack_max = num_to_alloc; 2345| 2.13k| yyg->yy_buffer_stack_top = 0; 2346| 2.13k| return; 2347| 2.13k| } 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.27k|{ 2703| 4.27k| 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.27k| yyg->yy_buffer_stack = NULL; 2709| 4.27k| yyg->yy_buffer_stack_top = 0; 2710| 4.27k| yyg->yy_buffer_stack_max = 0; 2711| 4.27k| yyg->yy_c_buf_p = NULL; 2712| 4.27k| yyg->yy_init = 0; 2713| 4.27k| yyg->yy_start = 0; 2714| | 2715| 4.27k| yyg->yy_start_stack_ptr = 0; 2716| 4.27k| yyg->yy_start_stack_depth = 0; 2717| 4.27k| 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.27k| yyin = NULL; ------------------ | | 344| 4.27k|#define yyin yyg->yyin_r ------------------ 2725| 4.27k| yyout = NULL; ------------------ | | 345| 4.27k|#define yyout yyg->yyout_r ------------------ 2726| 4.27k|#endif 2727| | 2728| | /* For future reference: Set errno on error, since we are called by 2729| | * yylex_init() 2730| | */ 2731| 4.27k| return 0; 2732| 4.27k|} libconfig_strbuf_ensure_capacity: 34| 11.6k|{ 35| 11.6k| static const size_t mask = ~(STRING_BLOCK_SIZE - 1); ------------------ | | 29| 11.6k|#define STRING_BLOCK_SIZE 64 ------------------ 36| | 37| 11.6k| size_t newlen = buf->length + len + 1; /* add 1 for NUL */ 38| 11.6k| if(newlen > buf->capacity) ------------------ | Branch (38:6): [True: 3.48k, False: 8.12k] ------------------ 39| 3.48k| { 40| 3.48k| buf->capacity = (newlen + (STRING_BLOCK_SIZE - 1)) & mask; ------------------ | | 29| 3.48k|#define STRING_BLOCK_SIZE 64 ------------------ 41| 3.48k| buf->string = (char *)libconfig_realloc(buf->string, buf->capacity); 42| 3.48k| } 43| 11.6k|} libconfig_strbuf_release: 48| 9.33k|{ 49| 9.33k| char *r = buf->string; 50| 9.33k| __zero(buf); ------------------ | | 39| 9.33k|#define __zero(P) memset((void *)(P), 0, sizeof(*P)) ------------------ 51| 9.33k| return(r); 52| 9.33k|} libconfig_strbuf_append_string: 57| 6.22k|{ 58| 6.22k| size_t len = strlen(s); 59| 6.22k| libconfig_strbuf_ensure_capacity(buf, len); 60| 6.22k| strcpy(buf->string + buf->length, s); 61| 6.22k| buf->length += len; 62| 6.22k|} libconfig_strbuf_append_char: 67| 5.38k|{ 68| 5.38k| libconfig_strbuf_ensure_capacity(buf, 1); 69| 5.38k| *(buf->string + buf->length) = c; 70| 5.38k| ++(buf->length); 71| 5.38k| *(buf->string + buf->length) = '\0'; 72| 5.38k|} libconfig_strvec_release: 51| 2.13k|{ 52| 2.13k| const char **r = vec->strings; 53| 2.13k| if(r) ------------------ | Branch (53:6): [True: 0, False: 2.13k] ------------------ 54| 0| *(vec->end) = NULL; 55| | 56| 2.13k| __zero(vec); ------------------ | | 39| 2.13k|#define __zero(P) memset((void *)(P), 0, sizeof(*P)) ------------------ 57| 2.13k| return(r); 58| 2.13k|} libconfig_strvec_delete: 63| 6.63k|{ 64| 6.63k| const char *const *p; 65| | 66| 6.63k| if(!vec) return; ------------------ | Branch (66:6): [True: 6.63k, 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| 8.71k|{ 66| 8.71k| void *ptr = malloc(size); 67| 8.71k| if(!ptr) ------------------ | Branch (67:6): [True: 0, False: 8.71k] ------------------ 68| 0| libconfig_fatal_error(__libconfig_malloc_failure_message); 69| | 70| 8.71k| return(ptr); 71| 8.71k|} libconfig_calloc: 76| 143k|{ 77| 143k| void *ptr = calloc(nmemb, size); 78| 143k| if(!ptr) ------------------ | Branch (78:6): [True: 0, False: 143k] ------------------ 79| 0| libconfig_fatal_error(__libconfig_malloc_failure_message); 80| | 81| 143k| return(ptr); 82| 143k|} libconfig_realloc: 87| 57.6k|{ 88| 57.6k| ptr = realloc(ptr, size); 89| 57.6k| if(!ptr) ------------------ | Branch (89:6): [True: 0, False: 57.6k] ------------------ 90| 0| libconfig_fatal_error(__libconfig_malloc_failure_message); 91| | 92| 57.6k| return(ptr); 93| 57.6k|} libconfig_parse_integer: 103| 15.7k|{ 104| 15.7k| char *endptr; 105| 15.7k| int errsave = errno; 106| | 107| 15.7k| errno = 0; 108| 15.7k| *val = strtoll(s, &endptr, base); 109| | 110| 15.7k| if((base != 10) && (*val > INT32_MAX) && (*val <= UINT32_MAX)) ------------------ | Branch (110:6): [True: 6.56k, False: 9.19k] | Branch (110:22): [True: 631, False: 5.93k] | Branch (110:44): [True: 258, False: 373] ------------------ 111| 258| *val = (long long)(int)*val; 112| | 113| 15.7k| *is_long = ((*val < INT32_MIN) || (*val > INT32_MAX)); ------------------ | Branch (113:15): [True: 352, False: 15.4k] | Branch (113:37): [True: 442, False: 14.9k] ------------------ 114| | 115| | /* Check for trailing L's. */ 116| 20.3k| while(!errno && *endptr == 'L') ------------------ | Branch (116:9): [True: 20.3k, False: 11] | Branch (116:19): [True: 4.59k, False: 15.7k] ------------------ 117| 4.59k| { 118| 4.59k| *is_long = 1; 119| 4.59k| ++endptr; 120| 4.59k| } 121| | 122| 15.7k| if(*endptr || errno) ------------------ | Branch (122:6): [True: 2, False: 15.7k] | Branch (122:17): [True: 9, False: 15.7k] ------------------ 123| 11| { 124| 11| errno = errsave; 125| 11| return(0); /* parse error */ 126| 11| } 127| 15.7k| errno = errsave; 128| | 129| 15.7k| return(1); 130| 15.7k|} libconfig_format_double: 136| 13.2k|{ 137| 13.2k| const char *fmt = sci_ok ? "%.*g" : "%.*f"; ------------------ | Branch (137:21): [True: 0, False: 13.2k] ------------------ 138| 13.2k| char *p, *q; 139| | 140| 13.2k| snprintf(buf, buflen - 3, fmt, precision, val); 141| | 142| | /* Check for exponent. */ 143| 13.2k| p = strchr(buf, 'e'); 144| 13.2k| if(p) return; ------------------ | Branch (144:6): [True: 0, False: 13.2k] ------------------ 145| | 146| | /* Check for decimal point. */ 147| 13.2k| p = strchr(buf, '.'); 148| 13.2k| if(!p) ------------------ | Branch (148:6): [True: 245, False: 13.0k] ------------------ 149| 245| { 150| | /* No decimal point. Add trailing ".0". */ 151| 245| strcat(buf, ".0"); 152| 245| } 153| 13.0k| else 154| 13.0k| { 155| | /* Remove any excess trailing 0's after decimal point. */ 156| 75.1k| for(q = buf + strlen(buf) - 1; q > p + 1; --q) ------------------ | Branch (156:36): [True: 63.2k, False: 11.8k] ------------------ 157| 63.2k| { 158| 63.2k| if(*q == '0') ------------------ | Branch (158:10): [True: 62.1k, False: 1.16k] ------------------ 159| 62.1k| *q = '\0'; 160| 1.16k| else 161| 1.16k| break; 162| 63.2k| } 163| 13.0k| } 164| 13.2k|} libconfig_format_bin: 172| 1.64k|{ 173| 1.64k| static const int num_bits = sizeof(val) * BITS_IN_BYTE; ------------------ | | 27| 1.64k|#define BITS_IN_BYTE 8 ------------------ 174| 1.64k| char *p = buf + num_bits; 175| 1.64k| char *first_bit = NULL; 176| | 177| 1.64k| *p = '\0'; 178| | 179| 106k| for(int i = 0; i < num_bits; ++i) ------------------ | Branch (179:18): [True: 105k, False: 1.64k] ------------------ 180| 105k| { 181| 105k| int x = val & 1; 182| 105k| val >>= 1; 183| 105k| *(--p) = '0' + x; 184| 105k| if(!first_bit || x) first_bit = p; ------------------ | Branch (184:8): [True: 1.64k, False: 103k] | Branch (184:22): [True: 771, False: 102k] ------------------ 185| 105k| } 186| | 187| 1.64k| return(first_bit); 188| 1.64k|}