46 #if defined(HAVE_DLFCN_H) && !defined(HAVE_DL_H) && !defined(__APPLE__) 55 INTERNAL
int DYN_LoadLibrary(
void **pvLHandle,
char *pcLibrary)
58 #ifndef PCSCLITE_STATIC_DRIVER 59 *pvLHandle = dlopen(pcLibrary, RTLD_LAZY);
61 if (*pvLHandle == NULL)
63 Log3(PCSC_LOG_CRITICAL,
"%s: %s", pcLibrary, dlerror());
71 INTERNAL
int DYN_CloseLibrary(
void **pvLHandle)
73 #ifndef PCSCLITE_STATIC_DRIVER 76 ret = dlclose(*pvLHandle);
81 Log2(PCSC_LOG_CRITICAL,
"%s", dlerror());
89 INTERNAL
int DYN_GetAddress(
void *pvLHandle,
void **pvFHandle,
90 const char *pcFunction,
int mayfail)
92 char pcFunctionName[256];
96 (void)snprintf(pcFunctionName,
sizeof(pcFunctionName),
"_%s", pcFunction);
99 #ifndef PCSCLITE_STATIC_DRIVER 100 *pvFHandle = dlsym(pvLHandle, pcFunctionName);
103 if (*pvFHandle == NULL)
104 *pvFHandle = dlsym(pvLHandle, pcFunction);
106 if (*pvFHandle == NULL)
108 Log3(mayfail ? PCSC_LOG_INFO : PCSC_LOG_CRITICAL,
"%s: %s",
109 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