-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Parser for .netrc files -- -- This package provides a parser and a printer for so-called -- .netrc files. -- -- See netrc(5) manual page for more information about -- .netrc files. @package netrc @version 0.2.0.1 -- | Provides parser for $HOME/.netrc files -- -- The implemented grammar is approximately: -- --
--   NETRC := (WS|<comment>)* (ENTRY (WS+ <comment>*)+)* ENTRY?
--   
--   ENTRY := 'machine' WS+ <value> WS+ ((account|username|password) WS+ <value>)*
--          | 'default' WS+ (('account'|'username'|'password') WS+ <value>)*
--          | 'macdef' <value> LF (<line> LF)* LF
--   
--   WS := (LF|SPC|TAB)
--   
--   <line>  := !LF+
--   <value> := !WS+
--   <comment> := '#' !LF* LF
--   
-- -- As an extension to the .netrc-format as described in .e.g. -- netrc(5), #-style comments are tolerated. Comments are -- currently only allowed before, between, and after -- machine/default/macdef entries. Be aware -- though that such #-comment are not supported by all -- .netrc-aware applications, including ftp(1). module Network.NetRc -- | Represents (semantic) contents of a .netrc file data NetRc NetRc :: [NetRcHost] -> [NetRcMacDef] -> NetRc -- | machine/default entries -- -- Note: If it exists, the default entry ought to be the -- last entry, otherwise it can cause later entries to become invisible -- for some implementations (e.g. ftp(1)) [nrHosts] :: NetRc -> [NetRcHost] -- | Non-associated macdef entries -- -- Note: macdef entries not associated with host-entries -- are invisible to some applications (e.g. ftp(1)). [nrMacros] :: NetRc -> [NetRcMacDef] -- | machine and default entries describe remote accounts -- -- Invariant: fields must not contain any TABs, -- SPACE, or LFs. data NetRcHost NetRcHost :: !ByteString -> !ByteString -> !ByteString -> !ByteString -> [NetRcMacDef] -> NetRcHost -- | Remote machine name ("" for default-entries) [nrhName] :: NetRcHost -> !ByteString -- | login property ("" if missing) [nrhLogin] :: NetRcHost -> !ByteString -- | password property ("" if missing) [nrhPassword] :: NetRcHost -> !ByteString -- | account property ("" if missing) [nrhAccount] :: NetRcHost -> !ByteString -- | associated macdef entries [nrhMacros] :: NetRcHost -> [NetRcMacDef] -- | macdef entries defining ftp macros data NetRcMacDef NetRcMacDef :: !ByteString -> !ByteString -> NetRcMacDef -- | Name of macdef entry -- -- Invariant: must not contain any TABs, SPACE, -- or LFs [nrmName] :: NetRcMacDef -> !ByteString -- | Raw macdef body -- -- Invariant: must not contain null-lines, i.e. consecutive -- LFs [nrmBody] :: NetRcMacDef -> !ByteString -- | Construct a ByteString Builder netRcToBuilder :: NetRc -> Builder -- | Format NetRc into a ByteString -- -- This is currently just a convenience wrapper around -- netRcToBuilder netRcToByteString :: NetRc -> ByteString -- | Text.Parsec.ByteString Parser for .netrc -- grammar netRcParsec :: Parser NetRc -- | Convenience wrapper for netRcParsec parser -- -- This is basically just -- --
--   parseNetRc = parse (netRcParsec <* eof)
--   
-- -- This wrapper is mostly useful for avoiding to have to import Parsec -- modules (and to build-depend explicitly on parsec). parseNetRc :: SourceName -> ByteString -> Either ParseError NetRc -- | Reads and parses default $HOME/.netrc -- -- Returns Nothing if $HOME variable undefined and/or if -- .netrc if missing. Throws standard IO exceptions in case of -- other filesystem-errors. -- -- Note: This function performs no permission sanity-checking on -- the .netrc file readUserNetRc :: IO (Maybe (Either ParseError NetRc)) instance GHC.Generics.Generic Network.NetRc.NetRcMacDef instance Data.Data.Data Network.NetRc.NetRcMacDef instance GHC.Show.Show Network.NetRc.NetRcMacDef instance GHC.Classes.Ord Network.NetRc.NetRcMacDef instance GHC.Classes.Eq Network.NetRc.NetRcMacDef instance GHC.Generics.Generic Network.NetRc.NetRcHost instance Data.Data.Data Network.NetRc.NetRcHost instance GHC.Show.Show Network.NetRc.NetRcHost instance GHC.Classes.Ord Network.NetRc.NetRcHost instance GHC.Classes.Eq Network.NetRc.NetRcHost instance GHC.Generics.Generic Network.NetRc.NetRc instance Data.Data.Data Network.NetRc.NetRc instance GHC.Show.Show Network.NetRc.NetRc instance GHC.Classes.Ord Network.NetRc.NetRc instance GHC.Classes.Eq Network.NetRc.NetRc instance GHC.Show.Show Network.NetRc.PVal instance Control.DeepSeq.NFData Network.NetRc.NetRc instance Control.DeepSeq.NFData Network.NetRc.NetRcHost instance Control.DeepSeq.NFData Network.NetRc.NetRcMacDef