4 >MIME Type Detection</TITLE
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.64
10 TITLE="GnomeVFS - Filesystem Abstraction library"
11 HREF="index.html"><LINK
13 TITLE="MIME types & the Application Registry"
14 HREF="mime-registry.html"><LINK
16 TITLE="Magic MIME Detection"
17 HREF="gnome-vfs-mime-magic.html"><LINK
20 HREF="gnome-vfs-mime-handlers.html"></HEAD
43 >GnomeVFS - Filesystem Abstraction library</FONT
52 HREF="gnome-vfs-mime-magic.html"
57 ><<< Previous Page</B
90 HREF="mime-registry.html"
106 HREF="gnome-vfs-mime-handlers.html"
111 >Next Page >>></B
120 NAME="GNOME-VFS-MIME"
121 >MIME Type Detection</A
130 >MIME Type Detection -- detecting the mime type of a URI</DIV
132 CLASS="REFSYNOPSISDIV"
150 HREF="gnome-vfs-mime.html#GNOME-VFS-MIME-TYPE-UNKNOWN-CAPS"
151 >GNOME_VFS_MIME_TYPE_UNKNOWN</A
154 HREF="gnome-vfs-mime.html#GNOME-VFS-MIME-SHUTDOWN"
155 >gnome_vfs_mime_shutdown</A
158 HREF="gnome-vfs-mime.html#GNOME-VFS-MIME-TYPE-FROM-NAME"
159 >gnome_vfs_mime_type_from_name</A
161 HREF=../glib/glib-basic-types.html#GCHAR
162 >gchar</A> *filename);
164 HREF="gnome-vfs-mime.html#GNOME-VFS-MIME-TYPE-FROM-NAME-OR-DEFAULT"
165 >gnome_vfs_mime_type_from_name_or_default</A
168 HREF=../glib/glib-basic-types.html#GCHAR
169 >gchar</A> *filename,
171 HREF=../glib/glib-basic-types.html#GCHAR
172 >gchar</A> *defaultv);
174 HREF="gnome-vfs-mime.html#GNOME-VFS-GET-MIME-TYPE"
175 >gnome_vfs_get_mime_type</A
176 > (const char *text_uri);
178 HREF="gnome-vfs-mime.html#GNOME-VFS-GET-MIME-TYPE-FROM-URI"
179 >gnome_vfs_get_mime_type_from_uri</A
183 HREF="gnome-vfs-mime.html#GNOME-VFS-GET-MIME-TYPE-FROM-FILE-DATA"
184 >gnome_vfs_get_mime_type_from_file_data</A
188 HREF="gnome-vfs-mime.html#GNOME-VFS-GET-MIME-TYPE-FOR-DATA"
189 >gnome_vfs_get_mime_type_for_data</A
192 HREF=../glib/glib-basic-types.html#GCONSTPOINTER
193 >gconstpointer</A> data,
196 HREF="gnome-vfs-mime.html#GNOME-VFS-GET-FILE-MIME-TYPE"
197 >gnome_vfs_get_file_mime_type</A
199 const struct stat *optional_stat_info,
201 HREF=../glib/glib-basic-types.html#GBOOLEAN
202 >gboolean</A> suffix_only);
204 HREF=../glib/glib-basic-types.html#GBOOLEAN
206 HREF="gnome-vfs-mime.html#GNOME-VFS-MIME-TYPE-IS-SUPERTYPE"
207 >gnome_vfs_mime_type_is_supertype</A
209 (const char *mime_type);
211 HREF="gnome-vfs-mime.html#GNOME-VFS-GET-SUPERTYPE-FROM-MIME-TYPE"
212 >gnome_vfs_get_supertype_from_mime_type</A
214 (const char *mime_type);</PRE
243 NAME="GNOME-VFS-MIME-TYPE-UNKNOWN-CAPS"
245 >GNOME_VFS_MIME_TYPE_UNKNOWN</H3
254 CLASS="PROGRAMLISTING"
255 >#define GNOME_VFS_MIME_TYPE_UNKNOWN "application/octet-stream"</PRE
269 NAME="GNOME-VFS-MIME-SHUTDOWN"
271 >gnome_vfs_mime_shutdown ()</H3
280 CLASS="PROGRAMLISTING"
281 >void gnome_vfs_mime_shutdown (void);</PRE
295 NAME="GNOME-VFS-MIME-TYPE-FROM-NAME"
297 >gnome_vfs_mime_type_from_name ()</H3
306 CLASS="PROGRAMLISTING"
307 >const char* gnome_vfs_mime_type_from_name (const <A
308 HREF=../glib/glib-basic-types.html#GCHAR
309 >gchar</A> *filename);</PRE
314 >Determined the mime type for <TT
323 CLASS="INFORMALTABLE"
352 > A filename (the file does not necessarily exist).</TD
367 >the mime-type for this filename.</TD
382 NAME="GNOME-VFS-MIME-TYPE-FROM-NAME-OR-DEFAULT"
384 >gnome_vfs_mime_type_from_name_or_default ()</H3
393 CLASS="PROGRAMLISTING"
394 >const char* gnome_vfs_mime_type_from_name_or_default
396 HREF=../glib/glib-basic-types.html#GCHAR
397 >gchar</A> *filename,
399 HREF=../glib/glib-basic-types.html#GCHAR
400 >gchar</A> *defaultv);</PRE
405 >This routine tries to determine the mime-type of the filename
406 only by looking at the filename from the GNOME database of mime-types.</P
410 CLASS="INFORMALTABLE"
439 > A filename (the file does not necesarily exist).</TD
456 > A default value to be returned if no match is found</TD
471 >the mime-type of the <TT
476 >. If no value could be
477 determined, it will return <TT
497 NAME="GNOME-VFS-GET-MIME-TYPE"
499 >gnome_vfs_get_mime_type ()</H3
508 CLASS="PROGRAMLISTING"
509 >char* gnome_vfs_get_mime_type (const char *text_uri);</PRE
514 >Determine the mime type of <TT
519 >. The mime type is determined
520 in the same way as by <A
521 HREF="gnome-vfs-ops.html#GNOME-VFS-GET-FILE-INFO"
522 >gnome_vfs_get_file_info</A
523 >(). This is meant as
524 a convenience function for times when you only want the mime type.</P
528 CLASS="INFORMALTABLE"
557 > URI of the file for which to get the mime type</TD
572 > The mime type, or NULL if there is an error reading
588 NAME="GNOME-VFS-GET-MIME-TYPE-FROM-URI"
590 >gnome_vfs_get_mime_type_from_uri ()</H3
599 CLASS="PROGRAMLISTING"
600 >const char* gnome_vfs_get_mime_type_from_uri
601 (GnomeVFSURI *uri);</PRE
606 >Tries to guess the mime type of the file <TT
612 checking the file name extension. Works on non-existent
617 CLASS="INFORMALTABLE"
661 >the mime-type for this filename.</TD
676 NAME="GNOME-VFS-GET-MIME-TYPE-FROM-FILE-DATA"
678 >gnome_vfs_get_mime_type_from_file_data ()</H3
687 CLASS="PROGRAMLISTING"
688 >const char* gnome_vfs_get_mime_type_from_file_data
689 (GnomeVFSURI *uri);</PRE
694 >Tries to guess the mime type of the file <TT
700 checking the file data using the magic patterns. Does not handle text files properly</P
704 CLASS="INFORMALTABLE"
748 >the mime-type for this filename.</TD
763 NAME="GNOME-VFS-GET-MIME-TYPE-FOR-DATA"
765 >gnome_vfs_get_mime_type_for_data ()</H3
774 CLASS="PROGRAMLISTING"
775 >const char* gnome_vfs_get_mime_type_for_data
777 HREF=../glib/glib-basic-types.html#GCONSTPOINTER
778 >gconstpointer</A> data,
784 >Tries to guess the mime type of the data in <TT
790 using the magic patterns.</P
794 CLASS="INFORMALTABLE"
823 > A pointer to data in memory.</TD
840 > Size of the data.</TD
855 >the mime-type for this filename.</TD
870 NAME="GNOME-VFS-GET-FILE-MIME-TYPE"
872 >gnome_vfs_get_file_mime_type ()</H3
881 CLASS="PROGRAMLISTING"
882 >const char* gnome_vfs_get_file_mime_type (const char *path,
883 const struct stat *optional_stat_info,
885 HREF=../glib/glib-basic-types.html#GBOOLEAN
886 >gboolean</A> suffix_only);</PRE
891 >Tries to guess the mime type of the file represented by <TT
902 > is false, uses the mime-magic based lookup first.
908 > of a non-existent file by falling back
909 on returning a type based on the extension.</P
913 CLASS="INFORMALTABLE"
942 > a path of a file.</TD
952 >optional_stat_info</I
959 > optional stat buffer.</TD
976 > whether or not to do a magic-based lookup.</TD
991 > the mime-type for this path</TD
1006 NAME="GNOME-VFS-MIME-TYPE-IS-SUPERTYPE"
1008 >gnome_vfs_mime_type_is_supertype ()</H3
1017 CLASS="PROGRAMLISTING"
1019 HREF=../glib/glib-basic-types.html#GBOOLEAN
1020 >gboolean</A> gnome_vfs_mime_type_is_supertype
1021 (const char *mime_type);</PRE
1028 CLASS="INFORMALTABLE"
1087 NAME="GNOME-VFS-GET-SUPERTYPE-FROM-MIME-TYPE"
1089 >gnome_vfs_get_supertype_from_mime_type ()</H3
1098 CLASS="PROGRAMLISTING"
1099 >char* gnome_vfs_get_supertype_from_mime_type
1100 (const char *mime_type);</PRE
1107 CLASS="INFORMALTABLE"
1163 CLEAR="all"><BR><TABLE
1175 HREF="gnome-vfs-mime-magic.html"
1180 ><<< Previous Page</B
1213 HREF="mime-registry.html"
1229 HREF="gnome-vfs-mime-handlers.html"
1234 >Next Page >>></B
1247 >Magic MIME Detection</B