Commit | Line | Data |
---|---|---|
f5ea0241 | 1 | /* |
ab5be9fa | 2 | * Copyright (C) 2020 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
f5ea0241 | 3 | * |
ab5be9fa | 4 | * SPDX-License-Identifier: LGPL-2.1-only |
f5ea0241 | 5 | * |
f5ea0241 JG |
6 | */ |
7 | ||
8 | #ifndef FS_HANDLE_INTERNAL_H | |
9 | #define FS_HANDLE_INTERNAL_H | |
10 | ||
11 | struct fs_handle; | |
12 | ||
13 | /* | |
14 | * Multiple internal APIs return fs_handles. For the moment, this internal | |
15 | * interface allows the use of different fs_handle implementations in different | |
16 | * daemons. For instance, the trace chunk interface returns fs_handles that | |
17 | * behave diffently depending on whether or not the trace chunk was configured | |
18 | * to use an fd-tracker. | |
19 | */ | |
20 | ||
21 | typedef int (*fs_handle_get_fd_cb)(struct fs_handle *); | |
22 | typedef void (*fs_handle_put_fd_cb)(struct fs_handle *); | |
23 | typedef int (*fs_handle_unlink_cb)(struct fs_handle *); | |
24 | typedef int (*fs_handle_close_cb)(struct fs_handle *); | |
25 | ||
26 | struct fs_handle { | |
27 | fs_handle_get_fd_cb get_fd; | |
28 | fs_handle_put_fd_cb put_fd; | |
29 | fs_handle_unlink_cb unlink; | |
30 | fs_handle_close_cb close; | |
31 | }; | |
32 | ||
33 | #endif /* FS_HANDLE_INTERNAL_H */ |