Blender  V3.3
wayland_dynload_utils.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include <stdio.h>
8 
10 
12  const int paths_num,
13  const bool verbose,
14  int *r_path_index)
15 {
17  for (int a = 0; a < paths_num; a++) {
18  lib = dynamic_library_open(paths[a]);
19  if (lib) {
20  *r_path_index = a;
21  break;
22  }
23  }
24  if (lib == NULL) {
25  /* Use the last path as it's likely to be least specific. */
26  if (verbose) {
27  fprintf(stderr, "Unable to find '%s'\n", paths[paths_num - 1]);
28  }
29  }
30  return lib;
31 }
32 
33 void *dynamic_library_find_with_error(DynamicLibrary lib, const char *symbol, const char *path_lib)
34 {
35  void *symbol_var = dynamic_library_find(lib, symbol);
36  if (symbol_var == NULL) {
37  fprintf(stderr, "Unable to find '%s' in '%s'.\n", symbol, path_lib);
38  }
39  return symbol_var;
40 }
static int verbose
Definition: cineonlib.c:29
DRWShaderLibrary * lib
static unsigned a[3]
Definition: RandGen.cpp:78
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)
#define dynamic_library_find(lib, symbol)
#define dynamic_library_open(path)