~ubuntu-branches/ubuntu/natty/pcsc-lite/natty

« back to all changes in this revision

Viewing changes to src/eventhandler.h

  • Committer: Martin Pitt
  • Date: 2011-03-21 07:44:42 UTC
  • mfrom: (26.1.6 pcsc-lite)
  • Revision ID: martin.pitt@canonical.com-20110321074442-3we5jrh1c4xq8mmh
mergeĀ fromĀ Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * MUSCLE SmartCard Development ( http://www.linuxnet.com )
3
3
 *
4
 
 * Copyright (C) 1999
 
4
 * Copyright (C) 1999-2002
5
5
 *  David Corcoran <corcoran@linuxnet.com>
6
 
 * Copyright (C) 2004
 
6
 * Copyright (C) 2002-2010
7
7
 *  Ludovic Rousseau <ludovic.rousseau@free.fr>
8
8
 *
9
 
 * $Id: eventhandler.h 3259 2009-01-02 14:32:44Z rousseau $
 
9
 * $Id: eventhandler.h 5434 2010-12-08 14:13:21Z rousseau $
10
10
 */
11
11
 
12
12
/**
20
20
 
21
21
#include <stdint.h>
22
22
 
23
 
#ifdef __cplusplus
24
 
extern "C"
25
 
{
26
 
#endif
27
 
 
28
23
        /**
29
24
         * Define an exported public reader state structure so each
30
25
         * application gets instant notification of changes in state.
31
26
         */
32
27
        typedef struct pubReaderStatesList
33
28
        {
34
 
                int32_t readerID;
35
 
                char readerName[MAX_READERNAME];
36
 
                uint32_t readerState;
37
 
                int32_t readerSharing;
 
29
                char readerName[MAX_READERNAME]; /**< reader name */
 
30
                uint32_t eventCounter; /**< number of card events */
 
31
                uint32_t readerState; /**< SCARD_* bit field */
 
32
                int32_t readerSharing; /**< PCSCLITE_SHARING_* sharing status */
38
33
 
39
 
                UCHAR cardAtr[MAX_ATR_SIZE];
40
 
                uint32_t cardAtrLength;
41
 
                uint32_t cardProtocol;
 
34
                UCHAR cardAtr[MAX_ATR_SIZE]; /**< ATR */
 
35
                uint32_t cardAtrLength; /**< ATR length */
 
36
                uint32_t cardProtocol; /**< SCARD_PROTOCOL_* value */
42
37
        }
43
 
        READER_STATE, *PREADER_STATE;
 
38
        READER_STATE;
44
39
 
 
40
        LONG EHTryToUnregisterClientForEvent(int32_t filedes);
 
41
        LONG EHRegisterClientForEvent(int32_t filedes);
 
42
        LONG EHUnregisterClientForEvent(int32_t filedes);
 
43
        LONG EHSignalEventToClients(void);
45
44
        LONG EHInitializeEventStructures(void);
46
 
        LONG EHSpawnEventHandler(PREADER_CONTEXT,
47
 
                /*@null@*/ RESPONSECODE (*)(DWORD));
48
 
        LONG EHDestroyEventHandler(PREADER_CONTEXT);
49
 
 
50
 
#ifdef __cplusplus
51
 
}
52
 
#endif
 
45
        LONG EHSpawnEventHandler(READER_CONTEXT *);
 
46
        LONG EHDestroyEventHandler(READER_CONTEXT *);
 
47
 
 
48
/** One application is using the reader */
 
49
#define PCSCLITE_SHARING_LAST_CONTEXT       1
 
50
/** No application is using the reader */
 
51
#define PCSCLITE_SHARING_NO_CONTEXT         0
 
52
/** Reader used in exclusive mode */
 
53
#define PCSCLITE_SHARING_EXCLUSIVE_CONTEXT -1
 
54
 
 
55
/** Special value to indicate that power up has not yet happen
 
56
 * This is used to auto start mode to wait until the reader is
 
57
 * ready and the (possible) card has been powered up */
 
58
#define READER_NOT_INITIALIZED (MAX_ATR_SIZE+1)
53
59
 
54
60
#endif                                                  /* __eventhandler_h__ */