ftp://ftp.redhat.com/pub/redhat/linux/rawhide/SRPMS/SRPMS/gnome-vfs2-2.3.8-1.src.rpm
[gnome-vfs-httpcaptive.git] / doc / html / gnome-vfs-gnome-vfs-mime.html
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>
2 MIME typing</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.0"><meta name="generator" content="GTK-Doc V1.1 (XML mode)"><style type="text/css">
3         .synopsis, .classsynopsis {
4             background: #eeeeee;
5             border: solid 1px #aaaaaa;
6             padding: 0.5em;
7         }
8         .programlisting {
9             background: #eeeeff;
10             border: solid 1px #aaaaff;
11             padding: 0.5em;
12         }
13         .variablelist {
14             padding: 4px;
15             margin-left: 3em;
16         }
17         .navigation {
18             background: #ffeeee;
19             border: solid 1px #ffaaaa;
20             margin-top: 0.5em;
21             margin-bottom: 0.5em;
22         }
23         .navigation a {
24             color: #770000;
25         }
26         .navigation a:visited {
27             color: #550000;
28         }
29         .navigation .title {
30             font-size: 200%;
31         }
32       </style><link rel="home" href="index.html" title="GnomeVFS - Filesystem Abstraction library"><link rel="up" href="modules.html" title="Filesystem Modules"><link rel="previous" href="gnome-vfs-writing-modules.html" title="Writing Modules"><link rel="next" href="gnome-vfs-gnome-vfs-method.html" title="gnome-vfs-method"></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="gnome-vfs-writing-modules.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="modules.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">GnomeVFS - Filesystem Abstraction library</th><td><a accesskey="n" href="gnome-vfs-gnome-vfs-method.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr></table><div class="refentry" lang="en"><a name="gnome-vfs-gnome-vfs-mime"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">
33 MIME typing</span></h2><p>
34 MIME typing &#8212; </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
35
36
37
38 void        <a href="gnome-vfs-gnome-vfs-mime.html#gnome-vfs-mime-shutdown">gnome_vfs_mime_shutdown</a>         (void);
39 const char* <a href="gnome-vfs-gnome-vfs-mime.html#gnome-vfs-mime-type-from-name">gnome_vfs_mime_type_from_name</a>   (const char *filename);
40 const char* <a href="gnome-vfs-gnome-vfs-mime.html#gnome-vfs-mime-type-from-name-or-default">gnome_vfs_mime_type_from_name_or_default</a>
41                                             (const char *filename,
42                                              const char *defaultv);
43 const char* <a href="gnome-vfs-gnome-vfs-mime.html#gnome-vfs-get-mime-type-common">gnome_vfs_get_mime_type_common</a>  (GnomeVFSURI *uri);
44 const char* <a href="gnome-vfs-gnome-vfs-mime.html#gnome-vfs-get-mime-type-from-uri">gnome_vfs_get_mime_type_from_uri</a>
45                                             (GnomeVFSURI *uri);
46 const char* <a href="gnome-vfs-gnome-vfs-mime.html#gnome-vfs-get-mime-type-from-file-data">gnome_vfs_get_mime_type_from_file_data</a>
47                                             (GnomeVFSURI *uri);
48 const char* <a href="gnome-vfs-gnome-vfs-mime.html#gnome-vfs-get-file-mime-type">gnome_vfs_get_file_mime_type</a>    (const char *path,
49                                              const struct stat *optional_stat_info,
50                                              <a
51 href="../glib/glib-Basic-Types.html#gboolean"
52 >gboolean</a> suffix_only);
53 <a
54 href="../glib/glib-Basic-Types.html#gboolean"
55 >gboolean</a>    <a href="gnome-vfs-gnome-vfs-mime.html#gnome-vfs-mime-type-is-supertype">gnome_vfs_mime_type_is_supertype</a>
56                                             (const char *mime_type);
57 char*       <a href="gnome-vfs-gnome-vfs-mime.html#gnome-vfs-get-supertype-from-mime-type">gnome_vfs_get_supertype_from_mime_type</a>
58                                             (const char *mime_type);
59 </pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>
60
61 </p></div><div class="refsect1" lang="en"><h2>Details</h2><div class="refsect2" lang="en"><h3><a name="gnome-vfs-mime-shutdown"></a>gnome_vfs_mime_shutdown ()</h3><pre class="programlisting">void        gnome_vfs_mime_shutdown         (void);</pre><p>
62 Unload the MIME database from memory.</p><p>
63
64 </p></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-mime-type-from-name"></a>gnome_vfs_mime_type_from_name ()</h3><pre class="programlisting">const char* gnome_vfs_mime_type_from_name   (const char *filename);</pre><p>
65 Determined the mime type for <i class="parameter"><tt>filename</tt></i>.</p><p>
66
67 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>filename</tt></i> :</span></td><td> A filename (the file does not necessarily exist).
68 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the mime-type for this filename.
69 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-mime-type-from-name-or-default"></a>gnome_vfs_mime_type_from_name_or_default ()</h3><pre class="programlisting">const char* gnome_vfs_mime_type_from_name_or_default
70                                             (const char *filename,
71                                              const char *defaultv);</pre><p>
72 This routine tries to determine the mime-type of the filename
73 only by looking at the filename from the GNOME database of mime-types.</p><p>
74
75 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>filename</tt></i> :</span></td><td> A filename (the file does not necesarily exist).
76 </td></tr><tr><td><span class="term"><i class="parameter"><tt>defaultv</tt></i> :</span></td><td> A default value to be returned if no match is found
77 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the mime-type of the <i class="parameter"><tt>filename</tt></i>.  If no value could be
78 determined, it will return <i class="parameter"><tt>defaultv</tt></i>.
79 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-get-mime-type-common"></a>gnome_vfs_get_mime_type_common ()</h3><pre class="programlisting">const char* gnome_vfs_get_mime_type_common  (GnomeVFSURI *uri);</pre><p>
80 Tries to guess the mime type of the file represented by <i class="parameter"><tt>uir</tt></i>.
81 Favors using the file data to the <i class="parameter"><tt>uri</tt></i> extension.
82 Handles passing <i class="parameter"><tt>uri</tt></i> of a non-existent file by falling back
83 on returning a type based on the extension.
84 </p><p>
85 FIXME: This function will not necessarily return the same mime type as doing a
86 get file info on the text uri.</p><p>
87
88 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>uri</tt></i> :</span></td><td> a real file or a non-existent uri.
89 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the mime-type for this uri.
90
91 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-get-mime-type-from-uri"></a>gnome_vfs_get_mime_type_from_uri ()</h3><pre class="programlisting">const char* gnome_vfs_get_mime_type_from_uri
92                                             (GnomeVFSURI *uri);</pre><p>
93 Tries to guess the mime type of the file <i class="parameter"><tt>uri</tt></i> by
94 checking the file name extension. Works on non-existent
95 files.</p><p>
96
97 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>uri</tt></i> :</span></td><td> A file uri.
98 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the mime-type for this filename.
99 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-get-mime-type-from-file-data"></a>gnome_vfs_get_mime_type_from_file_data ()</h3><pre class="programlisting">const char* gnome_vfs_get_mime_type_from_file_data
100                                             (GnomeVFSURI *uri);</pre><p>
101 Tries to guess the mime type of the file <i class="parameter"><tt>uri</tt></i> by
102 checking the file data using the magic patterns. Does not handle text files properly</p><p>
103
104 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>uri</tt></i> :</span></td><td> A file uri.
105 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the mime-type for this filename.
106 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-get-file-mime-type"></a>gnome_vfs_get_file_mime_type ()</h3><pre class="programlisting">const char* gnome_vfs_get_file_mime_type    (const char *path,
107                                              const struct stat *optional_stat_info,
108                                              <a
109 href="../glib/glib-Basic-Types.html#gboolean"
110 >gboolean</a> suffix_only);</pre><p>
111 Tries to guess the mime type of the file represented by <i class="parameter"><tt>path</tt></i>.
112 If <i class="parameter"><tt>suffix_only</tt></i> is false, uses the mime-magic based lookup first.
113 Handles passing <i class="parameter"><tt>path</tt></i> of a non-existent file by falling back
114 on returning a type based on the extension.</p><p>
115
116 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>path</tt></i> :</span></td><td> a path of a file.
117 </td></tr><tr><td><span class="term"><i class="parameter"><tt>optional_stat_info</tt></i> :</span></td><td> optional stat buffer.
118 </td></tr><tr><td><span class="term"><i class="parameter"><tt>suffix_only</tt></i> :</span></td><td> whether or not to do a magic-based lookup.
119 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the mime-type for this path
120 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-mime-type-is-supertype"></a>gnome_vfs_mime_type_is_supertype ()</h3><pre class="programlisting"><a
121 href="../glib/glib-Basic-Types.html#gboolean"
122 >gboolean</a>    gnome_vfs_mime_type_is_supertype
123                                             (const char *mime_type);</pre><p>
124
125 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>mime_type</tt></i> :</span></td><td>
126 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>
127
128
129 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-get-supertype-from-mime-type"></a>gnome_vfs_get_supertype_from_mime_type ()</h3><pre class="programlisting">char*       gnome_vfs_get_supertype_from_mime_type
130                                             (const char *mime_type);</pre><p>
131
132 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>mime_type</tt></i> :</span></td><td>
133 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>
134
135
136 </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="gnome-vfs-writing-modules.html"><b>&lt;&lt; Writing Modules</b></a></td><td align="right"><a accesskey="n" href="gnome-vfs-gnome-vfs-method.html"><b>gnome-vfs-method &gt;&gt;</b></a></td></tr></table></body></html>