1.1 --- a/client/file.h Thu Apr 08 23:55:47 2021 +0200
1.2 +++ b/client/file.h Sun Apr 11 19:34:07 2021 +0200
1.3 @@ -42,12 +42,17 @@
1.4 /* File region parameters. */
1.5
1.6 offset_t start_pos, end_pos; /* start and end positions of region */
1.7 - offset_t data_end; /* amount of data in the region */
1.8 + offset_t data_end; /* amount/extent of data in the region */
1.9 + offset_t data_current; /* client access offset */
1.10
1.11 /* Total size of file. */
1.12
1.13 offset_t size;
1.14
1.15 + /* Arbitrary memory mapping support. */
1.16 +
1.17 + int can_mmap;
1.18 +
1.19 } file_t;
1.20
1.21
1.22 @@ -65,6 +70,7 @@
1.23
1.24 /* File and region operations. */
1.25
1.26 +long file_flush(file_t *file);
1.27 long file_mmap(file_t *file, offset_t position, offset_t length);
1.28 long file_resize(file_t *file, offset_t size);
1.29
1.30 @@ -78,6 +84,19 @@
1.31 char *file_string_get(file_t *file, offset_t offset);
1.32 int file_string_set(file_t *file, const char *data, offset_t offset, offset_t *written);
1.33
1.34 +/* Client data functions. */
1.35 +
1.36 +offset_t file_data_available(file_t *file);
1.37 +char *file_data_current(file_t *file);
1.38 +offset_t file_data_current_position(file_t *file);
1.39 +offset_t file_data_end_position(file_t *file);
1.40 +offset_t file_data_space(file_t *file);
1.41 +
1.42 +/* Client data transfer functions. */
1.43 +
1.44 +void file_data_read(file_t *file, char *buf, size_t to_transfer);
1.45 +void file_data_write(file_t *file, char *buf, size_t to_transfer);
1.46 +
1.47
1.48
1.49 /* Pipe operations. */