41 #if defined(HAVE_DLFCN_H) && !defined(HAVE_DL_H) && !defined(__APPLE__) 50 INTERNAL LONG DYN_LoadLibrary(
void **pvLHandle,
char *pcLibrary)
53 #ifndef PCSCLITE_STATIC_DRIVER 54 *pvLHandle = dlopen(pcLibrary, RTLD_LAZY);
56 if (*pvLHandle == NULL)
58 Log3(PCSC_LOG_CRITICAL,
"%s: %s", pcLibrary, dlerror());
66 INTERNAL LONG DYN_CloseLibrary(
void **pvLHandle)
68 #ifndef PCSCLITE_STATIC_DRIVER 71 ret = dlclose(*pvLHandle);
76 Log2(PCSC_LOG_CRITICAL,
"%s", dlerror());
84 INTERNAL LONG DYN_GetAddress(
void *pvLHandle,
void **pvFHandle,
85 const char *pcFunction,
int mayfail)
87 char pcFunctionName[256];
91 (void)snprintf(pcFunctionName,
sizeof(pcFunctionName),
"_%s", pcFunction);
94 #ifndef PCSCLITE_STATIC_DRIVER 95 *pvFHandle = dlsym(pvLHandle, pcFunctionName);
98 if (*pvFHandle == NULL)
99 *pvFHandle = dlsym(pvLHandle, pcFunction);
101 if (*pvFHandle == NULL)
106 Log3(mayfail ? PCSC_LOG_INFO : PCSC_LOG_CRITICAL,
"%s: %s",
107 pcFunction, dlerror());
This abstracts dynamic library loading functions.
#define SCARD_S_SUCCESS
No error was encountered.
#define SCARD_F_UNKNOWN_ERROR
An internal error has been detected, but the source is unknown.
This keeps a list of defines for pcsc-lite.