src/buffer_edit.c File Reference

Buffer edit operations. More...

#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include "buffer.h"
#include "buffer_internal.h"
#include "buffer_util.h"
#include "data_object.h"
#include "data_object_memory.h"
#include "type_limits.h"
#include "buffer_action.h"
#include "buffer_action_edit.h"
#include "buffer_event.h"
#include "util.h"
#include "debug.h"
Include dependency graph for buffer_edit.c:

Go to the source code of this file.

Functions

static int read_foreach_func (segcol_t *segcol, segment_t *seg, off_t mapping, off_t read_start, off_t read_length, void *user_data)
 A segcol_foreach_func that reads data from a segment_t into memory.
int bless_buffer_append (bless_buffer_t *buf, bless_buffer_source_t *src, off_t src_offset, off_t length)
 Appends data to a bless_buffer_t.
int bless_buffer_insert (bless_buffer_t *buf, off_t offset, bless_buffer_source_t *src, off_t src_offset, off_t length)
 Inserts data into a bless_buffer_t.
int bless_buffer_delete (bless_buffer_t *buf, off_t offset, off_t length)
 Delete data from a bless_buffer_t.
int bless_buffer_read (bless_buffer_t *buf, off_t src_offset, void *dst, size_t dst_offset, size_t length)
 Reads data from a bless_buffer_t.
int bless_buffer_copy (bless_buffer_t *src, off_t src_offset, bless_buffer_t *dst, off_t dst_offset, off_t length)
 Copies data from a bless_buffer_t to another.
int bless_buffer_find (bless_buffer_t *buf, off_t *match, off_t start_offset, void *data, size_t length, bless_progress_func *progress_func)
 Searches for data in a bless_buffer_t.

Detailed Description

Buffer edit operations.

Definition in file buffer_edit.c.


Function Documentation

int bless_buffer_copy ( bless_buffer_t src,
off_t  src_offset,
bless_buffer_t dst,
off_t  dst_offset,
off_t  length 
)

Copies data from a bless_buffer_t to another.

Parameters:
src the bless_buffer_t to read data from
src_offset the offset in the source bless_buffer_t to start reading from
dst the bless_buffer_t to copy data to
dst_offset the offset in the destination bless_buffer_t to start copying data to
length the length of the data to read
Returns:
the operation error code

Definition at line 408 of file buffer_edit.c.

int bless_buffer_find ( bless_buffer_t buf,
off_t *  match,
off_t  start_offset,
void *  data,
size_t  length,
bless_progress_func progress_func 
)

Searches for data in a bless_buffer_t.

Parameters:
buf the bless_buffer_t to search
[out] match the offset the data was found at or -1 if no match was found
start_offset the offset in the bless_buffer_t to start searching from
data a pointer to the data to search for
length the length of the data to search for
progress_func the bless_progress_cb to call to report the progress of the operation or NULL to disable reporting
Returns:
the offset in the bless_buffer_t where a match was found or an operation error code

Definition at line 434 of file buffer_edit.c.

static int read_foreach_func ( segcol_t segcol,
segment_t seg,
off_t  mapping,
off_t  read_start,
off_t  read_length,
void *  user_data 
) [static]

A segcol_foreach_func that reads data from a segment_t into memory.

Parameters:
segcol the segcol_t containing the segment
seg the segment to read from
mapping the mapping of the segment in segcol
read_start the offset in the data of the segment to start reading
read_length the length of the data to read
user_data a void ** pointer containing the pointer to write to
Returns:
the operation error code

Definition at line 59 of file buffer_edit.c.

References read_data_object(), and segment_get_data().

Referenced by bless_buffer_read().

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Sun Nov 15 15:27:37 2009 for libbls by  doxygen 1.6.1