Monado OpenXR Runtime
u_file.h
Go to the documentation of this file.
1// Copyright 2019-2025, Collabora, Ltd.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Very simple file opening functions.
6 * @author Jakob Bornecrantz <jakob@collabora.com>
7 * @ingroup aux_util
8 */
9
10#pragma once
11
12#include <stdio.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18int
19u_file_get_config_dir(char *out_path, size_t out_path_size);
20
21int
22u_file_get_path_in_config_dir(const char *suffix, char *out_path, size_t out_path_size);
23
24FILE *
25u_file_open_file_in_config_dir(const char *filename, const char *mode);
26
27FILE *
28u_file_open_file_in_config_dir_subpath(const char *subpath, const char *filename, const char *mode);
29
30int
31u_file_get_hand_tracking_models_dir(char *out_path, size_t out_path_size);
32
33int
34u_file_get_runtime_dir(char *out_path, size_t out_path_size);
35
36char *
37u_file_read_content(FILE *file, size_t *out_file_size);
38
39char *
40u_file_read_content_from_path(const char *path, size_t *out_file_size);
41
42int
43u_file_get_path_in_runtime_dir(const char *suffix, char *out_path, size_t out_path_size);
44
45#ifdef __cplusplus
46}
47#endif