commit: 2f6f70fe85e8a792ab54144071fb3af7efe0c96b
parent 0fd795873fae5853a0b14d713273b0602e1aedad
Author: Potosi <potosi@disroot.org>
Date: Tue, 9 Apr 2024 21:24:40 +0200
Added quark 5ad0df9175
Diffstat:
6 files changed, 68 insertions(+), 0 deletions(-)
diff --git a/.gitmodules b/.gitmodules
@@ -281,6 +281,9 @@
path = pkg/qbe/src
url = git://c9x.me/qbe.git
ignore = all
+[submodule "pkg/quark/src"]
+ path = pkg/quark/src
+ url = git://git.suckless.org/quark
[submodule "pkg/rc/src"]
path = pkg/rc/src
url = https://github.com/benavento/rc.git
diff --git a/pkg/gen.lua b/pkg/gen.lua
@@ -99,6 +99,7 @@ subgen 'pounce'
subgen 'pwgen'
subgen 'python'
subgen 'qbe'
+subgen 'quark'
subgen 'rc'
subgen 'samurai'
subgen 'sbase'
diff --git a/pkg/quark/config.h b/pkg/quark/config.h
@@ -0,0 +1,39 @@
+#ifndef CONFIG_H
+#define CONFIG_H
+
+#define BUFFER_SIZE 4096
+#define FIELD_MAX 200
+
+/* mime-types */
+static const struct {
+ char *ext;
+ char *type;
+} mimes[] = {
+ { "xml", "application/xml; charset=utf-8" },
+ { "xhtml", "application/xhtml+xml; charset=utf-8" },
+ { "html", "text/html; charset=utf-8" },
+ { "htm", "text/html; charset=utf-8" },
+ { "css", "text/css; charset=utf-8" },
+ { "txt", "text/plain; charset=utf-8" },
+ { "md", "text/plain; charset=utf-8" },
+ { "c", "text/plain; charset=utf-8" },
+ { "h", "text/plain; charset=utf-8" },
+ { "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; charset=utf-8" },
+ { "flac", "audio/flac" },
+ { "mp3", "audio/mpeg" },
+ { "ogg", "audio/ogg" },
+ { "mp4", "video/mp4" },
+ { "ogv", "video/ogg" },
+ { "webm", "video/webm" },
+};
+
+#endif /* CONFIG_H */
diff --git a/pkg/quark/gen.lua b/pkg/quark/gen.lua
@@ -0,0 +1,23 @@
+cflags {
+ '-std=c99', '-Wpedantic', '-Wall', '-Wextra',
+ '-D _DEFAULT_SOURCE',
+ '-D _XOPEN_SOURCE=700',
+ '-D _BSD_SOURCE',
+ '-D VERSION=0',
+ '-I $dir',
+}
+
+exe('quark', {
+ 'main.c',
+ 'connection.c',
+ 'data.c',
+ 'http.c',
+ 'queue.c',
+ 'server.c',
+ 'sock.c',
+ 'util.c',
+})
+file('bin/quark', '775', '$outdir/quark')
+man{'quark.1'}
+
+fetch 'git'
diff --git a/pkg/quark/src b/pkg/quark/src
@@ -0,0 +1 @@
+Subproject commit 5ad0df91757fbc577ffceeca633725e962da345d
diff --git a/pkg/quark/ver b/pkg/quark/ver
@@ -0,0 +1 @@
+5ad0df9175 r0