Blender V4.3
wayland_dynload_utils.c
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include <stdio.h>
10
12
14 const int paths_num,
15 const bool verbose,
16 int *r_path_index)
17{
19 for (int a = 0; a < paths_num; a++) {
20 lib = dynamic_library_open(paths[a]);
21 if (lib) {
22 *r_path_index = a;
23 break;
24 }
25 }
26 if (lib == NULL) {
27 /* Use the last path as it's likely to be least specific. */
28 if (verbose) {
29 fprintf(stderr, "Unable to find '%s'\n", paths[paths_num - 1]);
30 }
31 }
32 return lib;
33}
34
36 const char *symbol,
37 const char *path_lib,
38 const bool verbose)
39{
40 void *symbol_var = dynamic_library_find(lib, symbol);
41 if (symbol_var == NULL) {
42 if (verbose) {
43 fprintf(stderr, "Unable to find '%s' in '%s'.\n", symbol, path_lib);
44 }
45 }
46 return symbol_var;
47}
static int verbose
Definition cineonlib.cc:31
#define NULL
static DynamicLibrary lib
DynamicLibrary dynamic_library_open_array_with_error(const char **paths, const int paths_num, const bool verbose, int *r_path_index)
void * dynamic_library_find_with_error(DynamicLibrary lib, const char *symbol, const char *path_lib, const bool verbose)
#define dynamic_library_find(lib, symbol)
#define dynamic_library_open(path)