ftp://ftp.redhat.com/pub/redhat/linux/rawhide/SRPMS/SRPMS/gnome-vfs2-2.3.8-1.src.rpm
[gnome-vfs-httpcaptive.git] / libgnomevfs / gnome-vfs-mime-magic.h
1 #ifndef GNOME_VFS_MIME_MAGIC_H
2 #define GNOME_VFS_MIME_MAGIC_H
3
4 #include <glib/gtypes.h>
5
6 G_BEGIN_DECLS
7
8 /* Used internally by the magic code, exposes the parsing to users */
9 typedef enum {
10         T_END, /* end of array */
11         T_BYTE,
12         T_SHORT,
13         T_LONG,
14         T_STR,
15         T_DATE, 
16         T_BESHORT,
17         T_BELONG,
18         T_BEDATE,
19         T_LESHORT,
20         T_LELONG,
21         T_LEDATE
22 } GnomeMagicType;
23
24 typedef struct _GnomeMagicEntry {
25         GnomeMagicType type;
26         guint16 range_start, range_end;
27         
28         guint16 pattern_length;
29         gboolean use_mask;
30         char pattern [48];
31         char mask [48];
32         
33         char mimetype[48];
34 } GnomeMagicEntry;
35
36 GnomeMagicEntry *_gnome_vfs_mime_magic_parse          (const gchar *filename,
37                                                       gint        *nents);
38
39 /* testing calls */
40 GnomeMagicEntry *gnome_vfs_mime_test_get_magic_table (const char  *table_path);
41 void             gnome_vfs_mime_dump_magic_table     (void);
42
43 G_END_DECLS
44
45 #endif