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