coroutine: add test-coroutine --benchmark-lifecycle
[qemu/stefanha.git] / libcacard / vreader.h
blobec2042136c49be1154b2bc038c08d21fc4eb74cd
1 /*
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.
4 */
6 #ifndef VREADER_H
7 #define VREADER_H 1
9 #include "eventt.h"
10 #include "vreadert.h"
11 #include "vcardt.h"
14 * calls for reader front end
16 VReaderStatus vreader_power_on(VReader *reader, unsigned char *atr, int *len);
17 VReaderStatus vreader_power_off(VReader *reader);
18 VReaderStatus vreader_xfr_bytes(VReader *reader, unsigned char *send_buf,
19 int send_buf_len, unsigned char *receive_buf,
20 int *receive_buf_len);
22 /* constructor */
23 VReader *vreader_new(const char *readerName, VReaderEmul *emul_private,
24 VReaderEmulFree private_free);
25 /* get a new reference to a reader */
26 VReader *vreader_reference(VReader *reader);
27 /* "destructor" (readers are reference counted) */
28 void vreader_free(VReader *reader);
30 /* accessors */
31 VReaderEmul *vreader_get_private(VReader *);
32 VReaderStatus vreader_card_is_present(VReader *reader);
33 void vreader_queue_card_event(VReader *reader);
34 const char *vreader_get_name(VReader *reader);
35 vreader_id_t vreader_get_id(VReader *reader);
36 VReaderStatus vreader_set_id(VReader *reader, vreader_id_t id);
38 /* list operations */
39 VReaderList *vreader_get_reader_list(void);
40 void vreader_list_delete(VReaderList *list);
41 VReader *vreader_list_get_reader(VReaderListEntry *entry);
42 VReaderListEntry *vreader_list_get_first(VReaderList *list);
43 VReaderListEntry *vreader_list_get_next(VReaderListEntry *list);
44 VReader *vreader_get_reader_by_id(vreader_id_t id);
45 VReader *vreader_get_reader_by_name(const char *name);
48 * list tools for vcard_emul
50 void vreader_init(void);
51 VReaderStatus vreader_add_reader(VReader *reader);
52 VReaderStatus vreader_remove_reader(VReader *reader);
53 VReaderStatus vreader_insert_card(VReader *reader, VCard *card);
55 #endif