#include <stdio.h>
#include <errno.h>
+#define _TINYDIR_MALLOC(_size) vg_linear_alloc( vg_mem.scratch, _size )
+#define _TINYDIR_FREE(_size)
+
+#include "submodules/tinydir/tinydir.h"
+
/*
* File I/O
*/
VG_STATIC void vg_file_print_invalid( FILE *fp )
{
- if( feof( fp ))
- {
+ if( feof( fp )) {
vg_error( "mdl_open: header too short\n" );
}
- else
- {
+ else{
if( ferror( fp ))
vg_error( "mdl_open: %s\n", strerror(errno) );
else
return buffer;
}
- else
- {
+ else{
vg_error( "vg_disk_open_read: %s\n", strerror(errno) );
return NULL;
}
}
-VG_STATIC int vg_asset_write( const char *path, void *data, i64 size )
-{
+VG_STATIC int vg_asset_write( const char *path, void *data, i64 size ){
FILE *f = fopen( path, "wb" );
- if( f )
- {
+ if( f ){
fwrite( data, size, 1, f );
fclose( f );
return 1;
}
- else
- {
+ else{
return 0;
}
}