libonion
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
mime.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "types.h"
#include "mime.h"
#include "dict.h"
#include "log.h"
#include "utils.h"

Functions

void onion_mime_set (onion_dict *d)
 Sets a user set dict as mime dictThis dict maps "extension" -> "mimetype".
const char * onion_mime_get (const char *filename)
 Given a filename or extensiton, it returns the proper mime type.If onion_mime_set was called before, it is used, else it reads mime types /etc/mime.types.
void onion_mime_update (const char *extension, const char *mimetype)
 Allow to update mime types.User can add new mime types, or remove (if mimetype == NULL).