suckless-quark/config.def.h
Laslo Hunhold 6b55e36036 Introduce flag-centric usage
The config.h-interface has proven to be very effective for a lot of
suckless tools, but it just does not make too much sense for a web
server like quark.

 $ quark

If you run multiple instances of it, you want to see in the command line
(or top) what it does, and given the amount of options it's logical to
just express them as options given in the command line.
It also is a problem if you can modify quark via the config.h,
contradicting the manual. Just saying "Well, then don't touch config.h"
is also not good, as the vhost and map options were only exposed via
this interface.

What is left in config.h are mime-types and two constants relating to
the incoming HTTP-header-limits.

In order to introduce these changes, some structs and safe utility
functions were added and imported from OpenBSD respectively.
2018-03-05 00:14:25 +01:00

34 lines
904 B
C

#define HEADER_MAX 4096
#define FIELD_MAX 200
/* mime-types */
static const struct {
char *ext;
char *type;
} mimes[] = {
{ "xml", "application/xml" },
{ "xhtml", "application/xhtml+xml" },
{ "html", "text/html; charset=UTF-8" },
{ "htm", "text/html; charset=UTF-8" },
{ "css", "text/css" },
{ "txt", "text/plain" },
{ "md", "text/plain" },
{ "c", "text/plain" },
{ "h", "text/plain" },
{ "gz", "application/x-gtar" },
{ "tar", "application/tar" },
{ "pdf", "application/x-pdf" },
{ "png", "image/png" },
{ "gif", "image/gif" },
{ "jpeg", "image/jpg" },
{ "jpg", "image/jpg" },
{ "iso", "application/x-iso9660-image" },
{ "webp", "image/webp" },
{ "svg", "image/svg+xml" },
{ "flac", "audio/flac" },
{ "mp3", "audio/mpeg" },
{ "ogg", "audio/ogg" },
{ "mp4", "video/mp4" },
{ "ogv", "video/ogg" },
{ "webm", "video/webm" },
};