Well I don’t know if you want to include this in the main library
or a seperate one in which case the prefix SDL_ should be
changed.
I’m not quite sure at all what’s this for. Is it for resources
stored in memory and routines to manage loading,
freeing and storing them?
It’s supposed to be quite open isn’t it?
C++ would be fine (and I’m using it for all my code, too) but
I see there is the problem that there’s only egcs (and maybe
gcc 2.8.) as compiler because gcc 2.7. doesn’t really work.
(no exceptions, crashes all the time reproducably)
If it’s C++, it shouldn’t be included in the main library (that’s
my opinion)~
Paulus Esterhazy (@Paulus_Esterhazy)
/* The functions to read and write data to memory or to a file.
C++ would be really nice for this.
*/
#include <stdio.h>
/* The functions and associated data for read/write access /
typedef struct SDL_FILE {
/ The data access functions */
int (*read)(SDL_FILE *area, char *data, int len);
int (*write)(SDL_FILE *area, char *data, int len);
void (*free)(SDL_FILE *area);
/* The private data for the functions */
int autoclose;
union {
struct {
FILE *fp;
} file;
struct {
Uint8 *base;
Uint8 *here;
Uint8 *stop;
} mem;
void *unknown;
} data;
} SDL_FILE;
/* Get a handle for a data access method, or create a new one
Returns NULL if there was an error in getting the method.
*/
SDL_FILE *SDL_GetFILEFromFile(char *filename);
SDL_FILE *SDL_GetFILEFromFP(FILE *fp);
SDL_FILE *SDL_GetFILEFromMem(Uint8 *area, Uint32 size);
SDL_FILE *SDL_GetFILEFromNet(TCPsocket sock);
SDL_FILE *SDL_CreateFILE(void);
/* Free a previously created data access method */
void SDL_FreeFILE(SDL_FILE *file);
I really do not want to be obtrusive, but is this proposal of
abstracting file handles extensible by the user? (Remember my problem of
reading data from a C++ stream as I posted some weeks ago).
I really do not want to be obtrusive, but is this proposal of
abstracting file handles extensible by the user? (Remember my problem of
reading data from a C++ stream as I posted some weeks ago).
Looks like you are not groking open source; you(the programmer-user) want
to be able to read .fudge files, add the code.