2 * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
3 * See the COPYING.LIB file in the top-level directory.
9 * these should come from some common spice header file
13 #define MIN(x, y) ((x) > (y) ? (y) : (x))
14 #define MAX(x, y) ((x) > (y) ? (x) : (y))
17 typedef struct VCardStruct VCard
;
18 typedef struct VCardAPDUStruct VCardAPDU
;
19 typedef struct VCardResponseStruct VCardResponse
;
20 typedef struct VCardBufferResponseStruct VCardBufferResponse
;
21 typedef struct VCardAppletStruct VCardApplet
;
22 typedef struct VCardAppletPrivateStruct VCardAppletPrivate
;
23 typedef struct VCardKeyStruct VCardKey
; /* opaque */
24 typedef struct VCardEmulStruct VCardEmul
;
28 /* create an ATR with appropriate historical bytes */
29 #define VCARD_ATR_PREFIX(size) 0x3b, 0x66+(size), 0x00, 0xff, \
30 'V', 'C', 'A', 'R', 'D', '_'
50 typedef VCardStatus (*VCardProcessAPDU
)(VCard
*card
, VCardAPDU
*apdu
,
51 VCardResponse
**response
);
52 typedef VCardStatus (*VCardResetApplet
)(VCard
*card
, int channel
);
53 typedef void (*VCardAppletPrivateFree
) (VCardAppletPrivate
*);
54 typedef void (*VCardEmulFree
) (VCardEmul
*);
55 typedef void (*VCardGetAtr
) (VCard
*, unsigned char *atr
, int *atr_len
);
57 struct VCardBufferResponseStruct
{
58 unsigned char *buffer
;
60 unsigned char *current
;