paul@90 | 1 | /* |
paul@90 | 2 | * Filesystem client functions. |
paul@90 | 3 | * |
paul@90 | 4 | * Copyright (C) 2018, 2019, 2020, 2021 Paul Boddie <paul@boddie.org.uk> |
paul@90 | 5 | * |
paul@90 | 6 | * This program is free software; you can redistribute it and/or |
paul@90 | 7 | * modify it under the terms of the GNU General Public License as |
paul@90 | 8 | * published by the Free Software Foundation; either version 2 of |
paul@90 | 9 | * the License, or (at your option) any later version. |
paul@90 | 10 | * |
paul@90 | 11 | * This program is distributed in the hope that it will be useful, |
paul@90 | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
paul@90 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
paul@90 | 14 | * GNU General Public License for more details. |
paul@90 | 15 | * |
paul@90 | 16 | * You should have received a copy of the GNU General Public License |
paul@90 | 17 | * along with this program; if not, write to the Free Software |
paul@90 | 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, |
paul@90 | 19 | * Boston, MA 02110-1301, USA |
paul@90 | 20 | */ |
paul@90 | 21 | |
paul@90 | 22 | #pragma once |
paul@90 | 23 | |
paul@90 | 24 | #include "file.h" |
paul@90 | 25 | |
paul@90 | 26 | EXTERN_C_BEGIN |
paul@90 | 27 | |
paul@90 | 28 | /* File operations. */ |
paul@90 | 29 | |
paul@90 | 30 | void client_close(file_t *file); |
paul@90 | 31 | file_t *client_open(const char *name, flags_t flags); |
paul@90 | 32 | long client_pipe(file_t **reader, file_t **writer); |
paul@90 | 33 | |
paul@90 | 34 | /* File and region operations. */ |
paul@90 | 35 | |
paul@90 | 36 | long client_flush(file_t *file); |
paul@91 | 37 | void *client_mmap(file_t *file, offset_t position, length_t length); |
paul@90 | 38 | |
paul@90 | 39 | /* Pipe region operations. */ |
paul@90 | 40 | |
paul@90 | 41 | void *client_current_region(file_t *file); |
paul@90 | 42 | void *client_next_region(file_t *file); |
paul@90 | 43 | |
paul@90 | 44 | /* File data operations. */ |
paul@90 | 45 | |
paul@90 | 46 | offset_t client_read(file_t *file, void *buf, offset_t count); |
paul@90 | 47 | offset_t client_write(file_t *file, const void *buf, offset_t count); |
paul@90 | 48 | |
paul@90 | 49 | /* File navigation operations. */ |
paul@90 | 50 | |
paul@90 | 51 | offset_t client_seek(file_t *file, offset_t offset, int whence); |
paul@90 | 52 | long client_tell(file_t *file); |
paul@90 | 53 | |
paul@90 | 54 | EXTERN_C_END |
paul@90 | 55 | |
paul@90 | 56 | // vim: tabstop=2 expandtab shiftwidth=2 |