BEAST/BSE - Better Audio System and Sound Engine  0.8.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
gslmagic.hh
Go to the documentation of this file.
00001  // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
00002 #ifndef __GSL_MAGIC_H__
00003 #define __GSL_MAGIC_H__
00004 
00005 #include <bse/gsldefs.hh>
00006 
00007 
00008 #ifdef __cplusplus
00009 extern "C" {
00010 #endif /* __cplusplus */
00011 
00012 
00013 
00014 /* --- structures --- */
00015 typedef struct _GslRealMagic GslRealMagic;
00016 struct _GslMagic
00017 {
00018   gpointer data;
00019   gchar   *extension;
00020 
00021   /*< private >*/
00022   gint          priority;
00023   GslRealMagic *match_list;
00024 };
00025 
00026 
00027 /* match entity with:
00028  * prefix,
00029  * extension,
00030  * magic_spec
00031  *
00032  * where prefix has absolute preference, and extension is just
00033  * a _hint_ for magic_spec match order, unless magic_spec==NULL
00034  *
00035  * no prefix for save handlers. (?) just extension matches.
00036  *
00037  * need pre-parse functionality, to figure name and type of a
00038  * file's contents.
00039  */
00040 
00041 
00042 /* --- prototypes --- */
00043 GslMagic*       gsl_magic_create                (gpointer        data,
00044                                                  gint            priority,
00045                                                  const gchar    *extension,
00046                                                  const gchar    *magic_spec);
00047 GslMagic*       gsl_magic_list_match_file       (SfiRing        *magic_list,
00048                                                  const gchar    *file_name);
00049 GslMagic*       gsl_magic_list_match_file_skip  (SfiRing        *magic_list,
00050                                                  const gchar    *file_name,
00051                                                  guint           skip_bytes);
00052 void            gsl_magic_list_brute_match      (SfiRing        *magic_list,
00053                                                  const gchar    *file_name,
00054                                                  guint           skip_bytes,
00055                                                  GslMagic       *skip_magic,
00056                                                  SfiRing       **ext_matches,
00057                                                  SfiRing       **other_matches);
00058 
00059 #ifdef __cplusplus
00060 }
00061 #endif /* __cplusplus */
00062 
00063 #endif /* __GSL_MAGIC_H__ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines