libwebsockets
Lightweight C library for HTML5 websockets
Loading...
Searching...
No Matches
lws-settings.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  lws_settings_instance_t
 
struct  lws_settings_ops
 

Macros

#define LSOOPEN_FLAG_WRITEABLE   (1 << 0)
 
#define lws_settings_ops_plat
 

Typedefs

typedef struct lws_settings_ops lws_settings_ops_t
 

Functions

LWS_VISIBLE LWS_EXTERN int lws_settings_plat_get (lws_settings_instance_t *si, const char *name, uint8_t *dest, size_t *max_actual)
 
LWS_VISIBLE LWS_EXTERN int lws_settings_plat_set (lws_settings_instance_t *si, const char *name, const uint8_t *src, size_t len)
 
LWS_VISIBLE LWS_EXTERN int lws_settings_plat_printf (lws_settings_instance_t *si, const char *name, const char *format,...) LWS_FORMAT(3)
 
LWS_VISIBLE LWS_EXTERN lws_settings_instance_tlws_settings_init (const lws_settings_ops_t *so, void *opaque_plat)
 
LWS_VISIBLE LWS_EXTERN void lws_settings_deinit (lws_settings_instance_t **si)
 

Data Structure Documentation

◆ lws_settings_instance_t

struct lws_settings_instance_t

Definition at line 41 of file lws-settings.h.

+ Collaboration diagram for lws_settings_instance_t:
Data Fields
void * handle_plat
const struct lws_settings_ops * so
uint8_t refcount
void * opaque_plat

◆ lws_settings_ops

struct lws_settings_ops

Definition at line 48 of file lws-settings.h.

+ Collaboration diagram for lws_settings_ops:
Data Fields
int(*)(lws_settings_instance_t *si, const char *name, uint8_t *dest, size_t *max_actual) get

if dest is NULL, max_actual is set to the actual length without copying anything out

int(*)(lws_settings_instance_t *si, const char *name, const uint8_t *src, size_t len) set

Macro Definition Documentation

◆ LSOOPEN_FLAG_WRITEABLE

#define LSOOPEN_FLAG_WRITEABLE   (1 << 0)

Definition at line 37 of file lws-settings.h.

◆ lws_settings_ops_plat

#define lws_settings_ops_plat
Value:
LWS_VISIBLE LWS_EXTERN int lws_settings_plat_get(lws_settings_instance_t *si, const char *name, uint8_t *dest, size_t *max_actual)
LWS_VISIBLE LWS_EXTERN int lws_settings_plat_set(lws_settings_instance_t *si, const char *name, const uint8_t *src, size_t len)

Definition at line 104 of file lws-settings.h.

104#define lws_settings_ops_plat \
105 .get = lws_settings_plat_get, \
106 .set = lws_settings_plat_set,

Typedef Documentation

◆ lws_settings_ops_t

Function Documentation

◆ lws_settings_plat_get()

LWS_VISIBLE LWS_EXTERN int lws_settings_plat_get ( lws_settings_instance_t * si,
const char * name,
uint8_t * dest,
size_t * max_actual )

lws_settings_plat_get() - read a named blob from a settings instance

Parameters
sithe settings instance
namethe name of the setting blob in the instance
destNULL, or the buffer to copy the setting blob info
max_actualpoint to size of dest, or zero; actual blob size on exit

If the named blob doesn't exist in the si, or can't read, returns nonzero. Otherwise, returns 0 and sets *max_actual to the true blob size. If dest is non-NULL, as much of the blob as will fit in the amount specified by *max_actual on entry is copied to dest.

References LWS_EXTERN, and LWS_VISIBLE.

◆ lws_settings_plat_set()

LWS_VISIBLE LWS_EXTERN int lws_settings_plat_set ( lws_settings_instance_t * si,
const char * name,
const uint8_t * src,
size_t len )

lws_settings_plat_get() - read a named blob from a settings instance

Parameters
sithe settings instance
namethe name of the setting blob in the instance
srcblob to copy to settings instance
lenlength of blob to copy

Creates or replaces a settings blob of the given name made up of the len bytes of data from src.

References LWS_EXTERN, and LWS_VISIBLE.

◆ lws_settings_plat_printf()

LWS_VISIBLE LWS_EXTERN int lws_settings_plat_printf ( lws_settings_instance_t * si,
const char * name,
const char * format,
... )

lws_settings_plat_printf() - read a named blob from a settings instance

Parameters
sithe settings instance
namethe name of the setting blob in the instance
formatprintf-style format string

Creates or replaces a settings blob of the given name from the printf-style format string and arguments provided. There's no specific limit to the size, the size is computed and then a temp heap buffer used.

References LWS_FORMAT.

◆ lws_settings_init()

LWS_VISIBLE LWS_EXTERN lws_settings_instance_t * lws_settings_init ( const lws_settings_ops_t * so,
void * opaque_plat )

References LWS_EXTERN, and LWS_VISIBLE.

◆ lws_settings_deinit()

LWS_VISIBLE LWS_EXTERN void lws_settings_deinit ( lws_settings_instance_t ** si)