1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
.\"Generated by db2man.xsl. Don't modify this, modify the source.
.de Sh \" Subsection
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Ip \" List item
.br
.ie \\n(.$>=3 .ne \\$3
.el .ne 3
.IP "\\$1" \\$2
..
.TH "SC_WAIT_FOR_EVENT" 3 "" "" "OpenSC API Reference"
.SH NAME
sc_wait_for_event \- Wait for an event on a smart card reader
.SH "SYNOPSIS"
.PP
.nf
#include <opensc\&.h>
int sc_wait_for_event(sc_reader_t *readers[], int slots[], size_t numslots,
unsigned int event_mask,
int *reader, unsigned int *event, int timeout);
.fi
.SH "DESCRIPTION"
.PP
This function blocks until an event occurs on any of the readers/slots specified\&. The \fIreaders\fR and \fIslots\fR fields list the readers and respective slots to be watched\&. \fInum_slots\fR holds the total number of slots passed\&. The \fIevent_mask\fR parameter specifies the types of events to wait for\&. This may be a combination of the following flags:
.TP
SC_EVENT_CARD_REMOVED
A card was removed from the reader/slot\&.
.TP
SC_EVENT_CARD_INSERTED
A card was inserted into the reader/slot\&.
.PP
On returning, the \fIreader\fR parameter holds the reader which generated an event, and \fIevent\fR holds the event flag, as in \fIevent_mask\fR\&.
.PP
The timeout parameter may be used to specify the maximum amount of time to wait for an event, in milliseconds\&. This may be set to \-1 to wait forever\&.
.SH "RETURN VALUE"
.PP
Returns 0 if successful, 1 if a timeout occurred, or a negative value in case of error\&.
|