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@174 | 24 | #include <dirent.h> |
paul@99 | 25 | #include <fsclient/file.h> |
paul@99 | 26 | |
paul@99 | 27 | |
paul@90 | 28 | |
paul@90 | 29 | EXTERN_C_BEGIN |
paul@90 | 30 | |
paul@144 | 31 | /* Filesystem access operations. */ |
paul@144 | 32 | |
paul@150 | 33 | l4_cap_idx_t client_open_for_user(user_t user); |
paul@150 | 34 | l4_cap_idx_t client_open_for_user_using(user_t user, l4_cap_idx_t server); |
paul@144 | 35 | |
paul@117 | 36 | /* Opening and closing operations. */ |
paul@90 | 37 | |
paul@90 | 38 | void client_close(file_t *file); |
paul@90 | 39 | file_t *client_open(const char *name, flags_t flags); |
paul@144 | 40 | file_t *client_open_using(const char *name, flags_t flags, l4_cap_idx_t server); |
paul@144 | 41 | |
paul@175 | 42 | file_t *client_opendir(const char *name); |
paul@175 | 43 | file_t *client_opendir_using(const char *name, l4_cap_idx_t server); |
paul@175 | 44 | |
paul@90 | 45 | long client_pipe(file_t **reader, file_t **writer); |
paul@144 | 46 | long client_pipe_using(file_t **reader, file_t **writer, l4_cap_idx_t server); |
paul@90 | 47 | |
paul@90 | 48 | /* File and region operations. */ |
paul@90 | 49 | |
paul@90 | 50 | long client_flush(file_t *file); |
paul@90 | 51 | void *client_mmap(file_t *file, offset_t position, offset_t length); |
paul@90 | 52 | |
paul@90 | 53 | /* Pipe region operations. */ |
paul@90 | 54 | |
paul@116 | 55 | long client_current_region(file_t *file); |
paul@116 | 56 | long client_next_region(file_t *file); |
paul@90 | 57 | |
paul@90 | 58 | /* File data operations. */ |
paul@90 | 59 | |
paul@90 | 60 | offset_t client_read(file_t *file, void *buf, offset_t count); |
paul@90 | 61 | offset_t client_write(file_t *file, const void *buf, offset_t count); |
paul@90 | 62 | |
paul@90 | 63 | /* File navigation operations. */ |
paul@90 | 64 | |
paul@90 | 65 | offset_t client_seek(file_t *file, offset_t offset, int whence); |
paul@90 | 66 | long client_tell(file_t *file); |
paul@90 | 67 | |
paul@174 | 68 | /* Directory reading operations. */ |
paul@174 | 69 | |
paul@174 | 70 | struct dirent *client_readdir(file_t *file); |
paul@174 | 71 | |
paul@117 | 72 | /* Notification operations. */ |
paul@117 | 73 | |
paul@122 | 74 | long client_set_blocking(file_t *file, notify_flags_t flags); |
paul@177 | 75 | long client_subscribe(file_t *file, notify_flags_t flags, notifier_t notifier_type); |
paul@177 | 76 | long client_unsubscribe(file_t *file, notifier_t notifier_type); |
paul@123 | 77 | long client_wait_file(file_t *file); |
paul@123 | 78 | long client_wait_files(file_t **file); |
paul@117 | 79 | |
paul@90 | 80 | EXTERN_C_END |
paul@90 | 81 | |
paul@90 | 82 | // vim: tabstop=2 expandtab shiftwidth=2 |