src/emu/mame.c
| r8567 | r8568 | |
| 565 | 565 | if (filerr != FILERR_NONE) |
| 566 | 566 | return FALSE; |
| 567 | 567 | |
| 568 | /* update game name so depending callback options could be added */ |
| 569 | options_force_option_callback(options, OPTION_GAMENAME, name, OPTION_PRIORITY_CMDLINE); |
| 570 | |
| 568 | 571 | /* parse the file and close it */ |
| 569 | 572 | mame_printf_verbose("Parsing %s.ini\n", name); |
| 570 | 573 | options_parse_ini_file(options, mame_core_file(file), priority); |
src/lib/util/options.h
| r8567 | r8568 | |
| 164 | 164 | /* parse option data from a command line */ |
| 165 | 165 | int options_parse_command_line(core_options *opts, int argc, char **argv, int priority); |
| 166 | 166 | |
| 167 | /* set option value and execute callback call */ |
| 168 | int options_force_option_callback(core_options *opts, const char *optionname, const char *newval, int priority); |
| 169 | |
| 167 | 170 | /* parse option data from an INI file */ |
| 168 | 171 | int options_parse_ini_file(core_options *opts, core_file *inifile, int priority); |
| 169 | 172 | |
src/lib/util/options.c
| r8567 | r8568 | |
| 495 | 495 | |
| 496 | 496 | |
| 497 | 497 | /*------------------------------------------------- |
| 498 | options_force_option_callback - set option value |
| 499 | and execute callback call |
| 500 | -------------------------------------------------*/ |
| 501 | |
| 502 | int options_force_option_callback(core_options *opts, const char *optionname, const char *newval, int priority) |
| 503 | { |
| 504 | options_data *data = find_entry_data(opts, optionname, TRUE); |
| 505 | if (data == NULL) |
| 506 | { |
| 507 | message(opts, OPTMSG_ERROR, "Error: unknown option: %s\n", optionname); |
| 508 | return 1; |
| 509 | } |
| 510 | |
| 511 | /* invoke callback, if present */ |
| 512 | if (data->callback != NULL) |
| 513 | (*data->callback)(opts, newval); |
| 514 | |
| 515 | /* allocate a new copy of data for this */ |
| 516 | update_data(opts, data, newval, priority); |
| 517 | return 0; |
| 518 | } |
| 519 | |
| 520 | |
| 521 | /*------------------------------------------------- |
| 498 | 522 | options_parse_ini_file - parse a series |
| 499 | 523 | of entries in an INI file |
| 500 | 524 | -------------------------------------------------*/ |