Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Address = Address String (Map String String)
- addressMethod :: Address -> String
- addressParameters :: Address -> Map String String
- address :: String -> Map String String -> Maybe Address
- validMethod :: String -> Bool
- validParams :: Map String String -> Bool
- optionallyEncoded :: [Char]
- formatAddress :: Address -> String
- formatAddresses :: [Address] -> String
- parseAddress :: String -> Maybe Address
- parseAddresses :: String -> Maybe [Address]
- parsecAddress :: Parser Address
- getSystemAddress :: IO (Maybe Address)
- getSessionAddress :: IO (Maybe Address)
- getStarterAddress :: IO (Maybe Address)
- hexToInt :: String -> Int
- maybeParseString :: Parser a -> String -> Maybe a
Documentation
When a D-Bus server must listen for connections, or a client must connect to a server, the listening socket's configuration is specified with an address. An address contains the method, which determines the protocol and transport mechanism, and parameters, which provide additional method-specific information about the address.
addressMethod :: Address -> String Source #
validMethod :: String -> Bool Source #
optionallyEncoded :: [Char] Source #
formatAddress :: Address -> String Source #
Convert an address to a string in the format expected by parseAddress
.
formatAddresses :: [Address] -> String Source #
Convert a list of addresses to a string in the format expected by
parseAddresses
.
parseAddress :: String -> Maybe Address Source #
Try to parse a string containing one valid address.
An address string is in the format method:key1=val1,key2=val2
. There
are some limitations on the characters allowed within methods and
parameters; see the D-Bus specification for full details.
parseAddresses :: String -> Maybe [Address] Source #
Try to parse a string containing one or more valid addresses.
Addresses are separated by semicolons. See parseAddress
for the format
of addresses.
getSystemAddress :: IO (Maybe Address) Source #
Returns the address in the environment variable
DBUS_SYSTEM_BUS_ADDRESS
, or
unix:path=/var/run/dbus/system_bus_socket
if DBUS_SYSTEM_BUS_ADDRESS
is not set.
Returns Nothing
if DBUS_SYSTEM_BUS_ADDRESS
contains an invalid address.
getSessionAddress :: IO (Maybe Address) Source #
Returns the first address in the environment variable
DBUS_SESSION_BUS_ADDRESS
, which must be set.
Returns Nothing
if DBUS_SYSTEM_BUS_ADDRESS
contains an invalid address
or DBUS_SESSION_BUS_ADDRESS
is unset XDG_RUNTIME_DIR
doesn't have /bus
.