Move to kernel style SPDX license identifiers
[babeltrace.git] / src / fd-cache / fd-cache.h
... / ...
CommitLineData
1/*
2 * SPDX-License-Identifier: MIT
3 *
4 * Copyright 2019 Francis Deslauriers <francis.deslauriers@efficios.com>
5 *
6 * Babeltrace - File descriptor cache
7 */
8
9#ifndef BABELTRACE_FD_CACHE_INTERNAL_H
10#define BABELTRACE_FD_CACHE_INTERNAL_H
11
12#include "common/macros.h"
13
14struct bt_fd_cache_handle {
15 int fd;
16};
17
18struct bt_fd_cache {
19 int log_level;
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
30int bt_fd_cache_init(struct bt_fd_cache *fdc, int log_level);
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.023191 seconds and 4 git commands to generate.