MCPcopy Create free account
hub / github.com/VirtualGL/virtualgl / loadX11Symbol

Function loadX11Symbol

server/faker-sym.cpp:291–327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289
290
291static void *loadX11Symbol(const char *name, bool optional)
292{
293 char *err = NULL;
294
295 if(!x11dllhnd)
296 {
297 if(strlen(fconfig.x11lib) > 0)
298 {
299 dlerror(); // Clear error state
300 void *dllhnd = _vgl_dlopen(fconfig.x11lib, RTLD_LAZY);
301 err = dlerror();
302 if(!dllhnd)
303 {
304 vglout.print("[VGL] ERROR: Could not open %s\n", fconfig.x11lib);
305 if(err) vglout.print("[VGL] %s\n", err);
306 return NULL;
307 }
308 x11dllhnd = dllhnd;
309 }
310 else x11dllhnd = RTLD_NEXT;
311 }
312
313 dlerror(); // Clear error state
314 void *sym = dlsym(x11dllhnd, (char *)name);
315 err = dlerror();
316
317 if(!sym && (fconfig.verbose || !optional))
318 {
319 vglout.print("[VGL] %s: Could not load function \"%s\"",
320 optional ? "WARNING" : "ERROR", name);
321 if(strlen(fconfig.x11lib) > 0)
322 vglout.print(" from %s", fconfig.x11lib);
323 vglout.print("\n");
324 if(err) vglout.print("[VGL] %s\n", err);
325 }
326 return sym;
327}
328
329
330#ifdef FAKEXCB

Callers 1

loadSymbolFunction · 0.85

Calls 2

_vgl_dlopenFunction · 0.85
printMethod · 0.45

Tested by

no test coverage detected