• Home
  • Raw
  • Download

Lines Matching refs:optflags

93 int set_config_int(config_setting_t *setting, char *dataString, struct flags optflags) {  in set_config_int()  argument
102 if(optflags.quiet == 0) printf(gettext("ERROR! Incorrect data format.\n")); in set_config_int()
110 if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n")); in set_config_int()
117 int set_config_int64(config_setting_t *setting, char *dataString, struct flags optflags) { in set_config_int64() argument
126 if(optflags.quiet == 0) printf(gettext("ERROR! Incorrect data format.\n")); in set_config_int64()
133 if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n")); in set_config_int64()
140 int set_config_float(config_setting_t *setting, char *dataString, struct flags optflags) { in set_config_float() argument
149 if(optflags.quiet == 0) printf(gettext("ERROR! Incorrect data format.\n")); in set_config_float()
156 if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n")); in set_config_float()
163 int set_config_bool(config_setting_t *setting, char *dataString, struct flags optflags) { in set_config_bool() argument
172 if(optflags.quiet == 0) printf(gettext("ERROR! Incorrect data format.\n")); in set_config_bool()
179 if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n")); in set_config_bool()
262 int set_config(char *configFile, char *dataPath, struct flags optflags, char *dataString, char *dat… in set_config() argument
272 if(optflags.quiet == 0) printf(gettext("ERROR! Can't read configuration file.\n")); in set_config()
279 if(optflags.quiet == 0) printf(gettext("ERROR! Conviguration variable path not given.\n")); in set_config()
284 if(optflags.quiet == 0) printf(gettext("ERROR! Configuration variable value not given.\n")); in set_config()
303 if(optflags.quiet == 0) printf(gettext("ERROR! Inavlid configuration variable path.\n")); in set_config()
310 …if(optflags.quiet == 0) printf(gettext("ERROR! New named configuration variable can be added only … in set_config()
316 if(optflags.quiet == 0) printf(gettext("ERROR! Configuration variable type not given.\n")); in set_config()
339 if(optflags.quiet == 0) printf(gettext("ERROR! Inlegal data type.\n")); in set_config()
346 if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n")); in set_config()
353 scs = set_config_int(ss, dataString, optflags); in set_config()
356 scs = set_config_int64(ss, dataString, optflags); in set_config()
359 scs = set_config_float(ss, dataString, optflags); in set_config()
364 if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n")); in set_config()
369 scs = set_config_bool(ss, dataString, optflags); in set_config()
385 if(optflags.quiet == 0) printf(gettext("ERROR! inconsistent value type.\n")); in set_config()
389 scs = set_config_int(setting, dataString, optflags); in set_config()
398 if(optflags.quiet == 0) printf(gettext("ERROR! inconsistent value type.\n")); in set_config()
402 scs = set_config_int64(setting, dataString, optflags); in set_config()
411 if(optflags.quiet == 0) printf(gettext("ERROR! inconsistent value type.\n")); in set_config()
415 scs = set_config_float(setting, dataString, optflags); in set_config()
424 if(optflags.quiet == 0) printf(gettext("ERROR! inconsistent value type.\n")); in set_config()
431 if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n")); in set_config()
438 if(optflags.quiet == 0) printf(gettext("ERROR! inconsistent value type.\n")); in set_config()
442 scs = set_config_bool(setting, dataString, optflags); in set_config()
454 if(optflags.quiet == 0) printf(gettext("ERROR! Configuration variable type not given.\n")); in set_config()
470 if(optflags.quiet == 0) printf(gettext("ERROR! Prohibited data type.\n")); in set_config()
477 if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n")); in set_config()
483 scs = set_config_int(ss, dataString, optflags); in set_config()
490 scs = set_config_int64(ss, dataString, optflags); in set_config()
497 scs = set_config_float(ss, dataString, optflags); in set_config()
507 if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n")); in set_config()
512 scs = set_config_bool(ss, dataString, optflags); in set_config()
528 if(optflags.quiet == 0) printf(gettext("ERROR! inconsistent value type.\n")); in set_config()
535 if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n")); in set_config()
539 scs = set_config_int(ss, dataString, optflags); in set_config()
548 if(optflags.quiet == 0) printf(gettext("ERROR! inconsistent value type.\n")); in set_config()
555 if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n")); in set_config()
559 scs = set_config_int64(ss, dataString, optflags); in set_config()
568 if(optflags.quiet == 0) printf(gettext("ERROR! inconsistent value type.\n")); in set_config()
575 if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n")); in set_config()
579 scs = set_config_float(ss, dataString, optflags); in set_config()
588 if(optflags.quiet == 0) printf(gettext("ERROR! inconsistent value type.\n")); in set_config()
595 if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n")); in set_config()
602 if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n")); in set_config()
609 if(optflags.quiet == 0) printf(gettext("ERROR! inconsistent value type.\n")); in set_config()
616 if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n")); in set_config()
620 scs = set_config_bool(ss, dataString, optflags); in set_config()
634 if(optflags.quiet == 0) printf(gettext("ERROR! Configuration variable type not given.\n")); in set_config()
655 if(optflags.quiet == 0) printf(gettext("ERROR! Inlegal data type.\n")); in set_config()
662 if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n")); in set_config()
669 scs = set_config_int(ss, dataString, optflags); in set_config()
672 scs = set_config_int64(ss, dataString, optflags); in set_config()
675 scs = set_config_int64(ss, dataString, optflags); in set_config()
681 if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n")); in set_config()
687 scs = set_config_int64(ss, dataString, optflags); in set_config()
695 if(optflags.quiet == 0) { in set_config()
705 if(optflags.quiet == 0) printf(gettext("ERROR! Configuration variable type not given.\n")); in set_config()
710 if(optflags.quiet == 0) printf(gettext("ERROR! Bad name of configuration variable.\n")); in set_config()
732 if(optflags.quiet == 0) printf(gettext("ERROR! Inlegal data type.\n")); in set_config()
739 if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n")); in set_config()
745 if(optflags.quiet == 0) { in set_config()
758 if(optflags.quiet == 0) printf(gettext("ERROR! Configuration file write failed.\n")); in set_config()
771 int unset_config(char *configFile, char *dataPath, struct flags optflags) { in unset_config() argument
779 if(optflags.quiet == 0) printf(gettext("ERROR! Can't read configuration file.\n")); in unset_config()
785 if(optflags.quiet == 0) printf(gettext("ERROR! Conviguration variable path not given.\n")); in unset_config()
792 if(optflags.quiet == 0) printf(gettext("ERROR! Given variable path not found.\n")); in unset_config()
799 if(optflags.quiet == 0) printf(gettext("ERROR! Can't remove root element.\n")); in unset_config()
806 if(optflags.quiet == 0) printf(gettext("ERROR! Can't find parent element.\n")); in unset_config()
813 if(optflags.quiet == 0) printf(gettext("ERROR! Variable unset failed.\n")); in unset_config()
820 if(optflags.quiet == 0) printf(gettext("ERROR! Configuration file write failed.\n")); in unset_config()
833 int read_config(char *configFile, char *dataPath, struct flags optflags) { in read_config() argument
855 if(optflags.quiet == 0) printf(gettext("ERROR! Can't read configuration file.\n")); in read_config()
867 if(optflags.quiet == 0) printf(gettext("ERROR! Given variable path not found.\n")); in read_config()
909 if(optflags.boolstring == 1) { in read_config()
965 if(optflags.boolstring == 1) { in read_config()
1046 if(optflags.boolstring == 1) { in read_config()
1115 …if(optflags.names == 1 && optflags.quiet == 0) printf(gettext("Variable name: %s\n"), da… in read_config()
1116 if(optflags.names == 1 && optflags.quiet == 1) printf("%s", dataName); in read_config()
1117 if((optflags.types == 1 && optflags.quiet == 1) && optflags.names == 1) printf(":"); in read_config()
1118 …if(optflags.types == 1 && optflags.quiet == 0) printf(gettext("Variable type: %s\n"), da… in read_config()
1119 if(optflags.types == 1 && optflags.quiet == 1) printf("%s", dataTypeName); in read_config()
1120 …if((optflags.values == 1 && optflags.quiet == 1) && (optflags.names == 1 || optflags.types == 1)) … in read_config()
1121 …if(optflags.values == 1 && optflags.quiet == 0) printf(gettext("Variable value: %s\n"), d… in read_config()
1122 if(optflags.values == 1 && optflags.quiet == 1) printf("%s", dataValueString); in read_config()
1123 …if((optflags.indexes == 1 && optflags.quiet == 1) && (optflags.names == 1 || optflags.types == 1 |… in read_config()
1124 …if(optflags.indexes == 1 && optflags.quiet == 0) printf(gettext("Variable index: %d\n"), … in read_config()
1125 if(optflags.indexes == 1 && optflags.quiet == 1) printf("%d", varindex); in read_config()
1126 …if((optflags.counter == 1 && optflags.quiet == 1) && (optflags.names == 1 || optflags.types == 1 |… in read_config()
1127 …if(optflags.counter == 1 && optflags.quiet == 0) printf(gettext("Variable elements count: %d\n"), … in read_config()
1128 if(optflags.counter == 1 && optflags.quiet == 1) printf("%d", varcounter); in read_config()
1129 if(optflags.quiet == 1) printf("\n"); in read_config()
1146 struct flags optflags = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; //global flags initialize in main() local
1155 {"quiet", no_argument, &optflags.quiet, 1}, in main()
1156 {"names", no_argument, &optflags.names, 1}, in main()
1157 {"types", no_argument, &optflags.types, 1}, in main()
1158 {"values", no_argument, &optflags.values, 1}, in main()
1159 {"indexes", no_argument, &optflags.indexes, 1}, in main()
1160 {"count", no_argument, &optflags.counter, 1}, in main()
1161 {"unset", no_argument, &optflags.unset, 1}, in main()
1162 {"bool-string", no_argument, &optflags.boolstring, 1}, in main()
1191 optflags.mode = 1; in main()
1199 optflags.mode = 0; in main()
1224 optflags.quiet = 1; in main()
1227 optflags.names = 1; in main()
1230 optflags.types = 1; in main()
1233 optflags.values = 1; in main()
1236 optflags.indexes = 1; in main()
1239 optflags.counter = 1; in main()
1242 optflags.unset = 1; in main()
1245 optflags.boolstring = 1; in main()
1254 optflags.mode = 1; in main()
1265 optflags.mode = 0; in main()
1305 if(optflags.mode == 0 && access(configFile, R_OK) < 0) optflags.error = 1; in main()
1306 if(optflags.mode == 1) { in main()
1309 optflags.error = 1; in main()
1313 if(optflags.error > 0) { in main()
1314 if(optflags.quiet == 0) printf(gettext("ERROR! Can't read configuration file.\n")); in main()
1321 if(optflags.mode == 1 && dataPath == NULL) { in main()
1322 if(optflags.quiet == 0) printf(gettext("ERROR! Conviguration variable path not given.\n")); in main()
1329 …if(optflags.names == 0 && optflags.types == 0 && optflags.values == 0 && optflags.indexes == 0 && in main()
1330 optflags.names = 1; in main()
1331 optflags.types = 1; in main()
1332 optflags.values = 1; in main()
1336 if(optflags.mode == 0) excode = read_config(configFile, dataPath, optflags); in main()
1337 …if(optflags.mode == 1 && optflags.unset == 1) excode = unset_config(configFile, dataPath, optflags in main()
1338 …if(optflags.mode == 1 && optflags.unset == 0) excode = set_config(configFile, dataPath, optflags, … in main()