pcsc-lite  1.8.20
Macros | Functions | Variables
readerfactory.c File Reference

This keeps track of a list of currently available reader structures. More...

#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <fcntl.h>
#include <pthread.h>
#include "misc.h"
#include "pcscd.h"
#include "debuglog.h"
#include "readerfactory.h"
#include "dyn_generic.h"
#include "sys_generic.h"
#include "eventhandler.h"
#include "ifdwrapper.h"
#include "hotplug.h"
#include "configfile.h"
#include "utils.h"

Go to the source code of this file.

Macros

#define TRUE   1
 
#define FALSE   0
 
#define IDENTITY_SHIFT   16
 
#define GET_ADDRESS_OPTIONALv2(s, code)
 
#define GET_ADDRESSv2(s)
 
#define GET_ADDRESS_OPTIONALv3(s, code)
 
#define GET_ADDRESSv3(s)
 

Functions

static LONG removeReader (READER_CONTEXT *sReader)
 
static int RDR_CLIHANDLES_seeker (const void *el, const void *key)
 
LONG _RefReader (READER_CONTEXT *sReader)
 
LONG _UnrefReader (READER_CONTEXT *sReader)
 
LONG RFAllocateReaderSpace (unsigned int customMaxReaderHandles)
 
LONG RFAddReader (const char *readerNameLong, int port, const char *library, const char *device)
 
LONG RFRemoveReader (const char *readerName, int port)
 
LONG RFSetReaderName (READER_CONTEXT *rContext, const char *readerName, const char *libraryName, int port)
 
LONG RFReaderInfo (const char *readerName, READER_CONTEXT **sReader)
 
LONG RFReaderInfoById (SCARDHANDLE hCard, READER_CONTEXT **sReader)
 
LONG RFLoadReader (READER_CONTEXT *rContext)
 
LONG RFBindFunctions (READER_CONTEXT *rContext)
 
LONG RFUnBindFunctions (READER_CONTEXT *rContext)
 
LONG RFUnloadReader (READER_CONTEXT *rContext)
 
LONG RFCheckSharing (SCARDHANDLE hCard, READER_CONTEXT *rContext)
 
LONG RFLockSharing (SCARDHANDLE hCard, READER_CONTEXT *rContext)
 
LONG RFUnlockSharing (SCARDHANDLE hCard, READER_CONTEXT *rContext)
 
LONG RFUnlockAllSharing (SCARDHANDLE hCard, READER_CONTEXT *rContext)
 
LONG RFInitializeReader (READER_CONTEXT *rContext)
 
void RFUnInitializeReader (READER_CONTEXT *rContext)
 
SCARDHANDLE RFCreateReaderHandle (READER_CONTEXT *rContext)
 
LONG RFAddReaderHandle (READER_CONTEXT *rContext, SCARDHANDLE hCard)
 
LONG RFRemoveReaderHandle (READER_CONTEXT *rContext, SCARDHANDLE hCard)
 
void RFSetReaderEventState (READER_CONTEXT *rContext, DWORD dwEvent)
 
LONG RFCheckReaderEventState (READER_CONTEXT *rContext, SCARDHANDLE hCard)
 
LONG RFClearReaderEventState (READER_CONTEXT *rContext, SCARDHANDLE hCard)
 
LONG RFCheckReaderStatus (READER_CONTEXT *rContext)
 
void RFCleanupReaders (void)
 

Variables

static READER_CONTEXTsReadersContexts [PCSCLITE_MAX_READERS_CONTEXTS]
 
READER_STATE readerStates [PCSCLITE_MAX_READERS_CONTEXTS]
 
static int maxReaderHandles = PCSC_MAX_READER_HANDLES
 
static DWORD dwNumReadersContexts = 0
 
static pthread_mutex_t LockMutex = PTHREAD_MUTEX_INITIALIZER
 

Detailed Description

This keeps track of a list of currently available reader structures.

Definition in file readerfactory.c.

Macro Definition Documentation

◆ GET_ADDRESS_OPTIONALv2

#define GET_ADDRESS_OPTIONALv2 (   s,
  code 
)
Value:
{ \
void *f1 = NULL; \
int rvl = DYN_GetAddress(rContext->vHandle, &f1, "IFDH" #s, FALSE); \
if (SCARD_S_SUCCESS != rvl) \
{ \
code \
} \
rContext->psFunctions.psFunctions_v2.pvf ## s = f1; \
}
#define SCARD_S_SUCCESS
No error was encountered.
Definition: pcsclite.h:107

◆ GET_ADDRESS_OPTIONALv3

#define GET_ADDRESS_OPTIONALv3 (   s,
  code 
)
Value:
{ \
void *f1 = NULL; \
int rvl = DYN_GetAddress(rContext->vHandle, &f1, "IFDH" #s, FALSE); \
if (SCARD_S_SUCCESS != rvl) \
{ \
code \
} \
rContext->psFunctions.psFunctions_v3.pvf ## s = f1; \
}
#define SCARD_S_SUCCESS
No error was encountered.
Definition: pcsclite.h:107

◆ GET_ADDRESSv2

#define GET_ADDRESSv2 (   s)
Value:
GET_ADDRESS_OPTIONALv2(s, \
Log1(PCSC_LOG_CRITICAL, "IFDHandler functions missing: " #s ); \
return(rv); )

◆ GET_ADDRESSv3

#define GET_ADDRESSv3 (   s)
Value:
GET_ADDRESS_OPTIONALv3(s, \
Log1(PCSC_LOG_CRITICAL, "IFDHandler functions missing: " #s ); \
return(rv); )