File: sc_wait_for_event.xml

package info (click to toggle)
opensc 0.11.1-2etch2
  • links: PTS
  • area: main
  • in suites: etch
  • size: 7,284 kB
  • ctags: 7,257
  • sloc: ansic: 69,499; sh: 9,480; xml: 4,191; makefile: 346; lex: 92; perl: 25
file content (71 lines) | stat: -rw-r--r-- 2,223 bytes parent folder | download | duplicates (4)
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
64
65
66
67
68
69
70
71
<?xml version="1.0" encoding="UTF-8"?>
<refentry id="scwaitforevent">
	<refentryinfo><title>OpenSC API Reference</title></refentryinfo>
	<refmeta>
		<refentrytitle>sc_wait_for_event</refentrytitle>
		<manvolnum>3</manvolnum>
		<refmiscinfo>opensc</refmiscinfo>
	</refmeta>

	<refnamediv>
		<refname>sc_wait_for_event</refname>
		<refpurpose>Wait for an event on a smart card reader</refpurpose>
	</refnamediv>

	<refsect1>
		<title>Synopsis</title>
		<para>
		<programlisting>
#include &lt;opensc.h&gt;

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);
		</programlisting>
		</para>
	</refsect1>

	<refsect1>
		<title>Description</title>
		<para>
			This function blocks until an event occurs on any of the
			readers/slots specified. The <emphasis>readers</emphasis> and <emphasis>slots</emphasis>
			fields list the readers and
			respective slots to be watched. <emphasis>num_slots</emphasis>
			holds the total number of slots passed. The <emphasis>event_mask</emphasis>
			parameter specifies the types of events to wait for. This may be a
			combination of the following flags:
			<variablelist>
				<varlistentry>
					<term><symbol>SC_EVENT_CARD_REMOVED</symbol></term>
					<listitem><para>A card was removed from the reader/slot.</para></listitem>
				</varlistentry>
				<varlistentry>
					<term><symbol>SC_EVENT_CARD_INSERTED</symbol></term>
					<listitem><para>A card was inserted into the reader/slot.</para></listitem>
				</varlistentry>
			</variablelist>
		</para>

		<para>
			On returning, the <emphasis>reader</emphasis> parameter holds the
			reader which generated an event, and <emphasis>event</emphasis> holds
			the event flag, as in <emphasis>event_mask</emphasis>.
		</para>

		<para>
			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.
		</para>
	</refsect1>

	<refsect1>
		<title>Return value</title>
		<para>
			Returns 0 if successful, 1 if a timeout occurred, or a negative
			value in case of error.
		</para>
	</refsect1>

</refentry>