BEAST/BSE - Better Audio System and Sound Engine  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
gslmagic.hh
Go to the documentation of this file.
1  // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
2 #ifndef __GSL_MAGIC_H__
3 #define __GSL_MAGIC_H__
4 
5 #include <bse/gsldefs.hh>
6 
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif /* __cplusplus */
11 
12 
13 
14 /* --- structures --- */
15 typedef struct _GslRealMagic GslRealMagic;
16 struct _GslMagic
17 {
18  gpointer data;
19  gchar *extension;
20 
21  /*< private >*/
22  gint priority;
23  GslRealMagic *match_list;
24 };
25 
26 
27 /* match entity with:
28  * prefix,
29  * extension,
30  * magic_spec
31  *
32  * where prefix has absolute preference, and extension is just
33  * a _hint_ for magic_spec match order, unless magic_spec==NULL
34  *
35  * no prefix for save handlers. (?) just extension matches.
36  *
37  * need pre-parse functionality, to figure name and type of a
38  * file's contents.
39  */
40 
41 
42 /* --- prototypes --- */
43 GslMagic* gsl_magic_create (gpointer data,
44  gint priority,
45  const gchar *extension,
46  const gchar *magic_spec);
47 GslMagic* gsl_magic_list_match_file (SfiRing *magic_list,
48  const gchar *file_name);
49 GslMagic* gsl_magic_list_match_file_skip (SfiRing *magic_list,
50  const gchar *file_name,
51  guint skip_bytes);
52 void gsl_magic_list_brute_match (SfiRing *magic_list,
53  const gchar *file_name,
54  guint skip_bytes,
55  GslMagic *skip_magic,
56  SfiRing **ext_matches,
57  SfiRing **other_matches);
58 
59 #ifdef __cplusplus
60 }
61 #endif /* __cplusplus */
62 
63 #endif /* __GSL_MAGIC_H__ */
Definition: sfiring.hh:23
Definition: gslmagic.hh:16