
#ifndef H_SFL_IO_OBJECT_
#define H_SFL_IO_OBJECT_

#ifdef __cplusplus
extern "C" {
#endif

#include <stddef.h>

#define SFL_IO_READ_ONLY  0x0001
#define SFL_IO_WRITE_ONLY 0x0002
#define SFL_IO_READ_WRITE (SFL_IO_READ_ONLY | SFL_IO_WRITE_ONLY)
#define SFL_IO_NBLOCK     0x0004
#define SFL_IO_DIROPEN    0x0008
#define SFL_IO_APPEND     0x0100
#define SFL_IO_CREATE     0x0200
#define SFL_IO_TRUNCATE   0x0400
#define SFL_IO_EXCL       0x0800
#define SFL_IO_NOWAIT     0x8000

struct sflIoObject_t;
typedef struct sflIoObject_t sflIoObject;

struct sflIoObject_t {
	int (*close)(sflIoObject *self);
	int (*read)(sflIoObject *self, void *data, size_t size);
	int (*write)(sflIoObject *self, const void *data, size_t size);
	int	(*lseek32)(sflIoObject *self, int offset, int whence);
	sflIoObject *(*clone)(sflIoObject *self);
};

//sflIoObject *sflIoObjectDefaultOpen(const char *file, int flags, int mode, int *res);
sflIoObject *sflIoObjectFullBufferedOpen(const char *file, int flags, int mode, int *res);
//sflIoObject *sflIoObjectBufferedOpen(const char *file, int flags, int mode, int *res, size_t bufsize);

#ifdef __cplusplus
}
#endif

#endif

