DataSource for C SDK
8.0.3.290770-7760911e
|
Macros | |
#define | NEWS_AUTHSTR_FIELDNUM 5 |
Definition of the authorisation string field number. More... | |
#define | NEWS_COMPANY_CODE_FIELDNUM 102 |
Definition of the company code field number. More... | |
#define | NEWS_DATETIME_FIELDNUM 2 |
Definition of the date time field number. More... | |
#define | NEWS_HEADLINE_FIELDNUM 0 |
Definition of the headline field number. More... | |
#define | NEWS_PRODUCT_CODE_FIELDNUM 100 |
Definition of the product code field number. More... | |
#define | NEWS_STORYCODE_FIELDNUM 1 |
Definition of the storycode field number. More... | |
#define | NEWS_TOPIC_CODE_FIELDNUM 101 |
Definition of the topic code field number. More... | |
#define | NEWS_USER_CODE_FIELDNUM 200 |
Definition of the user code starting field number. More... | |
#define | NEWS_USER_CODE_MAX 10 |
Maximum number of user codes. More... | |
Functions | |
void | ds_add_news_authstr (ds_data_t *data, const char *authstr) |
Add an authorisation string to the news headline message. More... | |
void | ds_add_news_company_code (ds_data_t *data, const char *code) |
Add a company code to the news headline message. More... | |
void | ds_add_news_datetime (ds_data_t *data, const char *datestr) |
Add a date stamp to the news headline message. More... | |
void | ds_add_news_field (ds_data_t *data, const char *fieldname, const char *value) |
Add a custom field to a news headline message. More... | |
void | ds_add_news_headline (ds_data_t *data, const char *headline) |
Add a news headline to the news headline message. More... | |
void | ds_add_news_product_code (ds_data_t *data, const char *code) |
Add a product code to the news headline message. More... | |
void | ds_add_news_storycode (ds_data_t *data, const char *story) |
Add a story code to the news object. More... | |
void | ds_add_news_topic_code (ds_data_t *data, const char *code) |
Add a topic code to the news headline message. More... | |
void | ds_add_news_user_code (ds_data_t *data, int codenum, const char *code) |
Add a user defined code to the news headline message. More... | |
ds_data_t * | ds_init_news (const char *subject, unsigned short flags) |
Create a news headline message. More... | |
Both news stories and headlines may be streamed. Conventionally, the streaming of stories has been thought not to have been beneficial. However, if the data can be arranged such that story corrections are transmitted on the same symbol names as the original story, then the end user will obtain an updated story without having to re-request the story. This is particularly useful for news articles that provide market summaries.
A news headline update should contain as a minimum the headline of the the story and the time of the story. To uniquely identify the story a story code should be added using the ds_add_news_storycode() function.
To facilitate efficient story searching, topic codes can be added to the headline update using the ds_add_news_product_code(), ds_add_news_topic_code() and ds_add_news_user_code() functions.
Example: Send to all subscribed peers a news headline on the /NEWS symbol.
Depending on your data requirements, stories may be sent to the Liberator as either broadcast (using the F_NONACTIVE flag), or active.
Story updates should be created using ds_init_data() with the DS_STORY_TYPE object type flag. These updates contain a single field with the fieldnumber 0 which contains the story text.
The story text may be broken across multiple datasource update packets, to indicate that a subsequent update is a continuation and not a replacement, the text should be inserted with the fieldnumber 1.
Example: Send a complete story in one datasource packet.
Example: Send a story in a multiple datasource packets.
Example: Send a story and then send a correction.
#define NEWS_AUTHSTR_FIELDNUM 5 |
Definition of the authorisation string field number.
#define NEWS_COMPANY_CODE_FIELDNUM 102 |
Definition of the company code field number.
#define NEWS_DATETIME_FIELDNUM 2 |
Definition of the date time field number.
#define NEWS_HEADLINE_FIELDNUM 0 |
Definition of the headline field number.
#define NEWS_PRODUCT_CODE_FIELDNUM 100 |
Definition of the product code field number.
#define NEWS_STORYCODE_FIELDNUM 1 |
Definition of the storycode field number.
#define NEWS_TOPIC_CODE_FIELDNUM 101 |
Definition of the topic code field number.
#define NEWS_USER_CODE_FIELDNUM 200 |
Definition of the user code starting field number.
#define NEWS_USER_CODE_MAX 10 |
Maximum number of user codes.
void ds_add_news_authstr | ( | ds_data_t * | data, |
const char * | authstr | ||
) |
Add an authorisation string to the news headline message.
data | The news headline message |
authstr | The authorisation string to be added |
The authorisation string will be available to the Liberator's authentication module if content based permissioning is required
void ds_add_news_company_code | ( | ds_data_t * | data, |
const char * | code | ||
) |
Add a company code to the news headline message.
data | The news headline message |
code | The company code to be added |
void ds_add_news_datetime | ( | ds_data_t * | data, |
const char * | datestr | ||
) |
Add a date stamp to the news headline message.
data | The news headline message |
datestr | The datestamp to be added |
void ds_add_news_field | ( | ds_data_t * | data, |
const char * | fieldname, | ||
const char * | value | ||
) |
Add a custom field to a news headline message.
data | The news headline message |
fieldname | The fieldname |
value | The value of the field |
void ds_add_news_headline | ( | ds_data_t * | data, |
const char * | headline | ||
) |
Add a news headline to the news headline message.
data | The news headline message |
headline | The headline to be added |
void ds_add_news_product_code | ( | ds_data_t * | data, |
const char * | code | ||
) |
Add a product code to the news headline message.
data | The news headline message |
code | The product code to be added |
void ds_add_news_storycode | ( | ds_data_t * | data, |
const char * | story | ||
) |
Add a story code to the news object.
data | The news headline message |
story | The story code to be added |
void ds_add_news_topic_code | ( | ds_data_t * | data, |
const char * | code | ||
) |
Add a topic code to the news headline message.
data | The news headline message |
code | The topic code to be added |
void ds_add_news_user_code | ( | ds_data_t * | data, |
int | codenum, | ||
const char * | code | ||
) |
Add a user defined code to the news headline message.
data | The news headline message |
codenum | An identifier for this type of code |
code | The code to be added |
A maximum of NEWS_USER_CODE_MAX user defined codes are permitted
ds_data_t* ds_init_news | ( | const char * | subject, |
unsigned short | flags | ||
) |
Create a news headline message.
subject | The name of the object |
flags | Object flags |