Copyright | (c) Eric Mertens 2016 |
---|---|
License | ISC |
Maintainer | emertens@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
Foreign interface to the IRC client via a simple C API and dynamically loaded modules.
- data ActiveExtension = ActiveExtension {
- aeFgn :: !FgnExtension
- aeDL :: !DL
- aeSession :: !(Ptr ())
- aeName :: !Text
- aeMajorVersion, aeMinorVersion :: !Int
- extensionSymbol :: String
- activateExtension :: Ptr () -> FilePath -> IO ActiveExtension
- deactivateExtension :: Ptr () -> ActiveExtension -> IO ()
- notifyExtensions :: Ptr () -> Text -> RawIrcMsg -> [ActiveExtension] -> IO Bool
- commandExtension :: Ptr () -> [Text] -> ActiveExtension -> IO ()
Extension type
data ActiveExtension Source #
Information about a loaded extension including the handle to the loaded shared object, and state value returned by the startup callback, and the loaded extension record.
ActiveExtension | |
|
Extension callbacks
extensionSymbol :: String Source #
The symbol that is loaded from an extension object.
Extensions are expected to export:
struct galua_extension extension;
:: Ptr () | |
-> FilePath | path to extension |
-> IO ActiveExtension |
Load the extension from the given path and call the start callback. The result of the start callback is saved to be passed to any subsequent calls into the extension.
deactivateExtension :: Ptr () -> ActiveExtension -> IO () Source #
Call the stop callback of the extension if it is defined and unload the shared object.
:: Ptr () | clientstate stable pointer |
-> Text | network |
-> RawIrcMsg | current message |
-> [ActiveExtension] | |
-> IO Bool | Return |
Call all of the process message callbacks in the list of extensions. This operation marshals the IRC message once and shares that across all of the callbacks.
:: Ptr () | client state stableptr |
-> [Text] | parameters |
-> ActiveExtension | extension to command |
-> IO () |
Notify an extension of a client command with the given parameters.