#include "dxxsconf.h"

#ifndef DXX_ENABLE_wrap_PHYSFS_read
#define DXX_ENABLE_wrap_PHYSFS_read	DXX_HAVE_POISON_VALGRIND
#endif

#ifndef DXX_ENABLE_wrap_PHYSFS_write
#define DXX_ENABLE_wrap_PHYSFS_write	DXX_HAVE_POISON_VALGRIND
#endif

#if DXX_ENABLE_wrap_PHYSFS_read || DXX_ENABLE_wrap_PHYSFS_write
#include <physfs.h>
#ifdef DXX_VG_DECLARE_EXTERN_C
extern "C" {
#if DXX_ENABLE_wrap_PHYSFS_read
	DXX_VG_DECLARE_EXTERN_C(PHYSFS_readSBE16);
	DXX_VG_DECLARE_EXTERN_C(PHYSFS_readSBE32);
	DXX_VG_DECLARE_EXTERN_C(PHYSFS_readSLE16);
	DXX_VG_DECLARE_EXTERN_C(PHYSFS_readSLE32);
	DXX_VG_DECLARE_EXTERN_C(PHYSFS_readULE16);
	DXX_VG_DECLARE_EXTERN_C(PHYSFS_readULE32);
	DXX_VG_DECLARE_EXTERN_C(PHYSFS_readBytes);
#endif
#if DXX_ENABLE_wrap_PHYSFS_write
	DXX_VG_DECLARE_EXTERN_C(PHYSFS_writeBytes);
	DXX_VG_DECLARE_EXTERN_C(PHYSFS_writeSBE16);
	DXX_VG_DECLARE_EXTERN_C(PHYSFS_writeSBE32);
	DXX_VG_DECLARE_EXTERN_C(PHYSFS_writeSLE16);
	DXX_VG_DECLARE_EXTERN_C(PHYSFS_writeSLE32);
	DXX_VG_DECLARE_EXTERN_C(PHYSFS_writeULE16);
	DXX_VG_DECLARE_EXTERN_C(PHYSFS_writeULE32);
#endif
}
#endif

#if DXX_ENABLE_wrap_PHYSFS_read
#ifdef DXX_VG_DECLARE_READ_HELPER
DXX_VG_DECLARE_READ_HELPER;
#endif

#ifdef DXX_VG_DEFINE_READ
DXX_VG_DEFINE_READ(PHYSFS_readSBE16, PHYSFS_sint16);
DXX_VG_DEFINE_READ(PHYSFS_readSBE32, PHYSFS_sint32);
DXX_VG_DEFINE_READ(PHYSFS_readSLE16, PHYSFS_sint16);
DXX_VG_DEFINE_READ(PHYSFS_readSLE32, PHYSFS_sint32);
#endif
#endif

#if DXX_ENABLE_wrap_PHYSFS_write
#ifdef DXX_VG_DECLARE_WRITE_HELPER
DXX_VG_DECLARE_WRITE_HELPER;
#endif

#ifdef DXX_VG_DEFINE_WRITE
DXX_VG_DEFINE_WRITE(PHYSFS_writeSBE16, PHYSFS_sint16);
DXX_VG_DEFINE_WRITE(PHYSFS_writeSBE32, PHYSFS_sint32);
DXX_VG_DEFINE_WRITE(PHYSFS_writeSLE16, PHYSFS_sint16);
DXX_VG_DEFINE_WRITE(PHYSFS_writeSLE32, PHYSFS_sint32);
DXX_VG_DEFINE_WRITE(PHYSFS_writeULE16, PHYSFS_uint16);
DXX_VG_DEFINE_WRITE(PHYSFS_writeULE32, PHYSFS_uint32);
#endif
#endif

#endif
