libwebsockets
Lightweight C library for HTML5 websockets
lws_plat_file_ops Struct Reference

#include <libwebsockets.h>

Data Fields

lws_filefd_type(* open )(struct lws *wsi, const char *filename, unsigned long *filelen, int flags)
 
int(* close )(struct lws *wsi, lws_filefd_type fd)
 
unsigned long(* seek_cur )(struct lws *wsi, lws_filefd_type fd, long offset_from_cur_pos)
 
int(* read )(struct lws *wsi, lws_filefd_type fd, unsigned long *amount, unsigned char *buf, unsigned long len)
 
int(* write )(struct lws *wsi, lws_filefd_type fd, unsigned long *amount, unsigned char *buf, unsigned long len)
 

Detailed Description

struct lws_plat_file_ops - Platform-specific file operations

These provide platform-agnostic ways to deal with filesystem access in the library and in the user code.

Field Documentation

◆ close

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

close file

◆ open

lws_filefd_type(* lws_plat_file_ops::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 should be set to O_RDONLY or O_RDWR

◆ read

int(* lws_plat_file_ops::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

◆ seek_cur

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

seek from current position

◆ write

int(* lws_plat_file_ops::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: