StreamLinkforC  7.0.3-308369
Subscribing to data

Data Structures

struct  sl_autoelem_s
 Structure that holds details of constituents. More...
 
struct  sl_container_model
 Structure that defines the interface for sl_container_apply_to_model() More...
 
struct  sl_container_action
 Structure that defines a container action. More...
 
struct  sl_container_event
 Event that is raised when the structure of a container changes. More...
 
struct  sl_directory_event
 Event that is raised when a directory subject changes. More...
 
struct  sl_permission_event
 Event that is raised when a permission subject updates. More...
 
struct  sl_record2_event
 Event raised when a type 2 record updates. More...
 
struct  sl_record3_event
 Event raised when a type 2 record updates. More...
 
struct  sl_page_segment
 Represents a region of a page that has updated. More...
 
struct  sl_page_event
 Event raised when a page updates. More...
 
struct  sl_news_event
 Event raised when a news headline subject updates. More...
 
struct  sl_story_event
 Event raised when a story subject updates. More...
 
struct  sl_chat_event
 Event raised when a chat subject updates. More...
 
struct  sl_subjectlistener
 Defines the interface that should be satisfied to receive updates for subjects. More...
 

Typedefs

typedef struct sl_subscription_s sl_subscription
 Opaque handle that represents a subscription to a StreamLink subject.
 
typedef struct sl_subscription_parameters_s sl_subscription_parameters
 Opaque structure that represents the parameters to a StreamLink subscription.
 

Enumerations

Functions

sl_subscriptionsl_subscribe (streamlink *client, const char *subject, sl_subscription_parameters *params, sl_subjectlistener *listener, void *ctx)
 Subscribe to a subject. More...
 
void sl_snapshot (streamlink *client, const char *subject, sl_subscription_parameters *params, sl_subjectlistener *listener, void *ctx)
 Snapshota subject. More...
 
int sl_subscription_setwindow (streamlink *client, sl_subscription *sub, sl_subscription_parameters *params)
 Change the window size for a container subscription. More...
 
void sl_unsubscribe (streamlink *client, sl_subscription *sub)
 Unsubscribe a subject subscription. More...
 
sl_subscription_parameterssl_create_container_parameters (streamlink *client, int window_start, int window_size, sl_subscription_parameters *constituent_parameters)
 Create a set of parameters for a container subscription. More...
 
sl_subscription_parameterssl_create_extended_container_parameters (streamlink *client, int window_start, int window_size, sl_subscription_parameters *constituent_parameters, const char *where, const char *sort, const char *groupby, bool structureonly, bool keep_inaccessible)
 Create a set of parameters for a container subscription. More...
 
sl_subscription_parameterssl_create_record_parameters (streamlink *client, char is_image_filter, const char *filter, int num_fields, const char **fields)
 Create a set of parameters for a record subscription. More...
 
sl_subscription_parameterssl_create_text_parameters (streamlink *client, const char *parameters)
 Create a set of parameters for a subscription. More...
 
void sl_container_apply_to_model (sl_container_event *ev, sl_container_model *model, void *context)
 Apply a container event to the supplied model. More...
 

Detailed Description

Enumeration Type Documentation

Enumeration that defines the chat message type that has been received.

Enumerator
sl_chat_MESSAGE 

A chat message has been received

sl_chat_USER_ADDED 

A user has been added to the chat channel

sl_chat_USER_REMOVED 

A user has been removed from the chat channel

sl_chat_JOINED 

A user has joined the chat channel

Enumeration defining a reason explaining why an error has been raised.

Enumerator
sl_REASON_NONE 

No reason

sl_REASON_USER1 

Liberator auth module user reason

sl_REASON_USER2 

Liberator auth module user reason

sl_REASON_USER3 

Liberator auth module user reason

sl_REASON_USER4 

Liberator auth module user reason

sl_REASON_USER5 

Liberator auth module user reason

sl_REASON_LICENCE 

Licence failure

Enumeration which represents the errors that can occur for a subject.

Enumerator
sl_ERROR_OK 

No error

sl_ERROR_NOTFOUND 

The subject could not be found.

sl_ERROR_UNAVAILABLE 

The subject was not available.

sl_ERROR_DELETED 

The subject has been deleted.

sl_ERROR_READ_DENIED 

The client does not have permission to read the subject.

sl_ERROR_WRITE_DENIED 

The client does not have permission to write to the subject.

sl_ERROR_INVALID_PARAMETERS 

Supplied parameters are invalid for this object type

sl_ERROR_THROTTLE_FAILED 

Throttle failed

sl_ERROR_CANCELLED 

Command has been cancelled

Enumeration defining the subject types

Function Documentation

void sl_container_apply_to_model ( sl_container_event ev,
sl_container_model model,
void *  context 
)

Apply a container event to the supplied model.

Parameters
ev- The container event to apply
model- The container model to apply the event to
context- A callback context
sl_subscription_parameters* sl_create_container_parameters ( streamlink client,
int  window_start,
int  window_size,
sl_subscription_parameters constituent_parameters 
)

Create a set of parameters for a container subscription.

Parameters
client- The client.
window_start- Start of the window (-1 for not specified).
window_size- Size of the window onto the container (-1 for not specified).
constituent_parameters- A set of parameters to be applied to the constituents of the container.
Returns
A subscription parameters object embedding the supplied information.
Note
The constituent_parameters object will not be valid following the call to this function.
Parameters should not be re-used for multiple subscriptions

The following example code creates a set of container parameters that request a window of elements 0 - 10 and request the Bid and Ask fields from the elements.

1 params = sl_create_container_parameters(client, 0, 10, record_parameters);
sl_subscription_parameters* sl_create_extended_container_parameters ( streamlink client,
int  window_start,
int  window_size,
sl_subscription_parameters constituent_parameters,
const char *  where,
const char *  sort,
const char *  groupby,
bool  structureonly,
bool  keep_inaccessible 
)

Create a set of parameters for a container subscription.

Parameters
client- The client.
window_start- Start of the window (-1 for not specified).
window_size- Size of the window onto the container (-1 for not specified).
constituent_parameters- A set of parameters to be applied to the constituents of the container.
where- Refiner filter parameters (can be NULL)
sort- Refiner sort parameters (can be NULL)
groupby- Refiner groupby parameters (can be NULL)
structureonly- Only subscribe to the container structure, not the constituents
keep_inaccessible- Set true to not remove non-permissioned/unavailable subjects from the structure of the container
Returns
A subscription parameters object embedding the supplied information.
Note
The constituent_parameters object will not be valid following the call to this function.
Parameters should not be re-used for multiple subscriptions
sl_subscription_parameters* sl_create_record_parameters ( streamlink client,
char  is_image_filter,
const char *  filter,
int  num_fields,
const char **  fields 
)

Create a set of parameters for a record subscription.

Parameters
client- The client
is_image_filter- Set if the filter represents an image filter.
filter- Any record filter to be applied
num_fields- Number of fields supplied
fields- An array of field names
Returns
A subscription parameters object embedding the supplied information.
Note
Parameters should not be re-used for multiple subscriptions

The following example code creates a set of record parameters that requests the Bid and Ask fields.

    char *fields[] = { "Bid", "Ask" };
    params = sl_create_record_parameters(client, 2, fields);
sl_subscription_parameters* sl_create_text_parameters ( streamlink client,
const char *  parameters 
)

Create a set of parameters for a subscription.

Parameters
client- The client
parameters- The RTTP encoded set of parameters
Returns
A subscription parameters object embedding the supplied information.
Note
Parameters should not be re-used for multiple subscriptions
void sl_snapshot ( streamlink client,
const char *  subject,
sl_subscription_parameters params,
sl_subjectlistener listener,
void *  ctx 
)

Snapshota subject.

Parameters
client- The connection on which to subscribe to the subject.
subject- The subject to subscribe to.
params- Any subscription parameters (can be NULL)
listener- The subject listener which will receive update.
ctx- User callback context which will passed to the listener.
Note
The library does not copy the contents of listener, thus it should not be modified or unexpected effects may occur.
sl_subscription* sl_subscribe ( streamlink client,
const char *  subject,
sl_subscription_parameters params,
sl_subjectlistener listener,
void *  ctx 
)

Subscribe to a subject.

Parameters
client- The connection on which to subscribe to the subject.
subject- The subject to subscribe to.
params- Any subscription parameters (can be NULL)
listener- The subject listener which will receive update.
ctx- User callback context which will passed to the listener.
Returns
A handle that should be retained should you wish to unsubscibe to the subject
Note
The library does not copy the contents of listener, thus it should not be modified or unexpected effects may occur.
int sl_subscription_setwindow ( streamlink client,
sl_subscription sub,
sl_subscription_parameters params 
)

Change the window size for a container subscription.

Parameters
client- The StreamLink client
sub- The subscription to change
params- The new parameters for the subscription
Return values
0- Change was applied to a container subscription
-1- Change was not applied to a container subscription
-2- Container was not requested with container parameters intiially
Note
The subscription parameter should be identical apart from the window start and size.
void sl_unsubscribe ( streamlink client,
sl_subscription sub 
)

Unsubscribe a subject subscription.

Parameters
client- The StreamLink client
sub- The subscription to unsubscribe from

Unsubscribing to a subscription will prevent updates being received for the subject


Generated on Tue Oct 16 2018 12:25:43 for StreamLinkforC