Segment Collection ADT. More...
#include <sys/types.h>
#include "segment.h"
Go to the source code of this file.
Typedefs | |
typedef struct segcol | segcol_t |
Opaque type for segment collection ADT. | |
typedef struct segcol_iter | segcol_iter_t |
Opaque type for segment collection iterator. | |
Functions | |
int | segcol_free (segcol_t *segcol) |
Frees the resources of a segcol_t. | |
int | segcol_append (segcol_t *segcol, segment_t *seg) |
Appends a segment to the segcol_t. | |
int | segcol_insert (segcol_t *segcol, off_t offset, segment_t *seg) |
Inserts a segment into the segcol_t. | |
int | segcol_delete (segcol_t *segcol, segcol_t **deleted, off_t offset, off_t length) |
Deletes a logical range from the segcol_t. | |
int | segcol_find (segcol_t *segcol, segcol_iter_t **iter, off_t offset) |
Finds the segment that contains a given logical offset. | |
int | segcol_get_size (segcol_t *segcol, off_t *size) |
Gets the size of the data contained in a segcol_t. | |
Iterator functions | |
int | segcol_iter_new (segcol_t *segcol, segcol_iter_t **iter) |
Gets a new (forward) iterator for a segcol_t. | |
int | segcol_iter_next (segcol_iter_t *iter) |
Moves the segcol_iter_t to the next element. | |
int | segcol_iter_is_valid (segcol_iter_t *iter, int *valid) |
Whether the iter points to a valid element. | |
int | segcol_iter_get_segment (segcol_iter_t *iter, segment_t **seg) |
Gets the segment pointed to by a segcol_iter_t. | |
int | segcol_iter_get_mapping (segcol_iter_t *iter, off_t *mapping) |
Gets the mapping (logical offset) of the segment pointed to by a segcol_iter_t. | |
int | segcol_iter_free (segcol_iter_t *iter) |
Frees a segcol_iter_t. |
Segment Collection ADT.
Definition in file segcol.h.