toxcore-c-0.2.12: Haskell bindings to the C reference implementation of Tox
Safe HaskellNone
LanguageHaskell2010

Network.Tox.C.Options

Synopsis

Documentation

data Options Source #

Instances

Instances details
Eq Options Source # 
Instance details

Defined in Network.Tox.C.Options

Methods

(==) :: Options -> Options -> Bool #

(/=) :: Options -> Options -> Bool #

Read Options Source # 
Instance details

Defined in Network.Tox.C.Options

Show Options Source # 
Instance details

Defined in Network.Tox.C.Options

Generic Options Source # 
Instance details

Defined in Network.Tox.C.Options

Associated Types

type Rep Options :: Type -> Type #

Methods

from :: Options -> Rep Options x #

to :: Rep Options x -> Options #

type Rep Options Source # 
Instance details

Defined in Network.Tox.C.Options

data ErrOptionsNew Source #

Constructors

ErrOptionsNewMalloc 

Instances

Instances details
Bounded ErrOptionsNew Source # 
Instance details

Defined in Network.Tox.C.Options

Enum ErrOptionsNew Source # 
Instance details

Defined in Network.Tox.C.Options

Eq ErrOptionsNew Source # 
Instance details

Defined in Network.Tox.C.Options

Ord ErrOptionsNew Source # 
Instance details

Defined in Network.Tox.C.Options

Read ErrOptionsNew Source # 
Instance details

Defined in Network.Tox.C.Options

Show ErrOptionsNew Source # 
Instance details

Defined in Network.Tox.C.Options

tox_options_new :: CErr ErrOptionsNew -> IO OptionsPtr Source #

Allocates a new Tox_Options object and initialises it with the default options. This function can be used to preserve long term ABI compatibility by giving the responsibility of allocation and deallocation to the Tox library.

Objects returned from this function must be freed using the tox_options_free function.

@return A new OptionsPtr with default options or nullPtr on failure.

toxOptionsFree :: OptionsPtr -> IO () Source #

Releases all resources associated with an options objects.

Passing a pointer that was not returned by tox_options_new results in undefined behaviour.

peekToxOptions :: OptionsPtr -> IO Options Source #

Read Options from an OptionsPtr.

If the passed pointer is nullPtr, the behaviour is undefined.

withOptions :: Options -> (OptionsPtr -> IO r) -> IO (Either ErrOptionsNew r) Source #

Allocate a new C options pointer, fills in the values from Options, calls the processor function, and deallocates the options pointer.

The OptionsPtr passed to the processor function is never nullPtr. If allocation fails, the IO action evaluates to Left with an appropriate error code.