Clean up plat.h a bit

This commit is contained in:
David Hrdlička
2022-04-19 23:06:39 +02:00
parent 366b01fef6
commit e60af6c29d
49 changed files with 184 additions and 131 deletions

View File

@@ -27,6 +27,7 @@
#include <errno.h>
#define HAVE_STDARG_H
#include <86box/86box.h>
#include <86box/path.h>
#include <86box/plat.h>
#include <86box/random.h>
#include <86box/hdd.h>
@@ -76,7 +77,7 @@ hdd_image_log(const char *fmt, ...)
int
image_is_hdi(const char *s)
{
if (! strcasecmp(plat_get_extension((char *) s), "HDI"))
if (! strcasecmp(path_get_extension((char *) s), "HDI"))
return 1;
else
return 0;
@@ -90,7 +91,7 @@ image_is_hdx(const char *s, int check_signature)
uint64_t filelen;
uint64_t signature;
if (! strcasecmp(plat_get_extension((char *) s), "HDX")) {
if (! strcasecmp(path_get_extension((char *) s), "HDX")) {
if (check_signature) {
f = plat_fopen(s, "rb");
if (!f)
@@ -124,7 +125,7 @@ image_is_vhd(const char *s, int check_signature)
{
FILE* f;
if (! strcasecmp(plat_get_extension((char *) s), "VHD")) {
if (! strcasecmp(path_get_extension((char *) s), "VHD")) {
if (check_signature) {
f = plat_fopen(s, "rb");
if (!f)
@@ -251,7 +252,7 @@ hdd_image_load(int id)
memset(empty_sector, 0, sizeof(empty_sector));
if (fn) {
plat_path_normalize(fn);
path_normalize(fn);
}

View File

@@ -33,6 +33,7 @@
#include <86box/device.h>
#include <86box/scsi_device.h>
#include <86box/nvr.h>
#include <86box/path.h>
#include <86box/plat.h>
#include <86box/ui.h>
#include <86box/hdc.h>
@@ -332,7 +333,7 @@ mo_load_abort(mo_t *dev)
int
image_is_mdi(const char *s)
{
if (! strcasecmp(plat_get_extension((char *) s), "MDI"))
if (! strcasecmp(path_get_extension((char *) s), "MDI"))
return 1;
else
return 0;