pcsc-lite  1.8.8
eventhandler.h
Go to the documentation of this file.
1 /*
2  * MUSCLE SmartCard Development ( http://www.linuxnet.com )
3  *
4  * Copyright (C) 1999-2002
5  * David Corcoran <corcoran@linuxnet.com>
6  * Copyright (C) 2002-2010
7  * Ludovic Rousseau <ludovic.rousseau@free.fr>
8  *
9  * $Id: eventhandler.h 5434 2010-12-08 14:13:21Z rousseau $
10  */
11 
18 #ifndef __eventhandler_h__
19 #define __eventhandler_h__
20 
21 #include <stdint.h>
22 
27  typedef struct pubReaderStatesList
28  {
29  char readerName[MAX_READERNAME];
30  uint32_t eventCounter;
31  uint32_t readerState;
32  int32_t readerSharing;
35  uint32_t cardAtrLength;
36  uint32_t cardProtocol;
37  }
39 
40  LONG EHTryToUnregisterClientForEvent(int32_t filedes);
41  LONG EHRegisterClientForEvent(int32_t filedes);
42  LONG EHUnregisterClientForEvent(int32_t filedes);
43  LONG EHSignalEventToClients(void);
44  LONG EHInitializeEventStructures(void);
45  LONG EHSpawnEventHandler(READER_CONTEXT *);
46  LONG EHDestroyEventHandler(READER_CONTEXT *);
47 
49 #define PCSCLITE_SHARING_LAST_CONTEXT 1
50 
51 #define PCSCLITE_SHARING_NO_CONTEXT 0
52 
53 #define PCSCLITE_SHARING_EXCLUSIVE_CONTEXT -1
54 
58 #define READER_NOT_INITIALIZED (MAX_ATR_SIZE+1)
59 
60 #endif /* __eventhandler_h__ */
LONG EHUnregisterClientForEvent(int32_t filedes)
Unregister a client and log an error if the client is not found.
Definition: eventhandler.c:81
uint32_t cardAtrLength
ATR length.
Definition: eventhandler.h:35
char readerName[MAX_READERNAME]
reader name
Definition: eventhandler.h:29
int32_t readerSharing
PCSCLITE_SHARING_* sharing status.
Definition: eventhandler.h:32
uint32_t eventCounter
number of card events
Definition: eventhandler.h:30
LONG EHSignalEventToClients(void)
Sends an asynchronous event to any waiting client.
Definition: eventhandler.c:94
LONG EHTryToUnregisterClientForEvent(int32_t filedes)
Try to unregisted a client If no client is found then do not log an error.
Definition: eventhandler.c:61
struct pubReaderStatesList READER_STATE
Define an exported public reader state structure so each application gets instant notification of cha...
UCHAR cardAtr[MAX_ATR_SIZE]
ATR.
Definition: eventhandler.h:34
uint32_t cardProtocol
SCARD_PROTOCOL_* value.
Definition: eventhandler.h:36
Define an exported public reader state structure so each application gets instant notification of cha...
Definition: eventhandler.h:27
#define MAX_ATR_SIZE
Maximum ATR size.
Definition: pcsclite.h:38
uint32_t readerState
SCARD_* bit field.
Definition: eventhandler.h:31