libtelnet 0.1.0.0 → 0.1.0.1
raw patch · 9 files changed
+101/−41 lines, 9 filesdep ~basedep ~bytestringPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, bytestring
API changes (from Hackage documentation)
Files
- CHANGELOG.md +9/−0
- ChangeLog.md +0/−3
- README.md +2/−0
- libtelnet.cabal +7/−11
- src/Network/Telnet/LibTelnet.hs +31/−22
- src/Network/Telnet/LibTelnet/Ffi.hsc +13/−2
- src/Network/Telnet/LibTelnet/Iac.hsc +12/−1
- src/Network/Telnet/LibTelnet/Options.hsc +13/−1
- src/Network/Telnet/LibTelnet/Types.hsc +14/−1
+ CHANGELOG.md view
@@ -0,0 +1,9 @@+# Revision history for libtelnet++## 0.1.0.1 -- 2021-02-13++* Silence a redundant import warning. This raises the lower bound on `base`.++## 0.1.0.0 -- 2019-02-03++* First version. Released on an unsuspecting world.
− ChangeLog.md
@@ -1,3 +0,0 @@-# 0.1.0.0--* Initial release.
README.md view
@@ -1,5 +1,7 @@ # Bindings to libtelnet +[](https://builds.sr.ht/~jack/libtelnet-haskell?)+ This is a wrapper around [libtelnet](https://github.com/seanmiddleditch/libtelnet), a C library for handling Telnet streams, including option negotiation, &c. As a
libtelnet.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: libtelnet-version: 0.1.0.0+version: 0.1.0.1 synopsis: Bindings to libtelnet description: Binds https://github.com/seanmiddleditch/libtelnet , a C library for writing telnet clients and@@ -12,17 +12,13 @@ license-file: COPYING author: Jack Kelly maintainer: jack@jackkelly.name-copyright: (c) 2017-2019 Jack Kelly+copyright: (c) 2017-2021 Jack Kelly category: Network build-type: Simple-extra-source-files: COPYING, ChangeLog.md, README.md-tested-with: GHC == 8.6.3- , GHC == 8.6.1- , GHC == 8.4.4- , GHC == 8.4.3- , GHC == 8.4.2- , GHC == 8.2.2- , GHC == 8.0.2+extra-source-files: COPYING, CHANGELOG.md, README.md+tested-with: GHC == 8.10.3+ , GHC == 8.8.4+ , GHC == 8.6.5 flag example description: Build the example program@@ -37,7 +33,7 @@ , Network.Telnet.LibTelnet.Options , Network.Telnet.LibTelnet.Types ghc-options: -Wall- build-depends: base >= 4.7 && < 5+ build-depends: base >= 4.9 && < 4.16 , bytestring >= 0.10.6.0 && < 0.11 pkgconfig-depends: libtelnet default-language: Haskell2010
src/Network/Telnet/LibTelnet.hs view
@@ -5,28 +5,38 @@ {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeSynonymInstances #-} --- | Getting Started:------ 1. Skim--- <https://github.com/seanmiddleditch/libtelnet the libtelnet documentation>,--- as these bindings follow the C library's conventions quite closely.------ 2. Write an event-handling function, of type 'EventHandler'.------ 3. When you accept a new connection, create a 'Telnet' state--- tracker for it using 'telnetInit'. Options and flags are defined in--- the same way as the C library; option constants are exported from--- "Network.Telnet.LibTelnet.Options".------ 4. When you receive data (probably on a socket), tell 'Telnet'--- about it using 'telnetRecv'.------ 5. To send data, negotiate options, &c., use 'telnetSend',--- 'telnetIac', &c.------ 6. IAC (Interpret-As-Command) codes are exported from--- "Network.Telnet.LibTelnet.Iac".+{-|+Module : Network.Telnet.LibTelnet+Description : Bindings to C libtelnet+Copyright : (c) 2017-2019 Jack Kelly+License : GPL-3.0-or-later+Maintainer : jack@jackkelly.name+Stability : experimental+Portability : non-portable +Getting Started:++1. Skim+<https://github.com/seanmiddleditch/libtelnet the libtelnet documentation>,+as these bindings follow the C library's conventions quite closely.++2. Write an event-handling function, of type 'EventHandler'.++3. When you accept a new connection, create a 'Telnet' state+tracker for it using 'telnetInit'. Options and flags are defined in+the same way as the C library; option constants are exported from+"Network.Telnet.LibTelnet.Options".++4. When you receive data (probably on a socket), tell 'Telnet'+about it using 'telnetRecv'.++5. To send data, negotiate options, &c., use 'telnetSend',+'telnetIac', &c.++6. IAC (Interpret-As-Command) codes are exported from+"Network.Telnet.LibTelnet.Iac".+-}+ module Network.Telnet.LibTelnet ( telnetInit , OptionSpec(..)@@ -86,7 +96,6 @@ import Data.Foldable (traverse_) import Data.Function (on) import Data.List (groupBy)-import Data.Monoid ((<>)) import Data.Typeable (Typeable) import Foreign (ForeignPtr, Ptr, peek, peekArray, withForeignPtr) import Foreign.C.String (castCUCharToChar)
src/Network/Telnet/LibTelnet/Ffi.hsc view
@@ -1,5 +1,16 @@--- | FFI binding to @libtelnet@.+{-|+Module : Network.Telnet.LibTelnet.Ffi+Description : Low-level FFI binding+Copyright : (c) 2017-2021 Jack Kelly+License : GPL-3.0-or-later+Maintainer : jack@jackkelly.name+Stability : experimental+Portability : non-portable +FFI binding to @libtelnet@. The vast majority of these functions are+generated from @foreign import@ declarations.+-}+ module Network.Telnet.LibTelnet.Ffi where import Network.Telnet.LibTelnet.Iac (Iac(..), iacNull)@@ -159,7 +170,7 @@ -> IO () -- | Collect '[ByteString]' into a temporary array of strings in a--- 'Ptr CString', to passing to C functions.+-- 'Ptr CString', for passing to C functions. useAsCStrings :: [ByteString] -> (Ptr CString -> IO a) -> IO a useAsCStrings list f = go list [] where go [] css = withArray (reverse css) f
src/Network/Telnet/LibTelnet/Iac.hsc view
@@ -1,6 +1,17 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-} --- | Telnet interpret-as-command (IAC) codes.+{-|+Module : Network.Telnet.LibTelnet.Iac+Description : Constants for interpret-as-command (IAC) codes+Copyright : (c) 2017-2021 Jack Kelly+License : GPL-3.0-or-later+Maintainer : jack@jackkelly.name+Stability : experimental+Portability : non-portable++Telnet interpret-as-command (IAC) codes. See+<http://www.faqs.org/rfcs/rfc854.html RFC 854> for the meaning of many of these.+-} module Network.Telnet.LibTelnet.Iac ( Iac(..)
src/Network/Telnet/LibTelnet/Options.hsc view
@@ -1,6 +1,18 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-} --- | Telnet option codes.+{-|+Module : Network.Telnet.LibTelnet.Options+Description : Constants for option codes+Copyright : (c) 2017-2021 Jack Kelly+License : GPL-3.0-or-later+Maintainer : jack@jackkelly.name+Stability : experimental+Portability : non-portable++Telnet option codes. Many of these are defined in their own RFC.+<http://www.omnifarious.org/~hopper/technical/telnet-rfc.html> is a+good index of known options.+-} module Network.Telnet.LibTelnet.Options ( Option(..)
src/Network/Telnet/LibTelnet/Types.hsc view
@@ -4,7 +4,20 @@ {-# LANGUAGE MultiWayIf #-} {-# LANGUAGE RecordWildCards #-} --- | Wrapping of @libtelnet@ types.+{-|+Module : Network.Telnet.LibTelnet.Types+Description : Wrappers for @libtelnet@ types+Copyright : (c) 2017-2021 Jack Kelly+License : GPL-3.0-or-later+Maintainer : jack@jackkelly.name+Stability : experimental+Portability : non-portable++Wrappers for @libtelnet@ types, where the wrapping is simple enough to+not need its own module. Interpret-as-command codes live in+"Network.Telnet.LibTelnet.Iac", and telnet option codes live in+"Network.Telnet.LibTelnet.Options".+-} module Network.Telnet.LibTelnet.Types where