Back to index

libcitadel  8.12
xdgmimeglob.h
Go to the documentation of this file.
00001 /* -*- mode: C; c-file-style: "gnu" -*- */
00002 /* xdgmimeglob.h: Private file.  Datastructure for storing the globs.
00003  *
00004  * More info can be found at http://www.freedesktop.org/standards/
00005  *
00006  * Copyright (C) 2003  Red Hat, Inc.
00007  * Copyright (C) 2003  Jonathan Blandford <jrb@alum.mit.edu>
00008  *
00009  * Licensed under the Academic Free License version 2.0
00010  * Or under the following terms:
00011  *
00012  * This library is free software; you can redistribute it and/or
00013  * modify it under the terms of the GNU Lesser General Public
00014  * License as published by the Free Software Foundation; either
00015  * version 2 of the License, or (at your option) any later version.
00016  *
00017  * This library is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020  * Lesser General Public License for more details.
00021  *
00022  * You should have received a copy of the GNU Lesser General Public
00023  * License along with this library; if not, write to the
00024  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00025  * Boston, MA 02111-1307, USA.
00026  */
00027 
00028 #ifndef __XDG_MIME_GLOB_H__
00029 #define __XDG_MIME_GLOB_H__
00030 
00031 #include "xdgmime.h"
00032 
00033 typedef struct XdgGlobHash XdgGlobHash;
00034 
00035 typedef enum
00036 {
00037   XDG_GLOB_LITERAL, /* Makefile */
00038   XDG_GLOB_SIMPLE,  /* *.gif */
00039   XDG_GLOB_FULL     /* x*.[ch] */
00040 } XdgGlobType;
00041 
00042   
00043 #ifdef XDG_PREFIX
00044 #define _xdg_mime_glob_read_from_file         XDG_RESERVED_ENTRY(mime_glob_read_from_file)
00045 #define _xdg_glob_hash_new                    XDG_RESERVED_ENTRY(glob_hash_new)
00046 #define _xdg_glob_hash_free                   XDG_RESERVED_ENTRY(glob_hash_free)
00047 #define _xdg_glob_hash_lookup_file_name       XDG_RESERVED_ENTRY(glob_hash_lookup_file_name)
00048 #define _xdg_glob_hash_append_glob            XDG_RESERVED_ENTRY(glob_hash_append_glob)
00049 #define _xdg_glob_determine_type              XDG_RESERVED_ENTRY(glob_determine_type)
00050 #define _xdg_glob_hash_dump                   XDG_RESERVED_ENTRY(glob_hash_dump)
00051 #endif
00052 
00053 void         _xdg_mime_glob_read_from_file   (XdgGlobHash *glob_hash,
00054                                          const char  *file_name);
00055 XdgGlobHash *_xdg_glob_hash_new              (void);
00056 void         _xdg_glob_hash_free             (XdgGlobHash *glob_hash);
00057 int          _xdg_glob_hash_lookup_file_name (XdgGlobHash *glob_hash,
00058                                          const char  *text,
00059                                          const char  *mime_types[],
00060                                          int          n_mime_types);
00061 void         _xdg_glob_hash_append_glob      (XdgGlobHash *glob_hash,
00062                                          const char  *glob,
00063                                          const char  *mime_type);
00064 XdgGlobType  _xdg_glob_determine_type        (const char  *glob);
00065 void         _xdg_glob_hash_dump             (XdgGlobHash *glob_hash);
00066 
00067 #endif /* __XDG_MIME_GLOB_H__ */