TradeChannel objects.


Classes

struct  ctl_channel_listener
 Listener interface that should be registered if you wish to receive notification of trade creation and closing. More...

Typedefs

typedef struct
ctl_channel_s 
ctl_channel
 Opaque handle representing a trade channel.

Functions

void ctl_channel_set_listener (ctl_provider *provider, ctl_channel *channel, ctl_channel_listener *listener, void *context)
 Set the listener on the trade channel.
void ctl_channel_set_user_pointer (ctl_provider *provider, ctl_channel *channel, void *ptr)
 Set a user pointer on the ctl_channel object.
void * ctl_channel_get_user_pointer (ctl_provider *provider, ctl_channel *channel)
 Gets the user pointer on the ctl_trade object.
const char * ctl_channel_get_username (ctl_provider *provider, ctl_channel *channel)
 Get the name of the user that opened the specified channel.
const char * ctl_channel_get_subject (ctl_provider *provider, ctl_channel *channel)
 Get the subject of the TradeChannel.
void ctl_channel_close (ctl_provider *provider, ctl_channel *channel)
 Forcibly close the trade channel.

Function Documentation

void ctl_channel_close ( ctl_provider provider,
ctl_channel channel 
)

Forcibly close the trade channel.

Parameters:
provider - The trading provider
channel - The trade channel to close

const char* ctl_channel_get_subject ( ctl_provider provider,
ctl_channel channel 
)

Get the subject of the TradeChannel.

Parameters:
provider - The trading provider
channel - The trade channel to query
Returns:
The subject of the TradeChannel (or NULL should the channel not exist).
Note:
The return value should not be freed.

void* ctl_channel_get_user_pointer ( ctl_provider provider,
ctl_channel channel 
)

Gets the user pointer on the ctl_trade object.

Parameters:
provider - The trading provider
channel - The trade channel
Returns:
The previously set user pointer (or NULL should the channel not exist)

const char* ctl_channel_get_username ( ctl_provider provider,
ctl_channel channel 
)

Get the name of the user that opened the specified channel.

Parameters:
provider - The trading provider
channel - The trade channel to query
Returns:
The username (or NULL should the channel not exist).
Note:
The return value should not be freed.

void ctl_channel_set_listener ( ctl_provider provider,
ctl_channel channel,
ctl_channel_listener listener,
void *  context 
)

Set the listener on the trade channel.

Parameters:
provider - The trading provider
channel - The trade channel
listener - The listener to call
context - A context pointer for the listener
The registered listener will receive notification of the creation of trades in addition to trades being closed. A trade will be closed when the user logs out of the application.

Note:
To avoid race conditions or missed notifications, this function should be called within ctl_application_listener::channel_created()

void ctl_channel_set_user_pointer ( ctl_provider provider,
ctl_channel channel,
void *  ptr 
)

Set a user pointer on the ctl_channel object.

Parameters:
provider - The trading provider
channel - The trade channel
ptr - the pointer to store
This function can be called to stash a user pointer against a channel object. This is of use if this C API is being wrapped to present a C++ or Objective-C API to your application.


Generated on Fri Aug 14 12:41:23 2015 for Trading API for C by  doxygen 1.5.3