2 * gnome-vfs-mime-sniff-buffer.h
3 * Utility for implementing gnome_vfs_mime_type_from_magic, and other
4 * mime-type sniffing calls.
6 * Copyright (C) 2000 Eazel, Inc.
9 * This file is part of the Gnome Library.
11 * The Gnome Library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Library General Public License as
13 * published by the Free Software Foundation; either version 2 of the
14 * License, or (at your option) any later version.
16 * The Gnome Library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Library General Public License for more details.
21 * You should have received a copy of the GNU Library General Public
22 * License along with the Gnome Library; see the file COPYING.LIB. If not,
23 * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 * Boston, MA 02111-1307, USA.
27 #ifndef GNOME_VFS_MIME_SNIFF_BUFFER_H
28 #define GNOME_VFS_MIME_SNIFF_BUFFER_H
30 #include <libgnomevfs/gnome-vfs-handle.h>
34 typedef GnomeVFSResult (* GnomeVFSSniffBufferSeekCall)(gpointer context,
35 GnomeVFSSeekPosition whence, GnomeVFSFileOffset offset);
36 typedef GnomeVFSResult (* GnomeVFSSniffBufferReadCall)(gpointer context,
37 gpointer buffer, GnomeVFSFileSize bytes, GnomeVFSFileSize *bytes_read);
39 typedef struct GnomeVFSMimeSniffBuffer GnomeVFSMimeSniffBuffer;
41 void _gnome_vfs_mime_clear_magic_table (void);
43 GnomeVFSMimeSniffBuffer *_gnome_vfs_mime_sniff_buffer_new_from_handle
44 (GnomeVFSHandle *file);
45 GnomeVFSMimeSniffBuffer *_gnome_vfs_mime_sniff_buffer_new_from_memory
46 (const guchar *buffer,
48 GnomeVFSMimeSniffBuffer *gnome_vfs_mime_sniff_buffer_new_from_existing_data
49 (const guchar *buffer,
51 GnomeVFSMimeSniffBuffer *_gnome_vfs_mime_sniff_buffer_new_generic
52 (GnomeVFSSniffBufferSeekCall seek_callback,
53 GnomeVFSSniffBufferReadCall read_callback,
57 void gnome_vfs_mime_sniff_buffer_free
58 (GnomeVFSMimeSniffBuffer *buffer);
60 GnomeVFSResult _gnome_vfs_mime_sniff_buffer_get
61 (GnomeVFSMimeSniffBuffer *buffer,
64 const char *gnome_vfs_get_mime_type_for_buffer
65 (GnomeVFSMimeSniffBuffer *buffer);
67 gboolean _gnome_vfs_sniff_buffer_looks_like_text
68 (GnomeVFSMimeSniffBuffer *buffer);
69 gboolean _gnome_vfs_sniff_buffer_looks_like_mp3
70 (GnomeVFSMimeSniffBuffer *buffer);