.gitignore: generated files moved to cpp
[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
29BT_HIDDEN
86d8b7b8 30int bt_fd_cache_init(struct bt_fd_cache *fdc, int log_level);
1e638f98
FD
31
32BT_HIDDEN
33void bt_fd_cache_fini(struct bt_fd_cache *fdc);
34
35BT_HIDDEN
36struct bt_fd_cache_handle *bt_fd_cache_get_handle(struct bt_fd_cache *fdc,
37 const char *path);
38
39BT_HIDDEN
40void bt_fd_cache_put_handle(struct bt_fd_cache *fdc,
41 struct bt_fd_cache_handle *handle);
42
43#endif /* BABELTRACE_FD_CACHE_INTERNAL_H */
This page took 0.065151 seconds and 4 git commands to generate.