src/file/SDL_rwops.c
changeset 12799 302904fa669a
parent 12503 806492103856
child 12965 cac903c755a1
     1.1 --- a/src/file/SDL_rwops.c	Sat Jun 08 15:10:20 2019 -0700
     1.2 +++ b/src/file/SDL_rwops.c	Sat Jun 08 17:43:23 2019 -0700
     1.3 @@ -752,6 +752,48 @@
     1.4      return data;
     1.5  }
     1.6  
     1.7 +void *
     1.8 +SDL_LoadFile(const char *file, size_t *datasize)
     1.9 +{
    1.10 +   return SDL_LoadFile_RW(SDL_RWFromFile(file, "rb"), datasize, 1);
    1.11 +}
    1.12 +
    1.13 +Sint64
    1.14 +SDL_RWsize(SDL_RWops *context)
    1.15 +{
    1.16 +    return context->size(context);
    1.17 +}
    1.18 +
    1.19 +Sint64
    1.20 +SDL_RWseek(SDL_RWops *context, Sint64 offset, int whence)
    1.21 +{
    1.22 +    return context->seek(context, offset, whence);
    1.23 +}
    1.24 +
    1.25 +Sint64
    1.26 +SDL_RWtell(SDL_RWops *context)
    1.27 +{
    1.28 +    return context->seek(context, 0, RW_SEEK_CUR);
    1.29 +}
    1.30 +
    1.31 +size_t
    1.32 +SDL_RWread(SDL_RWops *context, void *ptr, size_t size, size_t maxnum)
    1.33 +{
    1.34 +    return context->read(context, ptr, size, maxnum);
    1.35 +}
    1.36 +
    1.37 +size_t
    1.38 +SDL_RWwrite(SDL_RWops *context, const void *ptr, size_t size, size_t num)
    1.39 +{
    1.40 +    return context->write(context, ptr, size, num);
    1.41 +}
    1.42 +
    1.43 +int
    1.44 +SDL_RWclose(SDL_RWops *context)
    1.45 +{
    1.46 +    return context->close(context);
    1.47 +}
    1.48 +
    1.49  /* Functions for dynamically reading and writing endian-specific values */
    1.50  
    1.51  Uint8