open_null_file: 30| 1|{ 31| 1| FILE *dev_null = fopen("/dev/null", "w"); 32| | 33| 1| if (dev_null == NULL) ------------------ | Branch (33:9): [True: 0, False: 1] ------------------ 34| 0| { 35| 0| abort(); 36| 0| } 37| | 38| 1| return dev_null; 39| 1|} find_setting_recursive: 46| 35.8k|{ 47| 35.8k| if (NULL == setting || NULL == name) ------------------ | Branch (47:9): [True: 0, False: 35.8k] | Branch (47:28): [True: 0, False: 35.8k] ------------------ 48| 0| { 49| 0| return NULL; 50| 0| } 51| | 52| | // Check if the current setting's name matches 53| 35.8k| const char *setting_name = config_setting_name(setting); ------------------ | | 290| 35.8k| ((S)->name) ------------------ 54| 35.8k| if (NULL != setting_name && strlen(setting_name) == name_len) { ------------------ | Branch (54:9): [True: 7.36k, False: 28.4k] | Branch (54:33): [True: 2.83k, False: 4.52k] ------------------ 55| 2.83k| if (strncmp(config_setting_name(setting), name, name_len) == 0) { ------------------ | | 290| 2.83k| ((S)->name) ------------------ | Branch (55:13): [True: 473, False: 2.36k] ------------------ 56| 473| return setting; 57| 473| } 58| 2.83k| } 59| | 60| | // If it's a group, iterate over its children recursively 61| 35.3k| if (config_setting_is_group(setting) || config_setting_is_array(setting) ------------------ | | 277| 70.7k| ((S)->type == CONFIG_TYPE_GROUP) | | ------------------ | | | | 50| 35.3k|#define CONFIG_TYPE_GROUP 1 | | ------------------ | | | Branch (277:3): [True: 4.48k, False: 30.8k] | | ------------------ ------------------ if (config_setting_is_group(setting) || config_setting_is_array(setting) ------------------ | | 279| 66.2k| ((S)->type == CONFIG_TYPE_ARRAY) | | ------------------ | | | | 56| 30.8k|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (279:3): [True: 1.75k, False: 29.1k] | | ------------------ ------------------ 62| 29.1k| || config_setting_is_list(setting)) ------------------ | | 281| 29.1k| ((S)->type == CONFIG_TYPE_LIST) | | ------------------ | | | | 57| 29.1k|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (281:3): [True: 1.16k, False: 27.9k] | | ------------------ ------------------ 63| 7.40k| { 64| 7.40k| int count = config_setting_length(setting); 65| 40.5k| for (int i = 0; i < count; ++i) ------------------ | Branch (65:25): [True: 33.9k, False: 6.65k] ------------------ 66| 33.9k| { 67| 33.9k| config_setting_t *child = config_setting_get_elem(setting, i); 68| 33.9k| config_setting_t *result = find_setting_recursive(child, name, name_len); 69| 33.9k| if (result != NULL) ------------------ | Branch (69:17): [True: 757, False: 33.1k] ------------------ 70| 757| { 71| 757| return result; // Return the found setting 72| 757| } 73| 33.9k| } 74| 7.40k| } 75| | 76| | // Return NULL if not found 77| 34.6k| return NULL; 78| 35.3k|} LLVMFuzzerTestOneInput: 129| 2.48k|{ 130| 2.48k| static FILE *dev_null; 131| 2.48k| uint8_t data_buff[MAX_BUFF_SIZE] = {0}; 132| 2.48k| uint8_t scratch_mem[sizeof(uint64_t)] = {0}; 133| 2.48k| config_t cfg = {0}; 134| 2.48k| uint8_t *config_ptr; 135| 2.48k| uint8_t *path_ptr; 136| 2.48k| config_setting_t *root; 137| 2.48k| int rc = -1; 138| | 139| 2.48k| fuzz_data_t *fuzz_data = (fuzz_data_t*) data_buff; 140| | 141| 2.48k| if (NULL == dev_null) ------------------ | Branch (141:9): [True: 1, False: 2.48k] ------------------ 142| 1| { 143| | // Only called once per process 144| 1| dev_null = open_null_file(); 145| 1| } 146| | 147| 2.48k| if (size < MIN_BUFF_SIZE || size > MAX_BUFF_SIZE) ------------------ | | 10| 4.97k|#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.48k|#define MAX_BUFF_SIZE sizeof(fuzz_data_t) + MAX_CONFIG_SIZE + MAX_PATH_SIZE + 2 | | ------------------ | | | | 8| 2.48k|#define MAX_CONFIG_SIZE 4096 | | ------------------ | | #define MAX_BUFF_SIZE sizeof(fuzz_data_t) + MAX_CONFIG_SIZE + MAX_PATH_SIZE + 2 | | ------------------ | | | | 9| 2.48k|#define MAX_PATH_SIZE 256 | | ------------------ ------------------ | Branch (147:9): [True: 7, False: 2.48k] | Branch (147:33): [True: 14, False: 2.46k] ------------------ 148| 21| { 149| | // Not enough bytes to be a fuzz_data_t 150| 21| rc = 0; 151| 21| goto end; 152| 21| } 153| | 154| | // Copy the data to a buffer that can be mutated 155| 2.46k| memcpy(data_buff, data, size); 156| | 157| 2.46k| config_init(&cfg); 158| | 159| 2.46k| if (fuzz_data->content_size > MAX_CONFIG_SIZE || ------------------ | | 8| 4.93k|#define MAX_CONFIG_SIZE 4096 ------------------ | Branch (159:9): [True: 43, False: 2.42k] ------------------ 160| 2.42k| fuzz_data->path_size > MAX_PATH_SIZE || ------------------ | | 9| 4.89k|#define MAX_PATH_SIZE 256 ------------------ | Branch (160:9): [True: 49, False: 2.37k] ------------------ 161| 2.37k| sizeof(fuzz_data_t) + fuzz_data->content_size + fuzz_data->path_size > size) { ------------------ | Branch (161:9): [True: 20, False: 2.35k] ------------------ 162| 112| goto end; 163| 112| } 164| 2.35k| fuzz_data_content(fuzz_data, &config_ptr); 165| 2.35k| fuzz_data_path(fuzz_data, &path_ptr); 166| 2.35k| const char *config_data = (const char *) config_ptr; 167| 2.35k| const char *path_data = (const char *) path_ptr; 168| | 169| 2.35k| if (CONFIG_TRUE != config_read_string(&cfg, config_data) ------------------ | | 73| 2.35k|#define CONFIG_TRUE (1) ------------------ | Branch (169:9): [True: 440, False: 1.91k] ------------------ 170| 2.35k| || NULL == (root = config_root_setting(&cfg))) ------------------ | | 346| 1.91k| ((C)->root) ------------------ | Branch (170:12): [True: 0, False: 1.91k] ------------------ 171| 440| { 172| | // Parsing failed 173| 440| goto end; 174| 440| } 175| | 176| 1.91k| config_setting_t *setting = find_setting_recursive( 177| 1.91k| root, 178| 1.91k| (const char*) path_ptr, 179| 1.91k| fuzz_data->path_size 180| 1.91k| ); 181| | 182| 1.91k| if (NULL != setting) ------------------ | Branch (182:9): [True: 473, False: 1.44k] ------------------ 183| 473| { 184| 473| config_setting_get_elem(setting, config_setting_length(setting) - 1); 185| | 186| 473| switch (fuzz_data->lookup_type % (CONFIG_TYPE_LIST + 1)) { ------------------ | | 57| 473|#define CONFIG_TYPE_LIST 8 ------------------ 187| 57| case CONFIG_TYPE_FLOAT: ------------------ | | 53| 57|#define CONFIG_TYPE_FLOAT 4 ------------------ | Branch (187:13): [True: 57, False: 416] ------------------ 188| 57| config_setting_lookup_float(setting, path_data, 189| 57| (double*) scratch_mem); 190| 57| break; 191| 51| case CONFIG_TYPE_BOOL: ------------------ | | 55| 51|#define CONFIG_TYPE_BOOL 6 ------------------ | Branch (191:13): [True: 51, False: 422] ------------------ 192| 51| config_setting_lookup_bool(setting, path_data, 193| 51| (int*) scratch_mem); 194| 51| break; 195| 217| case CONFIG_TYPE_INT: ------------------ | | 51| 217|#define CONFIG_TYPE_INT 2 ------------------ | Branch (195:13): [True: 217, False: 256] ------------------ 196| 217| config_setting_lookup_int(setting, path_data, 197| 217| (int*) scratch_mem); 198| 217| break; 199| 57| case CONFIG_TYPE_INT64: ------------------ | | 52| 57|#define CONFIG_TYPE_INT64 3 ------------------ | Branch (199:13): [True: 57, False: 416] ------------------ 200| 57| config_setting_lookup_int64(setting, path_data, 201| 57| (long long *) scratch_mem); 202| 57| break; 203| 55| case CONFIG_TYPE_STRING: { ------------------ | | 54| 55|#define CONFIG_TYPE_STRING 5 ------------------ | Branch (203:13): [True: 55, False: 418] ------------------ 204| 55| const char *string_ptr = NULL; 205| 55| config_setting_lookup_string(setting, path_data, &string_ptr); 206| 55| break; 207| 0| } 208| 36| default: ------------------ | Branch (208:13): [True: 36, False: 437] ------------------ 209| 36| config_setting_lookup_const(setting, path_data); 210| 473| } 211| 473| } 212| | 213| 1.91k| if (NULL != (setting = config_setting_get_member(root, path_data))) ------------------ | Branch (213:9): [True: 444, False: 1.47k] ------------------ 214| 444| { 215| | // This setting exists, let's overwrite it 216| 444| config_setting_set_float(setting, 1.234); 217| 444| } 218| 1.47k| else { 219| | // This setting does not exist, create it 220| 1.47k| setting = config_setting_add(root, path_data, CONFIG_TYPE_FLOAT); ------------------ | | 53| 1.47k|#define CONFIG_TYPE_FLOAT 4 ------------------ 221| | 222| 1.47k| if (setting == NULL) ------------------ | Branch (222:13): [True: 576, False: 895] ------------------ 223| 576| { 224| 576| rc = -1; 225| 576| goto end; 226| 576| } 227| 895| config_setting_set_float(setting, 1.234); 228| 895| } 229| | 230| 1.33k| config_write(&cfg, dev_null); 231| 1.33k| config_setting_remove(root, path_data); 232| | 233| 1.33k| rc = 0; 234| | 235| 2.48k| end: 236| 2.48k| config_destroy(&cfg); 237| 2.48k| return rc; 238| 1.33k|} fuzz_data_content: 4| 2.35k|{ 5| 2.35k| *buff = fuzz_data->data; 6| | 7| | // Ensure the buffer is null terminated 8| 2.35k| (*buff)[fuzz_data->content_size] = '\0'; 9| 2.35k|} fuzz_data_path: 12| 2.35k|{ 13| 2.35k| *buff = fuzz_data->data + fuzz_data->content_size + 1; 14| | 15| | // Ensure the buffer is null terminated 16| 2.35k| (*buff)[fuzz_data->path_size] = '\0'; 17| 2.35k|} libconfig_yyerror: 112| 440|{ 113| 440| if(ctx->config->error_text) return; ------------------ | Branch (113:6): [True: 0, False: 440] ------------------ 114| 440| ctx->config->error_line = libconfig_yyget_lineno(scanner); 115| 440| ctx->config->error_text = s; 116| 440|} libconfig_yyparse: 1065| 2.35k|{ 1066| |/* Lookahead token kind. */ 1067| 2.35k|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.35k|YY_INITIAL_VALUE (static YYSTYPE yyval_default;) ------------------ | | 476| 2.35k|# define YY_INITIAL_VALUE(Value) Value ------------------ 1074| 2.35k|YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); ------------------ | | 476| 2.35k|# define YY_INITIAL_VALUE(Value) Value ------------------ 1075| | 1076| | /* Number of syntax errors so far. */ 1077| 2.35k| int yynerrs = 0; 1078| | 1079| 2.35k| yy_state_fast_t yystate = 0; 1080| | /* Number of tokens to shift before error messages enabled. */ 1081| 2.35k| 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.35k| YYPTRDIFF_T yystacksize = YYINITDEPTH; ------------------ | | 383| 2.35k|# define YYPTRDIFF_T __PTRDIFF_TYPE__ ------------------ YYPTRDIFF_T yystacksize = YYINITDEPTH; ------------------ | | 1004| 2.35k|# define YYINITDEPTH 200 ------------------ 1088| | 1089| | /* The state stack: array, bottom, top. */ 1090| 2.35k| yy_state_t yyssa[YYINITDEPTH]; 1091| 2.35k| yy_state_t *yyss = yyssa; 1092| 2.35k| yy_state_t *yyssp = yyss; 1093| | 1094| | /* The semantic value stack: array, bottom, top. */ 1095| 2.35k| YYSTYPE yyvsa[YYINITDEPTH]; 1096| 2.35k| YYSTYPE *yyvs = yyvsa; 1097| 2.35k| YYSTYPE *yyvsp = yyvs; 1098| | 1099| 2.35k| int yyn; 1100| | /* The return value of yyparse. */ 1101| 2.35k| int yyresult; 1102| | /* Lookahead symbol kind. */ 1103| 2.35k| yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; 1104| | /* The variables used to return semantic value and location from the 1105| | action routines. */ 1106| 2.35k| YYSTYPE yyval; 1107| | 1108| | 1109| | 1110| 2.35k|#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.35k| int yylen = 0; 1115| | 1116| 2.35k| YYDPRINTF ((stderr, "Starting parse\n")); ------------------ | | 995| 2.35k|# define YYDPRINTF(Args) ((void) 0) ------------------ 1117| | 1118| 2.35k| yychar = YYEMPTY; /* Cause a token to be read. */ ------------------ | | 191| 2.35k|#define YYEMPTY -2 ------------------ 1119| | 1120| 2.35k| goto yysetstate; 1121| | 1122| | 1123| |/*------------------------------------------------------------. 1124| || yynewstate -- push a new state, which is found in yystate. | 1125| |`------------------------------------------------------------*/ 1126| 383k|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| 383k| yyssp++; 1130| | 1131| | 1132| |/*--------------------------------------------------------------------. 1133| || yysetstate -- set current state (the top of the stack) to yystate. | 1134| |`--------------------------------------------------------------------*/ 1135| 386k|yysetstate: 1136| 386k| YYDPRINTF ((stderr, "Entering state %d\n", yystate)); ------------------ | | 995| 386k|# define YYDPRINTF(Args) ((void) 0) ------------------ 1137| 386k| YY_ASSERT (0 <= yystate && yystate < YYNSTATES); ------------------ | | 499| 386k|#define YY_ASSERT(E) ((void) (0 && (E))) | | ------------------ | | | Branch (499:31): [Folded, False: 386k] | | | Branch (499:37): [True: 0, False: 0] | | | Branch (499:37): [True: 0, False: 0] | | ------------------ ------------------ 1138| 386k| YY_IGNORE_USELESS_CAST_BEGIN 1139| 386k| *yyssp = YY_CAST (yy_state_t, yystate); ------------------ | | 126| 386k|# define YY_CAST(Type, Val) ((Type) (Val)) ------------------ 1140| 386k| YY_IGNORE_USELESS_CAST_END 1141| 386k| YY_STACK_PRINT (yyss, yyssp); 1142| | 1143| 386k| if (yyss + yystacksize - 1 <= yyssp) ------------------ | Branch (1143:7): [True: 171, False: 385k] ------------------ 1144| |#if !defined yyoverflow && !defined YYSTACK_RELOCATE 1145| | YYNOMEM; 1146| |#else 1147| 171| { 1148| | /* Get the current used size of the three stacks, in elements. */ 1149| 171| YYPTRDIFF_T yysize = yyssp - yyss + 1; ------------------ | | 383| 171|# 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| 171| if (YYMAXDEPTH <= yystacksize) ------------------ | | 1015| 171|# define YYMAXDEPTH 10000 ------------------ | Branch (1172:11): [True: 0, False: 171] ------------------ 1173| 0| YYNOMEM; ------------------ | | 845| 0|#define YYNOMEM goto yyexhaustedlab ------------------ 1174| 171| yystacksize *= 2; 1175| 171| if (YYMAXDEPTH < yystacksize) ------------------ | | 1015| 171|# define YYMAXDEPTH 10000 ------------------ | Branch (1175:11): [True: 3, False: 168] ------------------ 1176| 3| yystacksize = YYMAXDEPTH; ------------------ | | 1015| 3|# define YYMAXDEPTH 10000 ------------------ 1177| | 1178| 171| { 1179| 171| yy_state_t *yyss1 = yyss; 1180| 171| union yyalloc *yyptr = 1181| 171| YY_CAST (union yyalloc *, ------------------ | | 126| 171|# define YY_CAST(Type, Val) ((Type) (Val)) ------------------ 1182| 171| YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); 1183| 171| if (! yyptr) ------------------ | Branch (1183:13): [True: 0, False: 171] ------------------ 1184| 0| YYNOMEM; ------------------ | | 845| 0|#define YYNOMEM goto yyexhaustedlab ------------------ 1185| 171| YYSTACK_RELOCATE (yyss_alloc, yyss); ------------------ | | 596| 171| do \ | | 597| 171| { \ | | 598| 171| YYPTRDIFF_T yynewbytes; \ | | ------------------ | | | | 383| 171|# define YYPTRDIFF_T __PTRDIFF_TYPE__ | | ------------------ | | 599| 171| YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ | | ------------------ | | | | 614| 171| __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) | | | | ------------------ | | | | | | 126| 171|# define YY_CAST(Type, Val) ((Type) (Val)) | | | | ------------------ | | ------------------ | | 600| 171| Stack = &yyptr->Stack_alloc; \ | | 601| 171| yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ | | ------------------ | | | | 416| 171|#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) | | | | ------------------ | | | | | | 126| 171|# define YY_CAST(Type, Val) ((Type) (Val)) | | | | ------------------ | | ------------------ | | yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ | | ------------------ | | | | 580| 171|# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) | | | | ------------------ | | | | | | 416| 171|#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) | | | | | | ------------------ | | | | | | | | 126| 171|# define YY_CAST(Type, Val) ((Type) (Val)) | | | | | | ------------------ | | | | ------------------ | | ------------------ | | 602| 171| yyptr += yynewbytes / YYSIZEOF (*yyptr); \ | | ------------------ | | | | 416| 171|#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) | | | | ------------------ | | | | | | 126| 171|# define YY_CAST(Type, Val) ((Type) (Val)) | | | | ------------------ | | ------------------ | | 603| 171| } \ | | 604| 171| while (0) | | ------------------ | | | Branch (604:12): [Folded, False: 171] | | ------------------ ------------------ 1186| 171| YYSTACK_RELOCATE (yyvs_alloc, yyvs); ------------------ | | 596| 171| do \ | | 597| 171| { \ | | 598| 171| YYPTRDIFF_T yynewbytes; \ | | ------------------ | | | | 383| 171|# define YYPTRDIFF_T __PTRDIFF_TYPE__ | | ------------------ | | 599| 171| YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ | | ------------------ | | | | 614| 171| __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) | | | | ------------------ | | | | | | 126| 171|# define YY_CAST(Type, Val) ((Type) (Val)) | | | | ------------------ | | ------------------ | | 600| 171| Stack = &yyptr->Stack_alloc; \ | | 601| 171| yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ | | ------------------ | | | | 416| 171|#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) | | | | ------------------ | | | | | | 126| 171|# define YY_CAST(Type, Val) ((Type) (Val)) | | | | ------------------ | | ------------------ | | yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ | | ------------------ | | | | 580| 171|# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) | | | | ------------------ | | | | | | 416| 171|#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) | | | | | | ------------------ | | | | | | | | 126| 171|# define YY_CAST(Type, Val) ((Type) (Val)) | | | | | | ------------------ | | | | ------------------ | | ------------------ | | 602| 171| yyptr += yynewbytes / YYSIZEOF (*yyptr); \ | | ------------------ | | | | 416| 171|#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) | | | | ------------------ | | | | | | 126| 171|# define YY_CAST(Type, Val) ((Type) (Val)) | | | | ------------------ | | ------------------ | | 603| 171| } \ | | 604| 171| while (0) | | ------------------ | | | Branch (604:12): [Folded, False: 171] | | ------------------ ------------------ 1187| 171|# undef YYSTACK_RELOCATE 1188| 171| if (yyss1 != yyssa) ------------------ | Branch (1188:13): [True: 107, False: 64] ------------------ 1189| 107| YYSTACK_FREE (yyss1); ------------------ | | 541| 107|# define YYSTACK_FREE YYFREE | | ------------------ | | | | 560| 107|# define YYFREE free | | ------------------ ------------------ 1190| 171| } 1191| 0|# endif 1192| | 1193| 0| yyssp = yyss + yysize - 1; 1194| 171| yyvsp = yyvs + yysize - 1; 1195| | 1196| 171| YY_IGNORE_USELESS_CAST_BEGIN 1197| 171| YYDPRINTF ((stderr, "Stack size increased to %ld\n", ------------------ | | 995| 171|# define YYDPRINTF(Args) ((void) 0) ------------------ 1198| 171| YY_CAST (long, yystacksize))); 1199| 171| YY_IGNORE_USELESS_CAST_END 1200| | 1201| 171| if (yyss + yystacksize - 1 <= yyssp) ------------------ | Branch (1201:11): [True: 0, False: 171] ------------------ 1202| 0| YYABORT; ------------------ | | 843| 0|#define YYABORT goto yyabortlab ------------------ 1203| 171| } 1204| 386k|#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ 1205| | 1206| | 1207| 386k| if (yystate == YYFINAL) ------------------ | | 629| 386k|#define YYFINAL 6 ------------------ | Branch (1207:7): [True: 1.91k, False: 384k] ------------------ 1208| 1.91k| YYACCEPT; ------------------ | | 842| 1.91k|#define YYACCEPT goto yyacceptlab ------------------ 1209| | 1210| 384k| goto yybackup; 1211| | 1212| | 1213| |/*-----------. 1214| || yybackup. | 1215| |`-----------*/ 1216| 384k|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| 384k| yyn = yypact[yystate]; 1222| 384k| if (yypact_value_is_default (yyn)) ------------------ | | 735| 384k| ((Yyn) == YYPACT_NINF) | | ------------------ | | | | 732| 384k|#define YYPACT_NINF (-19) | | ------------------ | | | Branch (735:3): [True: 198k, False: 185k] | | ------------------ ------------------ 1223| 198k| 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| 185k| if (yychar == YYEMPTY) ------------------ | | 191| 185k|#define YYEMPTY -2 ------------------ | Branch (1228:7): [True: 159k, False: 26.1k] ------------------ 1229| 159k| { 1230| 159k| YYDPRINTF ((stderr, "Reading a token\n")); ------------------ | | 995| 159k|# define YYDPRINTF(Args) ((void) 0) ------------------ 1231| 159k| yychar = yylex (&yylval, scanner); ------------------ | | 69| 159k|#define yylex libconfig_yylex ------------------ 1232| 159k| } 1233| | 1234| 185k| if (yychar <= YYEOF) ------------------ | | 192| 185k|#define YYEOF 0 ------------------ | Branch (1234:7): [True: 5.66k, False: 179k] ------------------ 1235| 5.66k| { 1236| 5.66k| yychar = YYEOF; ------------------ | | 192| 5.66k|#define YYEOF 0 ------------------ 1237| 5.66k| yytoken = YYSYMBOL_YYEOF; 1238| 5.66k| YYDPRINTF ((stderr, "Now at end of input.\n")); ------------------ | | 995| 5.66k|# define YYDPRINTF(Args) ((void) 0) ------------------ 1239| 5.66k| } 1240| 179k| else if (yychar == YYerror) ------------------ | | 193| 179k|#define YYerror 256 ------------------ | Branch (1240:12): [True: 0, False: 179k] ------------------ 1241| 0| { 1242| | /* The scanner already issued an error message, process directly 1243| | to error recovery. But do not keep the error token as 1244| | lookahead, it is too special and may lead us to an endless 1245| | loop in error recovery. */ 1246| 0| yychar = YYUNDEF; ------------------ | | 194| 0|#define YYUNDEF 257 ------------------ 1247| 0| yytoken = YYSYMBOL_YYerror; 1248| 0| goto yyerrlab1; 1249| 0| } 1250| 179k| else 1251| 179k| { 1252| 179k| yytoken = YYTRANSLATE (yychar); ------------------ | | 649| 179k| (0 <= (YYX) && (YYX) <= YYMAXUTOK \ | | ------------------ | | | | 643| 179k|#define YYMAXUTOK 281 | | ------------------ | | | Branch (649:4): [True: 179k, False: 0] | | | Branch (649:18): [True: 179k, False: 0] | | ------------------ | | 650| 179k| ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ | | ------------------ | | | | 126| 179k|# define YY_CAST(Type, Val) ((Type) (Val)) | | ------------------ | | 651| 179k| : YYSYMBOL_YYUNDEF) ------------------ 1253| 179k| YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 1254| 179k| } 1255| | 1256| | /* If the proper action on seeing token YYTOKEN is to reduce or to 1257| | detect an error, take that action. */ 1258| 185k| yyn += yytoken; 1259| 185k| if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) ------------------ | | 631| 183k|#define YYLAST 50 ------------------ | Branch (1259:7): [True: 1.57k, False: 183k] | Branch (1259:18): [True: 1.56k, False: 182k] | Branch (1259:34): [True: 23.4k, False: 158k] ------------------ 1260| 26.5k| goto yydefault; 1261| 158k| yyn = yytable[yyn]; 1262| 158k| if (yyn <= 0) ------------------ | Branch (1262:7): [True: 0, False: 158k] ------------------ 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| 158k| if (yyerrstatus) ------------------ | Branch (1272:7): [True: 0, False: 158k] ------------------ 1273| 0| yyerrstatus--; 1274| | 1275| | /* Shift the lookahead token. */ 1276| 158k| YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 1277| 158k| yystate = yyn; 1278| 158k| YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1279| 158k| *++yyvsp = yylval; 1280| 158k| YY_IGNORE_MAYBE_UNINITIALIZED_END 1281| | 1282| | /* Discard the shifted token. */ 1283| 158k| yychar = YYEMPTY; ------------------ | | 191| 158k|#define YYEMPTY -2 ------------------ 1284| 158k| goto yynewstate; 1285| | 1286| | 1287| |/*-----------------------------------------------------------. 1288| || yydefault -- do the default action for the current state. | 1289| |`-----------------------------------------------------------*/ 1290| 225k|yydefault: 1291| 225k| yyn = yydefact[yystate]; 1292| 225k| if (yyn == 0) ------------------ | Branch (1292:7): [True: 394, False: 224k] ------------------ 1293| 394| goto yyerrlab; 1294| 224k| goto yyreduce; 1295| | 1296| | 1297| |/*-----------------------------. 1298| || yyreduce -- do a reduction. | 1299| |`-----------------------------*/ 1300| 224k|yyreduce: 1301| | /* yyn is the number of a rule to reduce with. */ 1302| 224k| 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| 224k| yyval = yyvsp[1-yylen]; 1313| | 1314| | 1315| 224k| YY_REDUCE_PRINT (yyn); 1316| 224k| switch (yyn) 1317| 224k| { 1318| 13.9k| case 11: /* $@1: %empty */ ------------------ | Branch (1318:3): [True: 13.9k, False: 210k] ------------------ 1319| 13.9k|#line 122 "grammar.y" 1320| 13.9k| { 1321| 13.9k| ctx->setting = config_setting_add(ctx->parent, (yyvsp[0].sval), CONFIG_TYPE_NONE); ------------------ | | 49| 13.9k|#define CONFIG_TYPE_NONE 0 ------------------ 1322| | 1323| 13.9k| if(ctx->setting == NULL) ------------------ | Branch (1323:8): [True: 16, False: 13.8k] ------------------ 1324| 16| { 1325| 16| libconfig_yyerror(scanner, ctx, scan_ctx, err_duplicate_setting); 1326| 16| YYABORT; ------------------ | | 843| 16|#define YYABORT goto yyabortlab ------------------ 1327| 16| } 1328| 13.8k| else 1329| 13.8k| { 1330| 13.8k| CAPTURE_PARSE_POS(ctx->setting); ------------------ | | 108| 13.8k| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1331| 13.8k| } 1332| 13.9k| } 1333| 13.8k|#line 1334 "grammar.c" 1334| 13.8k| break; 1335| | 1336| 13.8k| case 13: /* $@2: %empty */ ------------------ | Branch (1336:3): [True: 1.95k, False: 222k] ------------------ 1337| 1.95k|#line 141 "grammar.y" 1338| 1.95k| { 1339| 1.95k| if(IN_LIST()) ------------------ | | 98| 1.95k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 1.95k|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 1.95k, False: 0] | | | Branch (98:19): [True: 1.61k, False: 338] | | ------------------ ------------------ 1340| 1.61k| { 1341| 1.61k| ctx->parent = config_setting_add(ctx->parent, NULL, CONFIG_TYPE_ARRAY); ------------------ | | 56| 1.61k|#define CONFIG_TYPE_ARRAY 7 ------------------ 1342| 1.61k| CAPTURE_PARSE_POS(ctx->parent); ------------------ | | 108| 1.61k| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1343| 1.61k| } 1344| 338| else 1345| 338| { 1346| 338| ctx->setting->type = CONFIG_TYPE_ARRAY; ------------------ | | 56| 338|#define CONFIG_TYPE_ARRAY 7 ------------------ 1347| 338| ctx->parent = ctx->setting; 1348| 338| ctx->setting = NULL; 1349| 338| } 1350| 1.95k| } 1351| 1.95k|#line 1352 "grammar.c" 1352| 1.95k| break; 1353| | 1354| 1.87k| case 14: /* array: TOK_ARRAY_START $@2 simple_value_list_optional TOK_ARRAY_END */ ------------------ | Branch (1354:3): [True: 1.87k, False: 223k] ------------------ 1355| 1.87k|#line 156 "grammar.y" 1356| 1.87k| { 1357| 1.87k| if(ctx->parent) ------------------ | Branch (1357:8): [True: 1.87k, False: 0] ------------------ 1358| 1.87k| ctx->parent = ctx->parent->parent; 1359| 1.87k| } 1360| 1.87k|#line 1361 "grammar.c" 1361| 1.87k| break; 1362| | 1363| 47.9k| case 15: /* $@3: %empty */ ------------------ | Branch (1363:3): [True: 47.9k, False: 176k] ------------------ 1364| 47.9k|#line 164 "grammar.y" 1365| 47.9k| { 1366| 47.9k| if(IN_LIST()) ------------------ | | 98| 47.9k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 47.9k|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 47.9k, False: 0] | | | Branch (98:19): [True: 47.0k, False: 851] | | ------------------ ------------------ 1367| 47.0k| { 1368| 47.0k| ctx->parent = config_setting_add(ctx->parent, NULL, CONFIG_TYPE_LIST); ------------------ | | 57| 47.0k|#define CONFIG_TYPE_LIST 8 ------------------ 1369| 47.0k| CAPTURE_PARSE_POS(ctx->parent); ------------------ | | 108| 47.0k| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1370| 47.0k| } 1371| 851| else 1372| 851| { 1373| 851| ctx->setting->type = CONFIG_TYPE_LIST; ------------------ | | 57| 851|#define CONFIG_TYPE_LIST 8 ------------------ 1374| 851| ctx->parent = ctx->setting; 1375| 851| ctx->setting = NULL; 1376| 851| } 1377| 47.9k| } 1378| 47.9k|#line 1379 "grammar.c" 1379| 47.9k| break; 1380| | 1381| 1.54k| case 16: /* list: TOK_LIST_START $@3 value_list_optional TOK_LIST_END */ ------------------ | Branch (1381:3): [True: 1.54k, False: 223k] ------------------ 1382| 1.54k|#line 179 "grammar.y" 1383| 1.54k| { 1384| 1.54k| if(ctx->parent) ------------------ | Branch (1384:8): [True: 1.54k, False: 0] ------------------ 1385| 1.54k| ctx->parent = ctx->parent->parent; 1386| 1.54k| } 1387| 1.54k|#line 1388 "grammar.c" 1388| 1.54k| break; 1389| | 1390| 2.07k| case 21: /* string: TOK_STRING */ ------------------ | Branch (1390:3): [True: 2.07k, False: 222k] ------------------ 1391| 2.07k|#line 193 "grammar.y" 1392| 2.07k| { libconfig_parsectx_append_string(ctx, (yyvsp[0].sval)); free((yyvsp[0].sval)); } ------------------ | | 45| 2.07k| libconfig_strbuf_append_string(&((C)->string), (S)) ------------------ 1393| 2.07k|#line 1394 "grammar.c" 1394| 2.07k| break; 1395| | 1396| 1.36k| case 22: /* string: string TOK_STRING */ ------------------ | Branch (1396:3): [True: 1.36k, False: 223k] ------------------ 1397| 1.36k|#line 194 "grammar.y" 1398| 1.36k| { libconfig_parsectx_append_string(ctx, (yyvsp[0].sval)); free((yyvsp[0].sval)); } ------------------ | | 45| 1.36k| libconfig_strbuf_append_string(&((C)->string), (S)) ------------------ 1399| 1.36k|#line 1400 "grammar.c" 1400| 1.36k| break; 1401| | 1402| 1.38k| case 23: /* simple_value: TOK_BOOLEAN */ ------------------ | Branch (1402:3): [True: 1.38k, False: 223k] ------------------ 1403| 1.38k|#line 199 "grammar.y" 1404| 1.38k| { 1405| 1.38k| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 2.77k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 1.38k|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 1.38k, False: 0] | | | Branch (95:19): [True: 276, 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: 685, False: 426] | | ------------------ ------------------ 1406| 961| { 1407| 961| config_setting_t *e = config_setting_set_bool_elem(ctx->parent, -1, 1408| 961| (int)(yyvsp[0].ival)); 1409| | 1410| 961| if(! e) ------------------ | Branch (1410:10): [True: 3, False: 958] ------------------ 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| 958| else 1416| 958| { 1417| 958| CAPTURE_PARSE_POS(e); ------------------ | | 108| 958| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1418| 958| } 1419| 961| } 1420| 426| else 1421| 426| config_setting_set_bool(ctx->setting, (int)(yyvsp[0].ival)); 1422| 1.38k| } 1423| 1.38k|#line 1424 "grammar.c" 1424| 1.38k| break; 1425| | 1426| 6.92k| case 24: /* simple_value: TOK_INTEGER */ ------------------ | Branch (1426:3): [True: 6.92k, False: 217k] ------------------ 1427| 6.92k|#line 219 "grammar.y" 1428| 6.92k| { 1429| 6.92k| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 13.8k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 6.92k|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 6.92k, False: 0] | | | Branch (95:19): [True: 761, False: 6.16k] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 6.16k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 6.16k|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 6.16k, False: 0] | | | Branch (98:19): [True: 2.89k, False: 3.26k] | | ------------------ ------------------ 1430| 3.65k| { 1431| 3.65k| config_setting_t *e = config_setting_set_int_elem(ctx->parent, -1, (yyvsp[0].ival)); 1432| 3.65k| if(! e) ------------------ | Branch (1432:10): [True: 10, False: 3.64k] ------------------ 1433| 10| { 1434| 10| libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type); 1435| 10| YYABORT; ------------------ | | 843| 10|#define YYABORT goto yyabortlab ------------------ 1436| 10| } 1437| 3.64k| else 1438| 3.64k| { 1439| 3.64k| config_setting_set_format(e, CONFIG_FORMAT_DEFAULT); ------------------ | | 59| 3.64k|#define CONFIG_FORMAT_DEFAULT 0 ------------------ 1440| 3.64k| CAPTURE_PARSE_POS(e); ------------------ | | 108| 3.64k| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1441| 3.64k| } 1442| 3.65k| } 1443| 3.26k| else 1444| 3.26k| { 1445| 3.26k| config_setting_set_int(ctx->setting, (yyvsp[0].ival)); 1446| 3.26k| config_setting_set_format(ctx->setting, CONFIG_FORMAT_DEFAULT); ------------------ | | 59| 3.26k|#define CONFIG_FORMAT_DEFAULT 0 ------------------ 1447| 3.26k| } 1448| 6.92k| } 1449| 6.91k|#line 1450 "grammar.c" 1450| 6.91k| break; 1451| | 1452| 6.91k| case 25: /* simple_value: TOK_INTEGER64 */ ------------------ | Branch (1452:3): [True: 2.17k, False: 222k] ------------------ 1453| 2.17k|#line 241 "grammar.y" 1454| 2.17k| { 1455| 2.17k| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 4.35k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 2.17k|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 2.17k, False: 0] | | | Branch (95:19): [True: 873, False: 1.30k] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 1.30k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 1.30k|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 1.30k, False: 0] | | | Branch (98:19): [True: 729, False: 575] | | ------------------ ------------------ 1456| 1.60k| { 1457| 1.60k| config_setting_t *e = config_setting_set_int64_elem(ctx->parent, -1, (yyvsp[0].llval)); 1458| 1.60k| if(! e) ------------------ | Branch (1458:10): [True: 2, False: 1.60k] ------------------ 1459| 2| { 1460| 2| libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type); 1461| 2| YYABORT; ------------------ | | 843| 2|#define YYABORT goto yyabortlab ------------------ 1462| 2| } 1463| 1.60k| else 1464| 1.60k| { 1465| 1.60k| config_setting_set_format(e, CONFIG_FORMAT_DEFAULT); ------------------ | | 59| 1.60k|#define CONFIG_FORMAT_DEFAULT 0 ------------------ 1466| 1.60k| CAPTURE_PARSE_POS(e); ------------------ | | 108| 1.60k| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1467| 1.60k| } 1468| 1.60k| } 1469| 575| else 1470| 575| { 1471| 575| config_setting_set_int64(ctx->setting, (yyvsp[0].llval)); 1472| 575| config_setting_set_format(ctx->setting, CONFIG_FORMAT_DEFAULT); ------------------ | | 59| 575|#define CONFIG_FORMAT_DEFAULT 0 ------------------ 1473| 575| } 1474| 2.17k| } 1475| 2.17k|#line 1476 "grammar.c" 1476| 2.17k| break; 1477| | 1478| 2.17k| case 26: /* simple_value: TOK_HEX */ ------------------ | Branch (1478:3): [True: 1.82k, False: 223k] ------------------ 1479| 1.82k|#line 263 "grammar.y" 1480| 1.82k| { 1481| 1.82k| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 3.64k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 1.82k|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 1.82k, False: 0] | | | Branch (95:19): [True: 416, False: 1.40k] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 1.40k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 1.40k|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 1.40k, False: 0] | | | Branch (98:19): [True: 645, False: 761] | | ------------------ ------------------ 1482| 1.06k| { 1483| 1.06k| config_setting_t *e = config_setting_set_int_elem(ctx->parent, -1, (yyvsp[0].ival)); 1484| 1.06k| if(! e) ------------------ | Branch (1484:10): [True: 4, False: 1.05k] ------------------ 1485| 4| { 1486| 4| libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type); 1487| 4| YYABORT; ------------------ | | 843| 4|#define YYABORT goto yyabortlab ------------------ 1488| 4| } 1489| 1.05k| else 1490| 1.05k| { 1491| 1.05k| config_setting_set_format(e, CONFIG_FORMAT_HEX); ------------------ | | 60| 1.05k|#define CONFIG_FORMAT_HEX 1 ------------------ 1492| 1.05k| CAPTURE_PARSE_POS(e); ------------------ | | 108| 1.05k| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1493| 1.05k| } 1494| 1.06k| } 1495| 761| else 1496| 761| { 1497| 761| config_setting_set_int(ctx->setting, (yyvsp[0].ival)); 1498| 761| config_setting_set_format(ctx->setting, CONFIG_FORMAT_HEX); ------------------ | | 60| 761|#define CONFIG_FORMAT_HEX 1 ------------------ 1499| 761| } 1500| 1.82k| } 1501| 1.81k|#line 1502 "grammar.c" 1502| 1.81k| break; 1503| | 1504| 1.81k| case 27: /* simple_value: TOK_HEX64 */ ------------------ | Branch (1504:3): [True: 1.07k, False: 223k] ------------------ 1505| 1.07k|#line 285 "grammar.y" 1506| 1.07k| { 1507| 1.07k| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 2.14k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 1.07k|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 1.07k, False: 0] | | | Branch (95:19): [True: 346, False: 728] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 728| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 728|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 728, False: 0] | | | Branch (98:19): [True: 427, False: 301] | | ------------------ ------------------ 1508| 773| { 1509| 773| config_setting_t *e = config_setting_set_int64_elem(ctx->parent, -1, (yyvsp[0].llval)); 1510| 773| if(! e) ------------------ | Branch (1510:10): [True: 1, False: 772] ------------------ 1511| 1| { 1512| 1| libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type); 1513| 1| YYABORT; ------------------ | | 843| 1|#define YYABORT goto yyabortlab ------------------ 1514| 1| } 1515| 772| else 1516| 772| { 1517| 772| config_setting_set_format(e, CONFIG_FORMAT_HEX); ------------------ | | 60| 772|#define CONFIG_FORMAT_HEX 1 ------------------ 1518| 772| CAPTURE_PARSE_POS(e); ------------------ | | 108| 772| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1519| 772| } 1520| 773| } 1521| 301| else 1522| 301| { 1523| 301| config_setting_set_int64(ctx->setting, (yyvsp[0].llval)); 1524| 301| config_setting_set_format(ctx->setting, CONFIG_FORMAT_HEX); ------------------ | | 60| 301|#define CONFIG_FORMAT_HEX 1 ------------------ 1525| 301| } 1526| 1.07k| } 1527| 1.07k|#line 1528 "grammar.c" 1528| 1.07k| break; 1529| | 1530| 1.22k| case 28: /* simple_value: TOK_BIN */ ------------------ | Branch (1530:3): [True: 1.22k, False: 223k] ------------------ 1531| 1.22k|#line 307 "grammar.y" 1532| 1.22k| { 1533| 1.22k| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 2.45k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 1.22k|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 1.22k, False: 0] | | | Branch (95:19): [True: 716, False: 513] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 513| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 513|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 513, False: 0] | | | Branch (98:19): [True: 272, False: 241] | | ------------------ ------------------ 1534| 988| { 1535| 988| config_setting_t *e = config_setting_set_int_elem(ctx->parent, -1, (yyvsp[0].ival)); 1536| 988| if(! e) ------------------ | Branch (1536:10): [True: 2, False: 986] ------------------ 1537| 2| { 1538| 2| libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type); 1539| 2| YYABORT; ------------------ | | 843| 2|#define YYABORT goto yyabortlab ------------------ 1540| 2| } 1541| 986| else 1542| 986| { 1543| 986| config_setting_set_format(e, CONFIG_FORMAT_BIN); ------------------ | | 61| 986|#define CONFIG_FORMAT_BIN 2 ------------------ 1544| 986| CAPTURE_PARSE_POS(e); ------------------ | | 108| 986| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1545| 986| } 1546| 988| } 1547| 241| else 1548| 241| { 1549| 241| config_setting_set_int(ctx->setting, (yyvsp[0].ival)); 1550| 241| config_setting_set_format(ctx->setting, CONFIG_FORMAT_BIN); ------------------ | | 61| 241|#define CONFIG_FORMAT_BIN 2 ------------------ 1551| 241| } 1552| 1.22k| } 1553| 1.22k|#line 1554 "grammar.c" 1554| 1.22k| break; 1555| | 1556| 1.22k| case 29: /* simple_value: TOK_BIN64 */ ------------------ | Branch (1556:3): [True: 1.07k, False: 223k] ------------------ 1557| 1.07k|#line 329 "grammar.y" 1558| 1.07k| { 1559| 1.07k| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 2.14k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 1.07k|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 1.07k, False: 0] | | | Branch (95:19): [True: 363, False: 708] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 708| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 708|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 708, False: 0] | | | Branch (98:19): [True: 355, False: 353] | | ------------------ ------------------ 1560| 718| { 1561| 718| config_setting_t *e = config_setting_set_int64_elem(ctx->parent, -1, (yyvsp[0].llval)); 1562| 718| if(! e) ------------------ | Branch (1562:10): [True: 1, False: 717] ------------------ 1563| 1| { 1564| 1| libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type); 1565| 1| YYABORT; ------------------ | | 843| 1|#define YYABORT goto yyabortlab ------------------ 1566| 1| } 1567| 717| else 1568| 717| { 1569| 717| config_setting_set_format(e, CONFIG_FORMAT_BIN); ------------------ | | 61| 717|#define CONFIG_FORMAT_BIN 2 ------------------ 1570| 717| CAPTURE_PARSE_POS(e); ------------------ | | 108| 717| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1571| 717| } 1572| 718| } 1573| 353| else 1574| 353| { 1575| 353| config_setting_set_int64(ctx->setting, (yyvsp[0].llval)); 1576| 353| config_setting_set_format(ctx->setting, CONFIG_FORMAT_BIN); ------------------ | | 61| 353|#define CONFIG_FORMAT_BIN 2 ------------------ 1577| 353| } 1578| 1.07k| } 1579| 1.07k|#line 1580 "grammar.c" 1580| 1.07k| break; 1581| | 1582| 1.07k| case 30: /* simple_value: TOK_OCT */ ------------------ | Branch (1582:3): [True: 693, False: 224k] ------------------ 1583| 693|#line 351 "grammar.y" 1584| 693| { 1585| 693| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 1.38k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 693|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 693, False: 0] | | | Branch (95:19): [True: 216, False: 477] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 477| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 477|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 477, False: 0] | | | Branch (98:19): [True: 257, False: 220] | | ------------------ ------------------ 1586| 473| { 1587| 473| config_setting_t *e = config_setting_set_int_elem(ctx->parent, -1, (yyvsp[0].ival)); 1588| 473| if(! e) ------------------ | Branch (1588:10): [True: 1, False: 472] ------------------ 1589| 1| { 1590| 1| libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type); 1591| 1| YYABORT; ------------------ | | 843| 1|#define YYABORT goto yyabortlab ------------------ 1592| 1| } 1593| 472| else 1594| 472| { 1595| 472| config_setting_set_format(e, CONFIG_FORMAT_OCT); ------------------ | | 62| 472|#define CONFIG_FORMAT_OCT 3 ------------------ 1596| 472| CAPTURE_PARSE_POS(e); ------------------ | | 108| 472| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1597| 472| } 1598| 473| } 1599| 220| else 1600| 220| { 1601| 220| config_setting_set_int(ctx->setting, (yyvsp[0].ival)); 1602| 220| config_setting_set_format(ctx->setting, CONFIG_FORMAT_OCT); ------------------ | | 62| 220|#define CONFIG_FORMAT_OCT 3 ------------------ 1603| 220| } 1604| 693| } 1605| 692|#line 1606 "grammar.c" 1606| 692| break; 1607| | 1608| 692| case 31: /* simple_value: TOK_OCT64 */ ------------------ | Branch (1608:3): [True: 532, False: 224k] ------------------ 1609| 532|#line 373 "grammar.y" 1610| 532| { 1611| 532| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 1.06k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 532|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 532, False: 0] | | | Branch (95:19): [True: 207, False: 325] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 325| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 325|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 325, False: 0] | | | Branch (98:19): [True: 237, False: 88] | | ------------------ ------------------ 1612| 444| { 1613| 444| config_setting_t *e = config_setting_set_int64_elem(ctx->parent, -1, (yyvsp[0].llval)); 1614| 444| if(! e) ------------------ | Branch (1614:10): [True: 1, False: 443] ------------------ 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| 443| else 1620| 443| { 1621| 443| config_setting_set_format(e, CONFIG_FORMAT_OCT); ------------------ | | 62| 443|#define CONFIG_FORMAT_OCT 3 ------------------ 1622| 443| CAPTURE_PARSE_POS(e); ------------------ | | 108| 443| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1623| 443| } 1624| 444| } 1625| 88| else 1626| 88| { 1627| 88| config_setting_set_int64(ctx->setting, (yyvsp[0].llval)); 1628| 88| config_setting_set_format(ctx->setting, CONFIG_FORMAT_OCT); ------------------ | | 62| 88|#define CONFIG_FORMAT_OCT 3 ------------------ 1629| 88| } 1630| 532| } 1631| 531|#line 1632 "grammar.c" 1632| 531| break; 1633| | 1634| 15.2k| case 32: /* simple_value: TOK_FLOAT */ ------------------ | Branch (1634:3): [True: 15.2k, False: 209k] ------------------ 1635| 15.2k|#line 395 "grammar.y" 1636| 15.2k| { 1637| 15.2k| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 30.4k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 15.2k|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 15.2k, False: 0] | | | Branch (95:19): [True: 5.39k, False: 9.83k] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 9.83k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 9.83k|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 9.83k, False: 0] | | | Branch (98:19): [True: 8.26k, False: 1.57k] | | ------------------ ------------------ 1638| 13.6k| { 1639| 13.6k| config_setting_t *e = config_setting_set_float_elem(ctx->parent, -1, (yyvsp[0].fval)); 1640| 13.6k| if(! e) ------------------ | Branch (1640:10): [True: 4, False: 13.6k] ------------------ 1641| 4| { 1642| 4| libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type); 1643| 4| YYABORT; ------------------ | | 843| 4|#define YYABORT goto yyabortlab ------------------ 1644| 4| } 1645| 13.6k| else 1646| 13.6k| { 1647| 13.6k| CAPTURE_PARSE_POS(e); ------------------ | | 108| 13.6k| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1648| 13.6k| } 1649| 13.6k| } 1650| 1.57k| else 1651| 1.57k| config_setting_set_float(ctx->setting, (yyvsp[0].fval)); 1652| 15.2k| } 1653| 15.2k|#line 1654 "grammar.c" 1654| 15.2k| break; 1655| | 1656| 15.2k| case 33: /* simple_value: string */ ------------------ | Branch (1656:3): [True: 2.07k, False: 222k] ------------------ 1657| 2.07k|#line 413 "grammar.y" 1658| 2.07k| { 1659| 2.07k| if(IN_ARRAY() || IN_LIST()) ------------------ | | 95| 4.15k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY)) | | ------------------ | | | | 56| 2.07k|#define CONFIG_TYPE_ARRAY 7 | | ------------------ | | | Branch (95:4): [True: 2.07k, False: 0] | | | Branch (95:19): [True: 864, False: 1.21k] | | ------------------ ------------------ if(IN_ARRAY() || IN_LIST()) ------------------ | | 98| 1.21k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 1.21k|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 1.21k, False: 0] | | | Branch (98:19): [True: 619, False: 595] | | ------------------ ------------------ 1660| 1.48k| { 1661| 1.48k| const char *s = libconfig_parsectx_take_string(ctx); ------------------ | | 47| 1.48k| libconfig_strbuf_release(&((C)->string)) ------------------ 1662| 1.48k| config_setting_t *e = config_setting_set_string_elem(ctx->parent, -1, s); 1663| 1.48k| __delete(s); ------------------ | | 38| 1.48k|#define __delete(P) free((void *)(P)) ------------------ 1664| | 1665| 1.48k| if(! e) ------------------ | Branch (1665:10): [True: 1, False: 1.48k] ------------------ 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.48k| else 1671| 1.48k| { 1672| 1.48k| CAPTURE_PARSE_POS(e); ------------------ | | 108| 1.48k| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1673| 1.48k| } 1674| 1.48k| } 1675| 595| else 1676| 595| { 1677| 595| const char *s = libconfig_parsectx_take_string(ctx); ------------------ | | 47| 595| libconfig_strbuf_release(&((C)->string)) ------------------ 1678| 595| config_setting_set_string(ctx->setting, s); 1679| 595| __delete(s); ------------------ | | 38| 595|#define __delete(P) free((void *)(P)) ------------------ 1680| 595| } 1681| 2.07k| } 1682| 2.07k|#line 1683 "grammar.c" 1683| 2.07k| break; 1684| | 1685| 5.22k| case 44: /* $@4: %empty */ ------------------ | Branch (1685:3): [True: 5.22k, False: 219k] ------------------ 1686| 5.22k|#line 463 "grammar.y" 1687| 5.22k| { 1688| 5.22k| if(IN_LIST()) ------------------ | | 98| 5.22k| (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST)) | | ------------------ | | | | 57| 5.22k|#define CONFIG_TYPE_LIST 8 | | ------------------ | | | Branch (98:4): [True: 5.22k, False: 0] | | | Branch (98:19): [True: 995, False: 4.22k] | | ------------------ ------------------ 1689| 995| { 1690| 995| ctx->parent = config_setting_add(ctx->parent, NULL, CONFIG_TYPE_GROUP); ------------------ | | 50| 995|#define CONFIG_TYPE_GROUP 1 ------------------ 1691| 995| CAPTURE_PARSE_POS(ctx->parent); ------------------ | | 108| 995| capture_parse_pos(scanner, scan_ctx, (S)) ------------------ 1692| 995| } 1693| 4.22k| else 1694| 4.22k| { 1695| 4.22k| ctx->setting->type = CONFIG_TYPE_GROUP; ------------------ | | 50| 4.22k|#define CONFIG_TYPE_GROUP 1 ------------------ 1696| 4.22k| ctx->parent = ctx->setting; 1697| 4.22k| ctx->setting = NULL; 1698| 4.22k| } 1699| 5.22k| } 1700| 5.22k|#line 1701 "grammar.c" 1701| 5.22k| break; 1702| | 1703| 4.05k| case 45: /* group: TOK_GROUP_START $@4 setting_list_optional TOK_GROUP_END */ ------------------ | Branch (1703:3): [True: 4.05k, False: 220k] ------------------ 1704| 4.05k|#line 478 "grammar.y" 1705| 4.05k| { 1706| 4.05k| if(ctx->parent) ------------------ | Branch (1706:8): [True: 4.05k, False: 0] ------------------ 1707| 4.05k| ctx->parent = ctx->parent->parent; 1708| 4.05k| } 1709| 4.05k|#line 1710 "grammar.c" 1710| 4.05k| break; 1711| | 1712| | 1713| 0|#line 1714 "grammar.c" 1714| | 1715| 110k| default: break; ------------------ | Branch (1715:7): [True: 110k, False: 114k] ------------------ 1716| 224k| } 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| 224k| YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); 1729| | 1730| 224k| YYPOPSTACK (yylen); ------------------ | | 1110| 224k|#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) ------------------ 1731| 224k| yylen = 0; 1732| | 1733| 224k| *++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| 224k| { 1739| 224k| const int yylhs = yyr1[yyn] - YYNTOKENS; ------------------ | | 634| 224k|#define YYNTOKENS 27 ------------------ 1740| 224k| const int yyi = yypgoto[yylhs] + *yyssp; 1741| 224k| yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp ------------------ | | 631| 402k|#define YYLAST 50 ------------------ | Branch (1741:16): [True: 177k, False: 46.8k] | Branch (1741:28): [True: 177k, False: 0] | Branch (1741:45): [True: 46.0k, False: 131k] ------------------ 1742| 224k| ? yytable[yyi] 1743| 224k| : yydefgoto[yylhs]); 1744| 224k| } 1745| | 1746| 224k| goto yynewstate; 1747| | 1748| | 1749| |/*--------------------------------------. 1750| || yyerrlab -- here on detecting error. | 1751| |`--------------------------------------*/ 1752| 394|yyerrlab: 1753| | /* Make sure we have latest lookahead translation. See comments at 1754| | user semantic actions for why this is necessary. */ 1755| 394| yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); ------------------ | | 191| 394|#define YYEMPTY -2 ------------------ yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); ------------------ | | 649| 788| (0 <= (YYX) && (YYX) <= YYMAXUTOK \ | | ------------------ | | | | 643| 394|#define YYMAXUTOK 281 | | ------------------ | | | Branch (649:4): [True: 394, False: 0] | | | Branch (649:18): [True: 394, False: 0] | | ------------------ | | 650| 788| ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ | | ------------------ | | | | 126| 394|# define YY_CAST(Type, Val) ((Type) (Val)) | | ------------------ | | 651| 788| : YYSYMBOL_YYUNDEF) ------------------ | Branch (1755:13): [True: 0, False: 394] ------------------ 1756| | /* If not already recovering from an error, report this error. */ 1757| 394| if (!yyerrstatus) ------------------ | Branch (1757:7): [True: 394, False: 0] ------------------ 1758| 394| { 1759| 394| ++yynerrs; ------------------ | | 72| 394|#define yynerrs libconfig_yynerrs ------------------ 1760| 394| yyerror (scanner, ctx, scan_ctx, YY_("syntax error")); ------------------ | | 70| 394|#define yyerror libconfig_yyerror ------------------ yyerror (scanner, ctx, scan_ctx, YY_("syntax error")); ------------------ | | 433| 394|# define YY_(Msgid) Msgid ------------------ 1761| 394| } 1762| | 1763| 394| if (yyerrstatus == 3) ------------------ | Branch (1763:7): [True: 0, False: 394] ------------------ 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| 394| goto yyerrlab1; 1785| | 1786| | 1787| |/*---------------------------------------------------. 1788| || yyerrorlab -- error raised explicitly by YYERROR. | 1789| |`---------------------------------------------------*/ 1790| 394|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| 394|yyerrlab1: 1810| 394| yyerrstatus = 3; /* Each real token shifted decrements this. */ 1811| | 1812| | /* Pop stack until we find a state that shifts the error token. */ 1813| 394| for (;;) 1814| 98.8k| { 1815| 98.8k| yyn = yypact[yystate]; 1816| 98.8k| if (!yypact_value_is_default (yyn)) ------------------ | | 735| 98.8k| ((Yyn) == YYPACT_NINF) | | ------------------ | | | | 732| 98.8k|#define YYPACT_NINF (-19) | | ------------------ ------------------ | Branch (1816:11): [True: 50.4k, False: 48.4k] ------------------ 1817| 50.4k| { 1818| 50.4k| yyn += YYSYMBOL_YYerror; 1819| 50.4k| if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) ------------------ | | 631| 53.3k|#define YYLAST 50 ------------------ | Branch (1819:15): [True: 2.96k, False: 47.4k] | Branch (1819:27): [True: 2.96k, False: 0] | Branch (1819:44): [True: 0, False: 2.96k] ------------------ 1820| 0| { 1821| 0| yyn = yytable[yyn]; 1822| 0| if (0 < yyn) ------------------ | Branch (1822:19): [True: 0, False: 0] ------------------ 1823| 0| break; 1824| 0| } 1825| 50.4k| } 1826| | 1827| | /* Pop the current state because it cannot handle the error token. */ 1828| 98.8k| if (yyssp == yyss) ------------------ | Branch (1828:11): [True: 394, False: 98.4k] ------------------ 1829| 394| YYABORT; ------------------ | | 843| 394|#define YYABORT goto yyabortlab ------------------ 1830| | 1831| | 1832| 98.4k| yydestruct ("Error: popping", 1833| 98.4k| YY_ACCESSING_SYMBOL (yystate), yyvsp, scanner, ctx, scan_ctx); ------------------ | | 701| 98.4k|#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) | | ------------------ | | | | 126| 98.4k|# define YY_CAST(Type, Val) ((Type) (Val)) | | ------------------ ------------------ 1834| 98.4k| YYPOPSTACK (1); ------------------ | | 1110| 98.4k|#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) ------------------ 1835| 98.4k| yystate = *yyssp; 1836| 98.4k| YY_STACK_PRINT (yyss, yyssp); 1837| 98.4k| } 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.91k|yyacceptlab: 1855| 1.91k| yyresult = 0; 1856| 1.91k| goto yyreturnlab; 1857| | 1858| | 1859| |/*-----------------------------------. 1860| || yyabortlab -- YYABORT comes here. | 1861| |`-----------------------------------*/ 1862| 440|yyabortlab: 1863| 440| yyresult = 1; 1864| 440| 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.35k|yyreturnlab: 1880| 2.35k| if (yychar != YYEMPTY) ------------------ | | 191| 2.35k|#define YYEMPTY -2 ------------------ | Branch (1880:7): [True: 395, False: 1.96k] ------------------ 1881| 395| { 1882| | /* Make sure we have latest lookahead translation. See comments at 1883| | user semantic actions for why this is necessary. */ 1884| 395| yytoken = YYTRANSLATE (yychar); ------------------ | | 649| 395| (0 <= (YYX) && (YYX) <= YYMAXUTOK \ | | ------------------ | | | | 643| 395|#define YYMAXUTOK 281 | | ------------------ | | | Branch (649:4): [True: 395, False: 0] | | | Branch (649:18): [True: 395, False: 0] | | ------------------ | | 650| 395| ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ | | ------------------ | | | | 126| 395|# define YY_CAST(Type, Val) ((Type) (Val)) | | ------------------ | | 651| 395| : YYSYMBOL_YYUNDEF) ------------------ 1885| 395| yydestruct ("Cleanup: discarding lookahead", 1886| 395| yytoken, &yylval, scanner, ctx, scan_ctx); 1887| 395| } 1888| | /* Do not reclaim the symbols of the rule whose action triggered 1889| | this YYABORT or YYACCEPT. */ 1890| 2.35k| YYPOPSTACK (yylen); ------------------ | | 1110| 2.35k|#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) ------------------ 1891| 2.35k| YY_STACK_PRINT (yyss, yyssp); 1892| 7.95k| while (yyssp != yyss) ------------------ | Branch (1892:10): [True: 5.59k, False: 2.35k] ------------------ 1893| 5.59k| { 1894| 5.59k| yydestruct ("Cleanup: popping", 1895| 5.59k| YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, scanner, ctx, scan_ctx); ------------------ | | 701| 5.59k|#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) | | ------------------ | | | | 126| 5.59k|# define YY_CAST(Type, Val) ((Type) (Val)) | | ------------------ ------------------ 1896| 5.59k| YYPOPSTACK (1); ------------------ | | 1110| 5.59k|#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) ------------------ 1897| 5.59k| } 1898| 2.35k|#ifndef yyoverflow 1899| 2.35k| if (yyss != yyssa) ------------------ | Branch (1899:7): [True: 64, False: 2.29k] ------------------ 1900| 64| YYSTACK_FREE (yyss); ------------------ | | 541| 64|# define YYSTACK_FREE YYFREE | | ------------------ | | | | 560| 64|# define YYFREE free | | ------------------ ------------------ 1901| 2.35k|#endif 1902| | 1903| 2.35k| return yyresult; 1904| 394|} grammar.c:capture_parse_pos: 102| 89.3k|{ 103| 89.3k| setting->line = (unsigned int)libconfig_yyget_lineno(scanner); 104| 89.3k| setting->file = libconfig_scanctx_current_filename(scan_ctx); 105| 89.3k|} grammar.c:yydestruct: 1030| 104k|{ 1031| 104k| YY_USE (yyvaluep); ------------------ | | 456| 104k|# define YY_USE(E) ((void) (E)) ------------------ 1032| 104k| YY_USE (scanner); ------------------ | | 456| 104k|# define YY_USE(E) ((void) (E)) ------------------ 1033| 104k| YY_USE (ctx); ------------------ | | 456| 104k|# define YY_USE(E) ((void) (E)) ------------------ 1034| 104k| YY_USE (scan_ctx); ------------------ | | 456| 104k|# define YY_USE(E) ((void) (E)) ------------------ 1035| 104k| if (!yymsg) ------------------ | Branch (1035:7): [True: 0, False: 104k] ------------------ 1036| 0| yymsg = "Deleting"; 1037| 104k| YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); 1038| | 1039| 104k| YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1040| 104k| switch (yykind) 1041| 104k| { 1042| 6| case YYSYMBOL_TOK_STRING: /* TOK_STRING */ ------------------ | Branch (1042:5): [True: 6, False: 104k] ------------------ 1043| 6|#line 95 "grammar.y" 1044| 6| { free(((*yyvaluep).sval)); } 1045| 6|#line 1046 "grammar.c" 1046| 6| break; 1047| | 1048| 104k| default: ------------------ | Branch (1048:7): [True: 104k, False: 6] ------------------ 1049| 104k| break; 1050| 104k| } 1051| 104k| YY_IGNORE_MAYBE_UNINITIALIZED_END 1052| 104k|} config_read_string: 619| 2.35k|{ 620| 2.35k| config_assert(config != NULL); 621| 2.35k| config_assert(str != NULL); 622| | 623| 2.35k| return(__config_read(config, NULL, NULL, str)); 624| 2.35k|} config_write: 665| 1.33k|{ 666| 1.33k| config_assert(config != NULL); 667| 1.33k| config_assert(stream != NULL); 668| | 669| 1.33k| __config_locale_override(); 670| | 671| 1.33k| __config_write_setting(config, config->root, stream, 0); 672| | 673| 1.33k| __config_locale_restore(); 674| 1.33k|} config_destroy: 760| 2.48k|{ 761| 2.48k| if(config == NULL) ------------------ | Branch (761:6): [True: 0, False: 2.48k] ------------------ 762| 0| return; 763| | 764| 2.48k| __config_setting_destroy(config->root); 765| 2.48k| libconfig_strvec_delete(config->filenames); 766| 2.48k| __delete(config->include_dir); ------------------ | | 38| 2.48k|#define __delete(P) free((void *)(P)) ------------------ 767| 2.48k| __zero(config); ------------------ | | 39| 2.48k|#define __zero(P) memset((void *)(P), 0, sizeof(*P)) ------------------ 768| 2.48k|} config_clear: 773| 4.82k|{ 774| 4.82k| config_assert(config != NULL); 775| | 776| | /* Destroy the root setting (recursively) and then create a new one. */ 777| 4.82k| __config_setting_destroy(config->root); 778| | 779| 4.82k| libconfig_strvec_delete(config->filenames); 780| 4.82k| config->filenames = NULL; 781| | 782| 4.82k| config->root = __new(config_setting_t); ------------------ | | 37| 4.82k|#define __new(T) (T *)libconfig_calloc(1, sizeof(T)) /* zeroed */ ------------------ 783| 4.82k| config->root->type = CONFIG_TYPE_GROUP; ------------------ | | 50| 4.82k|#define CONFIG_TYPE_GROUP 1 ------------------ 784| 4.82k| config->root->config = config; 785| 4.82k|} config_init: 827| 2.46k|{ 828| 2.46k| config_assert(config != NULL); 829| | 830| 2.46k| __zero(config); ------------------ | | 39| 2.46k|#define __zero(P) memset((void *)(P), 0, sizeof(*P)) ------------------ 831| 2.46k| config_clear(config); 832| | 833| | /* Set default options. */ 834| 2.46k| config->options = (CONFIG_OPTION_SEMICOLON_SEPARATORS ------------------ | | 65| 2.46k|#define CONFIG_OPTION_SEMICOLON_SEPARATORS 0x02 ------------------ 835| 2.46k| | CONFIG_OPTION_COLON_ASSIGNMENT_FOR_GROUPS ------------------ | | 66| 2.46k|#define CONFIG_OPTION_COLON_ASSIGNMENT_FOR_GROUPS 0x04 ------------------ 836| 2.46k| | CONFIG_OPTION_OPEN_BRACE_ON_SEPARATE_LINE); ------------------ | | 68| 2.46k|#define CONFIG_OPTION_OPEN_BRACE_ON_SEPARATE_LINE 0x10 ------------------ 837| 2.46k| config->tab_width = DEFAULT_TAB_WIDTH; ------------------ | | 52| 2.46k|#define DEFAULT_TAB_WIDTH 2 ------------------ 838| 2.46k| config->float_precision = DEFAULT_FLOAT_PRECISION; ------------------ | | 53| 2.46k|#define DEFAULT_FLOAT_PRECISION 6 ------------------ 839| 2.46k| config->include_fn = config_default_include_func; 840| 2.46k|} config_get_option: 875| 47.7k|{ 876| 47.7k| config_assert(config != NULL); 877| | 878| 47.7k| return((config->options & option) == option); 879| 47.7k|} config_setting_lookup_int: 1039| 217|{ 1040| 217| config_setting_t *member; 1041| | 1042| 217| config_assert(setting != NULL); 1043| 217| config_assert(value != NULL); 1044| | 1045| 217| member = config_setting_get_member(setting, name); 1046| 217| if(! member) ------------------ | Branch (1046:6): [True: 41, False: 176] ------------------ 1047| 41| return(CONFIG_FALSE); ------------------ | | 74| 41|#define CONFIG_FALSE (0) ------------------ 1048| | 1049| 176| return(__config_setting_get_int(member, value)); 1050| 217|} config_setting_lookup_int64: 1056| 57|{ 1057| 57| config_setting_t *member; 1058| | 1059| 57| config_assert(setting != NULL); 1060| 57| config_assert(name != NULL); 1061| 57| config_assert(value != NULL); 1062| | 1063| 57| member = config_setting_get_member(setting, name); 1064| 57| if(! member) ------------------ | Branch (1064:6): [True: 46, False: 11] ------------------ 1065| 46| return(CONFIG_FALSE); ------------------ | | 74| 46|#define CONFIG_FALSE (0) ------------------ 1066| | 1067| 11| return(__config_setting_get_int64(member, value)); 1068| 57|} config_setting_lookup_float: 1128| 57|{ 1129| 57| config_setting_t *member; 1130| | 1131| 57| config_assert(setting != NULL); 1132| 57| config_assert(name != NULL); 1133| 57| config_assert(value != NULL); 1134| | 1135| 57| member = config_setting_get_member(setting, name); 1136| 57| if(! member) ------------------ | Branch (1136:6): [True: 47, False: 10] ------------------ 1137| 47| return(CONFIG_FALSE); ------------------ | | 74| 47|#define CONFIG_FALSE (0) ------------------ 1138| | 1139| 10| return(__config_setting_get_float(member, value)); 1140| 57|} config_setting_lookup_string: 1146| 55|{ 1147| 55| config_setting_t *member; 1148| | 1149| 55| config_assert(setting != NULL); 1150| 55| config_assert(name != NULL); 1151| 55| config_assert(value != NULL); 1152| | 1153| 55| member = config_setting_get_member(setting, name); 1154| 55| if(! member) ------------------ | Branch (1154:6): [True: 48, False: 7] ------------------ 1155| 48| return(CONFIG_FALSE); ------------------ | | 74| 48|#define CONFIG_FALSE (0) ------------------ 1156| | 1157| 7| if(config_setting_type(member) != CONFIG_TYPE_STRING) ------------------ | | 274| 7| ((S)->type) ------------------ if(config_setting_type(member) != CONFIG_TYPE_STRING) ------------------ | | 54| 7|#define CONFIG_TYPE_STRING 5 ------------------ | Branch (1157:6): [True: 6, False: 1] ------------------ 1158| 6| return(CONFIG_FALSE); ------------------ | | 74| 6|#define CONFIG_FALSE (0) ------------------ 1159| | 1160| 1| *value = config_setting_get_string(member); 1161| 1| return(CONFIG_TRUE); ------------------ | | 73| 1|#define CONFIG_TRUE (1) ------------------ 1162| 7|} config_setting_lookup_bool: 1168| 51|{ 1169| 51| config_setting_t *member; 1170| | 1171| 51| config_assert(setting != NULL); 1172| 51| config_assert(name != NULL); 1173| 51| config_assert(value != NULL); 1174| | 1175| 51| member = config_setting_get_member(setting, name); 1176| 51| if(! member) ------------------ | Branch (1176:6): [True: 45, False: 6] ------------------ 1177| 45| return(CONFIG_FALSE); ------------------ | | 74| 45|#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.48k| case CONFIG_TYPE_NONE: ------------------ | | 49| 4.48k|#define CONFIG_TYPE_NONE 0 ------------------ | Branch (1194:5): [True: 4.48k, False: 6.16k] ------------------ 1195| 4.48k| setting->type = CONFIG_TYPE_INT; ------------------ | | 51| 4.48k|#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.16k, False: 4.48k] ------------------ 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.84k|{ 1220| 4.84k| config_assert(setting != NULL); 1221| | 1222| 4.84k| switch(setting->type) 1223| 4.84k| { 1224| 1.31k| case CONFIG_TYPE_NONE: ------------------ | | 49| 1.31k|#define CONFIG_TYPE_NONE 0 ------------------ | Branch (1224:5): [True: 1.31k, False: 3.53k] ------------------ 1225| 1.31k| setting->type = CONFIG_TYPE_INT64; ------------------ | | 52| 1.31k|#define CONFIG_TYPE_INT64 3 ------------------ 1226| | /* fall through */ 1227| | 1228| 4.84k| case CONFIG_TYPE_INT64: ------------------ | | 52| 4.84k|#define CONFIG_TYPE_INT64 3 ------------------ | Branch (1228:5): [True: 3.53k, False: 1.31k] ------------------ 1229| 4.84k| setting->value.llval = value; 1230| 4.84k| return(CONFIG_TRUE); ------------------ | | 73| 4.84k|#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.84k] ------------------ 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.84k] ------------------ 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.84k] ------------------ 1251| 0| return(CONFIG_FALSE); ------------------ | | 74| 0|#define CONFIG_FALSE (0) ------------------ 1252| 4.84k| } 1253| 4.84k|} config_setting_set_float: 1258| 16.5k|{ 1259| 16.5k| config_assert(setting != NULL); 1260| | 1261| 16.5k| switch(setting->type) 1262| 16.5k| { 1263| 1.57k| case CONFIG_TYPE_NONE: ------------------ | | 49| 1.57k|#define CONFIG_TYPE_NONE 0 ------------------ | Branch (1263:5): [True: 1.57k, False: 14.9k] ------------------ 1264| 1.57k| setting->type = CONFIG_TYPE_FLOAT; ------------------ | | 53| 1.57k|#define CONFIG_TYPE_FLOAT 4 ------------------ 1265| | /* fall through */ 1266| | 1267| 16.1k| case CONFIG_TYPE_FLOAT: ------------------ | | 53| 16.1k|#define CONFIG_TYPE_FLOAT 4 ------------------ | Branch (1267:5): [True: 14.5k, False: 2.01k] ------------------ 1268| 16.1k| setting->value.fval = value; 1269| 16.1k| return(CONFIG_TRUE); ------------------ | | 73| 16.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: 16.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| 6| case CONFIG_TYPE_INT64: ------------------ | | 52| 6|#define CONFIG_TYPE_INT64 3 ------------------ | Branch (1280:5): [True: 6, False: 16.5k] ------------------ 1281| 6| if(config_get_option(setting->config, CONFIG_OPTION_AUTOCONVERT)) ------------------ | | 64| 6|#define CONFIG_OPTION_AUTOCONVERT 0x01 ------------------ | Branch (1281:10): [True: 0, False: 6] ------------------ 1282| 0| { 1283| 0| setting->value.llval = (long long)value; 1284| 0| return(CONFIG_TRUE); ------------------ | | 73| 0|#define CONFIG_TRUE (1) ------------------ 1285| 0| } 1286| 6| else 1287| 6| return(CONFIG_FALSE); ------------------ | | 74| 6|#define CONFIG_FALSE (0) ------------------ 1288| | 1289| 426| default: ------------------ | Branch (1289:5): [True: 426, False: 16.1k] ------------------ 1290| 426| return(CONFIG_FALSE); ------------------ | | 74| 426|#define CONFIG_FALSE (0) ------------------ 1291| 16.5k| } 1292| 16.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.38k|{ 1324| 1.38k| config_assert(setting != NULL); 1325| | 1326| 1.38k| if(setting->type == CONFIG_TYPE_NONE) ------------------ | | 49| 1.38k|#define CONFIG_TYPE_NONE 0 ------------------ | Branch (1326:6): [True: 426, False: 958] ------------------ 1327| 426| setting->type = CONFIG_TYPE_BOOL; ------------------ | | 55| 426|#define CONFIG_TYPE_BOOL 6 ------------------ 1328| 958| else if(setting->type != CONFIG_TYPE_BOOL) ------------------ | | 55| 958|#define CONFIG_TYPE_BOOL 6 ------------------ | Branch (1328:11): [True: 0, False: 958] ------------------ 1329| 0| return(CONFIG_FALSE); ------------------ | | 74| 0|#define CONFIG_FALSE (0) ------------------ 1330| | 1331| 1.38k| setting->value.ival = value; 1332| 1.38k| return(CONFIG_TRUE); ------------------ | | 73| 1.38k|#define CONFIG_TRUE (1) ------------------ 1333| 1.38k|} 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.07k|{ 1365| 2.07k| config_assert(setting != NULL); 1366| 2.07k| config_assert(value != NULL); 1367| | 1368| 2.07k| if(setting->type == CONFIG_TYPE_NONE) ------------------ | | 49| 2.07k|#define CONFIG_TYPE_NONE 0 ------------------ | Branch (1368:6): [True: 595, False: 1.48k] ------------------ 1369| 595| setting->type = CONFIG_TYPE_STRING; ------------------ | | 54| 595|#define CONFIG_TYPE_STRING 5 ------------------ 1370| 1.48k| else if(setting->type != CONFIG_TYPE_STRING) ------------------ | | 54| 1.48k|#define CONFIG_TYPE_STRING 5 ------------------ | Branch (1370:11): [True: 0, False: 1.48k] ------------------ 1371| 0| return(CONFIG_FALSE); ------------------ | | 74| 0|#define CONFIG_FALSE (0) ------------------ 1372| | 1373| 2.07k| if(setting->value.sval) ------------------ | Branch (1373:6): [True: 0, False: 2.07k] ------------------ 1374| 0| __delete(setting->value.sval); ------------------ | | 38| 0|#define __delete(P) free((void *)(P)) ------------------ 1375| | 1376| 2.07k| setting->value.sval = (value == NULL) ? NULL : strdup(value); ------------------ | Branch (1376:25): [True: 0, False: 2.07k] ------------------ 1377| | 1378| 2.07k| return(CONFIG_TRUE); ------------------ | | 73| 2.07k|#define CONFIG_TRUE (1) ------------------ 1379| 2.07k|} config_setting_set_format: 1384| 15.4k|{ 1385| 15.4k| config_assert(setting != NULL); 1386| | 1387| 15.4k| if(((setting->type != CONFIG_TYPE_INT) ------------------ | | 51| 15.4k|#define CONFIG_TYPE_INT 2 ------------------ | Branch (1387:7): [True: 4.84k, False: 10.6k] ------------------ 1388| 4.84k| && (setting->type != CONFIG_TYPE_INT64)) ------------------ | | 52| 4.84k|#define CONFIG_TYPE_INT64 3 ------------------ | Branch (1388:10): [True: 0, False: 4.84k] ------------------ 1389| 15.4k| || ((format != CONFIG_FORMAT_DEFAULT) ------------------ | | 59| 15.4k|#define CONFIG_FORMAT_DEFAULT 0 ------------------ | Branch (1389:10): [True: 6.41k, False: 9.08k] ------------------ 1390| 6.41k| && (format != CONFIG_FORMAT_HEX) ------------------ | | 60| 6.41k|#define CONFIG_FORMAT_HEX 1 ------------------ | Branch (1390:13): [True: 3.52k, False: 2.89k] ------------------ 1391| 3.52k| && (format != CONFIG_FORMAT_BIN))) ------------------ | | 61| 3.52k|#define CONFIG_FORMAT_BIN 2 ------------------ | Branch (1391:13): [True: 1.22k, False: 2.29k] ------------------ 1392| 1.22k| return(CONFIG_FALSE); ------------------ | | 74| 1.22k|#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.4k|} config_setting_get_format: 1402| 32.0k|{ 1403| 32.0k| config_assert(setting != NULL); 1404| | 1405| 32.0k| return(setting->format != 0 ? setting->format ------------------ | Branch (1405:10): [True: 3.19k, False: 28.8k] ------------------ 1406| 32.0k| : setting->config->default_format); 1407| 32.0k|} config_setting_lookup_const: 1413| 1.37k|{ 1414| 1.37k| const char *p = path; 1415| 1.37k| const config_setting_t *found = setting; 1416| | 1417| 1.37k| config_assert(setting != NULL); 1418| 1.37k| config_assert(path != NULL); 1419| | 1420| 2.72k| while(*p && found) ------------------ | Branch (1420:9): [True: 1.37k, False: 1.34k] | Branch (1420:15): [True: 1.37k, False: 0] ------------------ 1421| 1.37k| { 1422| 1.37k| if(strchr(PATH_TOKENS, *p)) ------------------ | | 50| 1.37k|#define PATH_TOKENS ":./" ------------------ | Branch (1422:8): [True: 0, False: 1.37k] ------------------ 1423| 0| ++p; 1424| | 1425| 1.37k| if(*p == '[') ------------------ | Branch (1425:8): [True: 0, False: 1.37k] ------------------ 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.37k| else if(found->type == CONFIG_TYPE_GROUP) ------------------ | | 50| 1.37k|#define CONFIG_TYPE_GROUP 1 ------------------ | Branch (1435:13): [True: 1.34k, False: 26] ------------------ 1436| 1.34k| { 1437| 1.34k| const char *q = p; 1438| | 1439| 7.53k| while(*q && !strchr(PATH_TOKENS, *q)) ------------------ | | 50| 6.19k|#define PATH_TOKENS ":./" ------------------ | Branch (1439:13): [True: 6.19k, False: 1.34k] | Branch (1439:19): [True: 6.19k, False: 0] ------------------ 1440| 6.19k| ++q; 1441| | 1442| 1.34k| found = __config_list_search(found->value.list, p, (size_t)(q - p), 1443| 1.34k| NULL); 1444| 1.34k| p = q; 1445| 1.34k| } 1446| 26| else 1447| 26| break; 1448| 1.37k| } 1449| | 1450| 1.37k| return((*p || (found == setting)) ? NULL : found); ------------------ | Branch (1450:11): [True: 26, False: 1.34k] | Branch (1450:17): [True: 0, False: 1.34k] ------------------ 1451| 1.37k|} config_setting_lookup: 1457| 1.33k|{ 1458| 1.33k| config_assert(setting != NULL); 1459| 1.33k| config_assert(path != NULL); 1460| | 1461| 1.33k| return((config_setting_t *)config_setting_lookup_const(setting, path)); 1462| 1.33k|} config_setting_set_int_elem: 1601| 6.18k|{ 1602| 6.18k| config_setting_t *element = NULL; 1603| | 1604| 6.18k| config_assert(setting != NULL); 1605| | 1606| 6.18k| if((setting->type != CONFIG_TYPE_ARRAY) ------------------ | | 56| 6.18k|#define CONFIG_TYPE_ARRAY 7 ------------------ | Branch (1606:6): [True: 4.07k, False: 2.10k] ------------------ 1607| 4.07k| && (setting->type != CONFIG_TYPE_LIST)) ------------------ | | 57| 4.07k|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (1607:9): [True: 0, False: 4.07k] ------------------ 1608| 0| return(NULL); 1609| | 1610| 6.18k| if(idx < 0) ------------------ | Branch (1610:6): [True: 6.18k, False: 0] ------------------ 1611| 6.18k| { 1612| 6.18k| if(! __config_list_checktype(setting, CONFIG_TYPE_INT)) ------------------ | | 51| 6.18k|#define CONFIG_TYPE_INT 2 ------------------ | Branch (1612:8): [True: 17, False: 6.16k] ------------------ 1613| 17| return(NULL); 1614| | 1615| 6.16k| element = __config_setting_create(setting, NULL, CONFIG_TYPE_INT); ------------------ | | 51| 6.16k|#define CONFIG_TYPE_INT 2 ------------------ 1616| 6.16k| } 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.16k| if(! config_setting_set_int(element, value)) ------------------ | Branch (1625:6): [True: 0, False: 6.16k] ------------------ 1626| 0| return(NULL); 1627| | 1628| 6.16k| return(element); 1629| 6.16k|} config_setting_set_int64_elem: 1649| 3.53k|{ 1650| 3.53k| config_setting_t *element = NULL; 1651| | 1652| 3.53k| config_assert(setting != NULL); 1653| | 1654| 3.53k| if((setting->type != CONFIG_TYPE_ARRAY) ------------------ | | 56| 3.53k|#define CONFIG_TYPE_ARRAY 7 ------------------ | Branch (1654:6): [True: 1.74k, False: 1.78k] ------------------ 1655| 1.74k| && (setting->type != CONFIG_TYPE_LIST)) ------------------ | | 57| 1.74k|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (1655:9): [True: 0, False: 1.74k] ------------------ 1656| 0| return(NULL); 1657| | 1658| 3.53k| if(idx < 0) ------------------ | Branch (1658:6): [True: 3.53k, False: 0] ------------------ 1659| 3.53k| { 1660| 3.53k| if(! __config_list_checktype(setting, CONFIG_TYPE_INT64)) ------------------ | | 52| 3.53k|#define CONFIG_TYPE_INT64 3 ------------------ | Branch (1660:8): [True: 5, False: 3.53k] ------------------ 1661| 5| return(NULL); 1662| | 1663| 3.53k| element = __config_setting_create(setting, NULL, CONFIG_TYPE_INT64); ------------------ | | 52| 3.53k|#define CONFIG_TYPE_INT64 3 ------------------ 1664| 3.53k| } 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.53k| if(! config_setting_set_int64(element, value)) ------------------ | Branch (1673:6): [True: 0, False: 3.53k] ------------------ 1674| 0| return(NULL); 1675| | 1676| 3.53k| return(element); 1677| 3.53k|} config_setting_set_float_elem: 1696| 13.6k|{ 1697| 13.6k| config_setting_t *element = NULL; 1698| | 1699| 13.6k| config_assert(setting != NULL); 1700| | 1701| 13.6k| if((setting->type != CONFIG_TYPE_ARRAY) ------------------ | | 56| 13.6k|#define CONFIG_TYPE_ARRAY 7 ------------------ | Branch (1701:6): [True: 8.26k, False: 5.39k] ------------------ 1702| 8.26k| && (setting->type != CONFIG_TYPE_LIST)) ------------------ | | 57| 8.26k|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (1702:9): [True: 0, False: 8.26k] ------------------ 1703| 0| return(NULL); 1704| | 1705| 13.6k| if(idx < 0) ------------------ | Branch (1705:6): [True: 13.6k, False: 0] ------------------ 1706| 13.6k| { 1707| 13.6k| if(! __config_list_checktype(setting, CONFIG_TYPE_FLOAT)) ------------------ | | 53| 13.6k|#define CONFIG_TYPE_FLOAT 4 ------------------ | Branch (1707:8): [True: 4, False: 13.6k] ------------------ 1708| 4| return(NULL); 1709| | 1710| 13.6k| element = __config_setting_create(setting, NULL, CONFIG_TYPE_FLOAT); ------------------ | | 53| 13.6k|#define CONFIG_TYPE_FLOAT 4 ------------------ 1711| 13.6k| } 1712| 0| else 1713| 0| element = config_setting_get_elem(setting, idx); 1714| | 1715| 13.6k| if(! element) ------------------ | Branch (1715:6): [True: 0, False: 13.6k] ------------------ 1716| 0| return(NULL); 1717| | 1718| 13.6k| if(! config_setting_set_float(element, value)) ------------------ | Branch (1718:6): [True: 0, False: 13.6k] ------------------ 1719| 0| return(NULL); 1720| | 1721| 13.6k| return(element); 1722| 13.6k|} config_setting_set_bool_elem: 1747| 961|{ 1748| 961| config_setting_t *element = NULL; 1749| | 1750| 961| config_assert(setting != NULL); 1751| | 1752| 961| if((setting->type != CONFIG_TYPE_ARRAY) ------------------ | | 56| 961|#define CONFIG_TYPE_ARRAY 7 ------------------ | Branch (1752:6): [True: 685, False: 276] ------------------ 1753| 685| && (setting->type != CONFIG_TYPE_LIST)) ------------------ | | 57| 685|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (1753:9): [True: 0, False: 685] ------------------ 1754| 0| return(NULL); 1755| | 1756| 961| if(idx < 0) ------------------ | Branch (1756:6): [True: 961, False: 0] ------------------ 1757| 961| { 1758| 961| if(! __config_list_checktype(setting, CONFIG_TYPE_BOOL)) ------------------ | | 55| 961|#define CONFIG_TYPE_BOOL 6 ------------------ | Branch (1758:8): [True: 3, False: 958] ------------------ 1759| 3| return(NULL); 1760| | 1761| 958| element = __config_setting_create(setting, NULL, CONFIG_TYPE_BOOL); ------------------ | | 55| 958|#define CONFIG_TYPE_BOOL 6 ------------------ 1762| 958| } 1763| 0| else 1764| 0| element = config_setting_get_elem(setting, idx); 1765| | 1766| 958| if(! element) ------------------ | Branch (1766:6): [True: 0, False: 958] ------------------ 1767| 0| return(NULL); 1768| | 1769| 958| if(! config_setting_set_bool(element, value)) ------------------ | Branch (1769:6): [True: 0, False: 958] ------------------ 1770| 0| return(NULL); 1771| | 1772| 958| return(element); 1773| 958|} config_setting_set_string_elem: 1798| 1.48k|{ 1799| 1.48k| config_setting_t *element = NULL; 1800| | 1801| 1.48k| config_assert(setting != NULL); 1802| 1.48k| config_assert(value != NULL); 1803| | 1804| 1.48k| if((setting->type != CONFIG_TYPE_ARRAY) ------------------ | | 56| 1.48k|#define CONFIG_TYPE_ARRAY 7 ------------------ | Branch (1804:6): [True: 619, False: 864] ------------------ 1805| 619| && (setting->type != CONFIG_TYPE_LIST)) ------------------ | | 57| 619|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (1805:9): [True: 0, False: 619] ------------------ 1806| 0| return(NULL); 1807| | 1808| 1.48k| if(idx < 0) ------------------ | Branch (1808:6): [True: 1.48k, False: 0] ------------------ 1809| 1.48k| { 1810| 1.48k| if(! __config_list_checktype(setting, CONFIG_TYPE_STRING)) ------------------ | | 54| 1.48k|#define CONFIG_TYPE_STRING 5 ------------------ | Branch (1810:8): [True: 1, False: 1.48k] ------------------ 1811| 1| return(NULL); 1812| | 1813| 1.48k| element = __config_setting_create(setting, NULL, CONFIG_TYPE_STRING); ------------------ | | 54| 1.48k|#define CONFIG_TYPE_STRING 5 ------------------ 1814| 1.48k| } 1815| 0| else 1816| 0| element = config_setting_get_elem(setting, idx); 1817| | 1818| 1.48k| if(! element) ------------------ | Branch (1818:6): [True: 0, False: 1.48k] ------------------ 1819| 0| return(NULL); 1820| | 1821| 1.48k| if(! config_setting_set_string(element, value)) ------------------ | Branch (1821:6): [True: 0, False: 1.48k] ------------------ 1822| 0| return(NULL); 1823| | 1824| 1.48k| return(element); 1825| 1.48k|} config_setting_get_elem: 1831| 34.4k|{ 1832| 34.4k| config_list_t *list; 1833| | 1834| 34.4k| config_assert(setting != NULL); 1835| | 1836| 34.4k| if(! config_setting_is_aggregate(setting)) ------------------ | Branch (1836:6): [True: 45, False: 34.3k] ------------------ 1837| 45| return(NULL); 1838| | 1839| 34.3k| list = setting->value.list; 1840| 34.3k| if(! list) ------------------ | Branch (1840:6): [True: 21, False: 34.3k] ------------------ 1841| 21| return(NULL); 1842| | 1843| 34.3k| if(idx >= list->length) ------------------ | Branch (1843:6): [True: 0, False: 34.3k] ------------------ 1844| 0| return(NULL); 1845| | 1846| 34.3k| return(list->elements[idx]); 1847| 34.3k|} config_setting_get_member: 1853| 66.8k|{ 1854| 66.8k| config_assert(setting != NULL); 1855| | 1856| 66.8k| if(setting->type != CONFIG_TYPE_GROUP) ------------------ | | 50| 66.8k|#define CONFIG_TYPE_GROUP 1 ------------------ | Branch (1856:6): [True: 49.7k, False: 17.1k] ------------------ 1857| 49.7k| return(NULL); 1858| | 1859| 17.1k| if(!name) ------------------ | Branch (1859:6): [True: 0, False: 17.1k] ------------------ 1860| 0| return(NULL); 1861| | 1862| 17.1k| return(__config_list_search(setting->value.list, name, strlen(name), NULL)); 1863| 17.1k|} config_setting_length: 1896| 7.88k|{ 1897| 7.88k| config_assert(setting != NULL); 1898| | 1899| 7.88k| if(! config_setting_is_aggregate(setting)) ------------------ | Branch (1899:6): [True: 45, False: 7.83k] ------------------ 1900| 45| return(0); 1901| | 1902| 7.83k| if(! setting->value.list) ------------------ | Branch (1902:6): [True: 1.88k, False: 5.95k] ------------------ 1903| 1.88k| return(0); 1904| | 1905| 5.95k| return(setting->value.list->length); 1906| 7.83k|} config_setting_add: 1921| 65.0k|{ 1922| 65.0k| if((type < CONFIG_TYPE_NONE) || (type > CONFIG_TYPE_LIST)) ------------------ | | 49| 65.0k|#define CONFIG_TYPE_NONE 0 ------------------ if((type < CONFIG_TYPE_NONE) || (type > CONFIG_TYPE_LIST)) ------------------ | | 57| 65.0k|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (1922:6): [True: 0, False: 65.0k] | Branch (1922:35): [True: 0, False: 65.0k] ------------------ 1923| 0| return(NULL); 1924| | 1925| 65.0k| if(! parent) ------------------ | Branch (1925:6): [True: 0, False: 65.0k] ------------------ 1926| 0| return(NULL); 1927| | 1928| 65.0k| if((parent->type == CONFIG_TYPE_ARRAY) && !__config_type_is_scalar(type)) ------------------ | | 56| 65.0k|#define CONFIG_TYPE_ARRAY 7 ------------------ | Branch (1928:6): [True: 0, False: 65.0k] | Branch (1928:45): [True: 0, False: 0] ------------------ 1929| 0| return(NULL); /* only scalars can be added to arrays */ 1930| | 1931| 65.0k| if((parent->type == CONFIG_TYPE_ARRAY) || (parent->type == CONFIG_TYPE_LIST)) ------------------ | | 56| 65.0k|#define CONFIG_TYPE_ARRAY 7 ------------------ if((parent->type == CONFIG_TYPE_ARRAY) || (parent->type == CONFIG_TYPE_LIST)) ------------------ | | 57| 65.0k|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (1931:6): [True: 0, False: 65.0k] | Branch (1931:45): [True: 49.6k, False: 15.3k] ------------------ 1932| 49.6k| name = NULL; 1933| | 1934| 65.0k| if(name) ------------------ | Branch (1934:6): [True: 15.3k, False: 49.6k] ------------------ 1935| 15.3k| { 1936| 15.3k| if(! __config_validate_name(name)) ------------------ | Branch (1936:8): [True: 576, False: 14.7k] ------------------ 1937| 576| return(NULL); 1938| 15.3k| } 1939| | 1940| 64.4k| if(config_setting_get_member(parent, name) != NULL) ------------------ | Branch (1940:6): [True: 16, False: 64.4k] ------------------ 1941| 16| { 1942| 16| if(config_get_option(parent->config, CONFIG_OPTION_ALLOW_OVERRIDES)) ------------------ | | 71| 16|#define CONFIG_OPTION_ALLOW_OVERRIDES 0x80 ------------------ | Branch (1942:8): [True: 0, False: 16] ------------------ 1943| 0| config_setting_remove(parent, name); 1944| 16| else 1945| 16| return(NULL); /* already exists */ 1946| 16| } 1947| | 1948| 64.4k| return(__config_setting_create(parent, name, type)); 1949| 64.4k|} config_setting_remove: 1954| 1.33k|{ 1955| 1.33k| unsigned int idx; 1956| 1.33k| config_setting_t *setting; 1957| 1.33k| const char *settingName; 1958| 1.33k| const char *lastFound; 1959| | 1960| 1.33k| if(! parent || !name) ------------------ | Branch (1960:6): [True: 0, False: 1.33k] | Branch (1960:18): [True: 0, False: 1.33k] ------------------ 1961| 0| return(CONFIG_FALSE); ------------------ | | 74| 0|#define CONFIG_FALSE (0) ------------------ 1962| | 1963| 1.33k| if(parent->type != CONFIG_TYPE_GROUP) ------------------ | | 50| 1.33k|#define CONFIG_TYPE_GROUP 1 ------------------ | Branch (1963:6): [True: 0, False: 1.33k] ------------------ 1964| 0| return(CONFIG_FALSE); ------------------ | | 74| 0|#define CONFIG_FALSE (0) ------------------ 1965| | 1966| 1.33k| setting = config_setting_lookup(parent, name); 1967| 1.33k| if(! setting) ------------------ | Branch (1967:6): [True: 0, False: 1.33k] ------------------ 1968| 0| return(CONFIG_FALSE); ------------------ | | 74| 0|#define CONFIG_FALSE (0) ------------------ 1969| | 1970| 1.33k| settingName = name; 1971| 1.33k| do 1972| 1.33k| { 1973| 1.33k| lastFound = settingName; 1974| 7.49k| while(settingName && !strchr(PATH_TOKENS, *settingName)) ------------------ | | 50| 7.49k|#define PATH_TOKENS ":./" ------------------ | Branch (1974:11): [True: 7.49k, False: 0] | Branch (1974:26): [True: 6.15k, False: 1.33k] ------------------ 1975| 6.15k| ++settingName; 1976| | 1977| 1.33k| if(*settingName == '\0') ------------------ | Branch (1977:8): [True: 1.33k, False: 0] ------------------ 1978| 1.33k| { 1979| 1.33k| settingName = lastFound; 1980| 1.33k| break; 1981| 1.33k| } 1982| | 1983| 1.33k| } 1984| 1.33k| while(*++settingName); ------------------ | Branch (1984:9): [True: 0, False: 0] ------------------ 1985| | 1986| 1.33k| if(!(setting = __config_list_search(setting->parent->value.list, settingName, ------------------ | Branch (1986:6): [True: 0, False: 1.33k] ------------------ 1987| 1.33k| strlen(settingName), &idx))) 1988| 0| return(CONFIG_FALSE); ------------------ | | 74| 0|#define CONFIG_FALSE (0) ------------------ 1989| | 1990| 1.33k| __config_list_remove(setting->parent->value.list, idx); 1991| 1.33k| __config_setting_destroy(setting); 1992| | 1993| 1.33k| return(CONFIG_TRUE); ------------------ | | 73| 1.33k|#define CONFIG_TRUE (1) ------------------ 1994| 1.33k|} config_setting_is_aggregate: 2088| 225k|{ 2089| 225k| config_assert(setting != NULL); 2090| | 2091| 225k| return((setting->type == CONFIG_TYPE_ARRAY) ------------------ | | 56| 225k|#define CONFIG_TYPE_ARRAY 7 ------------------ | Branch (2091:10): [True: 23.6k, False: 201k] ------------------ 2092| 201k| || (setting->type == CONFIG_TYPE_LIST) ------------------ | | 57| 201k|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (2092:13): [True: 131k, False: 70.6k] ------------------ 2093| 70.6k| || (setting->type == CONFIG_TYPE_GROUP)); ------------------ | | 50| 70.6k|#define CONFIG_TYPE_GROUP 1 ------------------ | Branch (2093:13): [True: 37.4k, False: 33.1k] ------------------ 2094| 225k|} libconfig.c:__config_read: 556| 2.35k|{ 557| 2.35k| yyscan_t scanner; 558| 2.35k| struct scan_context scan_ctx; 559| 2.35k| struct parse_context parse_ctx; 560| 2.35k| int r; 561| | 562| 2.35k| config_clear(config); 563| | 564| 2.35k| libconfig_parsectx_init(&parse_ctx); ------------------ | | 40| 2.35k| __zero(C) | | ------------------ | | | | 39| 2.35k|#define __zero(P) memset((void *)(P), 0, sizeof(*P)) | | ------------------ ------------------ 565| 2.35k| parse_ctx.config = config; 566| 2.35k| parse_ctx.parent = config->root; 567| 2.35k| parse_ctx.setting = config->root; 568| | 569| 2.35k| __config_locale_override(); 570| | 571| 2.35k| libconfig_scanctx_init(&scan_ctx, filename); 572| 2.35k| config->root->file = libconfig_scanctx_current_filename(&scan_ctx); 573| 2.35k| scan_ctx.config = config; 574| 2.35k| libconfig_yylex_init_extra(&scan_ctx, &scanner); 575| | 576| 2.35k| if(stream) ------------------ | Branch (576:6): [True: 0, False: 2.35k] ------------------ 577| 0| libconfig_yyrestart(stream, scanner); 578| 2.35k| else /* read from string */ 579| 2.35k| (void)libconfig_yy_scan_string(str, scanner); 580| | 581| 2.35k| libconfig_yyset_lineno(1, scanner); 582| 2.35k| r = libconfig_yyparse(scanner, &parse_ctx, &scan_ctx); 583| | 584| 2.35k| if(r != 0) ------------------ | Branch (584:6): [True: 440, False: 1.91k] ------------------ 585| 440| { 586| 440| YY_BUFFER_STATE buf; 587| | 588| 440| config->error_file = libconfig_scanctx_current_filename(&scan_ctx); 589| 440| config->error_type = CONFIG_ERR_PARSE; 590| | 591| | /* Unwind the include stack, freeing the buffers and closing the files. */ 592| 440| while((buf = (YY_BUFFER_STATE)libconfig_scanctx_pop_include(&scan_ctx)) ------------------ | Branch (592:11): [True: 0, False: 440] ------------------ 593| 440| != NULL) 594| 0| libconfig_yy_delete_buffer(buf, scanner); 595| 440| } 596| | 597| 2.35k| libconfig_yylex_destroy(scanner); 598| 2.35k| config->filenames = libconfig_scanctx_cleanup(&scan_ctx); 599| 2.35k| libconfig_parsectx_cleanup(&parse_ctx); ------------------ | | 42| 2.35k| __delete(libconfig_strbuf_release(&((C)->string))) | | ------------------ | | | | 38| 2.35k|#define __delete(P) free((void *)(P)) | | ------------------ ------------------ 600| | 601| 2.35k| __config_locale_restore(); 602| | 603| 2.35k| return(r == 0 ? CONFIG_TRUE : CONFIG_FALSE); ------------------ | | 73| 1.91k|#define CONFIG_TRUE (1) ------------------ return(r == 0 ? CONFIG_TRUE : CONFIG_FALSE); ------------------ | | 74| 440|#define CONFIG_FALSE (0) ------------------ | Branch (603:10): [True: 1.91k, False: 440] ------------------ 604| 2.35k|} libconfig.c:__config_locale_override: 100| 3.69k|{ 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.69k| locale_t loc = newlocale(LC_NUMERIC, "C", NULL); 114| 3.69k| uselocale(loc); 115| | 116| |#else 117| | 118| |#warning "No way to modify calling thread's locale!" 119| | 120| |#endif 121| 3.69k|} libconfig.c:__config_write_setting: 631| 10.9k|{ 632| 10.9k| char group_assign_char = config_get_option( ------------------ | Branch (632:28): [True: 10.9k, False: 0] ------------------ 633| 10.9k| config, CONFIG_OPTION_COLON_ASSIGNMENT_FOR_GROUPS) ? ':' : '='; ------------------ | | 66| 10.9k|#define CONFIG_OPTION_COLON_ASSIGNMENT_FOR_GROUPS 0x04 ------------------ 634| | 635| 10.9k| char nongroup_assign_char = config_get_option( ------------------ | Branch (635:31): [True: 0, False: 10.9k] ------------------ 636| 10.9k| config, CONFIG_OPTION_COLON_ASSIGNMENT_FOR_NON_GROUPS) ? ':' : '='; ------------------ | | 67| 10.9k|#define CONFIG_OPTION_COLON_ASSIGNMENT_FOR_NON_GROUPS 0x08 ------------------ 637| | 638| 10.9k| if(depth > 1) ------------------ | Branch (638:6): [True: 6.36k, False: 4.56k] ------------------ 639| 6.36k| __config_indent(stream, depth, config->tab_width); 640| | 641| | 642| 10.9k| if(setting->name) ------------------ | Branch (642:6): [True: 9.59k, False: 1.33k] ------------------ 643| 9.59k| { 644| 9.59k| fputs(setting->name, stream); 645| 9.59k| fprintf(stream, " %c ", ((setting->type == CONFIG_TYPE_GROUP) ------------------ | | 50| 9.59k|#define CONFIG_TYPE_GROUP 1 ------------------ | Branch (645:30): [True: 2.34k, False: 7.24k] ------------------ 646| 9.59k| ? group_assign_char 647| 9.59k| : nongroup_assign_char)); 648| 9.59k| } 649| | 650| 10.9k| __config_write_value(config, &(setting->value), setting->type, 651| 10.9k| config_setting_get_format(setting), depth, stream); 652| | 653| 10.9k| if(depth > 0) ------------------ | Branch (653:6): [True: 9.59k, False: 1.33k] ------------------ 654| 9.59k| { 655| 9.59k| if(config_get_option(config, CONFIG_OPTION_SEMICOLON_SEPARATORS)) ------------------ | | 65| 9.59k|#define CONFIG_OPTION_SEMICOLON_SEPARATORS 0x02 ------------------ | Branch (655:8): [True: 9.59k, False: 0] ------------------ 656| 9.59k| fputc(';', stream); 657| | 658| 9.59k| fputc('\n', stream); 659| 9.59k| } 660| 10.9k|} libconfig.c:__config_indent: 146| 10.8k|{ 147| 10.8k| if(w) ------------------ | Branch (147:6): [True: 10.8k, False: 0] ------------------ 148| 10.8k| 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.8k|} libconfig.c:__config_write_value: 162| 32.0k|{ 163| | /* Long enough for 64-bit binary value + NULL terminator. */ 164| 32.0k| char value_buf[(sizeof(int64_t) * BITS_IN_BYTE) + 1]; 165| | 166| 32.0k| switch(type) 167| 32.0k| { 168| | /* boolean */ 169| 893| case CONFIG_TYPE_BOOL: ------------------ | | 55| 893|#define CONFIG_TYPE_BOOL 6 ------------------ | Branch (169:5): [True: 893, False: 31.1k] ------------------ 170| 893| fputs(value->ival ? "true" : "false", stream); ------------------ | Branch (170:13): [True: 665, False: 228] ------------------ 171| 893| break; 172| | 173| | /* int */ 174| 7.19k| case CONFIG_TYPE_INT: ------------------ | | 51| 7.19k|#define CONFIG_TYPE_INT 2 ------------------ | Branch (174:5): [True: 7.19k, False: 24.8k] ------------------ 175| 7.19k| switch(format) 176| 7.19k| { 177| 988| case CONFIG_FORMAT_HEX: ------------------ | | 60| 988|#define CONFIG_FORMAT_HEX 1 ------------------ | Branch (177:9): [True: 988, False: 6.21k] ------------------ 178| 988| fprintf(stream, "0x%X", value->ival); 179| 988| break; 180| | 181| 959| case CONFIG_FORMAT_BIN: ------------------ | | 61| 959|#define CONFIG_FORMAT_BIN 2 ------------------ | Branch (181:9): [True: 959, False: 6.24k] ------------------ 182| 959| { 183| | /* Once %b/%B become more widely supported, could feature test for them */ 184| 959| char *str = libconfig_format_bin(value->ival, value_buf); 185| 959| fprintf(stream, "0b%s", str); 186| 959| break; 187| 0| } 188| | 189| 0| case CONFIG_FORMAT_OCT: ------------------ | | 62| 0|#define CONFIG_FORMAT_OCT 3 ------------------ | Branch (189:9): [True: 0, False: 7.19k] ------------------ 190| 0| fprintf(stream, "0o%o", value->ival); 191| 0| break; 192| | 193| 5.25k| case CONFIG_FORMAT_DEFAULT: ------------------ | | 59| 5.25k|#define CONFIG_FORMAT_DEFAULT 0 ------------------ | Branch (193:9): [True: 5.25k, False: 1.94k] ------------------ 194| 5.25k| default: ------------------ | Branch (194:9): [True: 0, False: 7.19k] ------------------ 195| 5.25k| fprintf(stream, "%d", value->ival); 196| 5.25k| break; 197| 7.19k| } 198| 7.19k| break; 199| | 200| | /* 64-bit int */ 201| 7.19k| case CONFIG_TYPE_INT64: ------------------ | | 52| 2.76k|#define CONFIG_TYPE_INT64 3 ------------------ | Branch (201:5): [True: 2.76k, False: 29.2k] ------------------ 202| 2.76k| switch(format) 203| 2.76k| { 204| 476| case CONFIG_FORMAT_HEX: ------------------ | | 60| 476|#define CONFIG_FORMAT_HEX 1 ------------------ | Branch (204:9): [True: 476, False: 2.28k] ------------------ 205| 476| fprintf(stream, "0x" INT64_HEX_FMT "L", value->llval); 206| 476| break; 207| | 208| 769| case CONFIG_FORMAT_BIN: ------------------ | | 61| 769|#define CONFIG_FORMAT_BIN 2 ------------------ | Branch (208:9): [True: 769, False: 1.99k] ------------------ 209| 769| { 210| | /* Once %b/%B become more widely supported, could feature test for them */ 211| 769| char *str = libconfig_format_bin(value->llval, value_buf); 212| 769| fprintf(stream, "0b%sL", str); 213| 769| break; 214| 0| } 215| | 216| 0| case CONFIG_FORMAT_OCT: ------------------ | | 62| 0|#define CONFIG_FORMAT_OCT 3 ------------------ | Branch (216:9): [True: 0, False: 2.76k] ------------------ 217| 0| fprintf(stream, "0o%lloL", value->llval); 218| 0| break; 219| | 220| 1.51k| case CONFIG_FORMAT_DEFAULT: ------------------ | | 59| 1.51k|#define CONFIG_FORMAT_DEFAULT 0 ------------------ | Branch (220:9): [True: 1.51k, False: 1.24k] ------------------ 221| 1.51k| default: ------------------ | Branch (221:9): [True: 0, False: 2.76k] ------------------ 222| 1.51k| fprintf(stream, INT64_FMT "L", value->llval); ------------------ | | 95| 1.51k|#define INT64_FMT "%lld" ------------------ 223| 1.51k| break; 224| 2.76k| } 225| 2.76k| break; 226| | 227| | /* float */ 228| 13.3k| case CONFIG_TYPE_FLOAT: ------------------ | | 53| 13.3k|#define CONFIG_TYPE_FLOAT 4 ------------------ | Branch (228:5): [True: 13.3k, False: 18.6k] ------------------ 229| 13.3k| { 230| 13.3k| const int sci_ok = config_get_option( 231| 13.3k| config, CONFIG_OPTION_ALLOW_SCIENTIFIC_NOTATION); ------------------ | | 69| 13.3k|#define CONFIG_OPTION_ALLOW_SCIENTIFIC_NOTATION 0x20 ------------------ 232| 13.3k| libconfig_format_double(value->fval, config->float_precision, sci_ok, 233| 13.3k| value_buf, sizeof(value_buf)); 234| 13.3k| fputs(value_buf, stream); 235| 13.3k| break; 236| 2.76k| } 237| | 238| | /* string */ 239| 1.29k| case CONFIG_TYPE_STRING: ------------------ | | 54| 1.29k|#define CONFIG_TYPE_STRING 5 ------------------ | Branch (239:5): [True: 1.29k, False: 30.7k] ------------------ 240| 1.29k| { 241| 1.29k| char *p; 242| | 243| 1.29k| fputc('\"', stream); 244| | 245| 1.29k| if(value->sval) ------------------ | Branch (245:10): [True: 1.29k, False: 0] ------------------ 246| 1.29k| { 247| 7.33k| for(p = value->sval; *p; p++) ------------------ | Branch (247:30): [True: 6.04k, False: 1.29k] ------------------ 248| 6.04k| { 249| 6.04k| int c = (int)*p & 0xFF; 250| 6.04k| switch(c) 251| 6.04k| { 252| 465| case '\"': ------------------ | Branch (252:13): [True: 465, False: 5.57k] ------------------ 253| 1.02k| case '\\': ------------------ | Branch (253:13): [True: 563, False: 5.47k] ------------------ 254| 1.02k| fputc('\\', stream); 255| 1.02k| fputc(c, stream); 256| 1.02k| break; 257| | 258| 268| case '\n': ------------------ | Branch (258:13): [True: 268, False: 5.77k] ------------------ 259| 268| fputs("\\n", stream); 260| 268| break; 261| | 262| 319| case '\r': ------------------ | Branch (262:13): [True: 319, False: 5.72k] ------------------ 263| 319| fputs("\\r", stream); 264| 319| break; 265| | 266| 382| case '\f': ------------------ | Branch (266:13): [True: 382, False: 5.66k] ------------------ 267| 382| fputs("\\f", stream); 268| 382| break; 269| | 270| 302| case '\t': ------------------ | Branch (270:13): [True: 302, False: 5.74k] ------------------ 271| 302| fputs("\\t", stream); 272| 302| break; 273| | 274| 3.74k| default: ------------------ | Branch (274:13): [True: 3.74k, False: 2.29k] ------------------ 275| 3.74k| if(c >= ' ') ------------------ | Branch (275:18): [True: 2.93k, False: 806] ------------------ 276| 2.93k| fputc(c, stream); 277| 806| else 278| 806| fprintf(stream, "\\x%02X", c); 279| 6.04k| } 280| 6.04k| } 281| 1.29k| } 282| 1.29k| fputc('\"', stream); 283| 1.29k| break; 284| 1.29k| } 285| | 286| | /* list */ 287| 1.11k| case CONFIG_TYPE_LIST: ------------------ | | 57| 1.11k|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (287:5): [True: 1.11k, False: 30.8k] ------------------ 288| 1.11k| { 289| 1.11k| config_list_t *list = value->list; 290| | 291| 1.11k| fputs("( ", stream); 292| | 293| 1.11k| if(list) ------------------ | Branch (293:10): [True: 876, False: 238] ------------------ 294| 876| { 295| 876| int len = list->length; 296| 876| config_setting_t **s; 297| | 298| 14.8k| for(s = list->elements; len--; s++) ------------------ | Branch (298:33): [True: 13.9k, False: 876] ------------------ 299| 13.9k| { 300| 13.9k| __config_write_value(config, &((*s)->value), (*s)->type, 301| 13.9k| config_setting_get_format(*s), depth + 1, 302| 13.9k| stream); 303| | 304| 13.9k| if(len) ------------------ | Branch (304:14): [True: 13.1k, False: 876] ------------------ 305| 13.1k| fputc(',', stream); 306| | 307| 13.9k| fputc(' ', stream); 308| 13.9k| } 309| 876| } 310| | 311| 1.11k| fputc(')', stream); 312| 1.11k| break; 313| 1.29k| } 314| | 315| | /* array */ 316| 1.13k| case CONFIG_TYPE_ARRAY: ------------------ | | 56| 1.13k|#define CONFIG_TYPE_ARRAY 7 ------------------ | Branch (316:5): [True: 1.13k, False: 30.8k] ------------------ 317| 1.13k| { 318| 1.13k| config_list_t *list = value->list; 319| | 320| 1.13k| fputs("[ ", stream); 321| | 322| 1.13k| if(list) ------------------ | Branch (322:10): [True: 754, False: 380] ------------------ 323| 754| { 324| 754| int len = list->length; 325| 754| config_setting_t **s; 326| | 327| 7.85k| for(s = list->elements; len--; s++) ------------------ | Branch (327:33): [True: 7.09k, False: 754] ------------------ 328| 7.09k| { 329| 7.09k| __config_write_value(config, &((*s)->value), (*s)->type, 330| 7.09k| config_setting_get_format(*s), depth + 1, 331| 7.09k| stream); 332| | 333| 7.09k| if(len) ------------------ | Branch (333:14): [True: 6.34k, False: 754] ------------------ 334| 6.34k| fputc(',', stream); 335| | 336| 7.09k| fputc(' ', stream); 337| 7.09k| } 338| 754| } 339| | 340| 1.13k| fputc(']', stream); 341| 1.13k| break; 342| 1.29k| } 343| | 344| | /* group */ 345| 4.22k| case CONFIG_TYPE_GROUP: ------------------ | | 50| 4.22k|#define CONFIG_TYPE_GROUP 1 ------------------ | Branch (345:5): [True: 4.22k, False: 27.7k] ------------------ 346| 4.22k| { 347| 4.22k| config_list_t *list = value->list; 348| | 349| 4.22k| if(depth > 0) ------------------ | Branch (349:10): [True: 2.88k, False: 1.33k] ------------------ 350| 2.88k| { 351| 2.88k| if(config_get_option(config, CONFIG_OPTION_OPEN_BRACE_ON_SEPARATE_LINE)) ------------------ | | 68| 2.88k|#define CONFIG_OPTION_OPEN_BRACE_ON_SEPARATE_LINE 0x10 ------------------ | Branch (351:12): [True: 2.88k, False: 0] ------------------ 352| 2.88k| { 353| 2.88k| fputc('\n', stream); 354| | 355| 2.88k| if(depth > 1) ------------------ | Branch (355:14): [True: 2.21k, False: 664] ------------------ 356| 2.21k| __config_indent(stream, depth, config->tab_width); 357| 2.88k| } 358| | 359| 2.88k| fputs("{\n", stream); 360| 2.88k| } 361| | 362| 4.22k| if(list) ------------------ | Branch (362:10): [True: 3.58k, False: 641] ------------------ 363| 3.58k| { 364| 3.58k| int len = list->length; 365| 3.58k| config_setting_t **s; 366| | 367| 13.1k| for(s = list->elements; len--; s++) ------------------ | Branch (367:33): [True: 9.59k, False: 3.58k] ------------------ 368| 9.59k| __config_write_setting(config, *s, stream, depth + 1); 369| 3.58k| } 370| | 371| 4.22k| if(depth > 1) ------------------ | Branch (371:10): [True: 2.21k, False: 2.00k] ------------------ 372| 2.21k| __config_indent(stream, depth, config->tab_width); 373| | 374| 4.22k| if(depth > 0) ------------------ | Branch (374:10): [True: 2.88k, False: 1.33k] ------------------ 375| 2.88k| fputc('}', stream); 376| | 377| 4.22k| break; 378| 1.29k| } 379| | 380| 0| default: ------------------ | Branch (380:5): [True: 0, False: 32.0k] ------------------ 381| | /* this shouldn't happen, but handle it gracefully... */ 382| 0| fputs("???", stream); 383| 0| break; 384| 32.0k| } 385| 32.0k|} libconfig.c:__config_locale_restore: 126| 3.69k|{ 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.69k| locale_t loc = uselocale(LC_GLOBAL_LOCALE); 134| 3.69k| freelocale(loc); 135| | 136| |#else 137| | 138| |#warning "No way to modify calling thread's locale!" 139| | 140| |#endif 141| 3.69k|} libconfig.c:__config_setting_destroy: 458| 97.5k|{ 459| 97.5k| if(setting) ------------------ | Branch (459:6): [True: 95.0k, False: 2.48k] ------------------ 460| 95.0k| { 461| 95.0k| if(setting->name) ------------------ | Branch (461:8): [True: 14.7k, False: 80.2k] ------------------ 462| 14.7k| __delete(setting->name); ------------------ | | 38| 14.7k|#define __delete(P) free((void *)(P)) ------------------ 463| | 464| 95.0k| if(setting->type == CONFIG_TYPE_STRING) ------------------ | | 54| 95.0k|#define CONFIG_TYPE_STRING 5 ------------------ | Branch (464:8): [True: 2.07k, False: 92.9k] ------------------ 465| 2.07k| __delete(setting->value.sval); ------------------ | | 38| 2.07k|#define __delete(P) free((void *)(P)) ------------------ 466| | 467| 92.9k| else if(config_setting_is_aggregate(setting)) ------------------ | Branch (467:13): [True: 59.9k, False: 33.0k] ------------------ 468| 59.9k| { 469| 59.9k| if(setting->value.list) ------------------ | Branch (469:10): [True: 55.1k, False: 4.72k] ------------------ 470| 55.1k| __config_list_destroy(setting->value.list); 471| 59.9k| } 472| | 473| 95.0k| if(setting->hook && setting->config->destructor) ------------------ | Branch (473:8): [True: 0, False: 95.0k] | Branch (473:25): [True: 0, False: 0] ------------------ 474| 0| setting->config->destructor(setting->hook); 475| | 476| 95.0k| __delete(setting); ------------------ | | 38| 95.0k|#define __delete(P) free((void *)(P)) ------------------ 477| 95.0k| } 478| 97.5k|} libconfig.c:__config_list_destroy: 483| 55.1k|{ 484| 55.1k| config_setting_t **p; 485| 55.1k| unsigned int i; 486| | 487| 55.1k| if(! list) ------------------ | Branch (487:6): [True: 0, False: 55.1k] ------------------ 488| 0| return; 489| | 490| 55.1k| if(list->elements) ------------------ | Branch (490:6): [True: 55.1k, False: 0] ------------------ 491| 55.1k| { 492| 144k| for(p = list->elements, i = 0; i < list->length; p++, i++) ------------------ | Branch (492:36): [True: 88.9k, False: 55.1k] ------------------ 493| 88.9k| __config_setting_destroy(*p); 494| | 495| 55.1k| __delete(list->elements); ------------------ | | 38| 55.1k|#define __delete(P) free((void *)(P)) ------------------ 496| 55.1k| } 497| | 498| 55.1k| __delete(list); ------------------ | | 38| 55.1k|#define __delete(P) free((void *)(P)) ------------------ 499| 55.1k|} libconfig.c:__config_setting_get_int: 930| 176|{ 931| 176| switch(setting->type) 932| 176| { 933| 4| case CONFIG_TYPE_INT: ------------------ | | 51| 4|#define CONFIG_TYPE_INT 2 ------------------ | Branch (933:5): [True: 4, False: 172] ------------------ 934| 4| *value = setting->value.ival; 935| 4| return(CONFIG_TRUE); ------------------ | | 73| 4|#define CONFIG_TRUE (1) ------------------ 936| | 937| 163| case CONFIG_TYPE_INT64: ------------------ | | 52| 163|#define CONFIG_TYPE_INT64 3 ------------------ | Branch (937:5): [True: 163, False: 13] ------------------ 938| 163| if((setting->value.llval >= INT32_MIN) ------------------ | Branch (938:10): [True: 91, False: 72] ------------------ 939| 91| && (setting->value.llval <= INT32_MAX)) ------------------ | Branch (939:13): [True: 69, False: 22] ------------------ 940| 69| { 941| 69| *value = (int)(setting->value.llval); 942| 69| return(CONFIG_TRUE); ------------------ | | 73| 69|#define CONFIG_TRUE (1) ------------------ 943| 69| } 944| 94| else 945| 94| return(CONFIG_FALSE); ------------------ | | 74| 94|#define CONFIG_FALSE (0) ------------------ 946| | 947| 3| case CONFIG_TYPE_FLOAT: ------------------ | | 53| 3|#define CONFIG_TYPE_FLOAT 4 ------------------ | Branch (947:5): [True: 3, False: 173] ------------------ 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| 6| default: ------------------ | Branch (956:5): [True: 6, False: 170] ------------------ 957| 6| return(CONFIG_FALSE); ------------------ | | 74| 6|#define CONFIG_FALSE (0) ------------------ 958| 176| } 959| 176|} libconfig.c:__config_setting_get_int64: 987| 11|{ 988| 11| switch(setting->type) 989| 11| { 990| 1| case CONFIG_TYPE_INT64: ------------------ | | 52| 1|#define CONFIG_TYPE_INT64 3 ------------------ | Branch (990:5): [True: 1, False: 10] ------------------ 991| 1| *value = setting->value.llval; 992| 1| return(CONFIG_TRUE); ------------------ | | 73| 1|#define CONFIG_TRUE (1) ------------------ 993| | 994| 3| case CONFIG_TYPE_INT: ------------------ | | 51| 3|#define CONFIG_TYPE_INT 2 ------------------ | Branch (994:5): [True: 3, False: 8] ------------------ 995| 3| *value = (long long)(setting->value.ival); 996| 3| return(CONFIG_TRUE); ------------------ | | 73| 3|#define CONFIG_TRUE (1) ------------------ 997| | 998| 4| case CONFIG_TYPE_FLOAT: ------------------ | | 53| 4|#define CONFIG_TYPE_FLOAT 4 ------------------ | Branch (998:5): [True: 4, False: 7] ------------------ 999| 4| if(config_get_option(setting->config, CONFIG_OPTION_AUTOCONVERT)) ------------------ | | 64| 4|#define CONFIG_OPTION_AUTOCONVERT 0x01 ------------------ | Branch (999:10): [True: 0, False: 4] ------------------ 1000| 0| { 1001| 0| *value = (long long)(setting->value.fval); 1002| 0| return(CONFIG_TRUE); ------------------ | | 73| 0|#define CONFIG_TRUE (1) ------------------ 1003| 0| } 1004| 4| else 1005| 4| return(CONFIG_FALSE); ------------------ | | 74| 4|#define CONFIG_FALSE (0) ------------------ 1006| | 1007| 3| default: ------------------ | Branch (1007:5): [True: 3, False: 8] ------------------ 1008| 3| return(CONFIG_FALSE); ------------------ | | 74| 3|#define CONFIG_FALSE (0) ------------------ 1009| 11| } 1010| 11|} libconfig.c:__config_setting_get_float: 1074| 10|{ 1075| 10| switch(setting->type) 1076| 10| { 1077| 4| case CONFIG_TYPE_FLOAT: ------------------ | | 53| 4|#define CONFIG_TYPE_FLOAT 4 ------------------ | Branch (1077:5): [True: 4, False: 6] ------------------ 1078| 4| *value = setting->value.fval; 1079| 4| return(CONFIG_TRUE); ------------------ | | 73| 4|#define CONFIG_TRUE (1) ------------------ 1080| | 1081| 3| case CONFIG_TYPE_INT: ------------------ | | 51| 3|#define CONFIG_TYPE_INT 2 ------------------ | Branch (1081:5): [True: 3, False: 7] ------------------ 1082| 3| if(config_get_auto_convert(setting->config)) ------------------ | | 271| 3| config_get_option((C), CONFIG_OPTION_AUTOCONVERT) | | ------------------ | | | | 64| 3|#define CONFIG_OPTION_AUTOCONVERT 0x01 | | ------------------ | | | Branch (271:3): [True: 0, False: 3] | | ------------------ ------------------ 1083| 0| { 1084| 0| *value = (double)(setting->value.ival); 1085| 0| return(CONFIG_TRUE); ------------------ | | 73| 0|#define CONFIG_TRUE (1) ------------------ 1086| 0| } 1087| 3| else 1088| 3| return(CONFIG_FALSE); ------------------ | | 74| 3|#define CONFIG_FALSE (0) ------------------ 1089| | 1090| 1| case CONFIG_TYPE_INT64: ------------------ | | 52| 1|#define CONFIG_TYPE_INT64 3 ------------------ | Branch (1090:5): [True: 1, False: 9] ------------------ 1091| 1| if(config_get_auto_convert(setting->config)) ------------------ | | 271| 1| config_get_option((C), CONFIG_OPTION_AUTOCONVERT) | | ------------------ | | | | 64| 1|#define CONFIG_OPTION_AUTOCONVERT 0x01 | | ------------------ | | | Branch (271:3): [True: 0, False: 1] | | ------------------ ------------------ 1092| 0| { 1093| 0| *value = (double)(setting->value.llval); 1094| 0| return(CONFIG_TRUE); ------------------ | | 73| 0|#define CONFIG_TRUE (1) ------------------ 1095| 0| } 1096| 1| else 1097| 1| return(CONFIG_FALSE); ------------------ | | 74| 1|#define CONFIG_FALSE (0) ------------------ 1098| | 1099| 2| default: ------------------ | Branch (1099:5): [True: 2, False: 8] ------------------ 1100| 2| return(CONFIG_FALSE); ------------------ | | 74| 2|#define CONFIG_FALSE (0) ------------------ 1101| 10| } 1102| 10|} libconfig.c:__config_list_search: 411| 19.7k|{ 412| 19.7k| config_setting_t **found = NULL; 413| 19.7k| unsigned int i; 414| | 415| 19.7k| if(! list || ! name) ------------------ | Branch (415:6): [True: 6.64k, False: 13.1k] | Branch (415:16): [True: 0, False: 13.1k] ------------------ 416| 6.64k| return(NULL); 417| | 418| 89.6k| for(i = 0, found = list->elements; i < list->length; i++, found++) ------------------ | Branch (418:38): [True: 79.8k, False: 9.80k] ------------------ 419| 79.8k| { 420| 79.8k| if(! (*found)->name) ------------------ | Branch (420:8): [True: 0, False: 79.8k] ------------------ 421| 0| continue; 422| | 423| 79.8k| if((strlen((*found)->name) == namelen) ------------------ | Branch (423:8): [True: 23.6k, False: 56.1k] ------------------ 424| 23.6k| && !strncmp(name, (*found)->name, namelen)) ------------------ | Branch (424:12): [True: 3.35k, False: 20.2k] ------------------ 425| 3.35k| { 426| 3.35k| if(idx) ------------------ | Branch (426:10): [True: 1.33k, False: 2.01k] ------------------ 427| 1.33k| *idx = i; 428| | 429| 3.35k| return(*found); 430| 3.35k| } 431| 79.8k| } 432| | 433| 9.80k| return(NULL); 434| 13.1k|} libconfig.c:__config_list_checktype: 504| 25.8k|{ 505| | /* if the array is empty, then it has no type yet */ 506| | 507| 25.8k| if(! setting->value.list) ------------------ | Branch (507:6): [True: 2.26k, False: 23.5k] ------------------ 508| 2.26k| return(CONFIG_TRUE); ------------------ | | 73| 2.26k|#define CONFIG_TRUE (1) ------------------ 509| | 510| 23.5k| if(setting->value.list->length == 0) ------------------ | Branch (510:6): [True: 0, False: 23.5k] ------------------ 511| 0| return(CONFIG_TRUE); ------------------ | | 73| 0|#define CONFIG_TRUE (1) ------------------ 512| | 513| | /* if it's a list, any type is allowed */ 514| | 515| 23.5k| if(setting->type == CONFIG_TYPE_LIST) ------------------ | | 57| 23.5k|#define CONFIG_TYPE_LIST 8 ------------------ | Branch (515:6): [True: 14.5k, False: 9.04k] ------------------ 516| 14.5k| return(CONFIG_TRUE); ------------------ | | 73| 14.5k|#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: 30] ------------------ 521| 9.04k| ? CONFIG_TRUE : CONFIG_FALSE); ------------------ | | 73| 9.01k|#define CONFIG_TRUE (1) ------------------ ? CONFIG_TRUE : CONFIG_FALSE); ------------------ | | 74| 30|#define CONFIG_FALSE (0) ------------------ 522| 23.5k|} libconfig.c:__config_setting_create: 901| 90.2k|{ 902| 90.2k| config_setting_t *setting; 903| 90.2k| config_list_t *list; 904| | 905| 90.2k| if(!config_setting_is_aggregate(parent)) ------------------ | Branch (905:6): [True: 0, False: 90.2k] ------------------ 906| 0| return(NULL); 907| | 908| 90.2k| setting = __new(config_setting_t); ------------------ | | 37| 90.2k|#define __new(T) (T *)libconfig_calloc(1, sizeof(T)) /* zeroed */ ------------------ 909| 90.2k| setting->parent = parent; 910| 90.2k| setting->name = (name == NULL) ? NULL : strdup(name); ------------------ | Branch (910:19): [True: 75.4k, False: 14.7k] ------------------ 911| 90.2k| setting->type = type; 912| 90.2k| setting->config = parent->config; 913| 90.2k| setting->hook = NULL; 914| 90.2k| setting->line = 0; 915| | 916| 90.2k| list = parent->value.list; 917| | 918| 90.2k| if(! list) ------------------ | Branch (918:6): [True: 55.1k, False: 35.0k] ------------------ 919| 55.1k| list = parent->value.list = __new(config_list_t); ------------------ | | 37| 55.1k|#define __new(T) (T *)libconfig_calloc(1, sizeof(T)) /* zeroed */ ------------------ 920| | 921| 90.2k| __config_list_add(list, setting); 922| | 923| 90.2k| return(setting); 924| 90.2k|} libconfig.c:__config_list_add: 390| 90.2k|{ 391| 90.2k| if((list->length % CHUNK_SIZE) == 0) ------------------ | | 51| 90.2k|#define CHUNK_SIZE 16 ------------------ | Branch (391:6): [True: 56.7k, False: 33.4k] ------------------ 392| 56.7k| { 393| 56.7k| list->elements = (config_setting_t **)libconfig_realloc( 394| 56.7k| list->elements, 395| 56.7k| (list->length + CHUNK_SIZE) * sizeof(config_setting_t *)); ------------------ | | 51| 56.7k|#define CHUNK_SIZE 16 ------------------ 396| 56.7k| } 397| | 398| 90.2k| list->elements[list->length] = setting; 399| 90.2k| list->length++; 400| 90.2k|} libconfig.c:__config_validate_name: 534| 15.3k|{ 535| 15.3k| const char *p = name; 536| | 537| 15.3k| if(*p == '\0') ------------------ | Branch (537:6): [True: 377, False: 14.9k] ------------------ 538| 377| return(CONFIG_FALSE); ------------------ | | 74| 377|#define CONFIG_FALSE (0) ------------------ 539| | 540| 14.9k| if(! isalpha((int)*p) && (*p != '*')) ------------------ | Branch (540:6): [True: 1.09k, False: 13.9k] | Branch (540:28): [True: 88, False: 1.00k] ------------------ 541| 88| return(CONFIG_FALSE); ------------------ | | 74| 88|#define CONFIG_FALSE (0) ------------------ 542| | 543| 82.3k| for(++p; *p; ++p) ------------------ | Branch (543:12): [True: 67.5k, False: 14.7k] ------------------ 544| 67.5k| { 545| 67.5k| if(! (isalpha((int)*p) || isdigit((int)*p) || strchr("*_-", (int)*p))) ------------------ | Branch (545:11): [True: 48.3k, False: 19.2k] | Branch (545:31): [True: 16.5k, False: 2.73k] | Branch (545:51): [True: 2.62k, False: 111] ------------------ 546| 111| return(CONFIG_FALSE); ------------------ | | 74| 111|#define CONFIG_FALSE (0) ------------------ 547| 67.5k| } 548| | 549| 14.7k| return(CONFIG_TRUE); ------------------ | | 73| 14.7k|#define CONFIG_TRUE (1) ------------------ 550| 14.9k|} libconfig.c:__config_list_remove: 439| 1.33k|{ 440| 1.33k| config_setting_t *removed = *(list->elements + idx); 441| 1.33k| int offset = (idx * sizeof(config_setting_t *)); 442| 1.33k| int len = list->length - 1 - idx; 443| 1.33k| char *base = (char *)list->elements + offset; 444| | 445| 1.33k| memmove(base, base + sizeof(config_setting_t *), 446| 1.33k| len * sizeof(config_setting_t *)); 447| | 448| 1.33k| list->length--; 449| | 450| | /* possibly realloc smaller? */ 451| | 452| 1.33k| return(removed); 453| 1.33k|} libconfig_scanctx_init: 40| 2.35k|{ 41| 2.35k| __zero(ctx); ------------------ | | 39| 2.35k|#define __zero(P) memset((void *)(P), 0, sizeof(*P)) ------------------ 42| 2.35k| if(top_filename) ------------------ | Branch (42:6): [True: 0, False: 2.35k] ------------------ 43| 0| { 44| 0| ctx->top_filename = strdup(top_filename); 45| 0| libconfig_strvec_append(&(ctx->filenames), ctx->top_filename); 46| 0| } 47| 2.35k|} libconfig_scanctx_cleanup: 52| 2.35k|{ 53| 2.35k| int i; 54| | 55| 2.35k| for(i = 0; i < ctx->stack_depth; ++i) ------------------ | Branch (55:14): [True: 0, False: 2.35k] ------------------ 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.35k| __delete(libconfig_strbuf_release(&(ctx->string))); ------------------ | | 38| 2.35k|#define __delete(P) free((void *)(P)) ------------------ 66| | 67| 2.35k| return(libconfig_strvec_release(&(ctx->filenames))); 68| 2.35k|} libconfig_scanctx_next_include_file: 125| 2.01k|{ 126| 2.01k| struct include_stack_frame *include_frame; 127| | 128| 2.01k| *error = NULL; 129| | 130| 2.01k| if(ctx->stack_depth == 0) ------------------ | Branch (130:6): [True: 2.01k, False: 0] ------------------ 131| 2.01k| 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.45k|{ 160| 2.45k| struct include_stack_frame *frame; 161| | 162| 2.45k| if(ctx->stack_depth == 0) ------------------ | Branch (162:6): [True: 2.45k, False: 0] ------------------ 163| 2.45k| 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.45k|} libconfig_scanctx_take_string: 182| 3.44k|{ 183| 3.44k| char *r = libconfig_strbuf_release(&(ctx->string)); 184| | 185| 3.44k| return(r ? r : strdup("")); ------------------ | Branch (185:10): [True: 1.10k, False: 2.34k] ------------------ 186| 3.44k|} libconfig_scanctx_current_filename: 191| 92.1k|{ 192| 92.1k| if(ctx->stack_depth > 0) ------------------ | Branch (192:6): [True: 0, False: 92.1k] ------------------ 193| 0| return(*(ctx->include_stack[ctx->stack_depth - 1].current_file)); 194| | 195| 92.1k| return(ctx->top_filename); 196| 92.1k|} libconfig_yylex: 1178| 159k|{ 1179| 159k| yy_state_type yy_current_state; 1180| 159k| char *yy_cp, *yy_bp; 1181| 159k| int yy_act; 1182| 159k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1183| | 1184| 159k| yylval = yylval_param; ------------------ | | 994| 159k| # define yylval yyg->yylval_r ------------------ 1185| | 1186| 159k| if ( !yyg->yy_init ) ------------------ | Branch (1186:7): [True: 2.35k, False: 157k] ------------------ 1187| 2.35k| { 1188| 2.35k| yyg->yy_init = 1; 1189| | 1190| |#ifdef YY_USER_INIT 1191| | YY_USER_INIT; 1192| |#endif 1193| | 1194| 2.35k| if ( ! yyg->yy_start ) ------------------ | Branch (1194:8): [True: 2.35k, False: 0] ------------------ 1195| 2.35k| yyg->yy_start = 1; /* first start state */ 1196| | 1197| 2.35k| if ( ! yyin ) ------------------ | | 344| 2.35k|#define yyin yyg->yyin_r ------------------ | Branch (1197:8): [True: 2.35k, False: 0] ------------------ 1198| 2.35k| yyin = stdin; ------------------ | | 344| 2.35k|#define yyin yyg->yyin_r ------------------ 1199| | 1200| 2.35k| if ( ! yyout ) ------------------ | | 345| 2.35k|#define yyout yyg->yyout_r ------------------ | Branch (1200:8): [True: 2.35k, False: 0] ------------------ 1201| 2.35k| yyout = stdout; ------------------ | | 345| 2.35k|#define yyout yyg->yyout_r ------------------ 1202| | 1203| 2.35k| if ( ! YY_CURRENT_BUFFER ) { ------------------ | | 509| 2.35k|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:29): [True: 2.35k, False: 0] | | ------------------ | | 510| 2.35k| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 2.35k| : NULL) ------------------ | Branch (1203:8): [True: 0, False: 2.35k] ------------------ 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.35k| yy_load_buffer_state( yyscanner ); ------------------ | | 62| 2.35k|#define yy_load_buffer_state libconfig_yy_load_buffer_state ------------------ 1210| 2.35k| } 1211| | 1212| 159k| { 1213| 159k|#line 72 "scanner.l" 1214| | 1215| | 1216| 159k|#line 1217 "scanner.c" 1217| | 1218| 191k| while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ ------------------ | Branch (1218:23): [True: 191k, Folded] ------------------ 1219| 191k| { 1220| 191k| yy_cp = yyg->yy_c_buf_p; 1221| | 1222| | /* Support of yytext. */ 1223| 191k| *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| 191k| yy_bp = yy_cp; 1229| | 1230| 191k| yy_current_state = yyg->yy_start; 1231| 191k| yy_current_state += YY_AT_BOL(); ------------------ | | 557| 191k|#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) | | ------------------ | | | | 515| 191k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ ------------------ 1232| 191k|yy_match: 1233| 191k| do 1234| 535k| { 1235| 535k| YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; ------------------ | | 334| 535k|#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) ------------------ 1236| 535k| if ( yy_accept[yy_current_state] ) ------------------ | Branch (1236:9): [True: 336k, False: 199k] ------------------ 1237| 336k| { 1238| 336k| yyg->yy_last_accepting_state = yy_current_state; 1239| 336k| yyg->yy_last_accepting_cpos = yy_cp; 1240| 336k| } 1241| 869k| while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) ------------------ | Branch (1241:12): [True: 333k, False: 535k] ------------------ 1242| 333k| { 1243| 333k| yy_current_state = (int) yy_def[yy_current_state]; 1244| 333k| if ( yy_current_state >= 214 ) ------------------ | Branch (1244:10): [True: 138k, False: 195k] ------------------ 1245| 138k| yy_c = yy_meta[yy_c]; 1246| 333k| } 1247| 535k| yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; 1248| 535k| ++yy_cp; 1249| 535k| } 1250| 535k| while ( yy_current_state != 213 ); ------------------ | Branch (1250:11): [True: 344k, False: 191k] ------------------ 1251| 191k| yy_cp = yyg->yy_last_accepting_cpos; 1252| 191k| yy_current_state = yyg->yy_last_accepting_state; 1253| | 1254| 193k|yy_find_action: 1255| 193k| yy_act = yy_accept[yy_current_state]; 1256| | 1257| 193k| YY_DO_BEFORE_ACTION; ------------------ | | 578| 193k| yyg->yytext_ptr = yy_bp; \ | | ------------------ | | | | 567| 193k|#define yytext_ptr yytext_r | | ------------------ | | 579| 193k| yyleng = (int) (yy_cp - yy_bp); \ | | ------------------ | | | | 347| 193k|#define yyleng yyg->yyleng_r | | ------------------ | | 580| 193k| yyg->yy_hold_char = *yy_cp; \ | | 581| 193k| *yy_cp = '\0'; \ | | 582| 193k| yyg->yy_c_buf_p = yy_cp; ------------------ 1258| | 1259| 193k| if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) ------------------ | | 584| 387k|#define YY_END_OF_BUFFER 49 ------------------ | Branch (1259:8): [True: 189k, False: 4.18k] | Branch (1259:38): [True: 7.26k, False: 182k] ------------------ 1260| 7.26k| { 1261| 7.26k| int yyl; 1262| 43.3k| for ( yyl = 0; yyl < yyleng; ++yyl ) ------------------ | | 347| 43.3k|#define yyleng yyg->yyleng_r ------------------ | Branch (1262:19): [True: 36.0k, False: 7.26k] ------------------ 1263| 36.0k| if ( yytext[yyl] == '\n' ) ------------------ | | 348| 36.0k|#define yytext yyg->yytext_r ------------------ | Branch (1263:10): [True: 3.27k, False: 32.8k] ------------------ 1264| | 1265| 3.27k| do{ yylineno++; ------------------ | | 349| 3.27k|#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) | | ------------------ | | | | 515| 3.27k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ ------------------ 1266| 3.27k| yycolumn=0; ------------------ | | 350| 3.27k|#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) | | ------------------ | | | | 515| 3.27k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ ------------------ 1267| 3.27k| }while(0) ------------------ | Branch (1267:12): [Folded, False: 3.27k] ------------------ 1268| 7.26k|; 1269| 7.26k| } 1270| | 1271| 195k|do_action: /* This label is used only to access EOF actions. */ 1272| | 1273| 195k| switch ( yy_act ) 1274| 195k| { /* beginning of action switch */ 1275| 26| case 0: /* must back up */ ------------------ | Branch (1275:4): [True: 26, False: 195k] ------------------ 1276| | /* undo the effects of YY_DO_BEFORE_ACTION */ 1277| 26| *yy_cp = yyg->yy_hold_char; 1278| 26| yy_cp = yyg->yy_last_accepting_cpos; 1279| 26| yy_current_state = yyg->yy_last_accepting_state; 1280| 26| goto yy_find_action; 1281| | 1282| 474|case 1: ------------------ | Branch (1282:1): [True: 474, False: 195k] ------------------ 1283| 474|YY_RULE_SETUP ------------------ | | 1170| 474| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 474|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 474, False: 0] | | ------------------ | | 1171| 474| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 474|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 474| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 474|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 474|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 474| YY_USER_ACTION ------------------ 1284| 474|#line 74 "scanner.l" 1285| 474|{ BEGIN SINGLE_LINE_COMMENT; } ------------------ | | 357| 474|#define BEGIN yyg->yy_start = 1 + 2 * ------------------ { BEGIN SINGLE_LINE_COMMENT; } ------------------ | | 939| 474|#define SINGLE_LINE_COMMENT 1 ------------------ 1286| 474| YY_BREAK ------------------ | | 1166| 474|#define YY_BREAK /*LINTED*/break; ------------------ 1287| 382|case 2: ------------------ | Branch (1287:1): [True: 382, False: 195k] ------------------ 1288| |/* rule 2 can match eol */ 1289| 382|YY_RULE_SETUP ------------------ | | 1170| 382| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 382|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 382, False: 0] | | ------------------ | | 1171| 382| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 382|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 382| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 382|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 382|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 382| YY_USER_ACTION ------------------ 1290| 382|#line 75 "scanner.l" 1291| 382|{ BEGIN INITIAL; } ------------------ | | 357| 382|#define BEGIN yyg->yy_start = 1 + 2 * ------------------ { BEGIN INITIAL; } ------------------ | | 938| 382|#define INITIAL 0 ------------------ 1292| 382| YY_BREAK ------------------ | | 1166| 382|#define YY_BREAK /*LINTED*/break; ------------------ 1293| 4.31k|case 3: ------------------ | Branch (1293:1): [True: 4.31k, False: 191k] ------------------ 1294| 4.31k|YY_RULE_SETUP ------------------ | | 1170| 4.31k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 4.31k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 4.31k, False: 0] | | ------------------ | | 1171| 4.31k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 4.31k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 4.31k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 4.31k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 4.31k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 4.31k| YY_USER_ACTION ------------------ 1295| 4.31k|#line 76 "scanner.l" 1296| 4.31k|{ /* ignore */ } 1297| 4.31k| YY_BREAK ------------------ | | 1166| 4.31k|#define YY_BREAK /*LINTED*/break; ------------------ 1298| 412|case 4: ------------------ | Branch (1298:1): [True: 412, False: 195k] ------------------ 1299| 412|YY_RULE_SETUP ------------------ | | 1170| 412| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 412|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 412, False: 0] | | ------------------ | | 1171| 412| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 412|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 412| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 412|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 412|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 412| YY_USER_ACTION ------------------ 1300| 412|#line 78 "scanner.l" 1301| 412|{ BEGIN MULTI_LINE_COMMENT; } ------------------ | | 357| 412|#define BEGIN yyg->yy_start = 1 + 2 * ------------------ { BEGIN MULTI_LINE_COMMENT; } ------------------ | | 940| 412|#define MULTI_LINE_COMMENT 2 ------------------ 1302| 412| YY_BREAK ------------------ | | 1166| 412|#define YY_BREAK /*LINTED*/break; ------------------ 1303| 382|case 5: ------------------ | Branch (1303:1): [True: 382, False: 195k] ------------------ 1304| 382|YY_RULE_SETUP ------------------ | | 1170| 382| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 382|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 382, False: 0] | | ------------------ | | 1171| 382| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 382|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 382| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 382|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 382|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 382| YY_USER_ACTION ------------------ 1305| 382|#line 79 "scanner.l" 1306| 382|{ BEGIN INITIAL; } ------------------ | | 357| 382|#define BEGIN yyg->yy_start = 1 + 2 * ------------------ { BEGIN INITIAL; } ------------------ | | 938| 382|#define INITIAL 0 ------------------ 1307| 382| YY_BREAK ------------------ | | 1166| 382|#define YY_BREAK /*LINTED*/break; ------------------ 1308| 7.44k|case 6: ------------------ | Branch (1308:1): [True: 7.44k, False: 188k] ------------------ 1309| 7.44k|YY_RULE_SETUP ------------------ | | 1170| 7.44k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 7.44k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 7.44k, False: 0] | | ------------------ | | 1171| 7.44k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 7.44k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 7.44k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 7.44k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 7.44k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 7.44k| YY_USER_ACTION ------------------ 1310| 7.44k|#line 80 "scanner.l" 1311| 7.44k|{ /* ignore */ } 1312| 7.44k| YY_BREAK ------------------ | | 1166| 7.44k|#define YY_BREAK /*LINTED*/break; ------------------ 1313| 444|case 7: ------------------ | Branch (1313:1): [True: 444, False: 195k] ------------------ 1314| |/* rule 7 can match eol */ 1315| 444|YY_RULE_SETUP ------------------ | | 1170| 444| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 444|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 444, False: 0] | | ------------------ | | 1171| 444| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 444|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 444| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 444|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 444|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 444| YY_USER_ACTION ------------------ 1316| 444|#line 81 "scanner.l" 1317| 444|{ /* ignore */ } 1318| 444| YY_BREAK ------------------ | | 1166| 444|#define YY_BREAK /*LINTED*/break; ------------------ 1319| 3.67k|case 8: ------------------ | Branch (1319:1): [True: 3.67k, False: 191k] ------------------ 1320| 3.67k|YY_RULE_SETUP ------------------ | | 1170| 3.67k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 3.67k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 3.67k, False: 0] | | ------------------ | | 1171| 3.67k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 3.67k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 3.67k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 3.67k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 3.67k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 3.67k| YY_USER_ACTION ------------------ 1321| 3.67k|#line 83 "scanner.l" 1322| 3.67k|{ BEGIN STRING; } ------------------ | | 357| 3.67k|#define BEGIN yyg->yy_start = 1 + 2 * ------------------ { BEGIN STRING; } ------------------ | | 941| 3.67k|#define STRING 3 ------------------ 1323| 3.67k| YY_BREAK ------------------ | | 1166| 3.67k|#define YY_BREAK /*LINTED*/break; ------------------ 1324| 3.39k|case 9: ------------------ | Branch (1324:1): [True: 3.39k, False: 192k] ------------------ 1325| |/* rule 9 can match eol */ 1326| 3.39k|YY_RULE_SETUP ------------------ | | 1170| 3.39k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 3.39k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 3.39k, False: 0] | | ------------------ | | 1171| 3.39k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 3.39k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 3.39k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 3.39k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 3.39k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 3.39k| YY_USER_ACTION ------------------ 1327| 3.39k|#line 84 "scanner.l" 1328| 3.39k|{ libconfig_scanctx_append_string(yyextra, yytext); } ------------------ | | 100| 3.39k| libconfig_strbuf_append_string(&((C)->string), (S)) ------------------ 1329| 3.39k| YY_BREAK ------------------ | | 1166| 3.39k|#define YY_BREAK /*LINTED*/break; ------------------ 1330| 211|case 10: ------------------ | Branch (1330:1): [True: 211, False: 195k] ------------------ 1331| 211|YY_RULE_SETUP ------------------ | | 1170| 211| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 211|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 211, False: 0] | | ------------------ | | 1171| 211| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 211|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 211| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 211|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 211|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 211| YY_USER_ACTION ------------------ 1332| 211|#line 85 "scanner.l" 1333| 211|{ libconfig_scanctx_append_char(yyextra, '\a'); } ------------------ | | 103| 211| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1334| 211| YY_BREAK ------------------ | | 1166| 211|#define YY_BREAK /*LINTED*/break; ------------------ 1335| 219|case 11: ------------------ | Branch (1335:1): [True: 219, False: 195k] ------------------ 1336| 219|YY_RULE_SETUP ------------------ | | 1170| 219| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 219|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 219, False: 0] | | ------------------ | | 1171| 219| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 219|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 219| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 219|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 219|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 219| YY_USER_ACTION ------------------ 1337| 219|#line 86 "scanner.l" 1338| 219|{ libconfig_scanctx_append_char(yyextra, '\b'); } ------------------ | | 103| 219| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1339| 219| YY_BREAK ------------------ | | 1166| 219|#define YY_BREAK /*LINTED*/break; ------------------ 1340| 275|case 12: ------------------ | Branch (1340:1): [True: 275, False: 195k] ------------------ 1341| 275|YY_RULE_SETUP ------------------ | | 1170| 275| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 275|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 275, False: 0] | | ------------------ | | 1171| 275| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 275|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 275| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 275|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 275|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 275| YY_USER_ACTION ------------------ 1342| 275|#line 87 "scanner.l" 1343| 275|{ libconfig_scanctx_append_char(yyextra, '\n'); } ------------------ | | 103| 275| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1344| 275| YY_BREAK ------------------ | | 1166| 275|#define YY_BREAK /*LINTED*/break; ------------------ 1345| 244|case 13: ------------------ | Branch (1345:1): [True: 244, False: 195k] ------------------ 1346| 244|YY_RULE_SETUP ------------------ | | 1170| 244| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 244|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 244, False: 0] | | ------------------ | | 1171| 244| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 244|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 244| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 244|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 244|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 244| YY_USER_ACTION ------------------ 1347| 244|#line 88 "scanner.l" 1348| 244|{ libconfig_scanctx_append_char(yyextra, '\r'); } ------------------ | | 103| 244| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1349| 244| YY_BREAK ------------------ | | 1166| 244|#define YY_BREAK /*LINTED*/break; ------------------ 1350| 679|case 14: ------------------ | Branch (1350:1): [True: 679, False: 194k] ------------------ 1351| 679|YY_RULE_SETUP ------------------ | | 1170| 679| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 679|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 679, False: 0] | | ------------------ | | 1171| 679| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 679|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 679| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 679|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 679|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 679| YY_USER_ACTION ------------------ 1352| 679|#line 89 "scanner.l" 1353| 679|{ libconfig_scanctx_append_char(yyextra, '\t'); } ------------------ | | 103| 679| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1354| 679| YY_BREAK ------------------ | | 1166| 679|#define YY_BREAK /*LINTED*/break; ------------------ 1355| 216|case 15: ------------------ | Branch (1355:1): [True: 216, False: 195k] ------------------ 1356| 216|YY_RULE_SETUP ------------------ | | 1170| 216| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 216|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 216, False: 0] | | ------------------ | | 1171| 216| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 216|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 216| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 216|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 216|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 216| YY_USER_ACTION ------------------ 1357| 216|#line 90 "scanner.l" 1358| 216|{ libconfig_scanctx_append_char(yyextra, '\v'); } ------------------ | | 103| 216| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1359| 216| YY_BREAK ------------------ | | 1166| 216|#define YY_BREAK /*LINTED*/break; ------------------ 1360| 351|case 16: ------------------ | Branch (1360:1): [True: 351, False: 195k] ------------------ 1361| 351|YY_RULE_SETUP ------------------ | | 1170| 351| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 351|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 351, False: 0] | | ------------------ | | 1171| 351| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 351|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 351| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 351|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 351|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 351| YY_USER_ACTION ------------------ 1362| 351|#line 91 "scanner.l" 1363| 351|{ libconfig_scanctx_append_char(yyextra, '\f'); } ------------------ | | 103| 351| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1364| 351| YY_BREAK ------------------ | | 1166| 351|#define YY_BREAK /*LINTED*/break; ------------------ 1365| 1.19k|case 17: ------------------ | Branch (1365:1): [True: 1.19k, False: 194k] ------------------ 1366| 1.19k|YY_RULE_SETUP ------------------ | | 1170| 1.19k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 1.19k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 1.19k, False: 0] | | ------------------ | | 1171| 1.19k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 1.19k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 1.19k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 1.19k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 1.19k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 1.19k| YY_USER_ACTION ------------------ 1367| 1.19k|#line 92 "scanner.l" 1368| 1.19k|{ libconfig_scanctx_append_char(yyextra, '\\'); } ------------------ | | 103| 1.19k| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1369| 1.19k| YY_BREAK ------------------ | | 1166| 1.19k|#define YY_BREAK /*LINTED*/break; ------------------ 1370| 568|case 18: ------------------ | Branch (1370:1): [True: 568, False: 194k] ------------------ 1371| 568|YY_RULE_SETUP ------------------ | | 1170| 568| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 568|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 568, False: 0] | | ------------------ | | 1171| 568| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 568|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 568| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 568|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 568|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 568| YY_USER_ACTION ------------------ 1372| 568|#line 93 "scanner.l" 1373| 568|{ libconfig_scanctx_append_char(yyextra, '\"'); } ------------------ | | 103| 568| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1374| 568| YY_BREAK ------------------ | | 1166| 568|#define YY_BREAK /*LINTED*/break; ------------------ 1375| 333|case 19: ------------------ | Branch (1375:1): [True: 333, False: 195k] ------------------ 1376| 333|YY_RULE_SETUP ------------------ | | 1170| 333| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 333|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 333, False: 0] | | ------------------ | | 1171| 333| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 333|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 333| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 333|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 333|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 333| YY_USER_ACTION ------------------ 1377| 333|#line 94 "scanner.l" 1378| 333|{ 1379| 333| char c = (char)(strtol(yytext + 2, NULL, 16) & 0xFF); ------------------ | | 348| 333|#define yytext yyg->yytext_r ------------------ 1380| 333| libconfig_scanctx_append_char(yyextra, c); ------------------ | | 103| 333| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1381| 333| } 1382| 333| YY_BREAK ------------------ | | 1166| 333|#define YY_BREAK /*LINTED*/break; ------------------ 1383| 1.25k|case 20: ------------------ | Branch (1383:1): [True: 1.25k, False: 194k] ------------------ 1384| 1.25k|YY_RULE_SETUP ------------------ | | 1170| 1.25k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 1.25k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 1.25k, False: 0] | | ------------------ | | 1171| 1.25k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 1.25k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 1.25k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 1.25k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 1.25k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 1.25k| YY_USER_ACTION ------------------ 1385| 1.25k|#line 98 "scanner.l" 1386| 1.25k|{ libconfig_scanctx_append_char(yyextra, '\\'); } ------------------ | | 103| 1.25k| libconfig_strbuf_append_char(&((C)->string), (X)) ------------------ 1387| 1.25k| YY_BREAK ------------------ | | 1166| 1.25k|#define YY_BREAK /*LINTED*/break; ------------------ 1388| 3.44k|case 21: ------------------ | Branch (1388:1): [True: 3.44k, False: 192k] ------------------ 1389| 3.44k|YY_RULE_SETUP ------------------ | | 1170| 3.44k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 3.44k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 3.44k, False: 0] | | ------------------ | | 1171| 3.44k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 3.44k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 3.44k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 3.44k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 3.44k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 3.44k| YY_USER_ACTION ------------------ 1390| 3.44k|#line 99 "scanner.l" 1391| 3.44k|{ 1392| 3.44k| yylval->sval = libconfig_scanctx_take_string(yyextra); ------------------ | | 994| 3.44k| # define yylval yyg->yylval_r ------------------ yylval->sval = libconfig_scanctx_take_string(yyextra); ------------------ | | 346| 3.44k|#define yyextra yyg->yyextra_r ------------------ 1393| 3.44k| BEGIN INITIAL; ------------------ | | 357| 3.44k|#define BEGIN yyg->yy_start = 1 + 2 * ------------------ BEGIN INITIAL; ------------------ | | 938| 3.44k|#define INITIAL 0 ------------------ 1394| 3.44k| return(TOK_STRING); ------------------ | | 99| 3.44k|#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: 195k] ------------------ 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: 195k] ------------------ 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: 195k] ------------------ 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: 195k] ------------------ 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: 195k] ------------------ 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| 3.04k|case 27: ------------------ | Branch (1444:1): [True: 3.04k, False: 192k] ------------------ 1445| |/* rule 27 can match eol */ 1446| 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 ------------------ 1447| 3.04k|#line 132 "scanner.l" 1448| 3.04k|{ /* ignore */ } 1449| 3.04k| YY_BREAK ------------------ | | 1166| 3.04k|#define YY_BREAK /*LINTED*/break; ------------------ 1450| 2.45k|case 28: ------------------ | Branch (1450:1): [True: 2.45k, False: 193k] ------------------ 1451| 2.45k|YY_RULE_SETUP ------------------ | | 1170| 2.45k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 2.45k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 2.45k, False: 0] | | ------------------ | | 1171| 2.45k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 2.45k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 2.45k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 2.45k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 2.45k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 2.45k| YY_USER_ACTION ------------------ 1452| 2.45k|#line 133 "scanner.l" 1453| 2.45k|{ /* ignore */ } 1454| 2.45k| YY_BREAK ------------------ | | 1166| 2.45k|#define YY_BREAK /*LINTED*/break; ------------------ 1455| 13.8k|case 29: ------------------ | Branch (1455:1): [True: 13.8k, False: 181k] ------------------ 1456| 13.8k|YY_RULE_SETUP ------------------ | | 1170| 13.8k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 13.8k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 13.8k, False: 0] | | ------------------ | | 1171| 13.8k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 13.8k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 13.8k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 13.8k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 13.8k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 13.8k| YY_USER_ACTION ------------------ 1457| 13.8k|#line 135 "scanner.l" 1458| 13.8k|{ return(TOK_EQUALS); } ------------------ | | 101| 13.8k|#define TOK_EQUALS 270 ------------------ 1459| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1460| 30.0k|case 30: ------------------ | Branch (1460:1): [True: 30.0k, False: 165k] ------------------ 1461| 30.0k|YY_RULE_SETUP ------------------ | | 1170| 30.0k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 30.0k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 30.0k, False: 0] | | ------------------ | | 1171| 30.0k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 30.0k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 30.0k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 30.0k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 30.0k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 30.0k| YY_USER_ACTION ------------------ 1462| 30.0k|#line 136 "scanner.l" 1463| 30.0k|{ return(TOK_COMMA); } ------------------ | | 107| 30.0k|#define TOK_COMMA 276 ------------------ 1464| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1465| 5.22k|case 31: ------------------ | Branch (1465:1): [True: 5.22k, False: 190k] ------------------ 1466| 5.22k|YY_RULE_SETUP ------------------ | | 1170| 5.22k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 5.22k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 5.22k, False: 0] | | ------------------ | | 1171| 5.22k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 5.22k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 5.22k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 5.22k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 5.22k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 5.22k| YY_USER_ACTION ------------------ 1467| 5.22k|#line 137 "scanner.l" 1468| 5.22k|{ return(TOK_GROUP_START); } ------------------ | | 108| 5.22k|#define TOK_GROUP_START 277 ------------------ 1469| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1470| 4.05k|case 32: ------------------ | Branch (1470:1): [True: 4.05k, False: 191k] ------------------ 1471| 4.05k|YY_RULE_SETUP ------------------ | | 1170| 4.05k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 4.05k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 4.05k, False: 0] | | ------------------ | | 1171| 4.05k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 4.05k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 4.05k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 4.05k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 4.05k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 4.05k| YY_USER_ACTION ------------------ 1472| 4.05k|#line 138 "scanner.l" 1473| 4.05k|{ return(TOK_GROUP_END); } ------------------ | | 109| 4.05k|#define TOK_GROUP_END 278 ------------------ 1474| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1475| 992|case 33: ------------------ | Branch (1475:1): [True: 992, False: 194k] ------------------ 1476| 992|YY_RULE_SETUP ------------------ | | 1170| 992| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 992|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 992, False: 0] | | ------------------ | | 1171| 992| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 992|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 992| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 992|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 992|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 992| YY_USER_ACTION ------------------ 1477| 992|#line 139 "scanner.l" 1478| 992|{ yylval->ival = 1; return(TOK_BOOLEAN); } ------------------ | | 994| 992| # define yylval yyg->yylval_r ------------------ { yylval->ival = 1; return(TOK_BOOLEAN); } ------------------ | | 89| 992|#define TOK_BOOLEAN 258 ------------------ 1479| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1480| 395|case 34: ------------------ | Branch (1480:1): [True: 395, False: 195k] ------------------ 1481| 395|YY_RULE_SETUP ------------------ | | 1170| 395| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 395|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 395, False: 0] | | ------------------ | | 1171| 395| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 395|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 395| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 395|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 395|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 395| YY_USER_ACTION ------------------ 1482| 395|#line 140 "scanner.l" 1483| 395|{ yylval->ival = 0; return(TOK_BOOLEAN); } ------------------ | | 994| 395| # define yylval yyg->yylval_r ------------------ { yylval->ival = 0; return(TOK_BOOLEAN); } ------------------ | | 89| 395|#define TOK_BOOLEAN 258 ------------------ 1484| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1485| 13.9k|case 35: ------------------ | Branch (1485:1): [True: 13.9k, False: 181k] ------------------ 1486| 13.9k|YY_RULE_SETUP ------------------ | | 1170| 13.9k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 13.9k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 13.9k, False: 0] | | ------------------ | | 1171| 13.9k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 13.9k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 13.9k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 13.9k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 13.9k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 13.9k| YY_USER_ACTION ------------------ 1487| 13.9k|#line 141 "scanner.l" 1488| 13.9k|{ yylval->sval = yytext; return(TOK_NAME); } ------------------ | | 994| 13.9k| # define yylval yyg->yylval_r ------------------ { yylval->sval = yytext; return(TOK_NAME); } ------------------ | | 348| 13.9k|#define yytext yyg->yytext_r ------------------ { yylval->sval = yytext; return(TOK_NAME); } ------------------ | | 100| 13.9k|#define TOK_NAME 269 ------------------ 1489| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1490| 15.2k|case 36: ------------------ | Branch (1490:1): [True: 15.2k, False: 180k] ------------------ 1491| 15.2k|YY_RULE_SETUP ------------------ | | 1170| 15.2k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 15.2k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 15.2k, False: 0] | | ------------------ | | 1171| 15.2k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 15.2k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 15.2k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 15.2k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 15.2k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 15.2k| YY_USER_ACTION ------------------ 1492| 15.2k|#line 142 "scanner.l" 1493| 15.2k|{ yylval->fval = atof(yytext); return(TOK_FLOAT); } ------------------ | | 994| 15.2k| # define yylval yyg->yylval_r ------------------ { yylval->fval = atof(yytext); return(TOK_FLOAT); } ------------------ | | 348| 15.2k|#define yytext yyg->yytext_r ------------------ { yylval->fval = atof(yytext); return(TOK_FLOAT); } ------------------ | | 98| 15.2k|#define TOK_FLOAT 267 ------------------ 1494| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1495| 7.52k|case 37: ------------------ | Branch (1495:1): [True: 7.52k, False: 188k] ------------------ 1496| 7.52k|YY_RULE_SETUP ------------------ | | 1170| 7.52k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 7.52k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 7.52k, False: 0] | | ------------------ | | 1171| 7.52k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 7.52k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 7.52k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 7.52k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 7.52k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 7.52k| YY_USER_ACTION ------------------ 1497| 7.52k|#line 143 "scanner.l" 1498| 7.52k|{ 1499| 7.52k| long long llval; 1500| 7.52k| int is_long; 1501| | 1502| 7.52k| if(!libconfig_parse_integer(yytext, 10, &llval, &is_long)) ------------------ | | 348| 7.52k|#define yytext yyg->yytext_r ------------------ | Branch (1502:24): [True: 6, False: 7.52k] ------------------ 1503| 6| return(TOK_ERROR); ------------------ | | 112| 6|#define TOK_ERROR 281 ------------------ 1504| | 1505| 7.52k| if(is_long) ------------------ | Branch (1505:24): [True: 533, False: 6.98k] ------------------ 1506| 533| { 1507| 533| yylval->llval = llval; ------------------ | | 994| 533| # define yylval yyg->yylval_r ------------------ 1508| 533| return(TOK_INTEGER64); ------------------ | | 94| 533|#define TOK_INTEGER64 263 ------------------ 1509| 533| } 1510| 6.98k| else 1511| 6.98k| { 1512| 6.98k| yylval->ival = (int)llval; ------------------ | | 994| 6.98k| # define yylval yyg->yylval_r ------------------ 1513| 6.98k| return(TOK_INTEGER); ------------------ | | 90| 6.98k|#define TOK_INTEGER 259 ------------------ 1514| 6.98k| } 1515| 7.52k| } 1516| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1517| 1.67k|case 38: ------------------ | Branch (1517:1): [True: 1.67k, False: 193k] ------------------ 1518| 1.67k|YY_RULE_SETUP ------------------ | | 1170| 1.67k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 1.67k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 1.67k, False: 0] | | ------------------ | | 1171| 1.67k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 1.67k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 1.67k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 1.67k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 1.67k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 1.67k| YY_USER_ACTION ------------------ 1519| 1.67k|#line 161 "scanner.l" 1520| 1.67k|{ 1521| 1.67k| int is_long; 1522| | 1523| 1.67k| if(!libconfig_parse_integer(yytext, 10, &(yylval->llval), ------------------ | | 348| 1.67k|#define yytext yyg->yytext_r ------------------ if(!libconfig_parse_integer(yytext, 10, &(yylval->llval), ------------------ | | 994| 1.67k| # define yylval yyg->yylval_r ------------------ | Branch (1523:24): [True: 2, False: 1.67k] ------------------ 1524| 1.67k| &is_long)) 1525| 2| return(TOK_ERROR); ------------------ | | 112| 2|#define TOK_ERROR 281 ------------------ 1526| | 1527| 1.67k| return(TOK_INTEGER64); ------------------ | | 94| 1.67k|#define TOK_INTEGER64 263 ------------------ 1528| 1.67k| } 1529| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1530| 2.30k|case 39: ------------------ | Branch (1530:1): [True: 2.30k, False: 193k] ------------------ 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.07k, False: 1.22k] ------------------ 1541| 1.07k| { 1542| 1.07k| yylval->llval = llval; ------------------ | | 994| 1.07k| # define yylval yyg->yylval_r ------------------ 1543| 1.07k| return(TOK_BIN64); ------------------ | | 96| 1.07k|#define TOK_BIN64 265 ------------------ 1544| 1.07k| } 1545| 1.22k| else 1546| 1.22k| { 1547| 1.22k| yylval->ival = (int)llval; ------------------ | | 994| 1.22k| # define yylval yyg->yylval_r ------------------ 1548| 1.22k| return(TOK_BIN); ------------------ | | 92| 1.22k|#define TOK_BIN 261 ------------------ 1549| 1.22k| } 1550| 2.30k| } 1551| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1552| 1.22k|case 40: ------------------ | Branch (1552:1): [True: 1.22k, False: 194k] ------------------ 1553| 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 ------------------ 1554| 1.22k|#line 188 "scanner.l" 1555| 1.22k|{ 1556| 1.22k| long long llval; 1557| 1.22k| int is_long; 1558| | 1559| 1.22k| if(!libconfig_parse_integer(yytext + 2, 8, &llval, &is_long)) ------------------ | | 348| 1.22k|#define yytext yyg->yytext_r ------------------ | Branch (1559:24): [True: 0, False: 1.22k] ------------------ 1560| 0| return(TOK_ERROR); ------------------ | | 112| 0|#define TOK_ERROR 281 ------------------ 1561| | 1562| 1.22k| if(is_long) ------------------ | Branch (1562:24): [True: 533, False: 693] ------------------ 1563| 533| { 1564| 533| yylval->llval = llval; ------------------ | | 994| 533| # define yylval yyg->yylval_r ------------------ 1565| 533| return(TOK_OCT64); ------------------ | | 97| 533|#define TOK_OCT64 266 ------------------ 1566| 533| } 1567| 693| else 1568| 693| { 1569| 693| yylval->ival = (int)llval; ------------------ | | 994| 693| # define yylval yyg->yylval_r ------------------ 1570| 693| return(TOK_OCT); ------------------ | | 93| 693|#define TOK_OCT 262 ------------------ 1571| 693| } 1572| 1.22k| } 1573| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1574| 2.90k|case 41: ------------------ | Branch (1574:1): [True: 2.90k, False: 192k] ------------------ 1575| 2.90k|YY_RULE_SETUP ------------------ | | 1170| 2.90k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 2.90k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 2.90k, False: 0] | | ------------------ | | 1171| 2.90k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 2.90k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 2.90k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 2.90k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 2.90k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 2.90k| YY_USER_ACTION ------------------ 1576| 2.90k|#line 206 "scanner.l" 1577| 2.90k|{ 1578| 2.90k| long long llval; 1579| 2.90k| int is_long; 1580| | 1581| 2.90k| if(!libconfig_parse_integer(yytext + 2, 16, &llval, ------------------ | | 348| 2.90k|#define yytext yyg->yytext_r ------------------ | Branch (1581:24): [True: 2, False: 2.90k] ------------------ 1582| 2.90k| &is_long)) 1583| 2| return(TOK_ERROR); ------------------ | | 112| 2|#define TOK_ERROR 281 ------------------ 1584| | 1585| 2.90k| if(is_long) ------------------ | Branch (1585:24): [True: 1.07k, False: 1.82k] ------------------ 1586| 1.07k| { 1587| 1.07k| yylval->llval = llval; ------------------ | | 994| 1.07k| # define yylval yyg->yylval_r ------------------ 1588| 1.07k| return(TOK_HEX64); ------------------ | | 95| 1.07k|#define TOK_HEX64 264 ------------------ 1589| 1.07k| } 1590| 1.82k| else 1591| 1.82k| { 1592| 1.82k| yylval->ival = (int)llval; ------------------ | | 994| 1.82k| # define yylval yyg->yylval_r ------------------ 1593| 1.82k| return(TOK_HEX); ------------------ | | 91| 1.82k|#define TOK_HEX 260 ------------------ 1594| 1.82k| } 1595| 2.90k| } 1596| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1597| 1.95k|case 42: ------------------ | Branch (1597:1): [True: 1.95k, False: 193k] ------------------ 1598| 1.95k|YY_RULE_SETUP ------------------ | | 1170| 1.95k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 1.95k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 1.95k, False: 0] | | ------------------ | | 1171| 1.95k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 1.95k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 1.95k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 1.95k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 1.95k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 1.95k| YY_USER_ACTION ------------------ 1599| 1.95k|#line 225 "scanner.l" 1600| 1.95k|{ return(TOK_ARRAY_START); } ------------------ | | 103| 1.95k|#define TOK_ARRAY_START 272 ------------------ 1601| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1602| 1.88k|case 43: ------------------ | Branch (1602:1): [True: 1.88k, False: 193k] ------------------ 1603| 1.88k|YY_RULE_SETUP ------------------ | | 1170| 1.88k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 1.88k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 1.88k, False: 0] | | ------------------ | | 1171| 1.88k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 1.88k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 1.88k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 1.88k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 1.88k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 1.88k| YY_USER_ACTION ------------------ 1604| 1.88k|#line 226 "scanner.l" 1605| 1.88k|{ return(TOK_ARRAY_END); } ------------------ | | 104| 1.88k|#define TOK_ARRAY_END 273 ------------------ 1606| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1607| 47.9k|case 44: ------------------ | Branch (1607:1): [True: 47.9k, False: 147k] ------------------ 1608| 47.9k|YY_RULE_SETUP ------------------ | | 1170| 47.9k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 47.9k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 47.9k, False: 0] | | ------------------ | | 1171| 47.9k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 47.9k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 47.9k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 47.9k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 47.9k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 47.9k| YY_USER_ACTION ------------------ 1609| 47.9k|#line 227 "scanner.l" 1610| 47.9k|{ return(TOK_LIST_START); } ------------------ | | 105| 47.9k|#define TOK_LIST_START 274 ------------------ 1611| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1612| 1.55k|case 45: ------------------ | Branch (1612:1): [True: 1.55k, False: 193k] ------------------ 1613| 1.55k|YY_RULE_SETUP ------------------ | | 1170| 1.55k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 1.55k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 1.55k, False: 0] | | ------------------ | | 1171| 1.55k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 1.55k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 1.55k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 1.55k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 1.55k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 1.55k| YY_USER_ACTION ------------------ 1614| 1.55k|#line 228 "scanner.l" 1615| 1.55k|{ return(TOK_LIST_END); } ------------------ | | 106| 1.55k|#define TOK_LIST_END 275 ------------------ 1616| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1617| 1.17k|case 46: ------------------ | Branch (1617:1): [True: 1.17k, False: 194k] ------------------ 1618| 1.17k|YY_RULE_SETUP ------------------ | | 1170| 1.17k| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 1.17k|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 1.17k, False: 0] | | ------------------ | | 1171| 1.17k| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 1.17k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 1.17k| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 1.17k|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 1.17k|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 1.17k| YY_USER_ACTION ------------------ 1619| 1.17k|#line 229 "scanner.l" 1620| 1.17k|{ return(TOK_SEMICOLON); } ------------------ | | 110| 1.17k|#define TOK_SEMICOLON 279 ------------------ 1621| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1622| 104|case 47: ------------------ | Branch (1622:1): [True: 104, False: 195k] ------------------ 1623| 104|YY_RULE_SETUP ------------------ | | 1170| 104| if ( yyleng > 0 ) \ | | ------------------ | | | | 347| 104|#define yyleng yyg->yyleng_r | | ------------------ | | | Branch (1170:7): [True: 104, False: 0] | | ------------------ | | 1171| 104| YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | | ------------------ | | | | 515| 104|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | 1172| 104| (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 348| 104|#define yytext yyg->yytext_r | | ------------------ | | (yytext[yyleng - 1] == '\n'); \ | | ------------------ | | | | 347| 104|#define yyleng yyg->yyleng_r | | ------------------ | | 1173| 104| YY_USER_ACTION ------------------ 1624| 104|#line 230 "scanner.l" 1625| 104|{ return(TOK_GARBAGE); } ------------------ | | 111| 104|#define TOK_GARBAGE 280 ------------------ 1626| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1627| 1.66k|case YY_STATE_EOF(INITIAL): ------------------ | | 365| 1.66k|#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) | | ------------------ | | | | 584| 1.66k|#define YY_END_OF_BUFFER 49 | | ------------------ ------------------ | Branch (1627:1): [True: 1.66k, False: 193k] ------------------ 1628| 1.75k|case YY_STATE_EOF(SINGLE_LINE_COMMENT): ------------------ | | 365| 1.75k|#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) | | ------------------ | | | | 584| 1.75k|#define YY_END_OF_BUFFER 49 | | ------------------ ------------------ | Branch (1628:1): [True: 92, False: 195k] ------------------ 1629| 1.78k|case YY_STATE_EOF(MULTI_LINE_COMMENT): ------------------ | | 365| 1.78k|#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) | | ------------------ | | | | 584| 1.78k|#define YY_END_OF_BUFFER 49 | | ------------------ ------------------ | Branch (1629:1): [True: 30, False: 195k] ------------------ 1630| 2.01k|case YY_STATE_EOF(STRING): ------------------ | | 365| 2.01k|#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) | | ------------------ | | | | 584| 2.01k|#define YY_END_OF_BUFFER 49 | | ------------------ ------------------ | Branch (1630:1): [True: 227, False: 195k] ------------------ 1631| 2.01k|case YY_STATE_EOF(INCLUDE): ------------------ | | 365| 2.01k|#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) | | ------------------ | | | | 584| 2.01k|#define YY_END_OF_BUFFER 49 | | ------------------ ------------------ | Branch (1631:1): [True: 0, False: 195k] ------------------ 1632| 2.01k|#line 232 "scanner.l" 1633| 2.01k|{ 1634| 2.01k| const char *error = NULL; 1635| 2.01k| FILE *fp; 1636| | 1637| 2.01k| fp = libconfig_scanctx_next_include_file(yyextra, &error); ------------------ | | 346| 2.01k|#define yyextra yyg->yyextra_r ------------------ 1638| 2.01k| if(fp) ------------------ | Branch (1638:6): [True: 0, False: 2.01k] ------------------ 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| 2.01k| else if(error) ------------------ | Branch (1645:11): [True: 0, False: 2.01k] ------------------ 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| 2.01k| else 1653| 2.01k| { 1654| | /* No more files in the current include list. */ 1655| 2.01k| YY_BUFFER_STATE buf = (YY_BUFFER_STATE)libconfig_scanctx_pop_include(yyextra); ------------------ | | 346| 2.01k|#define yyextra yyg->yyextra_r ------------------ 1656| 2.01k| if(buf) ------------------ | Branch (1656:8): [True: 0, False: 2.01k] ------------------ 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| 2.01k| else 1662| 2.01k| yyterminate(); ------------------ | | 1129| 2.01k|#define yyterminate() return YY_NULL | | ------------------ | | | | 329| 2.01k|#define YY_NULL 0 | | ------------------ ------------------ 1663| 2.01k| } 1664| 2.01k|} 1665| 0| YY_BREAK ------------------ | | 1166| 0|#define YY_BREAK /*LINTED*/break; ------------------ 1666| 0|case 48: ------------------ | Branch (1666:1): [True: 0, False: 195k] ------------------ 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| 4.18k| case YY_END_OF_BUFFER: ------------------ | | 584| 4.18k|#define YY_END_OF_BUFFER 49 ------------------ | Branch (1673:2): [True: 4.18k, False: 191k] ------------------ 1674| 4.18k| { 1675| | /* Amount of text matched not including the EOB char. */ 1676| 4.18k| int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; ------------------ | | 567| 4.18k|#define yytext_ptr yytext_r ------------------ 1677| | 1678| | /* Undo the effects of YY_DO_BEFORE_ACTION. */ 1679| 4.18k| *yy_cp = yyg->yy_hold_char; 1680| 4.18k| YY_RESTORE_YY_MORE_OFFSET 1681| | 1682| 4.18k| if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) ------------------ | | 515| 4.18k|#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| 4.18k|#define YY_BUFFER_NEW 0 ------------------ | Branch (1682:8): [True: 2.18k, False: 2.00k] ------------------ 1683| 2.18k| { 1684| | /* We're scanning a new file or input source. It's 1685| | * possible that this happened because the user 1686| | * just pointed yyin at a new source and called 1687| | * yylex(). If so, then we have to assure 1688| | * consistency between YY_CURRENT_BUFFER and our 1689| | * globals. Here is the right place to do so, because 1690| | * this is the first action (other than possibly a 1691| | * back-up) that will match for the new input source. 1692| | */ 1693| 2.18k| yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; ------------------ | | 515| 2.18k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 1694| 2.18k| YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; ------------------ | | 515| 2.18k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; ------------------ | | 344| 2.18k|#define yyin yyg->yyin_r ------------------ 1695| 2.18k| YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; ------------------ | | 515| 2.18k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; ------------------ | | 487| 2.18k|#define YY_BUFFER_NORMAL 1 ------------------ 1696| 2.18k| } 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| 4.18k| if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) ------------------ | | 515| 4.18k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ | Branch (1705:8): [True: 0, False: 4.18k] ------------------ 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| 4.18k| else switch ( yy_get_next_buffer( yyscanner ) ) ------------------ | Branch (1742:17): [True: 4.18k, False: 0] ------------------ 1743| 4.18k| { 1744| 2.01k| case EOB_ACT_END_OF_FILE: ------------------ | | 398| 2.01k|#define EOB_ACT_END_OF_FILE 1 ------------------ | Branch (1744:4): [True: 2.01k, False: 2.17k] ------------------ 1745| 2.01k| { 1746| 2.01k| yyg->yy_did_buffer_switch_on_eof = 0; 1747| | 1748| 2.01k| if ( yywrap( yyscanner ) ) ------------------ | | 206| 2.01k|#define yywrap libconfig_yywrap | | ------------------ | | | | 561| 2.01k|#define libconfig_yywrap(yyscanner) (/*CONSTCOND*/1) | | | | ------------------ | | | | | Branch (561:37): [True: 2.01k, Folded] | | | | ------------------ | | ------------------ ------------------ 1749| 2.01k| { 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| 2.01k| yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; ------------------ | | 567| 2.01k|#define yytext_ptr yytext_r ------------------ yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; ------------------ | | 888| 2.01k|#define YY_MORE_ADJ 0 ------------------ 1760| | 1761| 2.01k| yy_act = YY_STATE_EOF(YY_START); ------------------ | | 365| 2.01k|#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) | | ------------------ | | | | 584| 2.01k|#define YY_END_OF_BUFFER 49 | | ------------------ ------------------ 1762| 2.01k| goto do_action; 1763| 2.01k| } 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| 2.01k| } 1772| | 1773| 0| case EOB_ACT_CONTINUE_SCAN: ------------------ | | 397| 0|#define EOB_ACT_CONTINUE_SCAN 0 ------------------ | Branch (1773:4): [True: 0, False: 4.18k] ------------------ 1774| 0| yyg->yy_c_buf_p = 1775| 0| yyg->yytext_ptr + yy_amount_of_matched_text; ------------------ | | 567| 0|#define yytext_ptr yytext_r ------------------ 1776| | 1777| 0| yy_current_state = yy_get_previous_state( yyscanner ); 1778| | 1779| 0| yy_cp = yyg->yy_c_buf_p; 1780| 0| yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; ------------------ | | 567| 0|#define yytext_ptr yytext_r ------------------ yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; ------------------ | | 888| 0|#define YY_MORE_ADJ 0 ------------------ 1781| 0| goto yy_match; 1782| | 1783| 2.17k| case EOB_ACT_LAST_MATCH: ------------------ | | 399| 2.17k|#define EOB_ACT_LAST_MATCH 2 ------------------ | Branch (1783:4): [True: 2.17k, False: 2.01k] ------------------ 1784| 2.17k| yyg->yy_c_buf_p = 1785| 2.17k| &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; ------------------ | | 515| 2.17k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 1786| | 1787| 2.17k| yy_current_state = yy_get_previous_state( yyscanner ); 1788| | 1789| 2.17k| yy_cp = yyg->yy_c_buf_p; 1790| 2.17k| yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; ------------------ | | 567| 2.17k|#define yytext_ptr yytext_r ------------------ yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; ------------------ | | 888| 2.17k|#define YY_MORE_ADJ 0 ------------------ 1791| 2.17k| goto yy_find_action; 1792| 4.18k| } 1793| 0| break; 1794| 4.18k| } 1795| | 1796| 0| default: ------------------ | Branch (1796:2): [True: 0, False: 195k] ------------------ 1797| 0| YY_FATAL_ERROR( ------------------ | | 1139| 0|#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) ------------------ 1798| 195k| "fatal flex scanner internal error--no action found" ); 1799| 195k| } /* end of action switch */ 1800| 195k| } /* end of scanning one token */ 1801| 159k| } /* end of user's declarations */ 1802| 159k|} /* end of yylex */ libconfig_yy_switch_to_buffer: 2120| 2.35k|{ 2121| 2.35k| 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.35k| yyensure_buffer_stack (yyscanner); ------------------ | | 86| 2.35k|#define yyensure_buffer_stack libconfig_yyensure_buffer_stack ------------------ 2129| 2.35k| if ( YY_CURRENT_BUFFER == new_buffer ) ------------------ | | 509| 2.35k|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:29): [True: 2.35k, False: 0] | | ------------------ | | 510| 2.35k| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 2.35k| : NULL) ------------------ | Branch (2129:7): [True: 0, False: 2.35k] ------------------ 2130| 0| return; 2131| | 2132| 2.35k| if ( YY_CURRENT_BUFFER ) ------------------ | | 509| 2.35k|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:27): [True: 0, False: 2.35k] | | | Branch (509:29): [True: 2.35k, False: 0] | | ------------------ | | 510| 2.35k| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 2.35k| : 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.35k| YY_CURRENT_BUFFER_LVALUE = new_buffer; ------------------ | | 515| 2.35k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 2141| 2.35k| yy_load_buffer_state( yyscanner ); ------------------ | | 62| 2.35k|#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.35k| yyg->yy_did_buffer_switch_on_eof = 1; 2149| 2.35k|} libconfig_yy_delete_buffer: 2195| 2.35k|{ 2196| 2.35k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2197| | 2198| 2.35k| if ( ! b ) ------------------ | Branch (2198:7): [True: 0, False: 2.35k] ------------------ 2199| 0| return; 2200| | 2201| 2.35k| if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ ------------------ | | 509| 2.35k|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:29): [True: 2.35k, False: 0] | | ------------------ | | 510| 2.35k| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 2.35k| : NULL) ------------------ | Branch (2201:7): [True: 2.35k, False: 0] ------------------ 2202| 2.35k| YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; ------------------ | | 515| 2.35k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 2203| | 2204| 2.35k| if ( b->yy_is_our_buffer ) ------------------ | Branch (2204:7): [True: 2.35k, False: 0] ------------------ 2205| 2.35k| yyfree( (void *) b->yy_ch_buf , yyscanner ); ------------------ | | 236| 2.35k|#define yyfree libconfig_yyfree ------------------ 2206| | 2207| 2.35k| yyfree( (void *) b , yyscanner ); ------------------ | | 236| 2.35k|#define yyfree libconfig_yyfree ------------------ 2208| 2.35k|} libconfig_yypop_buffer_state: 2305| 2.35k|{ 2306| 2.35k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2307| 2.35k| if (!YY_CURRENT_BUFFER) ------------------ | | 509| 2.35k|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:29): [True: 2.35k, False: 0] | | ------------------ | | 510| 2.35k| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 2.35k| : NULL) ------------------ | Branch (2307:6): [True: 2.35k, False: 0] ------------------ 2308| 2.35k| 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.35k|{ 2376| 2.35k| YY_BUFFER_STATE b; 2377| | 2378| 2.35k| if ( size < 2 || ------------------ | Branch (2378:7): [True: 0, False: 2.35k] ------------------ 2379| 2.35k| base[size-2] != YY_END_OF_BUFFER_CHAR || ------------------ | | 368| 4.71k|#define YY_END_OF_BUFFER_CHAR 0 ------------------ | Branch (2379:7): [True: 0, False: 2.35k] ------------------ 2380| 2.35k| base[size-1] != YY_END_OF_BUFFER_CHAR ) ------------------ | | 368| 2.35k|#define YY_END_OF_BUFFER_CHAR 0 ------------------ | Branch (2380:7): [True: 0, False: 2.35k] ------------------ 2381| | /* They forgot to leave room for the EOB's. */ 2382| 0| return NULL; 2383| | 2384| 2.35k| b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); ------------------ | | 224| 2.35k|#define yyalloc libconfig_yyalloc ------------------ 2385| 2.35k| if ( ! b ) ------------------ | Branch (2385:7): [True: 0, False: 2.35k] ------------------ 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.35k| b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ 2389| 2.35k| b->yy_buf_pos = b->yy_ch_buf = base; 2390| 2.35k| b->yy_is_our_buffer = 0; 2391| 2.35k| b->yy_input_file = NULL; 2392| 2.35k| b->yy_n_chars = b->yy_buf_size; 2393| 2.35k| b->yy_is_interactive = 0; 2394| 2.35k| b->yy_at_bol = 1; 2395| 2.35k| b->yy_fill_buffer = 0; 2396| 2.35k| b->yy_buffer_status = YY_BUFFER_NEW; ------------------ | | 486| 2.35k|#define YY_BUFFER_NEW 0 ------------------ 2397| | 2398| 2.35k| yy_switch_to_buffer( b , yyscanner ); ------------------ | | 68| 2.35k|#define yy_switch_to_buffer libconfig_yy_switch_to_buffer ------------------ 2399| | 2400| 2.35k| return b; 2401| 2.35k|} libconfig_yy_scan_string: 2412| 2.35k|{ 2413| | 2414| 2.35k| return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); ------------------ | | 44| 2.35k|#define yy_scan_bytes libconfig_yy_scan_bytes ------------------ 2415| 2.35k|} libconfig_yy_scan_bytes: 2425| 2.35k|{ 2426| 2.35k| YY_BUFFER_STATE b; 2427| 2.35k| char *buf; 2428| 2.35k| yy_size_t n; 2429| 2.35k| int i; 2430| | 2431| | /* Get memory for full buffer, including space for trailing EOB's. */ 2432| 2.35k| n = (yy_size_t) (_yybytes_len + 2); 2433| 2.35k| buf = (char *) yyalloc( n , yyscanner ); ------------------ | | 224| 2.35k|#define yyalloc libconfig_yyalloc ------------------ 2434| 2.35k| if ( ! buf ) ------------------ | Branch (2434:7): [True: 0, False: 2.35k] ------------------ 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| 350k| for ( i = 0; i < _yybytes_len; ++i ) ------------------ | Branch (2437:15): [True: 347k, False: 2.35k] ------------------ 2438| 347k| buf[i] = yybytes[i]; 2439| | 2440| 2.35k| buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; ------------------ | | 368| 2.35k|#define YY_END_OF_BUFFER_CHAR 0 ------------------ 2441| | 2442| 2.35k| b = yy_scan_buffer( buf, n , yyscanner); ------------------ | | 32| 2.35k|#define yy_scan_buffer libconfig_yy_scan_buffer ------------------ 2443| 2.35k| if ( ! b ) ------------------ | Branch (2443:7): [True: 0, False: 2.35k] ------------------ 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.35k| b->yy_is_our_buffer = 1; 2450| | 2451| 2.35k| return b; 2452| 2.35k|} libconfig_yyget_lineno: 2498| 89.7k|{ 2499| 89.7k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2500| | 2501| 89.7k| if (! YY_CURRENT_BUFFER) ------------------ | | 509| 89.7k|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:29): [True: 89.7k, False: 0] | | ------------------ | | 510| 89.7k| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 89.7k| : NULL) ------------------ | Branch (2501:13): [True: 0, False: 89.7k] ------------------ 2502| 0| return 0; 2503| | 2504| 89.7k| return yylineno; ------------------ | | 349| 89.7k|#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) | | ------------------ | | | | 515| 89.7k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ ------------------ 2505| 89.7k|} libconfig_yyset_extra: 2562| 4.71k|{ 2563| 4.71k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2564| 4.71k| yyextra = user_defined ; ------------------ | | 346| 4.71k|#define yyextra yyg->yyextra_r ------------------ 2565| 4.71k|} libconfig_yyset_lineno: 2572| 2.35k|{ 2573| 2.35k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2574| | 2575| | /* lineno is only valid if an input buffer exists. */ 2576| 2.35k| if (! YY_CURRENT_BUFFER ) ------------------ | | 509| 2.35k|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:29): [True: 2.35k, False: 0] | | ------------------ | | 510| 2.35k| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 2.35k| : NULL) ------------------ | Branch (2576:13): [True: 0, False: 2.35k] ------------------ 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.35k| yylineno = _line_number; ------------------ | | 349| 2.35k|#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) | | ------------------ | | | | 515| 2.35k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ ------------------ 2580| 2.35k|} libconfig_yylex_init_extra: 2675| 2.35k|{ 2676| 2.35k| struct yyguts_t dummy_yyguts; 2677| | 2678| 2.35k| yyset_extra (yy_user_defined, &dummy_yyguts); ------------------ | | 140| 2.35k|#define yyset_extra libconfig_yyset_extra ------------------ 2679| | 2680| 2.35k| if (ptr_yy_globals == NULL){ ------------------ | Branch (2680:9): [True: 0, False: 2.35k] ------------------ 2681| 0| errno = EINVAL; 2682| 0| return 1; 2683| 0| } 2684| | 2685| 2.35k| *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); ------------------ | | 224| 2.35k|#define yyalloc libconfig_yyalloc ------------------ 2686| | 2687| 2.35k| if (*ptr_yy_globals == NULL){ ------------------ | Branch (2687:9): [True: 0, False: 2.35k] ------------------ 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.35k| memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); 2695| | 2696| 2.35k| yyset_extra (yy_user_defined, *ptr_yy_globals); ------------------ | | 140| 2.35k|#define yyset_extra libconfig_yyset_extra ------------------ 2697| | 2698| 2.35k| return yy_init_globals ( *ptr_yy_globals ); 2699| 2.35k|} libconfig_yylex_destroy: 2736| 2.35k|{ 2737| 2.35k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2738| | 2739| | /* Pop the buffer stack, destroying each element. */ 2740| 4.71k| while(YY_CURRENT_BUFFER){ ------------------ | | 509| 4.71k|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:27): [True: 2.35k, False: 2.35k] | | | Branch (509:29): [True: 4.71k, False: 0] | | ------------------ | | 510| 4.71k| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 4.71k| : NULL) ------------------ 2741| 2.35k| yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); ------------------ | | 26| 2.35k|#define yy_delete_buffer libconfig_yy_delete_buffer ------------------ yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); ------------------ | | 509| 2.35k|#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ | | ------------------ | | | Branch (509:29): [True: 2.35k, False: 0] | | ------------------ | | 510| 2.35k| ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ | | 511| 2.35k| : NULL) ------------------ 2742| 2.35k| YY_CURRENT_BUFFER_LVALUE = NULL; ------------------ | | 515| 2.35k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 2743| 2.35k| yypop_buffer_state(yyscanner); ------------------ | | 80| 2.35k|#define yypop_buffer_state libconfig_yypop_buffer_state ------------------ 2744| 2.35k| } 2745| | 2746| | /* Destroy the stack itself. */ 2747| 2.35k| yyfree(yyg->yy_buffer_stack , yyscanner); ------------------ | | 236| 2.35k|#define yyfree libconfig_yyfree ------------------ 2748| 2.35k| yyg->yy_buffer_stack = NULL; 2749| | 2750| | /* Destroy the start condition stack. */ 2751| 2.35k| yyfree( yyg->yy_start_stack , yyscanner ); ------------------ | | 236| 2.35k|#define yyfree libconfig_yyfree ------------------ 2752| 2.35k| 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.35k| yy_init_globals( yyscanner); 2757| | 2758| | /* Destroy the main struct (reentrant only). */ 2759| 2.35k| yyfree ( yyscanner , yyscanner ); ------------------ | | 236| 2.35k|#define yyfree libconfig_yyfree ------------------ 2760| | yyscanner = NULL; 2761| 2.35k| return 0; 2762| 2.35k|} libconfig_yyfree: 2792| 11.7k|{ 2793| 11.7k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2794| 11.7k| (void)yyg; 2795| 11.7k| free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ 2796| 11.7k|} libconfig_yyalloc: 2804| 9.42k|{ 2805| 9.42k| return(libconfig_malloc(bytes)); 2806| 9.42k|} scanner.c:yy_get_next_buffer: 1812| 4.18k|{ 1813| 4.18k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1814| 4.18k| char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; ------------------ | | 515| 4.18k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 1815| 4.18k| char *source = yyg->yytext_ptr; ------------------ | | 567| 4.18k|#define yytext_ptr yytext_r ------------------ 1816| 4.18k| int number_to_move, i; 1817| 4.18k| int ret_val; 1818| | 1819| 4.18k| if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) ------------------ | | 515| 4.18k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ | Branch (1819:7): [True: 0, False: 4.18k] ------------------ 1820| 0| YY_FATAL_ERROR( ------------------ | | 1139| 0|#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) ------------------ 1821| 4.18k| "fatal flex scanner internal error--end of buffer missed" ); 1822| | 1823| 4.18k| if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) ------------------ | | 515| 4.18k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ | Branch (1823:7): [True: 4.18k, False: 0] ------------------ 1824| 4.18k| { /* Don't try to fill the buffer, so this is an EOF. */ 1825| 4.18k| if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) ------------------ | | 567| 4.18k|#define yytext_ptr yytext_r ------------------ if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) ------------------ | | 888| 4.18k|#define YY_MORE_ADJ 0 ------------------ | Branch (1825:8): [True: 2.01k, False: 2.17k] ------------------ 1826| 2.01k| { 1827| | /* We matched a single character, the EOB, so 1828| | * treat this as a final EOF. 1829| | */ 1830| 2.01k| return EOB_ACT_END_OF_FILE; ------------------ | | 398| 2.01k|#define EOB_ACT_END_OF_FILE 1 ------------------ 1831| 2.01k| } 1832| | 1833| 2.17k| else 1834| 2.17k| { 1835| | /* We matched some text prior to the EOB, first 1836| | * process it. 1837| | */ 1838| 2.17k| return EOB_ACT_LAST_MATCH; ------------------ | | 399| 2.17k|#define EOB_ACT_LAST_MATCH 2 ------------------ 1839| 2.17k| } 1840| 4.18k| } 1841| | 1842| | /* Try to read more data. */ 1843| | 1844| | /* First move last chars to start of buffer. */ 1845| 0| number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); ------------------ | | 567| 0|#define yytext_ptr yytext_r ------------------ 1846| | 1847| 0| for ( i = 0; i < number_to_move; ++i ) ------------------ | Branch (1847:15): [True: 0, False: 0] ------------------ 1848| 0| *(dest++) = *(source++); 1849| | 1850| 0| if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) ------------------ | | 498| 0|#define YY_BUFFER_EOF_PENDING 2 ------------------ | Branch (1850:7): [True: 0, False: 0] ------------------ 1851| | /* don't do the read, it's not guaranteed to return an EOF, 1852| | * just force an EOF 1853| | */ 1854| 0| YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 1855| | 1856| 0| else 1857| 0| { 1858| 0| int num_to_read = 1859| 0| YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 1860| | 1861| 0| while ( num_to_read <= 0 ) ------------------ | Branch (1861:11): [True: 0, False: 0] ------------------ 1862| 0| { /* Not enough room in the buffer - grow it. */ 1863| | 1864| | /* just a shorter name for the current buffer */ 1865| 0| YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 1866| | 1867| 0| int yy_c_buf_p_offset = 1868| 0| (int) (yyg->yy_c_buf_p - b->yy_ch_buf); 1869| | 1870| 0| if ( b->yy_is_our_buffer ) ------------------ | Branch (1870:9): [True: 0, False: 0] ------------------ 1871| 0| { 1872| 0| int new_size = b->yy_buf_size * 2; 1873| | 1874| 0| if ( new_size <= 0 ) ------------------ | Branch (1874:10): [True: 0, False: 0] ------------------ 1875| 0| b->yy_buf_size += b->yy_buf_size / 8; 1876| 0| else 1877| 0| b->yy_buf_size *= 2; 1878| | 1879| 0| b->yy_ch_buf = (char *) 1880| | /* Include room in for 2 EOB chars. */ 1881| 0| yyrealloc( (void *) b->yy_ch_buf, ------------------ | | 230| 0|#define yyrealloc libconfig_yyrealloc ------------------ 1882| 0| (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); 1883| 0| } 1884| 0| else 1885| | /* Can't grow it, we don't own it. */ 1886| 0| b->yy_ch_buf = NULL; 1887| | 1888| 0| if ( ! b->yy_ch_buf ) ------------------ | Branch (1888:9): [True: 0, False: 0] ------------------ 1889| 0| YY_FATAL_ERROR( ------------------ | | 1139| 0|#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) ------------------ 1890| 0| "fatal error - scanner input buffer overflow" ); 1891| | 1892| 0| yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; 1893| | 1894| 0| num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 1895| 0| number_to_move - 1; 1896| | 1897| 0| } 1898| | 1899| 0| if ( num_to_read > YY_READ_BUF_SIZE ) ------------------ | | 1076| 0|#define YY_READ_BUF_SIZE 8192 ------------------ | Branch (1899:8): [True: 0, False: 0] ------------------ 1900| 0| num_to_read = YY_READ_BUF_SIZE; ------------------ | | 1076| 0|#define YY_READ_BUF_SIZE 8192 ------------------ 1901| | 1902| | /* Read in more data. */ 1903| 0| YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), ------------------ | | 1093| 0| if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ | | ------------------ | | | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ | | | Branch (1093:7): [True: 0, False: 0] | | ------------------ | | 1094| 0| { \ | | 1095| 0| int c = '*'; \ | | 1096| 0| int n; \ | | 1097| 0| for ( n = 0; n < max_size && \ | | ------------------ | | | Branch (1097:16): [True: 0, False: 0] | | ------------------ | | 1098| 0| (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ | | ------------------ | | | | 344| 0|#define yyin yyg->yyin_r | | ------------------ | | | Branch (1098:9): [True: 0, False: 0] | | | Branch (1098:38): [True: 0, False: 0] | | ------------------ | | 1099| 0| buf[n] = (char) c; \ | | 1100| 0| if ( c == '\n' ) \ | | ------------------ | | | Branch (1100:8): [True: 0, False: 0] | | ------------------ | | 1101| 0| buf[n++] = (char) c; \ | | 1102| 0| if ( c == EOF && ferror( yyin ) ) \ | | ------------------ | | | | 344| 0|#define yyin yyg->yyin_r | | ------------------ | | | Branch (1102:8): [True: 0, False: 0] | | | Branch (1102:20): [True: 0, False: 0] | | ------------------ | | 1103| 0| YY_FATAL_ERROR( "input in flex scanner failed" ); \ | | ------------------ | | | | 1139| 0|#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) | | ------------------ | | 1104| 0| result = n; \ | | 1105| 0| } \ | | 1106| 0| else \ | | 1107| 0| { \ | | 1108| 0| errno=0; \ | | 1109| 0| while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ | | ------------------ | | | | 344| 0|#define yyin yyg->yyin_r | | ------------------ | | while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ | | ------------------ | | | | 344| 0|#define yyin yyg->yyin_r | | ------------------ | | | Branch (1109:11): [True: 0, False: 0] | | | Branch (1109:78): [True: 0, False: 0] | | ------------------ | | 1110| 0| { \ | | 1111| 0| if( errno != EINTR) \ | | ------------------ | | | Branch (1111:8): [True: 0, False: 0] | | ------------------ | | 1112| 0| { \ | | 1113| 0| YY_FATAL_ERROR( "input in flex scanner failed" ); \ | | ------------------ | | | | 1139| 0|#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) | | ------------------ | | 1114| 0| break; \ | | 1115| 0| } \ | | 1116| 0| errno=0; \ | | 1117| 0| clearerr(yyin); \ | | ------------------ | | | | 344| 0|#define yyin yyg->yyin_r | | ------------------ | | 1118| 0| } \ | | 1119| 0| }\ ------------------ 1904| 0| yyg->yy_n_chars, num_to_read ); 1905| | 1906| 0| YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 1907| 0| } 1908| | 1909| 0| if ( yyg->yy_n_chars == 0 ) ------------------ | Branch (1909:7): [True: 0, False: 0] ------------------ 1910| 0| { 1911| 0| if ( number_to_move == YY_MORE_ADJ ) ------------------ | | 888| 0|#define YY_MORE_ADJ 0 ------------------ | Branch (1911:8): [True: 0, False: 0] ------------------ 1912| 0| { 1913| 0| ret_val = EOB_ACT_END_OF_FILE; ------------------ | | 398| 0|#define EOB_ACT_END_OF_FILE 1 ------------------ 1914| 0| yyrestart( yyin , yyscanner); ------------------ | | 98| 0|#define yyrestart libconfig_yyrestart ------------------ yyrestart( yyin , yyscanner); ------------------ | | 344| 0|#define yyin yyg->yyin_r ------------------ 1915| 0| } 1916| | 1917| 0| else 1918| 0| { 1919| 0| ret_val = EOB_ACT_LAST_MATCH; ------------------ | | 399| 0|#define EOB_ACT_LAST_MATCH 2 ------------------ 1920| 0| YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 1921| 0| YY_BUFFER_EOF_PENDING; ------------------ | | 498| 0|#define YY_BUFFER_EOF_PENDING 2 ------------------ 1922| 0| } 1923| 0| } 1924| | 1925| 0| else 1926| 0| ret_val = EOB_ACT_CONTINUE_SCAN; ------------------ | | 397| 0|#define EOB_ACT_CONTINUE_SCAN 0 ------------------ 1927| | 1928| 0| if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ | Branch (1928:6): [True: 0, False: 0] ------------------ 1929| | /* Extend the array by 50%, plus the number we really need. */ 1930| 0| int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); 1931| 0| YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( ------------------ | | 230| 0|#define yyrealloc libconfig_yyrealloc ------------------ 1932| 0| (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 1933| 0| if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ | Branch (1933:8): [True: 0, False: 0] ------------------ 1934| 0| YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); ------------------ | | 1139| 0|#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) ------------------ 1935| | /* "- 2" to take care of EOB's */ 1936| 0| YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 1937| 0| } 1938| | 1939| 0| yyg->yy_n_chars += number_to_move; 1940| 0| YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; ------------------ | | 368| 0|#define YY_END_OF_BUFFER_CHAR 0 ------------------ 1941| 0| YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; ------------------ | | 368| 0|#define YY_END_OF_BUFFER_CHAR 0 ------------------ 1942| | 1943| 0| yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; ------------------ | | 567| 0|#define yytext_ptr yytext_r ------------------ yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; ------------------ | | 515| 0|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 1944| | 1945| 0| return ret_val; 1946| 0|} scanner.c:yy_get_previous_state: 1951| 2.17k|{ 1952| 2.17k| yy_state_type yy_current_state; 1953| 2.17k| char *yy_cp; 1954| 2.17k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1955| | 1956| 2.17k| yy_current_state = yyg->yy_start; 1957| 2.17k| yy_current_state += YY_AT_BOL(); ------------------ | | 557| 2.17k|#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) | | ------------------ | | | | 515| 2.17k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] | | ------------------ ------------------ 1958| | 1959| 25.6k| for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) ------------------ | | 567| 2.17k|#define yytext_ptr yytext_r ------------------ for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) ------------------ | | 888| 2.17k|#define YY_MORE_ADJ 0 ------------------ | Branch (1959:47): [True: 23.4k, False: 2.17k] ------------------ 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: 20.9k, False: 2.46k] ------------------ 1963| 20.9k| { 1964| 20.9k| yyg->yy_last_accepting_state = yy_current_state; 1965| 20.9k| yyg->yy_last_accepting_cpos = yy_cp; 1966| 20.9k| } 1967| 39.0k| while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) ------------------ | Branch (1967:11): [True: 15.6k, False: 23.4k] ------------------ 1968| 15.6k| { 1969| 15.6k| yy_current_state = (int) yy_def[yy_current_state]; 1970| 15.6k| if ( yy_current_state >= 214 ) ------------------ | Branch (1970:9): [True: 15.4k, False: 148] ------------------ 1971| 15.4k| yy_c = yy_meta[yy_c]; 1972| 15.6k| } 1973| 23.4k| yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; 1974| 23.4k| } 1975| | 1976| 2.17k| return yy_current_state; 1977| 2.17k|} scanner.c:libconfig_yy_load_buffer_state: 2152| 4.71k|{ 2153| 4.71k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2154| 4.71k| yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; ------------------ | | 515| 4.71k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 2155| 4.71k| yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; ------------------ | | 567| 4.71k|#define yytext_ptr yytext_r ------------------ yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; ------------------ | | 515| 4.71k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 2156| 4.71k| yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; ------------------ | | 344| 4.71k|#define yyin yyg->yyin_r ------------------ yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; ------------------ | | 515| 4.71k|#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] ------------------ 2157| 4.71k| yyg->yy_hold_char = *yyg->yy_c_buf_p; 2158| 4.71k|} scanner.c:libconfig_yyensure_buffer_stack: 2325| 2.35k|{ 2326| 2.35k| yy_size_t num_to_alloc; 2327| 2.35k| struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2328| | 2329| 2.35k| if (!yyg->yy_buffer_stack) { ------------------ | Branch (2329:6): [True: 2.35k, 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.35k| num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ 2336| 2.35k| yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc ------------------ | | 224| 2.35k|#define yyalloc libconfig_yyalloc ------------------ 2337| 2.35k| (num_to_alloc * sizeof(struct yy_buffer_state*) 2338| 2.35k| , yyscanner); 2339| 2.35k| if ( ! yyg->yy_buffer_stack ) ------------------ | Branch (2339:8): [True: 0, False: 2.35k] ------------------ 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.35k| memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); 2343| | 2344| 2.35k| yyg->yy_buffer_stack_max = num_to_alloc; 2345| 2.35k| yyg->yy_buffer_stack_top = 0; 2346| 2.35k| return; 2347| 2.35k| } 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.71k|{ 2703| 4.71k| 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.71k| yyg->yy_buffer_stack = NULL; 2709| 4.71k| yyg->yy_buffer_stack_top = 0; 2710| 4.71k| yyg->yy_buffer_stack_max = 0; 2711| 4.71k| yyg->yy_c_buf_p = NULL; 2712| 4.71k| yyg->yy_init = 0; 2713| 4.71k| yyg->yy_start = 0; 2714| | 2715| 4.71k| yyg->yy_start_stack_ptr = 0; 2716| 4.71k| yyg->yy_start_stack_depth = 0; 2717| 4.71k| 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.71k| yyin = NULL; ------------------ | | 344| 4.71k|#define yyin yyg->yyin_r ------------------ 2725| 4.71k| yyout = NULL; ------------------ | | 345| 4.71k|#define yyout yyg->yyout_r ------------------ 2726| 4.71k|#endif 2727| | 2728| | /* For future reference: Set errno on error, since we are called by 2729| | * yylex_init() 2730| | */ 2731| 4.71k| return 0; 2732| 4.71k|} libconfig_strbuf_ensure_capacity: 34| 12.3k|{ 35| 12.3k| static const size_t mask = ~(STRING_BLOCK_SIZE - 1); ------------------ | | 29| 12.3k|#define STRING_BLOCK_SIZE 64 ------------------ 36| | 37| 12.3k| size_t newlen = buf->length + len + 1; /* add 1 for NUL */ 38| 12.3k| if(newlen > buf->capacity) ------------------ | Branch (38:6): [True: 3.57k, False: 8.80k] ------------------ 39| 3.57k| { 40| 3.57k| buf->capacity = (newlen + (STRING_BLOCK_SIZE - 1)) & mask; ------------------ | | 29| 3.57k|#define STRING_BLOCK_SIZE 64 ------------------ 41| 3.57k| buf->string = (char *)libconfig_realloc(buf->string, buf->capacity); 42| 3.57k| } 43| 12.3k|} libconfig_strbuf_release: 48| 10.2k|{ 49| 10.2k| char *r = buf->string; 50| 10.2k| __zero(buf); ------------------ | | 39| 10.2k|#define __zero(P) memset((void *)(P), 0, sizeof(*P)) ------------------ 51| 10.2k| return(r); 52| 10.2k|} libconfig_strbuf_append_string: 57| 6.83k|{ 58| 6.83k| size_t len = strlen(s); 59| 6.83k| libconfig_strbuf_ensure_capacity(buf, len); 60| 6.83k| strcpy(buf->string + buf->length, s); 61| 6.83k| buf->length += len; 62| 6.83k|} libconfig_strbuf_append_char: 67| 5.54k|{ 68| 5.54k| libconfig_strbuf_ensure_capacity(buf, 1); 69| 5.54k| *(buf->string + buf->length) = c; 70| 5.54k| ++(buf->length); 71| 5.54k| *(buf->string + buf->length) = '\0'; 72| 5.54k|} libconfig_strvec_release: 51| 2.35k|{ 52| 2.35k| const char **r = vec->strings; 53| 2.35k| if(r) ------------------ | Branch (53:6): [True: 0, False: 2.35k] ------------------ 54| 0| *(vec->end) = NULL; 55| | 56| 2.35k| __zero(vec); ------------------ | | 39| 2.35k|#define __zero(P) memset((void *)(P), 0, sizeof(*P)) ------------------ 57| 2.35k| return(r); 58| 2.35k|} libconfig_strvec_delete: 63| 7.31k|{ 64| 7.31k| const char *const *p; 65| | 66| 7.31k| if(!vec) return; ------------------ | Branch (66:6): [True: 7.31k, False: 0] ------------------ 67| | 68| 0| for(p = vec; *p; ++p) ------------------ | Branch (68:16): [True: 0, False: 0] ------------------ 69| 0| __delete(*p); ------------------ | | 38| 0|#define __delete(P) free((void *)(P)) ------------------ 70| | 71| 0| __delete(vec); ------------------ | | 38| 0|#define __delete(P) free((void *)(P)) ------------------ 72| 0|} libconfig_malloc: 65| 9.59k|{ 66| 9.59k| void *ptr = malloc(size); 67| 9.59k| if(!ptr) ------------------ | Branch (67:6): [True: 0, False: 9.59k] ------------------ 68| 0| libconfig_fatal_error(__libconfig_malloc_failure_message); 69| | 70| 9.59k| return(ptr); 71| 9.59k|} libconfig_calloc: 76| 150k|{ 77| 150k| void *ptr = calloc(nmemb, size); 78| 150k| if(!ptr) ------------------ | Branch (78:6): [True: 0, False: 150k] ------------------ 79| 0| libconfig_fatal_error(__libconfig_malloc_failure_message); 80| | 81| 150k| return(ptr); 82| 150k|} libconfig_realloc: 87| 60.3k|{ 88| 60.3k| ptr = realloc(ptr, size); 89| 60.3k| if(!ptr) ------------------ | Branch (89:6): [True: 0, False: 60.3k] ------------------ 90| 0| libconfig_fatal_error(__libconfig_malloc_failure_message); 91| | 92| 60.3k| return(ptr); 93| 60.3k|} libconfig_parse_integer: 103| 15.6k|{ 104| 15.6k| char *endptr; 105| 15.6k| int errsave = errno; 106| | 107| 15.6k| errno = 0; 108| 15.6k| *val = strtoll(s, &endptr, base); 109| | 110| 15.6k| if((base != 10) && (*val > INT32_MAX) && (*val <= UINT32_MAX)) ------------------ | Branch (110:6): [True: 6.43k, False: 9.20k] | Branch (110:22): [True: 601, False: 5.83k] | Branch (110:44): [True: 252, False: 349] ------------------ 111| 252| *val = (long long)(int)*val; 112| | 113| 15.6k| *is_long = ((*val < INT32_MIN) || (*val > INT32_MAX)); ------------------ | Branch (113:15): [True: 455, False: 15.1k] | Branch (113:37): [True: 467, False: 14.7k] ------------------ 114| | 115| | /* Check for trailing L's. */ 116| 20.0k| while(!errno && *endptr == 'L') ------------------ | Branch (116:9): [True: 20.0k, False: 12] | Branch (116:19): [True: 4.41k, False: 15.6k] ------------------ 117| 4.41k| { 118| 4.41k| *is_long = 1; 119| 4.41k| ++endptr; 120| 4.41k| } 121| | 122| 15.6k| if(*endptr || errno) ------------------ | Branch (122:6): [True: 2, False: 15.6k] | Branch (122:17): [True: 10, False: 15.6k] ------------------ 123| 12| { 124| 12| errno = errsave; 125| 12| return(0); /* parse error */ 126| 12| } 127| 15.6k| errno = errsave; 128| | 129| 15.6k| return(1); 130| 15.6k|} libconfig_format_double: 136| 13.3k|{ 137| 13.3k| const char *fmt = sci_ok ? "%.*g" : "%.*f"; ------------------ | Branch (137:21): [True: 0, False: 13.3k] ------------------ 138| 13.3k| char *p, *q; 139| | 140| 13.3k| snprintf(buf, buflen - 3, fmt, precision, val); 141| | 142| | /* Check for exponent. */ 143| 13.3k| p = strchr(buf, 'e'); 144| 13.3k| if(p) return; ------------------ | Branch (144:6): [True: 0, False: 13.3k] ------------------ 145| | 146| | /* Check for decimal point. */ 147| 13.3k| p = strchr(buf, '.'); 148| 13.3k| if(!p) ------------------ | Branch (148:6): [True: 255, False: 13.1k] ------------------ 149| 255| { 150| | /* No decimal point. Add trailing ".0". */ 151| 255| strcat(buf, ".0"); 152| 255| } 153| 13.1k| else 154| 13.1k| { 155| | /* Remove any excess trailing 0's after decimal point. */ 156| 75.5k| for(q = buf + strlen(buf) - 1; q > p + 1; --q) ------------------ | Branch (156:36): [True: 63.6k, False: 11.9k] ------------------ 157| 63.6k| { 158| 63.6k| if(*q == '0') ------------------ | Branch (158:10): [True: 62.4k, False: 1.18k] ------------------ 159| 62.4k| *q = '\0'; 160| 1.18k| else 161| 1.18k| break; 162| 63.6k| } 163| 13.1k| } 164| 13.3k|} libconfig_format_bin: 172| 1.72k|{ 173| 1.72k| static const int num_bits = sizeof(val) * BITS_IN_BYTE; ------------------ | | 27| 1.72k|#define BITS_IN_BYTE 8 ------------------ 174| 1.72k| char *p = buf + num_bits; 175| 1.72k| char *first_bit = NULL; 176| | 177| 1.72k| *p = '\0'; 178| | 179| 112k| for(int i = 0; i < num_bits; ++i) ------------------ | Branch (179:18): [True: 110k, False: 1.72k] ------------------ 180| 110k| { 181| 110k| int x = val & 1; 182| 110k| val >>= 1; 183| 110k| *(--p) = '0' + x; 184| 110k| if(!first_bit || x) first_bit = p; ------------------ | Branch (184:8): [True: 1.72k, False: 108k] | Branch (184:22): [True: 523, False: 108k] ------------------ 185| 110k| } 186| | 187| 1.72k| return(first_bit); 188| 1.72k|}