1/*******************************************************************************
2/
3/	File:			mime_table.h
4/
5/	Description:	Kernel mime table and matcher module API
6/
7/	Copyright 2005, Fran��ois Revol.
8/
9*******************************************************************************/
10
11#ifndef _MIME_TABLE_MODULE_H_
12#define _MIME_TABLE_MODULE_H_
13
14#include <module.h>
15
16struct ext_mime {
17	char *extension;
18	char *mime;
19};
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25/*
26	status_t get_table(struct ext_mime **table)
27		Returns the current kernel mime table.
28		You must call free_table() when finished with it.
29
30	void free_table(struct ext_mime *table)
31		Frees the given mime table;
32
33	const char * mime_for_ext(const char *ext)
34		Returns the known mime type for the given extension.
35
36	const char * ext_for_mime(const char *mime)
37		Returns the known extension for the given mime type.
38
39*/
40
41#define B_MIME_TABLE_MODULE_NAME "generic/mime_table/v1"
42
43typedef struct {
44	module_info		minfo;
45	status_t	(*get_table)(struct ext_mime **table);
46	void		(*free_table)(struct ext_mime *table);
47	const char *	(*mime_for_ext)(const char *ext);
48	const char *	(*ext_for_mime)(const char *mime);
49} mime_table_module_info;
50
51#ifdef __cplusplus
52}
53#endif
54
55#endif
56
57