]> git.proxmox.com Git - qemu.git/blame - libcacard/vreader.h
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
[qemu.git] / libcacard / vreader.h
CommitLineData
111a38b0
RR
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 */
5
6#ifndef VREADER_H
7#define VREADER_H 1
8
9#include "eventt.h"
10#include "vreadert.h"
11#include "vcardt.h"
12
13/*
14 * calls for reader front end
15 */
16VReaderStatus vreader_power_on(VReader *reader, unsigned char *atr, int *len);
17VReaderStatus vreader_power_off(VReader *reader);
18VReaderStatus vreader_xfr_bytes(VReader *reader, unsigned char *send_buf,
19 int send_buf_len, unsigned char *receive_buf,
20 int *receive_buf_len);
21
22/* constructor */
23VReader *vreader_new(const char *readerName, VReaderEmul *emul_private,
24 VReaderEmulFree private_free);
25/* get a new reference to a reader */
26VReader *vreader_reference(VReader *reader);
27/* "destructor" (readers are reference counted) */
28void vreader_free(VReader *reader);
29
30/* accessors */
31VReaderEmul *vreader_get_private(VReader *);
32VReaderStatus vreader_card_is_present(VReader *reader);
33void vreader_queue_card_event(VReader *reader);
34const char *vreader_get_name(VReader *reader);
35vreader_id_t vreader_get_id(VReader *reader);
36VReaderStatus vreader_set_id(VReader *reader, vreader_id_t id);
37
38/* list operations */
39VReaderList *vreader_get_reader_list(void);
40void vreader_list_delete(VReaderList *list);
41VReader *vreader_list_get_reader(VReaderListEntry *entry);
42VReaderListEntry *vreader_list_get_first(VReaderList *list);
43VReaderListEntry *vreader_list_get_next(VReaderListEntry *list);
44VReader *vreader_get_reader_by_id(vreader_id_t id);
45VReader *vreader_get_reader_by_name(const char *name);
46
47/*
48 * list tools for vcard_emul
49 */
50void vreader_init(void);
51VReaderStatus vreader_add_reader(VReader *reader);
52VReaderStatus vreader_remove_reader(VReader *reader);
53VReaderStatus vreader_insert_card(VReader *reader, VCard *card);
54
55#endif