Visibility hidden by default
[babeltrace.git] / src / fd-cache / fd-cache.h
CommitLineData
1e638f98 1/*
0235b0db 2 * SPDX-License-Identifier: MIT
1e638f98
FD
3 *
4 * Copyright 2019 Francis Deslauriers <francis.deslauriers@efficios.com>
5 *
0235b0db 6 * Babeltrace - File descriptor cache
1e638f98
FD
7 */
8
0235b0db
MJ
9#ifndef BABELTRACE_FD_CACHE_INTERNAL_H
10#define BABELTRACE_FD_CACHE_INTERNAL_H
11
91d81473 12#include "common/macros.h"
1e638f98
FD
13
14struct bt_fd_cache_handle {
15 int fd;
16};
17
18struct bt_fd_cache {
86d8b7b8 19 int log_level;
1e638f98
FD
20 GHashTable *cache;
21};
22
23static inline
24int bt_fd_cache_handle_get_fd(struct bt_fd_cache_handle *handle)
25{
26 return handle->fd;
27}
28
86d8b7b8 29int bt_fd_cache_init(struct bt_fd_cache *fdc, int log_level);
1e638f98 30
1e638f98
FD
31void bt_fd_cache_fini(struct bt_fd_cache *fdc);
32
1e638f98
FD
33struct bt_fd_cache_handle *bt_fd_cache_get_handle(struct bt_fd_cache *fdc,
34 const char *path);
35
1e638f98
FD
36void bt_fd_cache_put_handle(struct bt_fd_cache *fdc,
37 struct bt_fd_cache_handle *handle);
38
39#endif /* BABELTRACE_FD_CACHE_INTERNAL_H */
This page took 0.064278 seconds and 4 git commands to generate.