ELinks 0.18.0
mime.c File Reference
#include <string.h>
#include "elinks.h"
#include "cache/cache.h"
#include "config/options.h"
#include "encoding/encoding.h"
#include "intl/libintl.h"
#include "main/module.h"
#include "mime/backend/common.h"
#include "mime/mime.h"
#include "protocol/header.h"
#include "protocol/uri.h"
#include "util/conv.h"
#include "util/file.h"
#include "util/memory.h"
#include "util/string.h"
#include "mime/backend/default.h"
#include "mime/backend/dgi.h"
#include "mime/backend/mailcap.h"
#include "mime/backend/mimetypes.h"
Include dependency graph for mime.c:

Macros

#define _GNU_SOURCE   /* XXX: we _WANT_ strcasestr() ! */
 
#define get_opt_mime(which)   mime_options[(which)].option
 
#define get_default_mime_type()   get_opt_mime(MIME_DEFAULT_TYPE).value.string
 
#define debug_get_content_type_params(cached)
 
#define debug_ctype(ctype__)
 
#define debug_extension(extension__)
 

Enumerations

enum  mime_options { MIME_TREE , MIME_DEFAULT_TYPE , MIME_OPTIONS }
 

Functions

static char * get_content_filename (struct uri *uri, struct cache_entry *cached)
 
static char * check_extension_type (char *extension)
 
static char * check_encoding_type (char *extension)
 
char * get_extension_content_type (char *extension)
 
char * get_cache_header_content_type (struct cache_entry *cached)
 
static char * get_fragment_content_type (struct cache_entry *cached)
 
char * get_content_type (struct cache_entry *cached)
 
struct mime_handlerget_mime_type_handler (char *content_type, int xwin)
 
struct stringadd_mime_filename_to_string (struct string *string, struct uri *uri)
 

Variables

static union option_info mime_options []
 
static struct modulemime_submodules []
 
struct module mime_module
 

Macro Definition Documentation

◆ _GNU_SOURCE

#define _GNU_SOURCE   /* XXX: we _WANT_ strcasestr() ! */

◆ debug_ctype

#define debug_ctype ( ctype__)

◆ debug_extension

#define debug_extension ( extension__)

◆ debug_get_content_type_params

#define debug_get_content_type_params ( cached)

◆ get_default_mime_type

#define get_default_mime_type ( )    get_opt_mime(MIME_DEFAULT_TYPE).value.string

◆ get_opt_mime

#define get_opt_mime ( which)    mime_options[(which)].option

Enumeration Type Documentation

◆ mime_options

Enumerator
MIME_TREE 
MIME_DEFAULT_TYPE 
MIME_OPTIONS 

Function Documentation

◆ add_mime_filename_to_string()

struct string * add_mime_filename_to_string ( struct string * string,
struct uri * uri )

◆ check_encoding_type()

static char * check_encoding_type ( char * extension)
inlinestatic

◆ check_extension_type()

static char * check_extension_type ( char * extension)
inlinestatic

◆ get_cache_header_content_type()

char * get_cache_header_content_type ( struct cache_entry * cached)

◆ get_content_filename()

static char * get_content_filename ( struct uri * uri,
struct cache_entry * cached )
static

◆ get_content_type()

char * get_content_type ( struct cache_entry * cached)

◆ get_extension_content_type()

char * get_extension_content_type ( char * extension)

◆ get_fragment_content_type()

static char * get_fragment_content_type ( struct cache_entry * cached)
static

◆ get_mime_type_handler()

struct mime_handler * get_mime_type_handler ( char * content_type,
int xwin )

Variable Documentation

◆ mime_module

struct module mime_module
Initial value:
N_("MIME"),
)
#define NULL
Definition explodename.c:35
#define N_(msg)
Definition libintl.h:25
static struct module * mime_submodules[]
Definition mime.c:355
mime_options
Definition mime.c:30
#define struct_module(name, options, hooks, submods, data, init, done, getname)
Definition module.h:47

◆ mime_options

union option_info mime_options[]
static
Initial value:
= {
INIT_OPT_TREE("", N_("MIME"),
"mime", OPT_SORT,
N_("MIME-related options (handlers of various MIME types).")),
INIT_OPT_STRING("mime", N_("Default MIME-type"),
"default_type", OPT_ZERO, DEFAULT_MIME_TYPE,
N_("Document MIME-type to assume by default "
"(when we are unable to guess it properly "
"from known information about the document).")),
NULL_OPTION_INFO,
}
@ OPT_SORT
For OPT_TREE, automatically sort the content of the tree alphabetically (but all subtrees in front of...
Definition options.h:93
@ OPT_ZERO
Definition options.h:23
#define DEFAULT_MIME_TYPE
Definition setup.h:92

◆ mime_submodules

struct module* mime_submodules[]
static
Initial value:
= {
}
struct module default_mime_module
Definition default.c:220