43 #if defined(HAVE_DLFCN_H) && !defined(HAVE_DL_H) && !defined(__APPLE__)
52 INTERNAL
int DYN_LoadLibrary(
void **pvLHandle,
char *pcLibrary)
55 #ifndef PCSCLITE_STATIC_DRIVER
56 *pvLHandle = dlopen(pcLibrary, RTLD_LAZY);
58 if (*pvLHandle == NULL)
60 Log3(PCSC_LOG_CRITICAL,
"%s: %s", pcLibrary, dlerror());
68 INTERNAL
int DYN_CloseLibrary(
void **pvLHandle)
70 #ifndef PCSCLITE_STATIC_DRIVER
73 ret = dlclose(*pvLHandle);
78 Log2(PCSC_LOG_CRITICAL,
"%s", dlerror());
86 INTERNAL
int DYN_GetAddress(
void *pvLHandle,
void **pvFHandle,
87 const char *pcFunction,
int mayfail)
89 char pcFunctionName[256];
93 (void)snprintf(pcFunctionName,
sizeof(pcFunctionName),
"_%s", pcFunction);
96 #ifndef PCSCLITE_STATIC_DRIVER
97 *pvFHandle = dlsym(pvLHandle, pcFunctionName);
100 if (*pvFHandle == NULL)
101 *pvFHandle = dlsym(pvLHandle, pcFunction);
103 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.
This keeps a list of defines for pcsc-lite.
#define SCARD_S_SUCCESS
error codes from http://msdn.microsoft.com/en-us/library/aa924526.aspx