Quick API (suggestions?)

Here’s a quick API for file loading. Suggestions?

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)

Here’s a quick API for file loading. Suggestions?

/* 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);

Get me off this crazy list!

All emails to unsubscribe bounce!

Here’s a quick API for file loading. Suggestions?

Hi,

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).

See you

  • MarkusOn Tue, 3 Nov 1998, Sam Lantinga wrote:

Here’s a quick API for file loading. Suggestions?

I’ve decided to scrap this in favor of a separate library.
An add-on library can have many more features than I’m willing to put into SDL.

See ya!
-Sam Lantinga (slouken at devolution.com)–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/

Here’s a quick API for file loading. Suggestions?

I’ve decided to scrap this in favor of a separate library.
An add-on library can have many more features than I’m willing to put into SDL.

P.S. I have the code for memory and FILE data objects if anyone wants it.
I place it in the public domain.

See ya!
-Sam Lantinga (slouken at devolution.com)–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/

Hi,

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.

njhOn Thu, 5 Nov 1998, Markus Enzenberger wrote: