glirc-2.16: Console IRC client

Copyright(c) Eric Mertens, 2016
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellNone
LanguageHaskell2010

Client.CApi

Contents

Description

Foreign interface to the IRC client via a simple C API and dynamically loaded modules.

Synopsis

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.

Constructors

ActiveExtension 

Fields

Extension callbacks

extensionSymbol :: String Source #

The symbol that is loaded from an extension object.

Extensions are expected to export:

struct galua_extension extension;

activateExtension Source #

Arguments

:: 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.

notifyExtensions Source #

Arguments

:: Ptr ()

clientstate stable pointer

-> Text

network

-> RawIrcMsg

current message

-> [ActiveExtension] 
-> IO Bool

Return True to pass message

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.

commandExtension Source #

Arguments

:: Ptr ()

client state stableptr

-> [Text]

parameters

-> ActiveExtension

extension to command

-> IO () 

Notify an extension of a client command with the given parameters.