123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title><GMappedFile>: </title>
- <meta name="generator" content="DocBook XSL Stylesheets V1.79.2">
- <link rel="home" href="index.html" title="">
- <link rel="up" href="ch01.html" title="GLib">
- <link rel="prev" href="re34.html" title="<GMainLoop>">
- <link rel="next" href="re36.html" title="<%GLibMarkupCollectType>">
- <meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
- <link rel="stylesheet" href="style.css" type="text/css">
- </head>
- <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
- <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
- <td width="100%" align="left" class="shortcuts"></td>
- <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
- <td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
- <td><a accesskey="p" href="re34.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
- <td><a accesskey="n" href="re36.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
- </tr></table>
- <div class="refentry">
- <a name="id-1.1.36"></a><div class="titlepage"></div>
- <div class="refnamediv">
- <h2><GMappedFile></h2>
- <p><GMappedFile></p>
- </div>
- <div class="refsect1">
- <a name="id-1.1.36.2"></a><h2>Description</h2>
- <p>The <span class="type">GMappedFile</span> represents a file mapping created with
- <code class="function">g_mapped_file_new()</code>. It has only private members and should
- not be accessed directly.</p>
- </div>
- <div class="refsect1">
- <a name="id-1.1.36.3"></a><h2>Functions</h2>
- <div class="refsect2">
- <a name="id-1.1.36.3.2"></a><h3>free</h3>
- <div class="informalexample"><pre class="programlisting">(define-values () (mapped-file:free self))
- </pre></div>
- <p>This call existed before <span class="type">GMappedFile</span> had refcounting and is currently
- exactly the same as <code class="function">g_mapped_file_unref()</code>.</p>
- <div class="refsect3">
- <a name="id-1.1.36.3.2.4"></a><h4>Parameters</h4>
- <div class="informaltable"><table><tr>
- <td class="parameter_name"><p>file</p></td>
- <td class="parameter_description">
- <p>a <span class="type">GMappedFile</span></p>
- <p>Passed as <code class="code">self</code></p>
- </td>
- </tr></table></div>
- </div>
- </div>
- <div class="refsect2">
- <a name="id-1.1.36.3.3"></a><h3>get-bytes</h3>
- <div class="informalexample"><pre class="programlisting">(define-values (%return) (mapped-file:get-bytes self))
- </pre></div>
- <p>Creates a new <span class="type">GBytes</span> which references the data mapped from <em class="parameter"><code>file</code></em>.
- The mapped contents of the file must not be modified after creating this
- bytes object, because a <span class="type">GBytes</span> should be immutable.</p>
- <div class="refsect3">
- <a name="id-1.1.36.3.3.4"></a><h4>Parameters</h4>
- <div class="informaltable"><table><tr>
- <td class="parameter_name"><p>file</p></td>
- <td class="parameter_description">
- <p>a <span class="type">GMappedFile</span></p>
- <p>Passed as <code class="code">self</code></p>
- </td>
- </tr></table></div>
- </div>
- </div>
- <div class="refsect2">
- <a name="id-1.1.36.3.4"></a><h3>get-contents</h3>
- <div class="informalexample"><pre class="programlisting">(define-values (%return) (mapped-file:get-contents self))
- </pre></div>
- <p>Returns the contents of a <span class="type">GMappedFile</span>.
- </p>
- <p>Note that the contents may not be zero-terminated,
- even if the <span class="type">GMappedFile</span> is backed by a text file.
- </p>
- <p>If the file is empty then <code class="constant">NULL</code> is returned.</p>
- <div class="refsect3">
- <a name="id-1.1.36.3.4.6"></a><h4>Parameters</h4>
- <div class="informaltable"><table><tr>
- <td class="parameter_name"><p>file</p></td>
- <td class="parameter_description">
- <p>a <span class="type">GMappedFile</span></p>
- <p>Passed as <code class="code">self</code></p>
- </td>
- </tr></table></div>
- </div>
- </div>
- <div class="refsect2">
- <a name="id-1.1.36.3.5"></a><h3>get-length</h3>
- <div class="informalexample"><pre class="programlisting">(define-values (%return) (mapped-file:get-length self))
- </pre></div>
- <p>Returns the length of the contents of a <span class="type">GMappedFile</span>.</p>
- <div class="refsect3">
- <a name="id-1.1.36.3.5.4"></a><h4>Parameters</h4>
- <div class="informaltable"><table><tr>
- <td class="parameter_name"><p>file</p></td>
- <td class="parameter_description">
- <p>a <span class="type">GMappedFile</span></p>
- <p>Passed as <code class="code">self</code></p>
- </td>
- </tr></table></div>
- </div>
- </div>
- <div class="refsect2">
- <a name="id-1.1.36.3.6"></a><h3>ref</h3>
- <div class="informalexample"><pre class="programlisting">(define-values (%return) (mapped-file:ref self))
- </pre></div>
- <p>Increments the reference count of <em class="parameter"><code>file</code></em> by one. It is safe to call
- this function from any thread.</p>
- <div class="refsect3">
- <a name="id-1.1.36.3.6.4"></a><h4>Parameters</h4>
- <div class="informaltable"><table><tr>
- <td class="parameter_name"><p>file</p></td>
- <td class="parameter_description">
- <p>a <span class="type">GMappedFile</span></p>
- <p>Passed as <code class="code">self</code></p>
- </td>
- </tr></table></div>
- </div>
- </div>
- <div class="refsect2">
- <a name="id-1.1.36.3.7"></a><h3>unref</h3>
- <div class="informalexample"><pre class="programlisting">(define-values () (mapped-file:unref self))
- </pre></div>
- <p>Decrements the reference count of <em class="parameter"><code>file</code></em> by one. If the reference count
- drops to 0, unmaps the buffer of <em class="parameter"><code>file</code></em> and frees it.
- </p>
- <p>It is safe to call this function from any thread.
- </p>
- <p>Since 2.22</p>
- <div class="refsect3">
- <a name="id-1.1.36.3.7.6"></a><h4>Parameters</h4>
- <div class="informaltable"><table><tr>
- <td class="parameter_name"><p>file</p></td>
- <td class="parameter_description">
- <p>a <span class="type">GMappedFile</span></p>
- <p>Passed as <code class="code">self</code></p>
- </td>
- </tr></table></div>
- </div>
- </div>
- <div class="refsect2">
- <a name="id-1.1.36.3.8"></a><h3>mapped-file:new-from-fd</h3>
- <div class="informalexample"><pre class="programlisting">(define-values (%return) (mapped-file:new-from-fd fd writable))
- </pre></div>
- <p>Undocumented</p>
- <div class="refsect3">
- <a name="id-1.1.36.3.8.4"></a><h4>Parameters</h4>
- <div class="informaltable"><table>
- <tr>
- <td class="parameter_name"><p>fd</p></td>
- <td class="parameter_description">
- <p></p>
- <p>Passed as <code class="code">fd</code></p>
- </td>
- </tr>
- <tr>
- <td class="parameter_name"><p>writable</p></td>
- <td class="parameter_description">
- <p></p>
- <p>Passed as <code class="code">writable</code></p>
- </td>
- </tr>
- </table></div>
- </div>
- </div>
- <div class="refsect2">
- <a name="id-1.1.36.3.9"></a><h3>mapped-file:new</h3>
- <div class="informalexample"><pre class="programlisting">(define-values (%return) (mapped-file:new filename writable))
- </pre></div>
- <p>Undocumented</p>
- <div class="refsect3">
- <a name="id-1.1.36.3.9.4"></a><h4>Parameters</h4>
- <div class="informaltable"><table>
- <tr>
- <td class="parameter_name"><p>filename</p></td>
- <td class="parameter_description">
- <p></p>
- <p>Passed as <code class="code">filename</code></p>
- </td>
- </tr>
- <tr>
- <td class="parameter_name"><p>writable</p></td>
- <td class="parameter_description">
- <p></p>
- <p>Passed as <code class="code">writable</code></p>
- </td>
- </tr>
- </table></div>
- </div>
- </div>
- </div>
- </div>
- <div class="footer">
- <hr>Generated by GTK-Doc V1.33.1</div>
- </body>
- </html>
|