diff src/dmres.h @ 2586:9807ae37ad69

Require stdbool.h, we require C11 now.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 08 Dec 2022 15:59:22 +0200
parents 8193f62a541d
children
line wrap: on
line diff
--- a/src/dmres.h	Thu Dec 08 15:56:36 2022 +0200
+++ b/src/dmres.h	Thu Dec 08 15:59:22 2022 +0200
@@ -82,7 +82,7 @@
 
 typedef struct DMResourceDataOps
 {
-    BOOL   (*probe)(DMResource *res, const char *fext);
+    bool   (*probe)(DMResource *res, const char *fext);
     int    (*load)(DMResource *res);
     void   (*free)(DMResource *res);
 } DMResourceDataOps;
@@ -116,7 +116,7 @@
     int     (*fseek)(DMResource *, const off_t, const int);
     off_t   (*fsize)(DMResource *);
     off_t   (*ftell)(DMResource *);
-    BOOL    (*feof)(DMResource *);
+    bool    (*feof)(DMResource *);
     int     (*fgetc)(DMResource *);
     int     (*fputc)(int, DMResource *);
     size_t  (*fread)(void *, const size_t, const size_t, DMResource *);
@@ -130,7 +130,7 @@
 int          dmResourcesInit(DMResourceLib **lib, const char *filename, const char *path, const int flags, int (*classifier)(DMResource *));
 int          dmResourcesClose(DMResourceLib *lib);
 
-int          dmResourcesPreload(DMResourceLib *lib, BOOL start, int *loaded, int *total);
+int          dmResourcesPreload(DMResourceLib *lib, bool start, int *loaded, int *total);
 
 DMResource * dmResourceNew(DMResourceLib *lib, const char *filename, const size_t size, const int flags);
 void         dmResourceFree(DMResource *node);
@@ -159,7 +159,7 @@
 int          dmfseek(DMResource *fh, const off_t offset, const int whence);
 off_t        dmfsize(DMResource *fh);
 off_t        dmftell(DMResource *fh);
-BOOL         dmfeof(DMResource *fh);
+bool         dmfeof(DMResource *fh);
 int          dmfgetc(DMResource *fh);
 int          dmfputc(int val, DMResource *fh);
 size_t       dmfread(void *ptr, const size_t size, const size_t nmemb, DMResource *fh);
@@ -171,21 +171,21 @@
              DM_ATTR_PRINTF_FMT(2, 3);
 
 // Helper functions for endianess based reading etc
-BOOL         dmf_read_str(DMResource *fh, void *ptr, const size_t len);
-BOOL         dmf_read_byte(DMResource *fh, Uint8 *val);
+bool         dmf_read_str(DMResource *fh, void *ptr, const size_t len);
+bool         dmf_read_byte(DMResource *fh, Uint8 *val);
 
 #define DM_DEFINE_FFUNC(xname, xtype, z)          \
-BOOL         dmf_read_ ## xname (DMResource *fh, xtype *v);
+bool         dmf_read_ ## xname (DMResource *fh, xtype *v);
 
 #include "dmfiletmpl.h"
 
 #undef DM_DEFINE_FFUNC
 
-BOOL         dmf_write_str(DMResource *fh, const void *data, const size_t len);
-BOOL         dmf_write_byte(DMResource *fh, const Uint8 val);
+bool         dmf_write_str(DMResource *fh, const void *data, const size_t len);
+bool         dmf_write_byte(DMResource *fh, const Uint8 val);
 
 #define DM_DEFINE_FFUNC(xname, xtype, z)          \
-BOOL         dmf_write_ ## xname (DMResource *fh, const xtype v);
+bool         dmf_write_ ## xname (DMResource *fh, const xtype v);
 
 #include "dmfiletmpl.h"