src/mess/hashfile.c
| r10444 | r10445 | |
| 590 | 590 | |
| 591 | 591 | const char *read_hash_config(device_image_interface &image, const char *sysname) |
| 592 | 592 | { |
| 593 | | hash_file *hashfile = NULL; |
| 594 | | const hash_info *info = NULL; |
| 593 | hash_file *hashfile = NULL; |
| 594 | const hash_info *info = NULL; |
| 595 | 595 | char *temp = NULL; |
| 596 | 596 | |
| 597 | | /* open the hash file */ |
| 598 | | hashfile = hashfile_open(image.device().machine->options(), sysname, FALSE, NULL); |
| 599 | | if (!hashfile) |
| 600 | | goto done; |
| 601 | | |
| 602 | | /* look up this entry in the hash file */ |
| 603 | | info = hashfile_lookup(hashfile, &image.hash()); |
| 604 | | |
| 605 | | if (!info) |
| 606 | | goto done; |
| 607 | | |
| 597 | /* open the hash file */ |
| 598 | hashfile = hashfile_open(image.device().machine->options(), sysname, FALSE, NULL); |
| 599 | if (!hashfile) |
| 600 | return NULL; |
| 601 | |
| 602 | /* look up this entry in the hash file */ |
| 603 | info = hashfile_lookup(hashfile, &image.hash()); |
| 604 | |
| 605 | if (!info) |
| 606 | { |
| 607 | hashfile_close(hashfile); |
| 608 | return NULL; |
| 609 | } |
| 610 | |
| 608 | 611 | temp = core_strdup(info->extrainfo); |
| 609 | | /* copy the relevant entries */ |
| 610 | | if (hashfile != NULL) |
| 611 | | hashfile_close(hashfile); |
| 612 | | |
| 613 | | return temp ? astring(temp).cstr() : (const char*)NULL; |
| 614 | | done: |
| 615 | | if (hashfile != NULL) |
| 616 | | hashfile_close(hashfile); |
| 617 | | return NULL; |
| 612 | if (!temp) |
| 613 | { |
| 614 | hashfile_close(hashfile); |
| 615 | return NULL; |
| 616 | } |
| 617 | |
| 618 | astring result(temp); |
| 619 | |
| 620 | /* copy the relevant entries */ |
| 621 | hashfile_close(hashfile); |
| 622 | |
| 623 | //printf("%s\n", result.cstr()); |
| 624 | return result.cstr(); |
| 618 | 625 | } |
| 626 | |
| 619 | 627 | const char *hashfile_extrainfo(device_image_interface &image) |
| 620 | 628 | { |
| 621 | | const game_driver *drv; |
| 622 | | const char *rc; |
| 629 | const game_driver *drv; |
| 630 | const char *rc; |
| 623 | 631 | |
| 624 | 632 | /* now read the hash file */ |
| 625 | 633 | image.crc(); |