libwebsockets
Lightweight C library for HTML5 websockets
lws_plat_file_ops Struct Reference

Data Fields

lws_filefd_type(* LWS_FOP_OPEN )(struct lws *wsi, const char *filename, unsigned long *filelen, int *flags)
 
int(* LWS_FOP_CLOSE )(struct lws *wsi, lws_filefd_type fd)
 
unsigned long(* LWS_FOP_SEEK_CUR )(struct lws *wsi, lws_filefd_type fd, long offset_from_cur_pos)
 
int(* LWS_FOP_READ )(struct lws *wsi, lws_filefd_type fd, unsigned long *amount, unsigned char *buf, unsigned long len)
 
int(* LWS_FOP_WRITE )(struct lws *wsi, lws_filefd_type fd, unsigned long *amount, unsigned char *buf, unsigned long len)
 

Field Documentation

§ LWS_FOP_CLOSE

int(* lws_plat_file_ops::LWS_FOP_CLOSE) (struct lws *wsi, lws_filefd_type fd)

close file

§ LWS_FOP_OPEN

lws_filefd_type(* lws_plat_file_ops::LWS_FOP_OPEN) (struct lws *wsi, const char *filename, unsigned long *filelen, int *flags)

Open file (always binary access if plat supports it) filelen is filled on exit to be the length of the file *flags & LWS_FOP_FLAGS_MASK should be set to O_RDONLY or O_RDWR. If the file may be gzip-compressed, LWS_FOP_FLAG_COMPR_ACCEPTABLE_GZIP is set. If it actually is gzip-compressed, then the open handler should OR LWS_FOP_FLAG_COMPR_IS_GZIP on to *flags before returning.

§ LWS_FOP_READ

int(* lws_plat_file_ops::LWS_FOP_READ) (struct lws *wsi, lws_filefd_type fd, unsigned long *amount, unsigned char *buf, unsigned long len)

Read from file, on exit *amount is set to amount actually read

§ LWS_FOP_SEEK_CUR

unsigned long(* lws_plat_file_ops::LWS_FOP_SEEK_CUR) (struct lws *wsi, lws_filefd_type fd, long offset_from_cur_pos)

seek from current position

§ LWS_FOP_WRITE

int(* lws_plat_file_ops::LWS_FOP_WRITE) (struct lws *wsi, lws_filefd_type fd, unsigned long *amount, unsigned char *buf, unsigned long len)

Write to file, on exit *amount is set to amount actually written


The documentation for this struct was generated from the following file: