MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / cfgfile_parse_host

Function cfgfile_parse_host

src/cfgfile.cpp:3673–4939  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3671}
3672
3673static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
3674{
3675 int i, v;
3676 bool vb;
3677 TCHAR *tmpp;
3678 TCHAR tmpbuf[CONFIG_BLEN];
3679
3680 if (_tcsncmp (option, _T("input."), 6) == 0 || _tcsncmp(option, _T("input_"), 6) == 0) {
3681 read_inputdevice_config (p, option, value);
3682 return 1;
3683 }
3684
3685 for (tmpp = option; *tmpp != '\0'; tmpp++)
3686 if (_istupper (*tmpp))
3687 *tmpp = _totlower (*tmpp);
3688 tmpp = _tcschr (option, '.');
3689 if (tmpp) {
3690 TCHAR *section = option;
3691 option = tmpp + 1;
3692 *tmpp = '\0';
3693 if (_tcscmp (section, TARGET_NAME) == 0) {
3694 /* We special case the various path options here. */
3695 if (cfgfile_multipath(option, value, _T("rom_path"), &p->path_rom, p)
3696 || cfgfile_multipath(option, value, _T("floppy_path"), &p->path_floppy, p)
3697 || cfgfile_multipath(option, value, _T("cd_path"), &p->path_cd, p)
3698 || cfgfile_multipath(option, value, _T("hardfile_path"), &p->path_hardfile, p))
3699 return 1;
3700 return target_parse_option(p, option, value, CONFIG_TYPE_HOST);
3701 }
3702 return 0;
3703 }
3704
3705 for (i = 0; i < MAX_SPARE_DRIVES; i++) {
3706 _sntprintf (tmpbuf, sizeof tmpbuf, _T("diskimage%d"), i);
3707 if (cfgfile_string(option, value, tmpbuf, p->dfxlist[i], sizeof p->dfxlist[i] / sizeof(TCHAR))) {
3708 return 1;
3709 }
3710 }
3711
3712 for (i = 0; i < MAX_TOTAL_SCSI_DEVICES; i++) {
3713 TCHAR tmp[20];
3714 _sntprintf (tmp, sizeof tmp, _T("cdimage%d"), i);
3715 if (!_tcsicmp (option, tmp)) {
3716 if (!_tcsicmp (value, _T("autodetect"))) {
3717 p->cdslots[i].type = SCSI_UNIT_DEFAULT;
3718 p->cdslots[i].inuse = true;
3719 p->cdslots[i].name[0] = 0;
3720 } else {
3721 p->cdslots[i].delayed = false;
3722 TCHAR *path = value;
3723 TCHAR *next = _tcsrchr(value, ',');
3724 if (value[0] == '\"') {
3725 const TCHAR *end;
3726 TCHAR *n = cfgfile_unescape(value, &end, 0, true);
3727 if (n) {
3728 path = n;
3729 next = _tcsrchr(value + (end - value), ',');
3730 }

Callers 1

cfgfile_parse_optionFunction · 0.85

Calls 15

read_inputdevice_configFunction · 0.85
target_parse_optionFunction · 0.85
cfgfile_stringFunction · 0.85
cfgfile_unescapeFunction · 0.85
match_stringFunction · 0.85
cfgfile_intvalFunction · 0.85
cfgfile_strvalFunction · 0.85
cfgfile_yesnoFunction · 0.85
cfgfile_floatvalFunction · 0.85
cfgfile_strboolvalFunction · 0.85
cfgfile_multichoiceFunction · 0.85
target_get_displayFunction · 0.85

Tested by

no test coverage detected