-VG_STATIC char *vg_file_read_text( void *lin_alloc, const char *path, u32 *sz )
-{
- u32 size;
- char *str = vg_file_read( lin_alloc, path, &size );
-
- if( !str )
- return NULL;
-
- /* include null terminator */
- str = vg_linear_extend( lin_alloc, str, 1 );
- str[ size ] = '\0';
- *sz = size+1;
-
- return str;
-}
-
-
-VG_STATIC int vg_asset_write( const char *path, void *data, i64 size ){
- FILE *f = fopen( path, "wb" );
- if( f ){
- fwrite( data, size, 1, f );
- fclose( f );
- return 1;
- }
- else{
- return 0;
- }
-}
-
-/* TODO: error handling if read fails */
-VG_STATIC int vg_file_copy( const char *src, const char *dst, void *lin_alloc )
-{
- vg_info( "vg_file_copy( %s -> %s )\n", src, dst );
- u32 size;
- void *data = vg_file_read( lin_alloc, src, &size );
- return vg_asset_write( dst, data, size );
-}
-
-VG_STATIC const char *vg_path_filename( const char *path )
-{
- const char *base = path;
-
- for( int i=0; i<1024; i++ ){
- if( path[i] == '\0' ) break;
- if( path[i] == '/' ){
- base = path+i+1;
- }
- }
-
- return base;
-}