Copyright | (c) Eric Mertens 2016 |
---|---|
License | ISC |
Maintainer | emertens@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
Marshaling types and functions for the C API
Synopsis
- data FgnExtension = FgnExtension {
- fgnStart :: FunPtr StartExtension
- fgnStop :: FunPtr StopExtension
- fgnMessage :: FunPtr ProcessMessage
- fgnChat :: FunPtr ProcessChat
- fgnCommand :: FunPtr ProcessCommand
- fgnName :: CString
- fgnMajorVersion, fgnMinorVersion :: CInt
- type StartExtension = Ptr () -> CString -> IO (Ptr ())
- type StopExtension = Ptr () -> Ptr () -> IO ()
- type ProcessMessage = Ptr () -> Ptr () -> Ptr FgnMsg -> IO MessageResult
- type ProcessCommand = Ptr () -> Ptr () -> Ptr FgnCmd -> IO ()
- data FgnStringLen = FgnStringLen !CString !CSize
- data FgnMsg = FgnMsg {}
- data FgnCmd = FgnCmd {}
- data FgnChat = FgnChat {}
- type Dynamic a = FunPtr a -> a
- runStartExtension :: Dynamic StartExtension
- runStopExtension :: Dynamic StopExtension
- runProcessMessage :: Dynamic ProcessMessage
- runProcessCommand :: Dynamic ProcessCommand
- runProcessChat :: Dynamic ProcessChat
- newtype MessageCode = MessageCode CInt
- normalMessage :: MessageCode
- errorMessage :: MessageCode
- newtype MessageResult = MessageResult CInt
- passMessage :: MessageResult
- dropMessage :: MessageResult
- withText0 :: Text -> (CStringLen -> IO a) -> IO a
- exportText :: Ptr CString -> Ptr CSize -> Text -> IO ()
- poke' :: Storable a => Ptr a -> a -> IO ()
Extension record
data FgnExtension Source #
struct glirc_extension;
FgnExtension | |
|
Instances
Storable FgnExtension Source # | |
sizeOf :: FgnExtension -> Int # alignment :: FgnExtension -> Int # peekElemOff :: Ptr FgnExtension -> Int -> IO FgnExtension # pokeElemOff :: Ptr FgnExtension -> Int -> FgnExtension -> IO () # peekByteOff :: Ptr b -> Int -> IO FgnExtension # pokeByteOff :: Ptr b -> Int -> FgnExtension -> IO () # peek :: Ptr FgnExtension -> IO FgnExtension # poke :: Ptr FgnExtension -> FgnExtension -> IO () # |
type StartExtension Source #
typedef void *start(void *glirc, const char *path);
type StopExtension Source #
typedef void stop(void *glirc, void *S);
type ProcessMessage Source #
typedef enum process_result process_message(void *glirc, void *S, const struct glirc_message *);
type ProcessCommand Source #
typedef void process_command(void *glirc, void *S, const struct glirc_command *);
Strings
data FgnStringLen Source #
struct glirc_string
Instances
Storable FgnStringLen Source # | |
sizeOf :: FgnStringLen -> Int # alignment :: FgnStringLen -> Int # peekElemOff :: Ptr FgnStringLen -> Int -> IO FgnStringLen # pokeElemOff :: Ptr FgnStringLen -> Int -> FgnStringLen -> IO () # peekByteOff :: Ptr b -> Int -> IO FgnStringLen # pokeByteOff :: Ptr b -> Int -> FgnStringLen -> IO () # peek :: Ptr FgnStringLen -> IO FgnStringLen # poke :: Ptr FgnStringLen -> FgnStringLen -> IO () # |
Messages
struct glirc_message
FgnMsg | |
|
Commands
struct glirc_command
Chat
struct glirc_message
Function pointer calling
runProcessChat :: Dynamic ProcessChat Source #
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;
Instances
Eq MessageCode Source # | |
(==) :: MessageCode -> MessageCode -> Bool # (/=) :: MessageCode -> MessageCode -> Bool # |
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 #
Instances
Eq MessageResult Source # | |
(==) :: MessageResult -> MessageResult -> Bool # (/=) :: MessageResult -> MessageResult -> Bool # |
Marshaling helpers
withText0 :: Text -> (CStringLen -> IO a) -> IO a Source #
Marshal a text as a temporary null-terminated CStringLen