VSF Documented
SDL_rwops.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2022 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18#ifndef __VSF_SDL2_RWOPS_H__
19#define __VSF_SDL2_RWOPS_H__
20
21/*============================ INCLUDES ======================================*/
22
23#include "../../vsf_sdl2_cfg.h"
24
25#if VSF_USE_SDL2 == ENABLED
26
27#include "SDL_stdinc.h"
28
29#include "begin_code.h"
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/*============================ MACROS ========================================*/
36/*============================ MACROFIED FUNCTIONS ===========================*/
37
38#if VSF_SDL_CFG_WRAPPER == ENABLED
39#define SDL_RWFromFile VSF_SDL_WRAPPER(SDL_RWFromFile)
40#define SDL_RWsize VSF_SDL_WRAPPER(SDL_RWsize)
41#define SDL_RWclose VSF_SDL_WRAPPER(SDL_RWclose)
42#define SDL_RWseek VSF_SDL_WRAPPER(SDL_RWseek)
43#define SDL_RWtell VSF_SDL_WRAPPER(SDL_RWtell)
44#define SDL_RWread VSF_SDL_WRAPPER(SDL_RWread)
45#define SDL_RWwrite VSF_SDL_WRAPPER(SDL_RWwrite)
46
47#define SDL_ReadU8 VSF_SDL_WRAPPER(SDL_ReadU8)
48#define SDL_ReadLE16 VSF_SDL_WRAPPER(SDL_ReadLE16)
49#define SDL_ReadBE16 VSF_SDL_WRAPPER(SDL_ReadBE16)
50#define SDL_ReadLE32 VSF_SDL_WRAPPER(SDL_ReadLE32)
51#define SDL_ReadBE32 VSF_SDL_WRAPPER(SDL_ReadBE32)
52#define SDL_ReadLE64 VSF_SDL_WRAPPER(SDL_ReadLE64)
53#define SDL_ReadBE64 VSF_SDL_WRAPPER(SDL_ReadBE64)
54#define SDL_WriteU8 VSF_SDL_WRAPPER(SDL_WriteU8)
55#define SDL_WriteLE16 VSF_SDL_WRAPPER(SDL_WriteLE16)
56#define SDL_WriteBE16 VSF_SDL_WRAPPER(SDL_WriteBE16)
57#define SDL_WriteLE32 VSF_SDL_WRAPPER(SDL_WriteLE32)
58#define SDL_WriteBE32 VSF_SDL_WRAPPER(SDL_WriteBE32)
59#define SDL_WriteLE64 VSF_SDL_WRAPPER(SDL_WriteLE64)
60#define SDL_WriteBE64 VSF_SDL_WRAPPER(SDL_WriteBE64)
61#endif
62
63/*============================ TYPES =========================================*/
64
65enum {
69};
71
72/*============================ GLOBAL VARIABLES ==============================*/
73/*============================ LOCAL VARIABLES ===============================*/
74/*============================ PROTOTYPES ====================================*/
75
76extern SDL_RWops * SDL_RWFromFile(const char * file, const char * mode);
77extern int64_t SDL_RWsize(SDL_RWops * context);
78extern int SDL_RWclose(SDL_RWops * context);
79extern int64_t SDL_RWseek(SDL_RWops * context, int64_t offset, int whence);
80extern int64_t SDL_RWtell(SDL_RWops * context);
81extern size_t SDL_RWread(SDL_RWops * context, void * ptr, size_t size, size_t maxnum);
82extern size_t SDL_RWwrite(SDL_RWops * context, const void * ptr, size_t size, size_t num);
83
84extern uint8_t SDL_ReadU8(SDL_RWops * context);
85extern uint16_t SDL_ReadLE16(SDL_RWops * context);
86extern uint16_t SDL_ReadBE16(SDL_RWops * context);
87extern uint32_t SDL_ReadLE32(SDL_RWops * context);
88extern uint32_t SDL_ReadBE32(SDL_RWops * context);
89extern uint64_t SDL_ReadLE64(SDL_RWops * context);
90extern uint64_t SDL_ReadBE64(SDL_RWops * context);
91extern uint8_t SDL_WriteU8(SDL_RWops * context, uint8_t value);
98
99#ifdef __cplusplus
100}
101#endif
102#include "close_code.h"
103
104#endif // VSF_USE_SDL2
105#endif // __VSF_SDL2_RWOPS_H__
106/* EOF */
#define SDL_WriteBE32
Definition SDL_rwops.h:58
#define SDL_ReadBE32
Definition SDL_rwops.h:51
#define SDL_ReadLE16
Definition SDL_rwops.h:48
#define SDL_ReadLE32
Definition SDL_rwops.h:50
#define SDL_WriteBE16
Definition SDL_rwops.h:56
#define SDL_RWwrite
Definition SDL_rwops.h:45
#define SDL_RWtell
Definition SDL_rwops.h:43
#define SDL_WriteBE64
Definition SDL_rwops.h:60
#define SDL_WriteLE64
Definition SDL_rwops.h:59
#define SDL_WriteLE16
Definition SDL_rwops.h:55
#define SDL_RWread
Definition SDL_rwops.h:44
#define SDL_RWseek
Definition SDL_rwops.h:42
#define SDL_ReadBE16
Definition SDL_rwops.h:49
#define SDL_RWFromFile
Definition SDL_rwops.h:39
#define SDL_WriteU8
Definition SDL_rwops.h:54
#define SDL_RWsize
Definition SDL_rwops.h:40
#define SDL_WriteLE32
Definition SDL_rwops.h:57
FILE SDL_RWops
Definition SDL_rwops.h:70
#define SDL_ReadLE64
Definition SDL_rwops.h:52
#define SDL_ReadBE64
Definition SDL_rwops.h:53
#define SDL_RWclose
Definition SDL_rwops.h:41
@ RW_SEEK_CUR
Definition SDL_rwops.h:67
@ RW_SEEK_END
Definition SDL_rwops.h:68
@ RW_SEEK_SET
Definition SDL_rwops.h:66
#define SDL_ReadU8
Definition SDL_rwops.h:47
unsigned short uint16_t
Definition stdint.h:7
unsigned uint32_t
Definition stdint.h:9
long long int64_t
Definition stdint.h:10
unsigned long long uint64_t
Definition stdint.h:11
unsigned char uint8_t
Definition stdint.h:5
#define SEEK_SET
Definition stdio.h:150
#define SEEK_CUR
Definition stdio.h:151
int FILE
Definition stdio.h:141
#define SEEK_END
Definition stdio.h:152
vk_av_control_value_t value
Definition vsf_audio.h:171
uint64_t offset
Definition vsf_memfs.h:49
uint32_t size
Definition vsf_memfs.h:50