You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gnucash/lib/libgsf-1.12.3/doc/html/gsf-Reading-and-Writing-fro...

540 lines
19 KiB

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Reading and Writing from local files and directories</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
<link rel="start" href="index.html" title="GSF Reference Manual">
<link rel="up" href="sources.html" title="Stream Sources">
<link rel="prev" href="gsf-Outfile-writing-structed-files.html" title="Outfile writing structed files">
<link rel="next" href="gsf-memory.html" title="memory">
<meta name="generator" content="GTK-Doc V1.4 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="part" href="into.html" title="Part&#160;I.&#160;GSF Overview">
<link rel="part" href="api.html" title="Part&#160;II.&#160;API Reference">
<link rel="chapter" href="io.html" title="Basic Input/Output">
<link rel="chapter" href="sources.html" title="Stream Sources">
<link rel="chapter" href="parsers.html" title="Stream Parsers">
<link rel="chapter" href="misc.html" title="Miscellaneous">
<link rel="index" href="ix01.html" title="Index">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
<td><a accesskey="p" href="gsf-Outfile-writing-structed-files.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="sources.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GSF Reference Manual</th>
<td><a accesskey="n" href="gsf-memory.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry" lang="en">
<a name="gsf-Reading-and-Writing-from-local-files-and-directories"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle">Reading and Writing from local files and directories</span></h2>
<p>Reading and Writing from local files and directories &#8212; </p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<a name="GsfInputStdio"></a><a name="GsfOutputStdio"></a><a name="GsfOutfileStdio"></a><a name="GsfInfileStdio"></a><pre class="synopsis">
<a href="gsf-Reading-and-Writing-from-local-files-and-directories.html#GsfInputStdio-struct">GsfInputStdio</a>;
<a href="gsf-Input-from-unstructured-files.html#GsfInput">GsfInput</a>* <a href="gsf-Reading-and-Writing-from-local-files-and-directories.html#gsf-input-stdio-new">gsf_input_stdio_new</a> (char const *filename,
GError **err);
<a href="gsf-Reading-and-Writing-from-local-files-and-directories.html#GsfOutputStdio-struct">GsfOutputStdio</a>;
<a href="gsf-Output-to-unstructured-files.html#GsfOutput">GsfOutput</a>* <a href="gsf-Reading-and-Writing-from-local-files-and-directories.html#gsf-output-stdio-new">gsf_output_stdio_new</a> (char const *filename,
GError **err);
<a href="gsf-Output-to-unstructured-files.html#GsfOutput">GsfOutput</a>* <a href="gsf-Reading-and-Writing-from-local-files-and-directories.html#gsf-output-stdio-new-full">gsf_output_stdio_new_full</a> (char const *filename,
GError **err,
char const *first_property_name,
...);
<a href="gsf-Output-to-unstructured-files.html#GsfOutput">GsfOutput</a>* <a href="gsf-Reading-and-Writing-from-local-files-and-directories.html#gsf-output-stdio-new-valist">gsf_output_stdio_new_valist</a> (char const *filename,
GError **err,
char const *first_property_name,
va_list var_args);
<a href="gsf-Output-to-unstructured-files.html#GsfOutput">GsfOutput</a>* <a href="gsf-Reading-and-Writing-from-local-files-and-directories.html#gsf-output-stdio-new-FILE">gsf_output_stdio_new_FILE</a> (char const *filename,
FILE *file,
gboolean keep_open);
<a href="gsf-Reading-and-Writing-from-local-files-and-directories.html#GsfOutfileStdio-struct">GsfOutfileStdio</a>;
<a href="gsf-Outfile-writing-structed-files.html#GsfOutfile">GsfOutfile</a>* <a href="gsf-Reading-and-Writing-from-local-files-and-directories.html#gsf-outfile-stdio-new">gsf_outfile_stdio_new</a> (char const *root,
GError **err);
<a href="gsf-Outfile-writing-structed-files.html#GsfOutfile">GsfOutfile</a>* <a href="gsf-Reading-and-Writing-from-local-files-and-directories.html#gsf-outfile-stdio-new-full">gsf_outfile_stdio_new_full</a> (char const *root,
GError **err,
char const *first_property_name,
...);
<a href="gsf-Outfile-writing-structed-files.html#GsfOutfile">GsfOutfile</a>* <a href="gsf-Reading-and-Writing-from-local-files-and-directories.html#gsf-outfile-stdio-new-valist">gsf_outfile_stdio_new_valist</a> (char const *root,
GError **err,
char const *first_property_name,
va_list var_args);
<a href="gsf-Reading-and-Writing-from-local-files-and-directories.html#GsfInfileStdio-struct">GsfInfileStdio</a>;
<a href="gsf-Infile-reading-structed-files.html#GsfInfile">GsfInfile</a>* <a href="gsf-Reading-and-Writing-from-local-files-and-directories.html#gsf-infile-stdio-new">gsf_infile_stdio_new</a> (char const *root,
GError **err);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2529211"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
GObject
+----<a href="gsf-Input-from-unstructured-files.html#GsfInput">GsfInput</a>
+----GsfInputStdio
</pre>
<pre class="synopsis">
GObject
+----<a href="gsf-Output-to-unstructured-files.html#GsfOutput">GsfOutput</a>
+----GsfOutputStdio
</pre>
<pre class="synopsis">
GObject
+----<a href="gsf-Output-to-unstructured-files.html#GsfOutput">GsfOutput</a>
+----<a href="gsf-Outfile-writing-structed-files.html#GsfOutfile">GsfOutfile</a>
+----GsfOutfileStdio
</pre>
<pre class="synopsis">
GObject
+----<a href="gsf-Input-from-unstructured-files.html#GsfInput">GsfInput</a>
+----<a href="gsf-Infile-reading-structed-files.html#GsfInfile">GsfInfile</a>
+----GsfInfileStdio
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2529312"></a><h2>Description</h2>
<p>
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2529321"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2529327"></a><h3>
<a name="GsfInputStdio-struct"></a>GsfInputStdio</h3>
<a class="indexterm" name="id2529338"></a><pre class="programlisting">typedef struct _GsfInputStdio GsfInputStdio;</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2529354"></a><h3>
<a name="gsf-input-stdio-new"></a>gsf_input_stdio_new ()</h3>
<a class="indexterm" name="id2529364"></a><pre class="programlisting"><a href="gsf-Input-from-unstructured-files.html#GsfInput">GsfInput</a>* gsf_input_stdio_new (char const *filename,
GError **err);</pre>
<p>
</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>filename</code></em>&#160;:</span></td>
<td> in utf8.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>err</code></em>&#160;:</span></td>
<td> optionally NULL.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td>a new file or NULL.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2529445"></a><h3>
<a name="GsfOutputStdio-struct"></a>GsfOutputStdio</h3>
<a class="indexterm" name="id2529457"></a><pre class="programlisting">typedef struct _GsfOutputStdio GsfOutputStdio;</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2529472"></a><h3>
<a name="gsf-output-stdio-new"></a>gsf_output_stdio_new ()</h3>
<a class="indexterm" name="id2529482"></a><pre class="programlisting"><a href="gsf-Output-to-unstructured-files.html#GsfOutput">GsfOutput</a>* gsf_output_stdio_new (char const *filename,
GError **err);</pre>
<p>
</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>filename</code></em>&#160;:</span></td>
<td> name of file to create or replace.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>err</code></em>&#160;:</span></td>
<td> optionally NULL.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td>a new file or NULL.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2529564"></a><h3>
<a name="gsf-output-stdio-new-full"></a>gsf_output_stdio_new_full ()</h3>
<a class="indexterm" name="id2529576"></a><pre class="programlisting"><a href="gsf-Output-to-unstructured-files.html#GsfOutput">GsfOutput</a>* gsf_output_stdio_new_full (char const *filename,
GError **err,
char const *first_property_name,
...);</pre>
<p>
</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>filename</code></em>&#160;:</span></td>
<td> name of file to create or replace.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>err</code></em>&#160;:</span></td>
<td> optionally NULL.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>first_property_name</code></em>&#160;:</span></td>
<td> NULL terminated list of properties
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>...</code></em>&#160;:</span></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td>a new file or NULL.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2529694"></a><h3>
<a name="gsf-output-stdio-new-valist"></a>gsf_output_stdio_new_valist ()</h3>
<a class="indexterm" name="id2529705"></a><pre class="programlisting"><a href="gsf-Output-to-unstructured-files.html#GsfOutput">GsfOutput</a>* gsf_output_stdio_new_valist (char const *filename,
GError **err,
char const *first_property_name,
va_list var_args);</pre>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>filename</code></em>&#160;:</span></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>err</code></em>&#160;:</span></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>first_property_name</code></em>&#160;:</span></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>var_args</code></em>&#160;:</span></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2529824"></a><h3>
<a name="gsf-output-stdio-new-FILE"></a>gsf_output_stdio_new_FILE ()</h3>
<a class="indexterm" name="id2529836"></a><pre class="programlisting"><a href="gsf-Output-to-unstructured-files.html#GsfOutput">GsfOutput</a>* gsf_output_stdio_new_FILE (char const *filename,
FILE *file,
gboolean keep_open);</pre>
<p>
Assumes ownership of <em class="parameter"><code>file</code></em>. If <em class="parameter"><code>keep_open</code></em> is true, ownership reverts
to caller when the GsfObject is closed.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>filename</code></em>&#160;:</span></td>
<td> The filename corresponding to <em class="parameter"><code>file</code></em>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>file</code></em>&#160;:</span></td>
<td> an existing stdio FILE *
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>keep_open</code></em>&#160;:</span></td>
<td> Should <em class="parameter"><code>file</code></em> be closed when the wrapper is closed
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td>a new GsfOutput wrapper for <em class="parameter"><code>file</code></em>. Warning: the result will be
seekable only if <em class="parameter"><code>file</code></em> is seekable. If it is seekable, the resulting
GsfOutput object will seek relative to <em class="parameter"><code>file</code></em>'s beginning, not its
current location at the time the GsfOutput object is created.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2529986"></a><h3>
<a name="GsfOutfileStdio-struct"></a>GsfOutfileStdio</h3>
<a class="indexterm" name="id2529997"></a><pre class="programlisting">typedef struct _GsfOutfileStdio GsfOutfileStdio;</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2530013"></a><h3>
<a name="gsf-outfile-stdio-new"></a>gsf_outfile_stdio_new ()</h3>
<a class="indexterm" name="id2530023"></a><pre class="programlisting"><a href="gsf-Outfile-writing-structed-files.html#GsfOutfile">GsfOutfile</a>* gsf_outfile_stdio_new (char const *root,
GError **err);</pre>
<p>
</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>root</code></em>&#160;:</span></td>
<td> root directory in utf8.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>err</code></em>&#160;:</span></td>
<td> optionally NULL.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td>a new outfile or NULL.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2530104"></a><h3>
<a name="gsf-outfile-stdio-new-full"></a>gsf_outfile_stdio_new_full ()</h3>
<a class="indexterm" name="id2530116"></a><pre class="programlisting"><a href="gsf-Outfile-writing-structed-files.html#GsfOutfile">GsfOutfile</a>* gsf_outfile_stdio_new_full (char const *root,
GError **err,
char const *first_property_name,
...);</pre>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>root</code></em>&#160;:</span></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>err</code></em>&#160;:</span></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>first_property_name</code></em>&#160;:</span></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>...</code></em>&#160;:</span></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2530228"></a><h3>
<a name="gsf-outfile-stdio-new-valist"></a>gsf_outfile_stdio_new_valist ()</h3>
<a class="indexterm" name="id2530239"></a><pre class="programlisting"><a href="gsf-Outfile-writing-structed-files.html#GsfOutfile">GsfOutfile</a>* gsf_outfile_stdio_new_valist (char const *root,
GError **err,
char const *first_property_name,
va_list var_args);</pre>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>root</code></em>&#160;:</span></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>err</code></em>&#160;:</span></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>first_property_name</code></em>&#160;:</span></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>var_args</code></em>&#160;:</span></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2530359"></a><h3>
<a name="GsfInfileStdio-struct"></a>GsfInfileStdio</h3>
<a class="indexterm" name="id2530370"></a><pre class="programlisting">typedef struct _GsfInfileStdio GsfInfileStdio;</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2530386"></a><h3>
<a name="gsf-infile-stdio-new"></a>gsf_infile_stdio_new ()</h3>
<a class="indexterm" name="id2530396"></a><pre class="programlisting"><a href="gsf-Infile-reading-structed-files.html#GsfInfile">GsfInfile</a>* gsf_infile_stdio_new (char const *root,
GError **err);</pre>
<p>
</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>root</code></em>&#160;:</span></td>
<td> in locale dependent encoding
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>err</code></em>&#160;:</span></td>
<td> optionally NULL.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td>a new file or NULL.
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle">
<td align="left"><a accesskey="p" href="gsf-Outfile-writing-structed-files.html"><b>&lt;&lt;&#160;Outfile writing structed files</b></a></td>
<td align="right"><a accesskey="n" href="gsf-memory.html"><b>memory&#160;&gt;&gt;</b></a></td>
</tr></table>
</body>
</html>