62 void (*cb)(
void *data,
const char *name,
struct sol_blob *blob,
int status),
86 #define CREATE_BUFFER(_val) \
87 struct sol_buffer buf SOL_BUFFER_INIT_FLAGS(_val, \
88 sizeof(*(_val)), SOL_BUFFER_FLAGS_MEMORY_NOT_OWNED | SOL_BUFFER_FLAGS_NO_NUL_BYTE);
90 #define CREATE_BUFFER(_val) \
91 struct sol_buffer buf = SOL_BUFFER_INIT_FLAGS(_val, \
92 sizeof(*(_val)), SOL_BUFFER_FLAGS_MEMORY_NOT_OWNED | SOL_BUFFER_FLAGS_NO_NUL_BYTE);
98 #define CREATE_BLOB(_val) \
99 struct sol_blob *blob; \
100 size_t _s = sizeof(*_val); \
101 void *v = malloc(_s); \
102 SOL_NULL_CHECK(v, -ENOMEM); \
103 memcpy(v, _val, _s); \
104 blob = sol_blob_new(&SOL_BLOB_TYPE_DEFAULT, NULL, v, _s); \
147 void (*cb)(
void *data,
const char *name,
struct sol_blob *blob,
int status),
196 void (*cb)(
void *data,
const char *name,
struct sol_blob *blob,
int status),
245 void (*cb)(
void *data,
const char *name,
struct sol_blob *blob,
int status),
294 void (*cb)(
void *data,
const char *name,
struct sol_blob *blob,
int status),
343 void (*cb)(
void *data,
const char *name,
struct sol_blob *blob,
int status),
392 void (*cb)(
void *data,
const char *name,
struct sol_blob *blob,
int status),
450 void (*cb)(
void *
data,
const char *name,
struct sol_blob *blob,
int status),
457 string = strdup(value);
static int sol_efivars_write_drange(const char *name, struct sol_drange *value, void(*cb)(void *data, const char *name, struct sol_blob *blob, int status), const void *data)
Writes a sol_drange into an EFI variable.
Definition: sol-efivarfs-storage.h:342
#define SOL_NULL_CHECK(ptr,...)
Convenience macro to check for NULL pointer.
Definition: sol-log.h:223
#define SOL_BUFFER_INIT_EMPTY
Helper macro to initialize an empty buffer.
Definition: sol-buffer.h:153
void sol_buffer_fini(struct sol_buffer *buf)
Finalizes the buffer.
static int sol_efivars_write_string(const char *name, const char *value, void(*cb)(void *data, const char *name, struct sol_blob *blob, int status), const void *data)
Writes a string into an EFI variable.
Definition: sol-efivarfs-storage.h:449
These routines are used for Soletta types' manipulation.
static int sol_efivars_read_double(const char *name, double *value)
Reads a double from the EFI given variable and set to value.
Definition: sol-efivarfs-storage.h:368
static int sol_efivars_read_uint8(const char *name, uint8_t *value)
Reads an uint8_t from the EFI given variable and set to value.
Definition: sol-efivarfs-storage.h:123
static int sol_efivars_read_bool(const char *name, bool *value)
Reads a boolean from the EFI given variable and set to value.
Definition: sol-efivarfs-storage.h:172
Data type describing a Double range.
Definition: sol-types.h:187
static int sol_efivars_write_int32(const char *name, int32_t value, void(*cb)(void *data, const char *name, struct sol_blob *blob, int status), const void *data)
Writes an int32_t into an EFI variable.
Definition: sol-efivarfs-storage.h:244
static int sol_efivars_read_drange(const char *name, struct sol_drange *value)
Reads a sol_drange from the EFI given variable and set to value.
Definition: sol-efivarfs-storage.h:319
static int sol_efivars_write_bool(const char *name, bool value, void(*cb)(void *data, const char *name, struct sol_blob *blob, int status), const void *data)
Writes a boolean into an EFI variable.
Definition: sol-efivarfs-storage.h:195
static int sol_efivars_read_int32(const char *name, int32_t *value)
Reads an int32_t from the EFI given variable and set to value.
Definition: sol-efivarfs-storage.h:221
struct sol_blob * sol_blob_new(const struct sol_blob_type *type, struct sol_blob *parent, const void *mem, size_t size)
Creates a new blob instance of the given type type.
const struct sol_blob_type SOL_BLOB_TYPE_DEFAULT
Blob type object for the default implementation.
static int sol_efivars_read_irange(const char *name, struct sol_irange *value)
Reads a sol_irange from the EFI given variable and set to value.
Definition: sol-efivarfs-storage.h:270
These routines are used for Soletta logging.
static struct sol_buffer value
Definition: server.c:42
These are routines that Soletta provides for its buffer implementation.
static int sol_efivars_write_double(const char *name, double value, void(*cb)(void *data, const char *name, struct sol_blob *blob, int status), const void *data)
Writes a double into an EFI variable.
Definition: sol-efivarfs-storage.h:391
Data type describing Integer ranges.
Definition: sol-types.h:327
#define CREATE_BUFFER(_val)
Macro to create a struct sol_buffer with value passed as argument and flags SOL_BUFFER_FLAGS_MEMORY_N...
Definition: sol-efivarfs-storage.h:90
void * data
Buffer data.
Definition: sol-buffer.h:131
static int sol_efivars_write_uint8(const char *name, uint8_t value, void(*cb)(void *data, const char *name, struct sol_blob *blob, int status), const void *data)
Writes an uint8_t into an EFI variable.
Definition: sol-efivarfs-storage.h:146
Data type describing the default blob implementation.
Definition: sol-types.h:468
#define CREATE_BLOB(_val)
Macro to create a struct sol_blob with value passed as argument.
Definition: sol-efivarfs-storage.h:98
int sol_efivars_read_raw(const char *name, struct sol_buffer *buffer)
Read stored contents and set to buffer.
static int sol_efivars_write_irange(const char *name, struct sol_irange *value, void(*cb)(void *data, const char *name, struct sol_blob *blob, int status), const void *data)
Writes a sol_irange into an EFI variable.
Definition: sol-efivarfs-storage.h:293
#define SOL_NULL_CHECK_GOTO(ptr, label)
Convenience macro to check for NULL pointer and jump to a given label.
Definition: sol-log.h:262
void * sol_buffer_steal(struct sol_buffer *buf, size_t *size)
'Steals' sol_buffer internal buffer and resets sol_buffer.
A sol_buffer is a dynamic array, that can be resized if needed.
Definition: sol-buffer.h:130
static int sol_efivars_read_string(const char *name, char **value)
Reads a string from the EFI given variable and set to value.
Definition: sol-efivarfs-storage.h:417
int sol_efivars_write_raw(const char *name, struct sol_blob *blob, void(*cb)(void *data, const char *name, struct sol_blob *blob, int status), const void *data)
Writes buffer contents to storage.
void sol_blob_unref(struct sol_blob *blob)
Decreases the reference counter of the given blob.