File: gnome-magic.h

package info (click to toggle)
gnome-libs 1.4.2-37
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 22,608 kB
  • ctags: 11,411
  • sloc: ansic: 133,185; sh: 9,463; makefile: 1,983; perl: 667; yacc: 318; awk: 285; lisp: 177
file content (47 lines) | stat: -rw-r--r-- 900 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef __GNOME_MAGIC_H__
#define __GNOME_MAGIC_H__

/*
 * Do not include this file in libgnome.h as it is of little use for
 * other applications.
 *
 * If you are only interested inthe gnome_mime_type_from_magic, see
 * the gnome-mime.h header file.
 */
BEGIN_GNOME_DECLS

/* Used internally by the magic code, exposes the parsing to users */
typedef enum {
	T_END, /* end of array */
	T_BYTE,
	T_SHORT,
	T_LONG,
	T_STR,
	T_DATE, 
	T_BESHORT,
	T_BELONG,
	T_BEDATE,
	T_LESHORT,
	T_LELONG,
	T_LEDATE
} GnomeMagicType;

typedef struct _GnomeMagicEntry {
	guint32 mask;
	GnomeMagicType type;
	guint16 offset, level;
	
	char test[48];
	guchar test_len;
	enum { CHECK_EQUAL, CHECK_LT, CHECK_GT, CHECK_AND, CHECK_XOR,
	       CHECK_ANY } comptype;
	guint32 compval;
	
	char mimetype[48];
} GnomeMagicEntry;

GnomeMagicEntry *gnome_magic_parse(const gchar *filename, gint *nents);

END_GNOME_DECLS

#endif