Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
n_http_mime.c File Reference

Media type of a file from its extension (see n_http_mime.h). More...

#include "nilorea/n_http_mime.h"
#include <string.h>
Include dependency graph for n_http_mime.c:

Go to the source code of this file.

Functions

int n_http_mime_table_check (void)
 check that the built-in table is sorted, as its lookup requires
const char * n_http_mime_type (const char *path, size_t len)
 media type for a path or file name, from its extension

Variables

struct { 
const char * ext
const char * type
} _mime_table []

Detailed Description

Media type of a file from its extension (see n_http_mime.h).

Author
Castagnier Mickael
Version
1.0
Date
2026

Definition in file n_http_mime.c.

Variable Documentation

◆ [struct]

const struct { ... } _mime_table[]
Initial value:
= {
{"7z", "application/x-7z-compressed"},
{"apk", "application/vnd.android.package-archive"},
{"avif", "image/avif"},
{"bmp", "image/bmp"},
{"css", "text/css"},
{"csv", "text/csv"},
{"data", "application/octet-stream"},
{"deb", "application/vnd.debian.binary-package"},
{"exe", "application/vnd.microsoft.portable-executable"},
{"gif", "image/gif"},
{"gz", "application/gzip"},
{"htm", "text/html"},
{"html", "text/html"},
{"ico", "image/vnd.microsoft.icon"},
{"jpeg", "image/jpeg"},
{"jpg", "image/jpeg"},
{"js", "text/javascript"},
{"json", "application/json"},
{"map", "application/json"},
{"md", "text/markdown"},
{"md5", "text/plain"},
{"mjs", "text/javascript"},
{"mp3", "audio/mpeg"},
{"mp4", "video/mp4"},
{"oga", "audio/ogg"},
{"ogg", "audio/ogg"},
{"ogv", "video/ogg"},
{"otf", "font/otf"},
{"pdf", "application/pdf"},
{"png", "image/png"},
{"rss", "application/rss+xml"},
{"svg", "image/svg+xml"},
{"tar", "application/x-tar"},
{"ttf", "font/ttf"},
{"txt", "text/plain"},
{"wasm", "application/wasm"},
{"wav", "audio/wav"},
{"webm", "video/webm"},
{"webmanifest", "application/manifest+json"},
{"webp", "image/webp"},
{"woff", "font/woff"},
{"woff2", "font/woff2"},
{"xml", "application/xml"},
{"zip", "application/zip"},
}

Referenced by n_http_mime_table_check(), and n_http_mime_type().