⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.10
Server IP:
157.245.101.34
Server:
Linux skvinfotech-website 5.4.0-131-generic #147-Ubuntu SMP Fri Oct 14 17:07:22 UTC 2022 x86_64
Server Software:
Apache/2.4.41 (Ubuntu)
PHP Version:
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
proc
/
self
/
root
/
usr
/
share
/
doc
/
libglib2.0-doc
/
gio
/
View File Name :
gio-GContentType.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>GContentType: GIO Reference Manual</title> <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> <link rel="home" href="index.html" title="GIO Reference Manual"> <link rel="up" href="types.html" title="File types and applications"> <link rel="prev" href="types.html" title="File types and applications"> <link rel="next" href="GAppInfo.html" title="GAppInfo"> <meta name="generator" content="GTK-Doc V1.32 (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"> <a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span> <a href="#gio-GContentType.description" class="shortcut">Description</a></span> </td> <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td> <td><a accesskey="u" href="types.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> <td><a accesskey="p" href="types.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> <td><a accesskey="n" href="GAppInfo.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> </tr></table> <div class="refentry"> <a name="gio-GContentType"></a><div class="titlepage"></div> <div class="refnamediv"><table width="100%"><tr> <td valign="top"> <h2><span class="refentrytitle"><a name="gio-GContentType.top_of_page"></a>GContentType</span></h2> <p>GContentType — Platform-specific content typing</p> </td> <td class="gallery_image" valign="top" align="right"></td> </tr></table></div> <div class="refsect1"> <a name="gio-GContentType.functions"></a><h2>Functions</h2> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="functions_proto_type"> <col class="functions_proto_name"> </colgroup> <tbody> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="gio-GContentType.html#g-content-type-equals" title="g_content_type_equals ()">g_content_type_equals</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="gio-GContentType.html#g-content-type-is-a" title="g_content_type_is_a ()">g_content_type_is_a</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="gio-GContentType.html#g-content-type-is-mime-type" title="g_content_type_is_mime_type ()">g_content_type_is_mime_type</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="gio-GContentType.html#g-content-type-is-unknown" title="g_content_type_is_unknown ()">g_content_type_is_unknown</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gchar</span> * </td> <td class="function_name"> <a class="link" href="gio-GContentType.html#g-content-type-get-description" title="g_content_type_get_description ()">g_content_type_get_description</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gchar</span> * </td> <td class="function_name"> <a class="link" href="gio-GContentType.html#g-content-type-get-mime-type" title="g_content_type_get_mime_type ()">g_content_type_get_mime_type</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GIcon.html" title="GIcon"><span class="returnvalue">GIcon</span></a> * </td> <td class="function_name"> <a class="link" href="gio-GContentType.html#g-content-type-get-icon" title="g_content_type_get_icon ()">g_content_type_get_icon</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GIcon.html" title="GIcon"><span class="returnvalue">GIcon</span></a> * </td> <td class="function_name"> <a class="link" href="gio-GContentType.html#g-content-type-get-symbolic-icon" title="g_content_type_get_symbolic_icon ()">g_content_type_get_symbolic_icon</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gchar</span> * </td> <td class="function_name"> <a class="link" href="gio-GContentType.html#g-content-type-get-generic-icon-name" title="g_content_type_get_generic_icon_name ()">g_content_type_get_generic_icon_name</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="gio-GContentType.html#g-content-type-can-be-executable" title="g_content_type_can_be_executable ()">g_content_type_can_be_executable</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gchar</span> * </td> <td class="function_name"> <a class="link" href="gio-GContentType.html#g-content-type-from-mime-type" title="g_content_type_from_mime_type ()">g_content_type_from_mime_type</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gchar</span> * </td> <td class="function_name"> <a class="link" href="gio-GContentType.html#g-content-type-guess" title="g_content_type_guess ()">g_content_type_guess</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gchar</span> ** </td> <td class="function_name"> <a class="link" href="gio-GContentType.html#g-content-type-guess-for-tree" title="g_content_type_guess_for_tree ()">g_content_type_guess_for_tree</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">GList</span> * </td> <td class="function_name"> <a class="link" href="gio-GContentType.html#g-content-types-get-registered" title="g_content_types_get_registered ()">g_content_types_get_registered</a> <span class="c_punctuation">()</span> </td> </tr> </tbody> </table></div> </div> <div class="refsect1"> <a name="gio-GContentType.includes"></a><h2>Includes</h2> <pre class="synopsis">#include <gio/gio.h> </pre> </div> <div class="refsect1"> <a name="gio-GContentType.description"></a><h2>Description</h2> <p>A content type is a platform specific string that defines the type of a file. On UNIX it is a <a class="ulink" href="http://www.wikipedia.org/wiki/Internet_media_type" target="_top">MIME type</a> like <code class="literal">text/plain</code> or <code class="literal">image/png</code>. On Win32 it is an extension string like <code class="literal">.doc</code>, <code class="literal">.txt</code> or a perceived string like <code class="literal">audio</code>. Such strings can be looked up in the registry at <code class="literal">HKEY_CLASSES_ROOT</code>. On macOS it is a <a class="ulink" href="https://en.wikipedia.org/wiki/Uniform_Type_Identifier" target="_top">Uniform Type Identifier</a> such as <code class="literal">com.apple.application</code>.</p> </div> <div class="refsect1"> <a name="gio-GContentType.functions_details"></a><h2>Functions</h2> <div class="refsect2"> <a name="g-content-type-equals"></a><h3>g_content_type_equals ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_content_type_equals (<em class="parameter"><code>const <span class="type">gchar</span> *type1</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *type2</code></em>);</pre> <p>Compares two content types for equality.</p> <div class="refsect3"> <a name="g-content-type-equals.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>type1</p></td> <td class="parameter_description"><p>a content type string</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>type2</p></td> <td class="parameter_description"><p>a content type string</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-content-type-equals.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the two strings are identical or equivalent, <code class="literal">FALSE</code> otherwise.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-content-type-is-a"></a><h3>g_content_type_is_a ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_content_type_is_a (<em class="parameter"><code>const <span class="type">gchar</span> *type</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *supertype</code></em>);</pre> <p>Determines if <em class="parameter"><code>type</code></em> is a subset of <em class="parameter"><code>supertype</code></em> .</p> <div class="refsect3"> <a name="g-content-type-is-a.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>type</p></td> <td class="parameter_description"><p>a content type string</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>supertype</p></td> <td class="parameter_description"><p>a content type string</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-content-type-is-a.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if <em class="parameter"><code>type</code></em> is a kind of <em class="parameter"><code>supertype</code></em> , <code class="literal">FALSE</code> otherwise.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-content-type-is-mime-type"></a><h3>g_content_type_is_mime_type ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_content_type_is_mime_type (<em class="parameter"><code>const <span class="type">gchar</span> *type</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *mime_type</code></em>);</pre> <p>Determines if <em class="parameter"><code>type</code></em> is a subset of <em class="parameter"><code>mime_type</code></em> . Convenience wrapper around <a class="link" href="gio-GContentType.html#g-content-type-is-a" title="g_content_type_is_a ()"><code class="function">g_content_type_is_a()</code></a>.</p> <div class="refsect3"> <a name="g-content-type-is-mime-type.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>type</p></td> <td class="parameter_description"><p>a content type string</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>mime_type</p></td> <td class="parameter_description"><p>a mime type string</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-content-type-is-mime-type.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if <em class="parameter"><code>type</code></em> is a kind of <em class="parameter"><code>mime_type</code></em> , <code class="literal">FALSE</code> otherwise.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-52.html#api-index-2.52">2.52</a></p> </div> <hr> <div class="refsect2"> <a name="g-content-type-is-unknown"></a><h3>g_content_type_is_unknown ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_content_type_is_unknown (<em class="parameter"><code>const <span class="type">gchar</span> *type</code></em>);</pre> <p>Checks if the content type is the generic "unknown" type. On UNIX this is the "application/octet-stream" mimetype, while on win32 it is "*" and on OSX it is a dynamic type or octet-stream.</p> <div class="refsect3"> <a name="g-content-type-is-unknown.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>type</p></td> <td class="parameter_description"><p>a content type string</p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-content-type-is-unknown.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the type is the unknown type.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-content-type-get-description"></a><h3>g_content_type_get_description ()</h3> <pre class="programlisting"><span class="returnvalue">gchar</span> * g_content_type_get_description (<em class="parameter"><code>const <span class="type">gchar</span> *type</code></em>);</pre> <p>Gets the human readable description of the content type.</p> <div class="refsect3"> <a name="g-content-type-get-description.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>type</p></td> <td class="parameter_description"><p>a content type string</p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-content-type-get-description.returns"></a><h4>Returns</h4> <p> a short description of the content type <em class="parameter"><code>type</code></em> . Free the returned string with <code class="function">g_free()</code></p> </div> </div> <hr> <div class="refsect2"> <a name="g-content-type-get-mime-type"></a><h3>g_content_type_get_mime_type ()</h3> <pre class="programlisting"><span class="returnvalue">gchar</span> * g_content_type_get_mime_type (<em class="parameter"><code>const <span class="type">gchar</span> *type</code></em>);</pre> <p>Gets the mime type for the content type, if one is registered.</p> <div class="refsect3"> <a name="g-content-type-get-mime-type.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>type</p></td> <td class="parameter_description"><p>a content type string</p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-content-type-get-mime-type.returns"></a><h4>Returns</h4> <p>the registered mime type for the given <em class="parameter"><code>type</code></em> , or <code class="literal">NULL</code> if unknown; free with <code class="function">g_free()</code>. </p> <p><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-content-type-get-icon"></a><h3>g_content_type_get_icon ()</h3> <pre class="programlisting"><a class="link" href="GIcon.html" title="GIcon"><span class="returnvalue">GIcon</span></a> * g_content_type_get_icon (<em class="parameter"><code>const <span class="type">gchar</span> *type</code></em>);</pre> <p>Gets the icon for a content type.</p> <div class="refsect3"> <a name="g-content-type-get-icon.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>type</p></td> <td class="parameter_description"><p>a content type string</p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-content-type-get-icon.returns"></a><h4>Returns</h4> <p><a class="link" href="GIcon.html" title="GIcon"><span class="type">GIcon</span></a> corresponding to the content type. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-content-type-get-symbolic-icon"></a><h3>g_content_type_get_symbolic_icon ()</h3> <pre class="programlisting"><a class="link" href="GIcon.html" title="GIcon"><span class="returnvalue">GIcon</span></a> * g_content_type_get_symbolic_icon (<em class="parameter"><code>const <span class="type">gchar</span> *type</code></em>);</pre> <p>Gets the symbolic icon for a content type.</p> <div class="refsect3"> <a name="g-content-type-get-symbolic-icon.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>type</p></td> <td class="parameter_description"><p>a content type string</p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-content-type-get-symbolic-icon.returns"></a><h4>Returns</h4> <p>symbolic <a class="link" href="GIcon.html" title="GIcon"><span class="type">GIcon</span></a> corresponding to the content type. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-2-34.html#api-index-2.34">2.34</a></p> </div> <hr> <div class="refsect2"> <a name="g-content-type-get-generic-icon-name"></a><h3>g_content_type_get_generic_icon_name ()</h3> <pre class="programlisting"><span class="returnvalue">gchar</span> * g_content_type_get_generic_icon_name (<em class="parameter"><code>const <span class="type">gchar</span> *type</code></em>);</pre> <p>Gets the generic icon name for a content type.</p> <p>See the <a class="ulink" href="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec" target="_top">shared-mime-info</a> specification for more on the generic icon name.</p> <div class="refsect3"> <a name="g-content-type-get-generic-icon-name.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>type</p></td> <td class="parameter_description"><p>a content type string</p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-content-type-get-generic-icon-name.returns"></a><h4>Returns</h4> <p>the registered generic icon name for the given <em class="parameter"><code>type</code></em> , or <code class="literal">NULL</code> if unknown. Free with <code class="function">g_free()</code>. </p> <p><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-2-34.html#api-index-2.34">2.34</a></p> </div> <hr> <div class="refsect2"> <a name="g-content-type-can-be-executable"></a><h3>g_content_type_can_be_executable ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_content_type_can_be_executable (<em class="parameter"><code>const <span class="type">gchar</span> *type</code></em>);</pre> <p>Checks if a content type can be executable. Note that for instance things like text files can be executables (i.e. scripts and batch files).</p> <div class="refsect3"> <a name="g-content-type-can-be-executable.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>type</p></td> <td class="parameter_description"><p>a content type string</p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-content-type-can-be-executable.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the file type corresponds to a type that can be executable, <code class="literal">FALSE</code> otherwise.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-content-type-from-mime-type"></a><h3>g_content_type_from_mime_type ()</h3> <pre class="programlisting"><span class="returnvalue">gchar</span> * g_content_type_from_mime_type (<em class="parameter"><code>const <span class="type">gchar</span> *mime_type</code></em>);</pre> <p>Tries to find a content type based on the mime type name.</p> <div class="refsect3"> <a name="g-content-type-from-mime-type.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>mime_type</p></td> <td class="parameter_description"><p>a mime type string</p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-content-type-from-mime-type.returns"></a><h4>Returns</h4> <p>Newly allocated string with content type or <code class="literal">NULL</code>. Free with <code class="function">g_free()</code>. </p> <p><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-2-18.html#api-index-2.18">2.18</a></p> </div> <hr> <div class="refsect2"> <a name="g-content-type-guess"></a><h3>g_content_type_guess ()</h3> <pre class="programlisting"><span class="returnvalue">gchar</span> * g_content_type_guess (<em class="parameter"><code>const <span class="type">gchar</span> *filename</code></em>, <em class="parameter"><code>const <span class="type">guchar</span> *data</code></em>, <em class="parameter"><code><span class="type">gsize</span> data_size</code></em>, <em class="parameter"><code><span class="type">gboolean</span> *result_uncertain</code></em>);</pre> <p>Guesses the content type based on example data. If the function is uncertain, <em class="parameter"><code>result_uncertain</code></em> will be set to <code class="literal">TRUE</code>. Either <em class="parameter"><code>filename</code></em> or <em class="parameter"><code>data</code></em> may be <code class="literal">NULL</code>, in which case the guess will be based solely on the other argument.</p> <div class="refsect3"> <a name="g-content-type-guess.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>filename</p></td> <td class="parameter_description"><p>a string, or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>data</p></td> <td class="parameter_description"><p>a stream of data, or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>][<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=data_size]</span></td> </tr> <tr> <td class="parameter_name"><p>data_size</p></td> <td class="parameter_description"><p>the size of <em class="parameter"><code>data</code></em> </p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>result_uncertain</p></td> <td class="parameter_description"><p>return location for the certainty of the result, or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-content-type-guess.returns"></a><h4>Returns</h4> <p> a string indicating a guessed content type for the given data. Free with <code class="function">g_free()</code></p> </div> </div> <hr> <div class="refsect2"> <a name="g-content-type-guess-for-tree"></a><h3>g_content_type_guess_for_tree ()</h3> <pre class="programlisting"><span class="returnvalue">gchar</span> ** g_content_type_guess_for_tree (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *root</code></em>);</pre> <p>Tries to guess the type of the tree with root <em class="parameter"><code>root</code></em> , by looking at the files it contains. The result is an array of content types, with the best guess coming first.</p> <p>The types returned all have the form x-content/foo, e.g. x-content/audio-cdda (for audio CDs) or x-content/image-dcf (for a camera memory card). See the <a class="ulink" href="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec" target="_top">shared-mime-info</a> specification for more on x-content types.</p> <p>This function is useful in the implementation of <a class="link" href="GMount.html#g-mount-guess-content-type" title="g_mount_guess_content_type ()"><code class="function">g_mount_guess_content_type()</code></a>.</p> <div class="refsect3"> <a name="g-content-type-guess-for-tree.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>root</p></td> <td class="parameter_description"><p>the root of the tree to guess a type for</p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-content-type-guess-for-tree.returns"></a><h4>Returns</h4> <p>an <code class="literal">NULL</code>-terminated array of zero or more content types. Free with <code class="function">g_strfreev()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> zero-terminated=1]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-2-18.html#api-index-2.18">2.18</a></p> </div> <hr> <div class="refsect2"> <a name="g-content-types-get-registered"></a><h3>g_content_types_get_registered ()</h3> <pre class="programlisting"><span class="returnvalue">GList</span> * g_content_types_get_registered (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> <p>Gets a list of strings containing all the registered content types known to the system. The list and its data should be freed using <code class="literal">g_list_free_full (list, g_free)</code>.</p> <div class="refsect3"> <a name="g-content-types-get-registered.returns"></a><h4>Returns</h4> <p>list of the registered content types. </p> <p><span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> utf8][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> </div> </div> <div class="footer"> <hr>Generated by GTK-Doc V1.32</div> </body> </html>