glirc-2.26: Console IRC client

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

Client.CApi.Types

Contents

Description

Marshaling types and functions for the C API

Synopsis

Extension record

data FgnExtension Source #

struct glirc_extension;

Constructors

FgnExtension 

Fields

type StartExtension Source #

Arguments

 = Ptr ()

api token

-> CString

path to extension

-> IO (Ptr ())

initialized extension state

typedef void *start(void *glirc, const char *path);

type StopExtension Source #

Arguments

 = Ptr ()

api token

-> Ptr ()

extension state

-> IO () 
typedef void stop(void *glirc, void *S);

type ProcessMessage Source #

Arguments

 = Ptr ()

api token

-> Ptr ()

extention state

-> Ptr FgnMsg

message to send

-> IO MessageResult 
typedef enum process_result process_message(void *glirc, void *S, const struct glirc_message *);

type ProcessCommand Source #

Arguments

 = Ptr ()

api token

-> Ptr ()

extension state

-> Ptr FgnCmd

command

-> IO () 
typedef void process_command(void *glirc, void *S, const struct glirc_command *);

Strings

Messages

data FgnMsg Source #

struct glirc_message
Instances
Storable FgnMsg Source # 
Instance details

Commands

data FgnCmd Source #

struct glirc_command

Constructors

FgnCmd 
Instances
Storable FgnCmd Source # 
Instance details

Chat

data FgnChat Source #

struct glirc_message
Instances
Storable FgnChat Source # 
Instance details

Function pointer calling

type Dynamic a = FunPtr a -> a Source #

Type of dynamic function pointer wrappers.

report message codes

newtype MessageCode Source #

Tag for describing the kind of message to display in the client as used in glirc_print.

enum message_code;

Constructors

MessageCode CInt 
Instances
Eq MessageCode Source # 
Instance details

errorMessage :: MessageCode Source #

Result used to determine what to do after processing a message with the ProcessMessage callback.

enum process_result;

process message results

newtype MessageResult Source #

Constructors

MessageResult CInt 
Instances
Eq MessageResult Source # 
Instance details

Marshaling helpers

withText0 :: Text -> (CStringLen -> IO a) -> IO a Source #

Marshal a text as a temporary null-terminated CStringLen

exportText :: Ptr CString -> Ptr CSize -> Text -> IO () Source #

Marshal a text as a malloced null-terminated CStringLen

poke' :: Storable a => Ptr a -> a -> IO () Source #

Like poke except it doesn't write to NULL