diff options
author | bptato <nincsnevem662@gmail.com> | 2024-05-21 18:03:14 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-05-21 18:03:14 +0200 |
commit | 0897f87797f364a28210df8bfef6f848ce543891 (patch) | |
tree | 53664e4a95e93a822e951e706c5522d10c9bfc87 /adapter/gophertypes.nim | |
parent | 9e845de83f692e70f9877eacfb83cfed43e4b9d5 (diff) | |
download | chawan-0897f87797f364a28210df8bfef6f848ce543891.tar.gz |
gopher: simplify
* update naming * do not send status code (it was always 200 anyway)
Diffstat (limited to 'adapter/gophertypes.nim')
-rw-r--r-- | adapter/gophertypes.nim | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/adapter/gophertypes.nim b/adapter/gophertypes.nim index a65b75fe..5a18b1b7 100644 --- a/adapter/gophertypes.nim +++ b/adapter/gophertypes.nim @@ -1,32 +1,32 @@ type GopherType* = enum - UNKNOWN = "unsupported" - TEXT_FILE = "text file" - ERROR = "error" - DIRECTORY = "directory" - DOS_BINARY = "DOS binary" - SEARCH = "search" - MESSAGE = "message" - SOUND = "sound" - GIF = "gif" - HTML = "HTML" - INFO = "" - IMAGE = "image" - BINARY = "binary" - PNG = "png" + gtUnknown = "unsupported" + gtTextFile = "text file" + gtError = "error" + gtDirectory = "directory" + gtDOSBinary = "DOS binary" + gtSearch = "search" + gtMessage = "message" + gtSound = "sound" + gtGif = "gif" + gtHTML = "HTML" + gtInfo = "" + gtImage = "image" + gtBinary = "binary" + gtPng = "png" func gopherType*(c: char): GopherType = return case c - of '0': TEXT_FILE - of '1': DIRECTORY - of '3': ERROR - of '5': DOS_BINARY - of '7': SEARCH - of 'm': MESSAGE - of 's': SOUND - of 'g': GIF - of 'h': HTML - of 'i': INFO - of 'I': IMAGE - of '9': BINARY - of 'p': PNG - else: UNKNOWN + of '0': gtTextFile + of '1': gtDirectory + of '3': gtError + of '5': gtDOSBinary + of '7': gtSearch + of 'm': gtMessage + of 's': gtSound + of 'g': gtGif + of 'h': gtHTML + of 'i': gtInfo + of 'I': gtImage + of '9': gtBinary + of 'p': gtPng + else: gtUnknown |