47 #if defined(LWS_WITH_ESP32)
49 #define LWS_FOP_OPEN _open
50 #define LWS_FOP_CLOSE _close
51 #define LWS_FOP_SEEK_CUR _seek_cur
52 #define LWS_FOP_READ _read
53 #define LWS_FOP_WRITE _write
55 #define LWS_FOP_OPEN open
56 #define LWS_FOP_CLOSE close
57 #define LWS_FOP_SEEK_CUR seek_cur
58 #define LWS_FOP_READ read
59 #define LWS_FOP_WRITE write
62 #define LWS_FOP_FLAGS_MASK ((1 << 23) - 1)
63 #define LWS_FOP_FLAG_COMPR_ACCEPTABLE_GZIP (1 << 24)
64 #define LWS_FOP_FLAG_COMPR_IS_GZIP (1 << 25)
65 #define LWS_FOP_FLAG_MOD_TIME_VALID (1 << 26)
66 #define LWS_FOP_FLAG_VIRTUAL (1 << 27)
96 const char *filename,
const char *vpath,
97 lws_fop_flags_t *flags);
110 lws_fileofs_t offset_from_cur_pos);
113 uint8_t *buf, lws_filepos_t len);
116 uint8_t *buf, lws_filepos_t len);
135 lws_get_fops(
struct lws_context *context);
136 LWS_VISIBLE LWS_EXTERN
void
143 LWS_VISIBLE LWS_EXTERN lws_filepos_t LWS_WARN_UNUSED_RESULT
150 LWS_VISIBLE LWS_EXTERN lws_filepos_t LWS_WARN_UNUSED_RESULT
157 LWS_VISIBLE LWS_EXTERN uint32_t LWS_WARN_UNUSED_RESULT
165 LWS_VISIBLE LWS_EXTERN lws_fileofs_t
166 lws_vfs_file_seek_set(
lws_fop_fd_t fop_fd, lws_fileofs_t offset);
173 LWS_VISIBLE LWS_EXTERN lws_fileofs_t
174 lws_vfs_file_seek_end(
lws_fop_fd_t fop_fd, lws_fileofs_t offset);
192 LWS_VISIBLE LWS_EXTERN
lws_fop_fd_t LWS_WARN_UNUSED_RESULT
194 lws_fop_flags_t *flags);
201 static LWS_INLINE
int
204 if (*fop_fd && (*fop_fd)->fops)
205 return (*fop_fd)->fops->LWS_FOP_CLOSE(fop_fd);
217 static LWS_INLINE lws_fileofs_t
218 lws_vfs_file_seek_cur(
lws_fop_fd_t fop_fd, lws_fileofs_t offset)
230 static LWS_INLINE
int LWS_WARN_UNUSED_RESULT
231 lws_vfs_file_read(
lws_fop_fd_t fop_fd, lws_filepos_t *amount,
232 uint8_t *buf, lws_filepos_t len)
244 static LWS_INLINE
int LWS_WARN_UNUSED_RESULT
245 lws_vfs_file_write(
lws_fop_fd_t fop_fd, lws_filepos_t *amount,
246 uint8_t *buf, lws_filepos_t len)
257 const char *vpath, lws_fop_flags_t *flags);
258 LWS_VISIBLE LWS_EXTERN
int
260 LWS_VISIBLE LWS_EXTERN lws_fileofs_t
261 _lws_plat_file_seek_cur(
lws_fop_fd_t fop_fd, lws_fileofs_t offset);
262 LWS_VISIBLE LWS_EXTERN
int
263 _lws_plat_file_read(
lws_fop_fd_t fop_fd, lws_filepos_t *amount,
264 uint8_t *buf, lws_filepos_t len);
265 LWS_VISIBLE LWS_EXTERN
int
266 _lws_plat_file_write(
lws_fop_fd_t fop_fd, lws_filepos_t *amount,
267 uint8_t *buf, lws_filepos_t len);
269 LWS_VISIBLE LWS_EXTERN
int
270 lws_alloc_vfs_file(
struct lws_context *context,
const char *filename,
271 uint8_t **buf, lws_filepos_t *amount);