00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _BLESS_BUFFER_UTIL_H
00026 #define _BLESS_BUFFER_UTIL_H
00027
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031
00032 #include <sys/types.h>
00033 #include "buffer.h"
00034 #include "buffer_action.h"
00035 #include "segcol.h"
00036 #include "segment.h"
00037 #include "data_object.h"
00038 #include "list.h"
00039
00040 typedef int (segcol_foreach_func)(segcol_t *segcol, segment_t *seg,
00041 off_t mapping, off_t read_start, off_t read_length, void *user_data);
00042
00043 int read_data_object(data_object_t *dobj, off_t offset, void *mem, off_t length);
00044
00045 int write_data_object(data_object_t *dobj, off_t offset, off_t length,
00046 int fd, off_t file_offset);
00047
00048 int write_data_object_safe(data_object_t *dobj, off_t offset, off_t length,
00049 int fd, off_t file_offset);
00050
00051 int segcol_foreach(segcol_t *segcol, off_t offset, off_t length,
00052 segcol_foreach_func *func, void *user_data);
00053
00054 int segcol_store_in_memory(segcol_t *segcol, off_t offset, off_t length);
00055
00056 int segcol_store_in_file(segcol_t *segcol, off_t offset, off_t length,
00057 char *tmpdir);
00058
00059 int segcol_add_copy(segcol_t *dst, off_t offset, segcol_t *src);
00060
00061 int undo_list_enforce_limit(bless_buffer_t *buf, int ensure_vacancy);
00062
00063 int action_list_clear(list_t *action_list);
00064
00065 int undo_list_append(bless_buffer_t *buf, buffer_action_t *action);
00066
00067 #ifdef __cplusplus
00068 }
00069 #endif
00070
00071 #endif