~singpolyma/gsasl-haskell

79e0ffaab24540313ae0bf6ee54d1a71bf146063 — John Millikin 12 years ago 5fad93a haskell-gsasl_0.3.4
Minor cleanups. Remove maximum version of "transformers" dependency.
2 files changed, 20 insertions(+), 25 deletions(-)

M gsasl.cabal
M lib/Network/Protocol/SASL/GNU.hs
M gsasl.cabal => gsasl.cabal +4 -4
@@ 1,5 1,5 @@
name: gsasl
version: 0.3.3
version: 0.3.4
license: GPL-3
license-file: license.txt
author: John Millikin <jmillikin@gmail.com>


@@ 11,7 11,7 @@ stability: experimental
homepage: https://john-millikin.com/software/haskell-gsasl/
bug-reports: mailto:jmillikin@gmail.com

synopsis: Bindings for GNU SASL
synopsis: Bindings for GNU libgsasl
description:

source-repository head


@@ 21,7 21,7 @@ source-repository head
source-repository this
  type: bazaar
  location: https://john-millikin.com/branches/haskell-gsasl/0.3/
  tag: haskell-gsasl_0.3.3
  tag: haskell-gsasl_0.3.4

library
  ghc-options: -Wall -O2


@@ 30,7 30,7 @@ library

  build-depends:
      base >= 4.0 && < 5.0
    , transformers >= 0.2 && < 0.3
    , transformers >= 0.2
    , bytestring >= 0.9 && < 0.10

  pkgconfig-depends: libgsasl >= 1.1

M lib/Network/Protocol/SASL/GNU.hs => lib/Network/Protocol/SASL/GNU.hs +16 -21
@@ 1,22 1,21 @@
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE ForeignFunctionInterface #-}

-- Copyright (C) 2010 John Millikin <jmillikin@gmail.com>
-- 
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- any later version.
-- 
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU General Public License for more details.
-- 
--
-- You should have received a copy of the GNU General Public License
-- along with this program.  If not, see <http://www.gnu.org/licenses/>.

{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE CPP #-}
module Network.Protocol.SASL.GNU
	(
	-- * Library Information


@@ 77,20 76,20 @@ module Network.Protocol.SASL.GNU

-- Imports {{{

import Prelude hiding (catch)
import           Prelude hiding (catch)
import qualified Control.Exception as E
import           Control.Monad (when, unless)
import           Control.Monad.IO.Class (MonadIO, liftIO)
import qualified Control.Monad.Trans.Reader as R
import qualified Data.ByteString as B
import qualified Data.ByteString.Unsafe as B
import Data.ByteString.Char8 ()
import Data.Char (isDigit)
import Data.Typeable (Typeable)
import Data.String (IsString, fromString)
import qualified Data.ByteString.Char8 as Char8
import           Data.Char (isDigit)
import           Data.String (IsString, fromString)
import           Data.Typeable (Typeable)
import qualified Foreign as F
import qualified Foreign.C as F
import System.IO.Unsafe (unsafePerformIO)
import Control.Monad (when, unless)
import Control.Monad.IO.Class (MonadIO, liftIO)
import qualified Control.Monad.Trans.Reader as R
import           System.IO.Unsafe (unsafePerformIO)
import qualified Text.ParserCombinators.ReadP as P

-- }}}


@@ 125,13 124,9 @@ libraryVersion = io where
			Just version -> version
			Nothing -> error $ "Invalid version string: " ++ show maybeStr
	
#if MIN_VERSION_base(4,2,0)
	eof = P.eof
#else
	eof = do
		s <- P.look
		unless (null s) P.pfail
#endif

-- | Whether the header and library versions are compatible
checkVersion :: IO Bool


@@ 208,7 203,7 @@ clientSupports (Mechanism name) = do
-- no supported 'Mechanism' is found).
clientSuggestMechanism :: [Mechanism] -> SASL (Maybe Mechanism)
clientSuggestMechanism mechs = do
	let bytes = B.intercalate " " [x | Mechanism x <- mechs]
	let bytes = B.intercalate (Char8.pack " ") [x | Mechanism x <- mechs]
	ctx <- getContext
	liftIO $ B.useAsCString bytes $ \pMechlist ->
		gsasl_client_suggest_mechanism ctx pMechlist >>=