Dillo v3.1.1-46-g8a360e32
Loading...
Searching...
No Matches
mime.c File Reference
#include "mime.h"
#include "../list.h"
Include dependency graph for mime.c:

Go to the source code of this file.

Functions

static int Mime_add_minor_type (const char *Key, Viewer_t Method)
 Add a specific MIME type (as "image/png") to our viewer list.
 
static int Mime_add_major_type (const char *Key, Viewer_t Method)
 Add a major MIME type (as "text") to our viewer list.
 
static Viewer_t Mime_minor_type_fetch (const char *Key, uint_t Size)
 Search the list of specific MIME viewers for a Method that matches 'Key'.
 
static Viewer_t Mime_major_type_fetch (const char *Key, uint_t Size)
 Search the list of major MIME viewers for a Method that matches 'Key'.
 
void a_Mime_init (void)
 Initializes Mime module and, sets the supported Mime types.
 
Viewer_t a_Mime_get_viewer (const char *content_type)
 Get the handler for the MIME type.
 

Variables

static int MimeMinItemsSize = 0
 
static int MimeMinItemsMax = 8
 
static MimeItem_t * MimeMinItems = NULL
 
static int MimeMajItemsSize = 0
 
static int MimeMajItemsMax = 8
 
static MimeItem_t * MimeMajItems = NULL
 

Function Documentation

◆ a_Mime_get_viewer()

Viewer_t a_Mime_get_viewer ( const char *  content_type)

Get the handler for the MIME type.

Return Value: On success: viewer On failure: NULL

Definition at line 130 of file mime.c.

References Mime_major_type_fetch(), and Mime_minor_type_fetch().

Referenced by a_Web_dispatch_by_type().

◆ a_Mime_init()

void a_Mime_init ( void  )

Initializes Mime module and, sets the supported Mime types.

Functions defined inside Mime module.

Definition at line 97 of file mime.c.

References a_Dicache_gif_image(), a_Dicache_jpeg_image(), a_Dicache_png_image(), a_Dicache_svg_image(), a_Html_text(), a_Plain_text(), Mime_add_major_type(), and Mime_add_minor_type().

Referenced by main().

◆ Mime_add_major_type()

static int Mime_add_major_type ( const char *  Key,
Viewer_t  Method 
)
static

Add a major MIME type (as "text") to our viewer list.

'Key' is the content-type string that identifies the MIME type 'Method' is the function that handles it

Definition at line 52 of file mime.c.

References a_List_add, MimeMajItems, MimeMajItemsMax, and MimeMajItemsSize.

Referenced by a_Mime_init().

◆ Mime_add_minor_type()

static int Mime_add_minor_type ( const char *  Key,
Viewer_t  Method 
)
static

Add a specific MIME type (as "image/png") to our viewer list.

'Key' is the content-type string that identifies the MIME type 'Method' is the function that handles it

Definition at line 38 of file mime.c.

References a_List_add, MimeMinItems, MimeMinItemsMax, and MimeMinItemsSize.

Referenced by a_Mime_init().

◆ Mime_major_type_fetch()

static Viewer_t Mime_major_type_fetch ( const char *  Key,
uint_t  Size 
)
static

Search the list of major MIME viewers for a Method that matches 'Key'.

'Key' is the content-type string that identifies the MIME type

Definition at line 81 of file mime.c.

References dStrnAsciiCasecmp(), MimeMajItems, and MimeMajItemsSize.

Referenced by a_Mime_get_viewer().

◆ Mime_minor_type_fetch()

static Viewer_t Mime_minor_type_fetch ( const char *  Key,
uint_t  Size 
)
static

Search the list of specific MIME viewers for a Method that matches 'Key'.

'Key' is the content-type string that identifies the MIME type

Definition at line 65 of file mime.c.

References dStrnAsciiCasecmp(), MimeMinItems, and MimeMinItemsSize.

Referenced by a_Mime_get_viewer().

Variable Documentation

◆ MimeMajItems

MimeItem_t* MimeMajItems = NULL
static

Definition at line 30 of file mime.c.

Referenced by Mime_add_major_type(), and Mime_major_type_fetch().

◆ MimeMajItemsMax

int MimeMajItemsMax = 8
static

Definition at line 29 of file mime.c.

Referenced by Mime_add_major_type().

◆ MimeMajItemsSize

int MimeMajItemsSize = 0
static

Definition at line 29 of file mime.c.

Referenced by Mime_add_major_type(), and Mime_major_type_fetch().

◆ MimeMinItems

MimeItem_t* MimeMinItems = NULL
static

Definition at line 27 of file mime.c.

Referenced by Mime_add_minor_type(), and Mime_minor_type_fetch().

◆ MimeMinItemsMax

int MimeMinItemsMax = 8
static

Definition at line 26 of file mime.c.

Referenced by Mime_add_minor_type().

◆ MimeMinItemsSize

int MimeMinItemsSize = 0
static

Definition at line 26 of file mime.c.

Referenced by Mime_add_minor_type(), and Mime_minor_type_fetch().