51INTERNAL
void * DYN_LoadLibrary(
const char *pcLibrary)
53 void *pvLHandle = NULL;
54#ifndef PCSCLITE_STATIC_DRIVER
55 pvLHandle = dlopen(pcLibrary, RTLD_LAZY);
57 if (pvLHandle == NULL)
59 Log3(PCSC_LOG_CRITICAL,
"%s: %s", pcLibrary, dlerror());
68INTERNAL LONG DYN_CloseLibrary(
void *pvLHandle)
70#ifndef PCSCLITE_STATIC_DRIVER
73 ret = dlclose(pvLHandle);
77 Log2(PCSC_LOG_CRITICAL,
"%s", dlerror());
87INTERNAL LONG DYN_GetAddress(
void *pvLHandle,
void **pvFHandle,
88 const char *pcFunction,
bool mayfail)
90 char pcFunctionName[256];
94 (void)snprintf(pcFunctionName,
sizeof(pcFunctionName),
"_%s", pcFunction);
97#ifndef PCSCLITE_STATIC_DRIVER
98 *pvFHandle = dlsym(pvLHandle, pcFunctionName);
101 if (*pvFHandle == NULL)
102 *pvFHandle = dlsym(pvLHandle, pcFunction);
104 if (*pvFHandle == NULL)
109 Log3(mayfail ? PCSC_LOG_INFO : PCSC_LOG_CRITICAL,
"%s: %s",
110 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.