include/SDL_rwops.h
changeset 2160 00adbaed3910
parent 2159 dd4753e47ed4
child 2161 e635db5b45ef
     1.1 --- a/include/SDL_rwops.h	Tue Jul 10 05:01:22 2007 +0000
     1.2 +++ b/include/SDL_rwops.h	Tue Jul 10 05:25:19 2007 +0000
     1.3 @@ -46,26 +46,29 @@
     1.4  typedef struct SDL_RWops
     1.5  {
     1.6      /* Seek to 'offset' relative to whence, one of stdio's whence values:
     1.7 -       SEEK_SET, SEEK_CUR, SEEK_END
     1.8 +       RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END
     1.9         Returns the final offset in the data source.
    1.10       */
    1.11 -    int (SDLCALL * seek) (struct SDL_RWops * context, int offset, int whence);
    1.12 +    long (SDLCALL * seek) (struct SDL_RWops * context, long offset,
    1.13 +                           int whence);
    1.14  
    1.15      /* Read up to 'num' objects each of size 'objsize' from the data
    1.16         source to the area pointed at by 'ptr'.
    1.17 -       Returns the number of objects read, or -1 if the read failed.
    1.18 +       Returns the number of objects read, or 0 at error or end of file.
    1.19       */
    1.20 -    int (SDLCALL * read) (struct SDL_RWops * context, void *ptr, int size,
    1.21 -                          int maxnum);
    1.22 +      size_t(SDLCALL * read) (struct SDL_RWops * context, void *ptr,
    1.23 +                              size_t size, size_t maxnum);
    1.24  
    1.25      /* Write exactly 'num' objects each of size 'objsize' from the area
    1.26         pointed at by 'ptr' to data source.
    1.27 -       Returns 'num', or -1 if the write failed.
    1.28 +       Returns the number of objects written, or 0 at error or end of file.
    1.29       */
    1.30 -    int (SDLCALL * write) (struct SDL_RWops * context, const void *ptr,
    1.31 -                           int size, int num);
    1.32 +      size_t(SDLCALL * write) (struct SDL_RWops * context, const void *ptr,
    1.33 +                               size_t size, size_t num);
    1.34  
    1.35 -    /* Close and free an allocated SDL_FSops structure */
    1.36 +    /* Close and free an allocated SDL_RWops structure.
    1.37 +       Returns 0 if successful or -1 on write error when flushing data.
    1.38 +     */
    1.39      int (SDLCALL * close) (struct SDL_RWops * context);
    1.40  
    1.41      Uint32 type;
    1.42 @@ -74,7 +77,7 @@
    1.43  #ifdef __WIN32__
    1.44          struct
    1.45          {
    1.46 -            int append;
    1.47 +            SDL_bool append;
    1.48              void *h;
    1.49              struct
    1.50              {
    1.51 @@ -87,7 +90,7 @@
    1.52  #ifdef HAVE_STDIO_H
    1.53          struct
    1.54          {
    1.55 -            int autoclose;
    1.56 +            SDL_bool autoclose;
    1.57              FILE *fp;
    1.58          } stdio;
    1.59  #endif