48 #if defined(LWS_PLAT_FREERTOS)
50 #define LWS_FOP_OPEN _open
51 #define LWS_FOP_CLOSE _close
52 #define LWS_FOP_SEEK_CUR _seek_cur
53 #define LWS_FOP_READ _read
54 #define LWS_FOP_WRITE _write
56 #define LWS_FOP_OPEN open
57 #define LWS_FOP_CLOSE close
58 #define LWS_FOP_SEEK_CUR seek_cur
59 #define LWS_FOP_READ read
60 #define LWS_FOP_WRITE write
63 #define LWS_FOP_FLAGS_MASK ((1 << 23) - 1)
64 #define LWS_FOP_FLAG_COMPR_ACCEPTABLE_GZIP (1 << 24)
65 #define LWS_FOP_FLAG_COMPR_IS_GZIP (1 << 25)
66 #define LWS_FOP_FLAG_MOD_TIME_VALID (1 << 26)
67 #define LWS_FOP_FLAG_VIRTUAL (1 << 27)
97 const char *filename,
const char *vpath,
98 lws_fop_flags_t *flags);
111 lws_fileofs_t offset_from_cur_pos);
114 uint8_t *buf, lws_filepos_t len);
117 uint8_t *buf, lws_filepos_t len);
136 lws_get_fops(
struct lws_context *context);
137 LWS_VISIBLE LWS_EXTERN
void
144 LWS_VISIBLE LWS_EXTERN lws_filepos_t LWS_WARN_UNUSED_RESULT
151 LWS_VISIBLE LWS_EXTERN lws_filepos_t LWS_WARN_UNUSED_RESULT
158 LWS_VISIBLE LWS_EXTERN uint32_t LWS_WARN_UNUSED_RESULT
166 LWS_VISIBLE LWS_EXTERN lws_fileofs_t
167 lws_vfs_file_seek_set(
lws_fop_fd_t fop_fd, lws_fileofs_t offset);
174 LWS_VISIBLE LWS_EXTERN lws_fileofs_t
175 lws_vfs_file_seek_end(
lws_fop_fd_t fop_fd, lws_fileofs_t offset);
193 LWS_VISIBLE LWS_EXTERN
lws_fop_fd_t LWS_WARN_UNUSED_RESULT
195 lws_fop_flags_t *flags);
202 static LWS_INLINE
int
205 if (*fop_fd && (*fop_fd)->fops)
206 return (*fop_fd)->fops->LWS_FOP_CLOSE(fop_fd);
218 static LWS_INLINE lws_fileofs_t
219 lws_vfs_file_seek_cur(
lws_fop_fd_t fop_fd, lws_fileofs_t offset)
231 static LWS_INLINE
int LWS_WARN_UNUSED_RESULT
232 lws_vfs_file_read(
lws_fop_fd_t fop_fd, lws_filepos_t *amount,
233 uint8_t *buf, lws_filepos_t len)
245 static LWS_INLINE
int LWS_WARN_UNUSED_RESULT
246 lws_vfs_file_write(
lws_fop_fd_t fop_fd, lws_filepos_t *amount,
247 uint8_t *buf, lws_filepos_t len)
258 const char *vpath, lws_fop_flags_t *flags);
259 LWS_VISIBLE LWS_EXTERN
int
261 LWS_VISIBLE LWS_EXTERN lws_fileofs_t
262 _lws_plat_file_seek_cur(
lws_fop_fd_t fop_fd, lws_fileofs_t offset);
263 LWS_VISIBLE LWS_EXTERN
int
264 _lws_plat_file_read(
lws_fop_fd_t fop_fd, lws_filepos_t *amount,
265 uint8_t *buf, lws_filepos_t len);
266 LWS_VISIBLE LWS_EXTERN
int
267 _lws_plat_file_write(
lws_fop_fd_t fop_fd, lws_filepos_t *amount,
268 uint8_t *buf, lws_filepos_t len);
270 LWS_VISIBLE LWS_EXTERN
int
271 lws_alloc_vfs_file(
struct lws_context *context,
const char *filename,
272 uint8_t **buf, lws_filepos_t *amount);
lws_filepos_t pos
Definition: lws-vfs.h:78
lws_fop_flags_t flags
Definition: lws-vfs.h:82
uint32_t mod_time
Definition: lws-vfs.h:84
const struct lws_plat_file_ops * fops
Definition: lws-vfs.h:74
lws_filefd_type fd
Definition: lws-vfs.h:72
lws_filepos_t len
Definition: lws-vfs.h:80
void * filesystem_priv
Definition: lws-vfs.h:76
lws_fop_fd_t(* LWS_FOP_OPEN)(const struct lws_plat_file_ops *fops, const char *filename, const char *vpath, lws_fop_flags_t *flags)
Definition: lws-vfs.h:96
const struct lws_plat_file_ops * next
Definition: lws-vfs.h:123
struct lws_fops_index fi[3]
Definition: lws-vfs.h:120
int(* LWS_FOP_WRITE)(lws_fop_fd_t fop_fd, lws_filepos_t *amount, uint8_t *buf, lws_filepos_t len)
Definition: lws-vfs.h:116
lws_fileofs_t(* LWS_FOP_SEEK_CUR)(lws_fop_fd_t fop_fd, lws_fileofs_t offset_from_cur_pos)
Definition: lws-vfs.h:110
int(* LWS_FOP_CLOSE)(lws_fop_fd_t *fop_fd)
Definition: lws-vfs.h:108
int(* LWS_FOP_READ)(lws_fop_fd_t fop_fd, lws_filepos_t *amount, uint8_t *buf, lws_filepos_t len)
Definition: lws-vfs.h:113