Browse Source

Extension data broken into parser and types, reexported at single extension module.

Marcos Dumay de Medeiros 8 years ago
parent
commit
fbe1e7fb62

+ 3 - 3
fcmtp-data.cabal

@@ -31,7 +31,7 @@ library
         Data.SMTP.Response
         Data.SMTP.Account
         Data.SMTP.Constants
-        Data.SMTP.Extensions
+        Data.SMTP.Extension
         Data.SMTP.Mime
         Data.SMTP.Resource
         Data.SMTP.ResponseCode
@@ -39,6 +39,7 @@ library
         Data.SMTP.URI
         Data.SMTP.Address
         Data.SMTP.Crypto.CP
+        Data.SMTP.Parser.Host
     exposed: True
     buildable: True
     hs-source-dirs: src
@@ -47,8 +48,7 @@ library
         OverloadedStrings
         DeriveDataTypeable
     other-modules:
-        Data.SMTP.Parser.Extensions
-        Data.SMTP.Parser.Host
+        Data.SMTP.Parser.Extension, Data.SMTP.Types.Extension
         Data.SMTP.Parser.Account Data.SMTP.Types.Account
         Data.SMTP.Types.Mime Data.SMTP.Parser.Mime
         Data.SMTP.Types.Resource Data.SMTP.Parser.Resource

+ 9 - 0
src/Data/SMTP/Extension.hs

@@ -0,0 +1,9 @@
+{-# LANGUAGE OverloadedStrings #-}
+
+module Data.SMTP.Extension (
+  module Data.SMTP.Types.Extension,
+  module Data.SMTP.Parser.Extension
+  )where
+
+import Data.SMTP.Types.Extension
+import Data.SMTP.Parser.Extension

+ 4 - 2
src/Data/SMTP/Parser/Extensions.hs → src/Data/SMTP/Parser/Extension.hs

@@ -1,9 +1,11 @@
 {-# LANGUAGE OverloadedStrings #-}
 -- Parser of mail commands
 
-module Data.SMTP.Parser.Extensions where
+module Data.SMTP.Parser.Extension (
+  parseExtension
+  ) where
 
-import Data.SMTP.Extensions
+import Data.SMTP.Types.Extension
 
 import Control.Applicative ((<|>))
 import qualified Data.Attoparsec.ByteString.Char8 as A

+ 12 - 1
src/Data/SMTP/Extensions.hs → src/Data/SMTP/Types/Extension.hs

@@ -1,6 +1,17 @@
 {-# LANGUAGE OverloadedStrings #-}
 
-module Data.SMTP.Extensions where
+module Data.SMTP.Types.Extension (
+  Extension(..),
+  ExtName(..),
+  ehloValue,
+  printExtName,
+  hasExtension,
+  getExtension,
+  getExtName,
+  SaslMethod(..),
+  saslValue,
+  readAllSasl,
+  )where
 
 import Data.List
 import Data.ByteString (ByteString)