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());
66INTERNAL LONG DYN_CloseLibrary(
void *pvLHandle)
68#ifndef PCSCLITE_STATIC_DRIVER
71 ret = dlclose(pvLHandle);
75 Log2(PCSC_LOG_CRITICAL,
"%s", dlerror());
83INTERNAL LONG DYN_GetAddress(
void *pvLHandle,
void **pvFHandle,
84 const char *pcFunction,
bool mayfail)
86 char pcFunctionName[256];
90 (void)snprintf(pcFunctionName,
sizeof(pcFunctionName),
"_%s", pcFunction);
93#ifndef PCSCLITE_STATIC_DRIVER
94 *pvFHandle = dlsym(pvLHandle, pcFunctionName);
97 if (*pvFHandle == NULL)
98 *pvFHandle = dlsym(pvLHandle, pcFunction);
100 if (*pvFHandle == NULL)
105 Log3(mayfail ? PCSC_LOG_INFO : PCSC_LOG_CRITICAL,
"%s: %s",
106 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.