File: xdgmimecache.h

package info (click to toggle)
sugar-base 0.98.0-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,968 kB
  • ctags: 532
  • sloc: sh: 11,146; ansic: 3,016; python: 483; makefile: 86
file content (63 lines) | stat: -rw-r--r-- 2,663 bytes parent folder | download | duplicates (21)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* -*- mode: C; c-file-style: "gnu" -*- */
/* xdgmimecache.h: Private file.  Datastructure for mmapped caches.
 *
 * More info can be found at http://www.freedesktop.org/standards/
 *
 * Copyright (C) 2005  Matthias Clasen <mclasen@redhat.com>
 *
 * Licensed under the Academic Free License version 2.0
 * Or under the following terms:
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#ifndef __XDG_MIME_CACHE_H__
#define __XDG_MIME_CACHE_H__

#include "xdgmime.h"

typedef struct _XdgMimeCache XdgMimeCache;

#ifdef XDG_PREFIX
#define _xdg_mime_cache_new_from_file        XDG_ENTRY(cache_new_from_file)
#define _xdg_mime_cache_ref                  XDG_ENTRY(cache_ref)
#define _xdg_mime_cache_unref                XDG_ENTRY(cache_unref)
#endif

extern XdgMimeCache **_caches;

XdgMimeCache *_xdg_mime_cache_new_from_file (const char   *file_name);
XdgMimeCache *_xdg_mime_cache_ref           (XdgMimeCache *cache);
void          _xdg_mime_cache_unref         (XdgMimeCache *cache);


const char  *_xdg_mime_cache_get_mime_type_for_data       (const void *data,
		 				           size_t      len);
const char  *_xdg_mime_cache_get_mime_type_for_file       (const char  *file_name,
							   struct stat *statbuf);
const char  *_xdg_mime_cache_get_mime_type_from_file_name (const char *file_name);
int          _xdg_mime_cache_is_valid_mime_type           (const char *mime_type);
int          _xdg_mime_cache_mime_type_equal              (const char *mime_a,
						           const char *mime_b);
int          _xdg_mime_cache_media_type_equal             (const char *mime_a,
							   const char *mime_b);
int          _xdg_mime_cache_mime_type_subclass           (const char *mime_a,
							   const char *mime_b);
char       **_xdg_mime_cache_list_mime_parents		  (const char *mime);
const char  *_xdg_mime_cache_unalias_mime_type            (const char *mime);
int          _xdg_mime_cache_get_max_buffer_extents       (void);

#endif /* __XDG_MIME_CACHE_H__ */