Back to index

libcitadel  8.12
xdgmimecache.h
Go to the documentation of this file.
00001 /* -*- mode: C; c-file-style: "gnu" -*- */
00002 /* xdgmimecache.h: Private file.  Datastructure for mmapped caches.
00003  *
00004  * More info can be found at http://www.freedesktop.org/standards/
00005  *
00006  * Copyright (C) 2005  Matthias Clasen <mclasen@redhat.com>
00007  *
00008  * Licensed under the Academic Free License version 2.0
00009  * Or under the following terms:
00010  *
00011  * This library is free software; you can redistribute it and/or
00012  * modify it under the terms of the GNU Lesser General Public
00013  * License as published by the Free Software Foundation; either
00014  * version 2 of the License, or (at your option) any later version.
00015  *
00016  * This library is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019  * Lesser General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU Lesser General Public
00022  * License along with this library; if not, write to the
00023  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00024  * Boston, MA 02111-1307, USA.
00025  */
00026 
00027 #ifndef __XDG_MIME_CACHE_H__
00028 #define __XDG_MIME_CACHE_H__
00029 
00030 #include "xdgmime.h"
00031 
00032 typedef struct _XdgMimeCache XdgMimeCache;
00033 
00034 #ifdef XDG_PREFIX
00035 #define _xdg_mime_cache_new_from_file                XDG_RESERVED_ENTRY(mime_cache_new_from_file)
00036 #define _xdg_mime_cache_ref                          XDG_RESERVED_ENTRY(mime_cache_ref)
00037 #define _xdg_mime_cache_unref                        XDG_RESERVED_ENTRY(mime_cache_unref)
00038 #define _xdg_mime_cache_get_mime_type_for_data       XDG_RESERVED_ENTRY(mime_cache_get_mime_type_for_data)
00039 #define _xdg_mime_cache_get_mime_type_for_file       XDG_RESERVED_ENTRY(mime_cache_get_mime_type_for_file)
00040 #define _xdg_mime_cache_get_mime_type_from_file_name XDG_RESERVED_ENTRY(mime_cache_get_mime_type_from_file_name)
00041 #define _xdg_mime_cache_is_valid_mime_type           XDG_RESERVED_ENTRY(mime_cache_is_valid_mime_type)
00042 #define _xdg_mime_cache_mime_type_equal              XDG_RESERVED_ENTRY(mime_cache_mime_type_equal)
00043 #define _xdg_mime_cache_media_type_equal             XDG_RESERVED_ENTRY(mime_cache_media_type_equal)
00044 #define _xdg_mime_cache_mime_type_subclass           XDG_RESERVED_ENTRY(mime_cache_mime_type_subclass)
00045 #define _xdg_mime_cache_list_mime_parents            XDG_RESERVED_ENTRY(mime_cache_list_mime_parents)
00046 #define _xdg_mime_cache_unalias_mime_type            XDG_RESERVED_ENTRY(mime_cache_unalias_mime_type)
00047 #define _xdg_mime_cache_get_max_buffer_extents       XDG_RESERVED_ENTRY(mime_cache_get_max_buffer_extents)
00048 #define _xdg_mime_caches                             XDG_RESERVED_ENTRY(mime_caches)
00049 #endif
00050 
00051 extern XdgMimeCache **_xdg_mime_caches;
00052 
00053 XdgMimeCache *_xdg_mime_cache_new_from_file (const char   *file_name);
00054 XdgMimeCache *_xdg_mime_cache_ref           (XdgMimeCache *cache);
00055 void          _xdg_mime_cache_unref         (XdgMimeCache *cache);
00056 
00057 
00058 const char  *_xdg_mime_cache_get_mime_type_for_data       (const void *data,
00059                                                      size_t      len);
00060 const char  *_xdg_mime_cache_get_mime_type_for_file       (const char  *file_name,
00061                                                     struct stat *statbuf);
00062 const char  *_xdg_mime_cache_get_mime_type_from_file_name (const char *file_name);
00063 int          _xdg_mime_cache_is_valid_mime_type           (const char *mime_type);
00064 int          _xdg_mime_cache_mime_type_equal              (const char *mime_a,
00065                                                      const char *mime_b);
00066 int          _xdg_mime_cache_media_type_equal             (const char *mime_a,
00067                                                     const char *mime_b);
00068 int          _xdg_mime_cache_mime_type_subclass           (const char *mime_a,
00069                                                     const char *mime_b);
00070 char       **_xdg_mime_cache_list_mime_parents            (const char *mime);
00071 const char  *_xdg_mime_cache_unalias_mime_type            (const char *mime);
00072 int          _xdg_mime_cache_get_max_buffer_extents       (void);
00073 
00074 #endif /* __XDG_MIME_CACHE_H__ */