1 | /* |
---|
2 | * gnome-vfs-mime-sniff-buffer.h |
---|
3 | * Utility for implementing gnome_vfs_mime_type_from_magic, and other |
---|
4 | * mime-type sniffing calls. |
---|
5 | * |
---|
6 | * Copyright (C) 2000 Eazel, Inc. |
---|
7 | * All rights reserved. |
---|
8 | * |
---|
9 | * This file is part of the Gnome Library. |
---|
10 | * |
---|
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. |
---|
15 | * |
---|
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. |
---|
20 | * |
---|
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. |
---|
25 | */ |
---|
26 | |
---|
27 | #ifndef GNOME_VFS_MIME_SNIFF_BUFFER_H |
---|
28 | #define GNOME_VFS_MIME_SNIFF_BUFFER_H |
---|
29 | |
---|
30 | #include <libgnomevfs/gnome-vfs-handle.h> |
---|
31 | |
---|
32 | typedef GnomeVFSResult (* GnomeVFSSniffBufferSeekCall)(gpointer context, |
---|
33 | GnomeVFSSeekPosition whence, GnomeVFSFileOffset offset); |
---|
34 | typedef GnomeVFSResult (* GnomeVFSSniffBufferReadCall)(gpointer context, |
---|
35 | gpointer buffer, GnomeVFSFileSize bytes, GnomeVFSFileSize *bytes_read); |
---|
36 | |
---|
37 | typedef struct GnomeVFSMimeSniffBuffer GnomeVFSMimeSniffBuffer; |
---|
38 | |
---|
39 | void gnome_vfs_mime_clear_magic_table (void); |
---|
40 | |
---|
41 | GnomeVFSMimeSniffBuffer *gnome_vfs_mime_sniff_buffer_new_from_handle |
---|
42 | (GnomeVFSHandle *file); |
---|
43 | GnomeVFSMimeSniffBuffer *gnome_vfs_mime_sniff_buffer_new_from_memory |
---|
44 | (const guchar *buffer, |
---|
45 | gssize buffer_size); |
---|
46 | GnomeVFSMimeSniffBuffer *gnome_vfs_mime_sniff_buffer_new_from_existing_data |
---|
47 | (const guchar *buffer, |
---|
48 | gssize buffer_size); |
---|
49 | GnomeVFSMimeSniffBuffer *gnome_vfs_mime_sniff_buffer_new_generic |
---|
50 | (GnomeVFSSniffBufferSeekCall seek_callback, |
---|
51 | GnomeVFSSniffBufferReadCall read_callback, |
---|
52 | gpointer context); |
---|
53 | |
---|
54 | |
---|
55 | void gnome_vfs_mime_sniff_buffer_free |
---|
56 | (GnomeVFSMimeSniffBuffer *buffer); |
---|
57 | |
---|
58 | GnomeVFSResult gnome_vfs_mime_sniff_buffer_get |
---|
59 | (GnomeVFSMimeSniffBuffer *buffer, |
---|
60 | gssize size); |
---|
61 | |
---|
62 | const char *gnome_vfs_get_mime_type_for_buffer |
---|
63 | (GnomeVFSMimeSniffBuffer *buffer); |
---|
64 | |
---|
65 | gboolean gnome_vfs_sniff_buffer_looks_like_text |
---|
66 | (GnomeVFSMimeSniffBuffer *buffer); |
---|
67 | gboolean gnome_vfs_sniff_buffer_looks_like_mp3 |
---|
68 | (GnomeVFSMimeSniffBuffer *buffer); |
---|
69 | gboolean gnome_vfs_sniff_buffer_looks_like_gzip |
---|
70 | (GnomeVFSMimeSniffBuffer *sniff_buffer, |
---|
71 | const char *file_name); |
---|
72 | |
---|
73 | #endif |
---|