client-c  0.8.1
ext_log_storage.h
Go to the documentation of this file.
1 
24 #ifndef EXT_LOG_STORAGE_H_
25 #define EXT_LOG_STORAGE_H_
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 #include <stddef.h>
32 
33 #include "../kaa_error.h"
34 
35 
39 typedef struct {
40  char *data;
41  size_t size;
42  uint16_t bucket_id;
44 
45 
46 
58 
59 
60 
72 
73 
74 
87 
105 kaa_error_t ext_log_storage_write_next_record(void *context, char *buffer, size_t buffer_len, uint16_t *bucket_id, size_t *record_len);
106 
107 
108 
117 kaa_error_t ext_log_storage_remove_by_bucket_id(void *context, uint16_t bucket_id);
118 
119 
120 
129 kaa_error_t ext_log_storage_unmark_by_bucket_id(void *context, uint16_t bucket_id);
130 
131 
132 
140 size_t ext_log_storage_get_total_size(const void *context);
141 
142 
143 
151 size_t ext_log_storage_get_records_count(const void *context);
152 
153 
154 
162 kaa_error_t ext_log_storage_destroy(void *context);
163 
164 #ifdef __cplusplus
165 } /* extern "C" */
166 #endif
167 
168 #endif /* EXT_LOG_STORAGE_H_ */
kaa_error_t ext_log_storage_allocate_log_record_buffer(void *context, kaa_log_record_t *record)
Allocates the data buffer to serialize a log entry into.
kaa_error_t ext_log_storage_destroy(void *context)
Destroys the log storage (which may decide to self-destroy).
kaa_error_t ext_log_storage_add_log_record(void *context, kaa_log_record_t *record)
Adds a log entry to the log storage.
kaa_error_t
Definition: kaa_error.h:31
size_t ext_log_storage_get_total_size(const void *context)
Returns total size occupied by logs in the log storage.
kaa_error_t ext_log_storage_write_next_record(void *context, char *buffer, size_t buffer_len, uint16_t *bucket_id, size_t *record_len)
Writes the next unmarked log entry into the supplied buffer and marks it with bucket_id the record si...
kaa_error_t ext_log_storage_remove_by_bucket_id(void *context, uint16_t bucket_id)
Removes from the storage all records marked with the provided bucket_id.
size_t ext_log_storage_get_records_count(const void *context)
Returns total log records count.
kaa_error_t ext_log_storage_unmark_by_bucket_id(void *context, uint16_t bucket_id)
Unmarks all records marked with the provided bucket_id.
kaa_error_t ext_log_storage_deallocate_log_record_buffer(void *context, kaa_log_record_t *record)
Deallocates the data buffer of a log record.