One of mailcap tests failed because of changed implementation
[elinks.git] / src / mime / mime.h
blob01524fdd51f7c05a013bc85b33c3e32effa72861
1 #ifndef EL__MIME_MIME_H
2 #define EL__MIME_MIME_H
4 #include "main/module.h"
6 struct cache_entry;
7 struct uri;
9 struct mime_handler {
10 unsigned char *description;
11 unsigned char *backend_name;
12 unsigned int ask:1;
13 unsigned int block:1;
14 unsigned int copiousoutput:1;
15 unsigned char program[1]; /* XXX: Keep last! */
18 extern struct module mime_module;
20 /* Guess content type of the document. Either from the protocol header or
21 * scanning the uri for extensions. */
22 unsigned char *get_content_type(struct cache_entry *cached);
24 /* Guess content type by looking at configurations of the given @extension */
25 unsigned char *get_extension_content_type(unsigned char *extension);
27 /* Find program to handle mimetype. The @xwin tells about X capabilities. */
28 struct mime_handler *
29 get_mime_type_handler(unsigned char *content_type, int xwin);
31 /* Extracts strictly the filename part (the crap between path and query) and
32 * adds it to the @string. Note that there are cases where the string will be
33 * empty ("") (ie. http://example.com/?crash=elinks). */
34 struct string *add_mime_filename_to_string(struct string *string, struct uri *uri);
36 #endif