78 |
78 |
79 illegalName :: B.ByteString -> Bool |
79 illegalName :: B.ByteString -> Bool |
80 illegalName = all isSpace . B.unpack |
80 illegalName = all isSpace . B.unpack |
81 |
81 |
82 protoNumber2ver :: Word16 -> B.ByteString |
82 protoNumber2ver :: Word16 -> B.ByteString |
83 protoNumber2ver 17 = "0.9.7-dev" |
83 protoNumber2ver v = Map.findWithDefault "Unknown" v vermap |
84 protoNumber2ver 19 = "0.9.7" |
84 where |
85 protoNumber2ver 20 = "0.9.8-dev" |
85 vermap = Map.fromList [ |
86 protoNumber2ver 21 = "0.9.8" |
86 (17, "0.9.7-dev"), |
87 protoNumber2ver 22 = "0.9.9-dev" |
87 (19, "0.9.7"), |
88 protoNumber2ver 23 = "0.9.9" |
88 (20, "0.9.8-dev"), |
89 protoNumber2ver 24 = "0.9.10-dev" |
89 (21, "0.9.8"), |
90 protoNumber2ver 25 = "0.9.10" |
90 (22, "0.9.9-dev"), |
91 protoNumber2ver 26 = "0.9.11-dev" |
91 (23, "0.9.9"), |
92 protoNumber2ver 27 = "0.9.11" |
92 (24, "0.9.10-dev"), |
93 protoNumber2ver 28 = "0.9.12-dev" |
93 (25, "0.9.10"), |
94 protoNumber2ver 29 = "0.9.12" |
94 (26, "0.9.11-dev"), |
95 protoNumber2ver 30 = "0.9.13-dev" |
95 (27, "0.9.11"), |
96 protoNumber2ver 31 = "0.9.13" |
96 (28, "0.9.12-dev"), |
97 protoNumber2ver 32 = "0.9.14-dev" |
97 (29, "0.9.12"), |
98 protoNumber2ver 33 = "0.9.14" |
98 (30, "0.9.13-dev"), |
99 protoNumber2ver 34 = "0.9.15-dev" |
99 (31, "0.9.13"), |
100 protoNumber2ver 35 = "0.9.14.1" |
100 (32, "0.9.14-dev"), |
101 protoNumber2ver _ = "Unknown" |
101 (33, "0.9.14"), |
|
102 (34, "0.9.15-dev"), |
|
103 (35, "0.9.14.1"), |
|
104 (37, "0.9.15"), |
|
105 (38, "0.9.15-dev")] |
102 |
106 |
103 askFromConsole :: String -> IO String |
107 askFromConsole :: String -> IO String |
104 askFromConsole msg = do |
108 askFromConsole msg = do |
105 putStr msg |
109 putStr msg |
106 hFlush stdout |
110 hFlush stdout |