diff options
author | bptato <nincsnevem662@gmail.com> | 2024-03-18 16:32:40 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-03-18 16:41:10 +0100 |
commit | 50ee9b03e320628b73d511c7d5ae217b07f00cce (patch) | |
tree | af1443a6dd310721dbf0a27d1f008a30b26f2cfa /src/config/mimetypes.nim | |
parent | c0af45b47a78bc4d3f07d84b2e04d61e9ced75ac (diff) | |
download | chawan-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.nim | 6 |
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. |