2006-02-27 Gabor Kelemen <kelemeng@gnome.hu>
[beagle.git] / chooser-fu / xdgmime.h
blobe079f06557006321bbd9e866cc49e2f787665b4a
1 /* -*- mode: C; c-file-style: "gnu" -*- */
2 /* xdgmime.h: XDG Mime Spec mime resolver. Based on version 0.11 of the spec.
4 * More info can be found at http://www.freedesktop.org/standards/
5 *
6 * Copyright (C) 2003 Red Hat, Inc.
7 * Copyright (C) 2003 Jonathan Blandford <jrb@alum.mit.edu>
9 * Licensed under the Academic Free License version 2.0
10 * Or under the following terms:
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public
14 * License as published by the Free Software Foundation; either
15 * version 2 of the License, or (at your option) any later version.
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details.
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library; if not, write to the
24 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25 * Boston, MA 02111-1307, USA.
29 #ifndef __XDG_MIME_H__
30 #define __XDG_MIME_H__
32 #include <stdlib.h>
34 #ifdef __cplusplus
35 extern "C" {
36 #endif /* __cplusplus */
38 #ifdef XDG_PREFIX
39 #define XDG_ENTRY(func) _XDG_ENTRY2(XDG_PREFIX,func)
40 #define _XDG_ENTRY2(prefix,func) _XDG_ENTRY3(prefix,func)
41 #define _XDG_ENTRY3(prefix,func) prefix##_##func
42 #endif
45 #ifdef XDG_PREFIX
46 #define xdg_mime_get_mime_type_for_data XDG_ENTRY(get_mime_type_for_data)
47 #define xdg_mime_get_mime_type_for_file XDG_ENTRY(get_mime_type_for_file)
48 #define xdg_mime_get_mime_type_from_file_name XDG_ENTRY(get_mime_type_from_file_name)
49 #define xdg_mime_is_valid_mime_type XDG_ENTRY(is_valid_mime_type)
50 #define xdg_mime_get_max_buffer_extents XDG_ENTRY(get_max_buffer_extents)
51 #define xdg_mime_type_unknown XDG_ENTRY(type_unknown)
52 #endif
54 extern const char *xdg_mime_type_unknown;
55 #define XDG_MIME_TYPE_UNKNOWN xdg_mime_type_unknown
57 const char *xdg_mime_get_mime_type_for_data (const void *data,
58 size_t len);
59 const char *xdg_mime_get_mime_type_for_file (const char *file_name);
60 const char *xdg_mime_get_mime_type_from_file_name (const char *file_name);
61 int xdg_mime_is_valid_mime_type (const char *mime_type);
62 int xdg_mime_get_max_buffer_extents (void);
63 void xdg_mime_shutdown (void);
66 #ifdef __cplusplus
68 #endif /* __cplusplus */
70 #endif /* __XDG_MIME_H__ */