1.1 --- a/file.h Sun Feb 28 23:28:45 2021 +0100
1.2 +++ b/file.h Mon Mar 01 00:22:56 2021 +0100
1.3 @@ -25,18 +25,37 @@
1.4
1.5
1.6
1.7 +EXTERN_C_BEGIN
1.8 +
1.9 +/* File access abstraction. */
1.10 +
1.11 typedef struct
1.12 {
1.13 + /* File object reference. */
1.14 +
1.15 l4_cap_idx_t ref;
1.16 +
1.17 + /* Mapped memory accessing a file region. */
1.18 +
1.19 char *memory;
1.20 - offset_t start_pos, end_pos, data_end, size;
1.21 +
1.22 + /* File region parameters. */
1.23 +
1.24 + offset_t start_pos, end_pos; /* start and end of region */
1.25 + offset_t data_end; /* amount of data in the region */
1.26 + offset_t size; /* total size of file */
1.27 +
1.28 } file_t;
1.29
1.30 -offset_t file_span(file_t *file);
1.31 +/* File access operations. */
1.32 +
1.33 +void file_close(file_t *file);
1.34 +long file_context(file_t *file, l4_cap_idx_t server);
1.35 void file_init(file_t *file);
1.36 +long file_mmap(file_t *file, offset_t position, offset_t length);
1.37 long file_open(file_t *file, l4_cap_idx_t context_ref);
1.38 -void file_close(file_t *file);
1.39 -long file_mmap(file_t *file, offset_t position, offset_t length);
1.40 -long context_open(file_t *file, l4_cap_idx_t server);
1.41 +offset_t file_span(file_t *file);
1.42 +
1.43 +EXTERN_C_END
1.44
1.45 // vim: tabstop=2 expandtab shiftwidth=2