8# define SF3_EXPORT static
9# define SF3_INLINE static inline
10#elif defined(_MSC_VER)
11# if defined(SF3_BUILD)
12# define SF3_EXPORT __declspec(dllexport)
13# define SF3_INLINE __declspec(dllexport)
15# define SF3_EXPORT __declspec(dllimport)
16# define SF3_INLINE __declspec(dllimport)
18#elif defined(__GNUC__)
19# if defined(SF3_BUILD)
20# define SF3_EXPORT __attribute__((visibility("default")))
21# define SF3_INLINE __attribute__((visibility("default")))
24# define SF3_INLINE static inline
128#ifdef SF3_NO_CUSTOM_ALLOCATOR
129#define sf3_calloc calloc
140 SF3_EXPORT extern void *(*sf3_calloc)(
size_t num,
size_t size);
@ SF3_WRITE_FAILED
The file write operation failed.
@ SF3_OUT_OF_MEMORY
A memory allocation failed.
@ SF3_OK
No error has occurred.
@ SF3_INVALID_FILE
The file is not a valid SF3 file.
@ SF3_MMAP_FAILED
The file failed to map into memory.
@ SF3_INVALID_HANDLE
An invalid sf3_handle was passed.
SF3_EXPORT const char * sf3_strerror(enum sf3_error error)
Return a string representation of the error code.
SF3_EXPORT void sf3_close(sf3_handle handle)
SF3_EXPORT int sf3_open(const char *path, enum sf3_open_mode mode, sf3_handle *handle)
SF3_EXPORT void * sf3_data(sf3_handle handle, size_t *size)
SF3_EXPORT int sf3_tell(const char *path)
SF3_EXPORT void(* sf3_free)(void *ptr)
void * sf3_handle
Opaque representation of a file handle.
SF3_EXPORT int sf3_create(void *addr, size_t size, sf3_handle *handle)
@ SF3_OPEN_READ_ONLY
Open the file for reading only.
SF3_EXPORT int sf3_write(const char *path, sf3_handle handle)