41#if defined(HAVE_DLFCN_H) && !defined(HAVE_DL_H) && !defined(__APPLE__)
51INTERNAL LONG DYN_LoadLibrary(
void **pvLHandle,
char *pcLibrary)
54#ifndef PCSCLITE_STATIC_DRIVER
55 *pvLHandle = dlopen(pcLibrary, RTLD_LAZY);
57 if (*pvLHandle == NULL)
59 Log3(PCSC_LOG_CRITICAL,
"%s: %s", pcLibrary, dlerror());
67INTERNAL LONG DYN_CloseLibrary(
void **pvLHandle)
69#ifndef PCSCLITE_STATIC_DRIVER
72 ret = dlclose(*pvLHandle);
77 Log2(PCSC_LOG_CRITICAL,
"%s", dlerror());
85INTERNAL LONG DYN_GetAddress(
void *pvLHandle,
void **pvFHandle,
86 const char *pcFunction,
bool mayfail)
88 char pcFunctionName[256];
92 (void)snprintf(pcFunctionName,
sizeof(pcFunctionName),
"_%s", pcFunction);
95#ifndef PCSCLITE_STATIC_DRIVER
96 *pvFHandle = dlsym(pvLHandle, pcFunctionName);
99 if (*pvFHandle == NULL)
100 *pvFHandle = dlsym(pvLHandle, pcFunction);
102 if (*pvFHandle == NULL)
107 Log3(mayfail ? PCSC_LOG_INFO : PCSC_LOG_CRITICAL,
"%s: %s",
108 pcFunction, dlerror());
This abstracts dynamic library loading functions.
#define SCARD_F_UNKNOWN_ERROR
An internal error has been detected, but the source is unknown.
#define SCARD_S_SUCCESS
No error was encountered.
This keeps a list of defines for pcsc-lite.