File: sc_update_binary.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 (56 lines) | stat: -rw-r--r-- 1,768 bytes parent folder | download | duplicates (2)
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
<?xml version="1.0" encoding="UTF-8"?>
<refentry id="scupdatebinary">
	<refentryinfo><title>OpenSC API Reference</title></refentryinfo>
	<refmeta>
		<refentrytitle>sc_update_binary</refentrytitle>
		<manvolnum>3</manvolnum>
		<refmiscinfo>opensc</refmiscinfo>
	</refmeta>

	<refnamediv>
		<refname>sc_update_binary</refname>
		<refpurpose>Write to an existing file</refpurpose>
	</refnamediv>

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

int sc_update_binary(struct sc_card *card, unsigned int offset,
                     const unsigned char *buf, size_t count,
                     unsigned long flags);
		</programlisting>
		</para>
	</refsect1>

	<refsect1>
		<title>Description</title>
		<para>
			This function writes <emphasis>count</emphasis> bytes from the buffer pointed to by
			<emphasis>buf</emphasis> to a transparent elementary file (EF) on <emphasis>card</emphasis>. It
			corresponds to the <link linkend="iso7816">ISO 7816</link> UPDATE BINARY function. Call <link
				linkend="scselectfile">sc_select_file()</link> first to select the file to write to.
		</para>

		<para>
			This function can only be used to write to a file region previously written to. For writing to a
			newly created file, or a new region of an existing file, use <link
				linkend="scwritebinary">sc_write_binary()</link>.
		</para>

		<para>
			The <emphasis>offset</emphasis> argument specifies the file offset in bytes. The
			<emphasis>flags</emphasis> argument is currently not used, and should be set to 0.
		</para>
	</refsect1>

	<refsect1>
		<title>Return value</title>
		<para>
			If successful, the number of bytes written is returned. Otherwise, a negative value is
			returned.
		</para>
	</refsect1>
</refentry>