opensc/doc/api/types/sc_file_t.xml

99 lines
3.6 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<refentry id="scfilet">
<refentryinfo><title>OpenSC API Reference</title></refentryinfo>
<refmeta>
<refentrytitle>sc_file_t</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>opensc</refmiscinfo>
</refmeta>
<refnamediv>
<refname>sc_file_t</refname>
<refpurpose>OpenSC file structure</refpurpose>
</refnamediv>
<refsect1>
<title>Synopsis</title>
<para>
<programlisting>
#include &lt;opensc.h&gt;
typedef struct sc_file {
struct sc_path path;
int type, ef_structure;
size_t size;
int id;
/* record structured files only */
int record_length;
int record_count;
} sc_file_t;
</programlisting>
</para>
</refsect1>
<refsect1>
<title>Description</title>
<para>
This structure describes a file object on a smart card. It contains the following members:
<variablelist>
<varlistentry>
<term><structfield>path</structfield></term>
<listitem><para>This is full the path to the file, starting at the MF.</para></listitem>
</varlistentry>
<varlistentry>
<term><structfield>type</structfield></term>
<listitem><para>This is the file type. It can be one of <symbol>SC_FILE_TYPE_DF</symbol>,
<symbol>SC_FILE_TYPE_WORKING_EF</symbol>, or <symbol>SC_FILE_TYPE_INTERNAL_EF</symbol>.
The latter is used by some cards only, and you normally shouldn't have to deal with these
files.</para></listitem>
</varlistentry>
<varlistentry>
<term><structfield>ef_structure</structfield></term>
<listitem><para>For elementary files (EFs), this field describes the file's structure.
It can be one of:
<simplelist type="vert" columns="1">
<member>SC_FILE_EF_TRANSPARENT</member>
<member>SC_FILE_EF_LINEAR_FIXED</member>
<member>SC_FILE_EF_LINEAR_FIXED_TLV</member>
<member>SC_FILE_EF_LINEAR_VARIABLE</member>
<member>SC_FILE_EF_LINEAR_VARIABLE_TLV</member>
<member>SC_FILE_EF_CYCLIC</member>
<member>SC_FILE_EF_CYCLIC_TLV</member>
<member>SC_FILE_EF_UNKNOWN</member>
</simplelist>
</para></listitem>
</varlistentry>
<varlistentry>
<term><structfield>size</structfield></term>
<listitem><para>gives the file's size in bytes.</para></listitem>
</varlistentry>
<varlistentry>
<term><structfield>id</structfield></term>
<listitem><para>gives the file's ID, as a 16-bit number.</para></listitem>
</varlistentry>
<varlistentry>
<term><structfield>record_count, record_length</structfield></term>
<listitem><para>For record structured files, <structfield>record_sount</structfield>
specifies the number of records in the file. For files with fixed length records,
<structfield>record_length</structfield> contains the record length.</para></listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
</refentry>