about summary refs log tree commit diff stats
path: root/src/config/mimetypes.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-03-18 16:32:40 +0100
committerbptato <nincsnevem662@gmail.com>2024-03-18 16:41:10 +0100
commit50ee9b03e320628b73d511c7d5ae217b07f00cce (patch)
treeaf1443a6dd310721dbf0a27d1f008a30b26f2cfa /src/config/mimetypes.nim
parentc0af45b47a78bc4d3f07d84b2e04d61e9ced75ac (diff)
downloadchawan-50ee9b03e320628b73d511c7d5ae217b07f00cce.tar.gz
config: parse mime.types/mailcap/urimethodmap inside parseConfig
Better (and simpler) than storing them all over the place.

extra: change lmDownload text to match w3m
Diffstat (limited to 'src/config/mimetypes.nim')
-rw-r--r--src/config/mimetypes.nim6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/config/mimetypes.nim b/src/config/mimetypes.nim
index 542bc267..e8a0fd07 100644
--- a/src/config/mimetypes.nim
+++ b/src/config/mimetypes.nim
@@ -4,7 +4,11 @@ import std/tables
 import utils/twtstr
 
 # extension -> type
-type MimeTypes* = Table[string, string]
+type MimeTypes* = distinct Table[string, string]
+
+proc `[]`*(mimeTypes: MimeTypes; k: string): string {.borrow.}
+proc contains*(mimeTypes: MimeTypes; k: string): bool {.borrow.}
+proc hasKeyOrPut*(mimeTypes: var MimeTypes; k, v: string): bool {.borrow.}
 
 # Add mime types found in stream to mimeTypes.
 # No error handling for now.