linked_file_bag.h
Go to the documentation of this file.
1 /******************************************************************************/
38 /******************************************************************************/
39 
40 #if !defined(ION_LINKED_FILE_BAG_H_)
41 #define ION_LINKED_FILE_BAG_H_
42 
43 #if defined(__cplusplus)
44 extern "C" {
45 #endif
46 
47 #include "../key_value/kv_system.h"
48 #include "ion_file.h"
49 
50 #define ION_LFB_NULL ION_FILE_NULL
51 
55 typedef struct linkedfilebag {
60 } ion_lfb_t;
61 
81 lfb_put(
82  ion_lfb_t *bag,
83  ion_byte_t *to_write,
84  unsigned int num_bytes,
86  ion_file_offset_t *wrote_at
87 );
88 
111 ion_err_t
112 lfb_get(
113  ion_lfb_t *bag,
114  ion_file_offset_t offset,
115  unsigned int num_bytes,
116  ion_byte_t *write_to,
118 );
119 
129 ion_err_t
130 lfb_delete(
131  ion_lfb_t *bag,
132  ion_file_offset_t offset
133 );
134 
151 ion_err_t
153  ion_lfb_t *bag,
154  ion_file_offset_t offset,
155  ion_result_count_t *count
156 );
157 
181 ion_err_t
182 lfb_update(
183  ion_lfb_t *bag,
184  ion_file_offset_t offset,
185  unsigned int num_bytes,
186  ion_byte_t *to_write,
188 );
189 
209 ion_err_t
211  ion_lfb_t *bag,
212  ion_file_offset_t offset,
213  unsigned int num_bytes,
214  ion_byte_t *to_write,
215  ion_result_count_t *count
216 );
217 
218 #if defined(__cplusplus)
219 }
220 #endif
221 
222 #endif
A file API for the ionDB.
unsigned char ion_byte_t
A byte type.
Definition: kv_system.h:232
ion_err_t lfb_update(ion_lfb_t *bag, ion_file_offset_t offset, unsigned int num_bytes, ion_byte_t *to_write, ion_file_offset_t *next)
Attempt to update a record within a linked file bag at a given offset.
#define next(b)
Definition: bpp_tree.c:82
ion_file_handle_t file_handle
ion_err_t lfb_update_all(ion_lfb_t *bag, ion_file_offset_t offset, unsigned int num_bytes, ion_byte_t *to_write, ion_result_count_t *count)
Attempt to update all records kept within a specific bag, starting at some record at a given offset...
char ion_err_t
The error type used to store error codes.
Definition: kv_system.h:226
FILE * ion_file_handle_t
Definition: ion_file.h:69
long ion_file_offset_t
Definition: ion_file.h:47
struct linkedfilebag ion_lfb_t
A handler struct for a linked file bag instance.
ion_file_offset_t next_empty
ion_err_t lfb_get(ion_lfb_t *bag, ion_file_offset_t offset, unsigned int num_bytes, ion_byte_t *write_to, ion_file_offset_t *next)
Add an item to the linked file bag.
ion_err_t lfb_delete_all(ion_lfb_t *bag, ion_file_offset_t offset, ion_result_count_t *count)
Attempt to delete all contents from the bag starting at a given offset.
ion_err_t lfb_delete(ion_lfb_t *bag, ion_file_offset_t offset)
Attempt to delete a record stored at a given offset.
ion_err_t lfb_put(ion_lfb_t *bag, ion_byte_t *to_write, unsigned int num_bytes, ion_file_offset_t next, ion_file_offset_t *wrote_at)
Add an item to the linked file bag.
int ion_result_count_t
A type for the number of results changed during an operation.
Definition: kv_system.h:284
A handler struct for a linked file bag instance.