Mercurial > audlegacy
annotate src/audacious/mime.c @ 3121:3b6d316f8b09 trunk
GPL3 relicensing.
author | William Pitcock <nenolod@atheme-project.org> |
---|---|
date | Fri, 20 Jul 2007 08:59:47 -0500 |
parents | 02a62ac3d9c2 |
children | f1c756f39e6c |
rev | line source |
---|---|
3009 | 1 /* |
2 * Audacious | |
3 * Copyright (c) 2007 William Pitcock | |
4 * | |
5 * This program is free software; you can redistribute it and/or modify | |
6 * it under the terms of the GNU General Public License as published by | |
3121
3b6d316f8b09
GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents:
3015
diff
changeset
|
7 * the Free Software Foundation; under version 3 of the License. |
3009 | 8 * |
9 * This program is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 * GNU General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU General Public License | |
3121
3b6d316f8b09
GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents:
3015
diff
changeset
|
15 * along with this program. If not, see <http://www.gnu.org/licenses>. |
3009 | 16 */ |
17 | |
18 #include "mime.h" | |
19 | |
20 mowgli_dictionary_t *mime_type_dict = NULL; | |
21 | |
22 void mime_set_plugin(const gchar *mimetype, InputPlugin *ip) | |
23 { | |
24 g_return_if_fail(mimetype != NULL); | |
25 g_return_if_fail(ip != NULL); | |
26 | |
27 if (mime_type_dict == NULL) | |
28 mime_type_dict = mowgli_dictionary_create(strcasecmp); | |
29 | |
30 mowgli_dictionary_add(mime_type_dict, mimetype, ip); | |
31 } | |
32 | |
33 InputPlugin *mime_get_plugin(const gchar *mimetype) | |
34 { | |
3015
02a62ac3d9c2
Handle metadata sources where there are no mimetype support yet implemented.
William Pitcock <nenolod@atheme-project.org>
parents:
3009
diff
changeset
|
35 if (mimetype == NULL) |
02a62ac3d9c2
Handle metadata sources where there are no mimetype support yet implemented.
William Pitcock <nenolod@atheme-project.org>
parents:
3009
diff
changeset
|
36 return NULL; |
02a62ac3d9c2
Handle metadata sources where there are no mimetype support yet implemented.
William Pitcock <nenolod@atheme-project.org>
parents:
3009
diff
changeset
|
37 |
3009 | 38 if (mime_type_dict == NULL) |
39 return NULL; | |
40 | |
41 return mowgli_dictionary_retrieve(mime_type_dict, mimetype); | |
42 } |