techidee GmbH
Projekt: NewsBox
Autor: Thomas Fruehwald
Compiler: gcc
Modul: news service decoder
Creation date: 2003-08-02
Last modified: 2004-02-16 (rbr)
The Journaline(R) news service decoder will accept Journaline(R) objects conforming to the news service "Journaline(R)" specification and store them (subject to specified memory limits) for later retrieval by a Journaline(R) application.
To use it, call createDec to create an instance, putData to put Journaline(R) objects into the decoder and in the end, use deleteDec to destroy the instance.
To make use of the watch functionality for monitoring object availability information, you must implement the object availability callback and pass it to createDec.
Go to the source code of this file.
Compounds | |
struct | NEWS_SVC_DEC_obj_availability_t |
object availability type More... | |
Typedefs | |
typedef const void * | NEWS_SVC_DEC_decoder_t |
news service decoder instance type | |
typedef void( | NEWS_SVC_DEC_cb )(unsigned long number_of_elements, NEWS_SVC_DEC_obj_availability_t *chg_list, void *arg) |
object availability callback function | |
Enumerations | |
enum | NEWS_SVC_DEC_obj_availability_status_t { NEWS_SVC_DEC_OBJ_NOT_YET_AVAILABLE, NEWS_SVC_DEC_OBJ_REMOVED, NEWS_SVC_DEC_OBJ_RECEIVED, NEWS_SVC_DEC_OBJ_UPDATED } |
object availability status type More... | |
Functions | |
NEWS_SVC_DEC_decoder_t | NEWS_SVC_DEC_createDec (NEWS_SVC_DEC_cb update, unsigned long max_memory, unsigned long *max_objects, unsigned long extended_header_len, void *arg) |
Create a news service decoder instance. | |
void | NEWS_SVC_DEC_deleteDec (NEWS_SVC_DEC_decoder_t decoder) |
Delete a news service decoder instance. | |
int | NEWS_SVC_DEC_get_news_object (NEWS_SVC_DEC_decoder_t decoder, unsigned short object_id, unsigned long *extended_header_len, unsigned long *len, unsigned char *nml) |
Get a news object by id. | |
int | NEWS_SVC_DEC_get_object_availability (NEWS_SVC_DEC_decoder_t decoder, unsigned long number_of_elements, NEWS_SVC_DEC_obj_availability_t *query_list) |
Query the availability of objects. | |
unsigned long | NEWS_SVC_DEC_putData (NEWS_SVC_DEC_decoder_t decoder, const unsigned long len, const unsigned char *buf) |
Put data into news decoder. | |
int | NEWS_SVC_DEC_watch_objects (NEWS_SVC_DEC_decoder_t decoder, unsigned long number_of_elements, NEWS_SVC_DEC_obj_availability_t *watch_list) |
Set a watch on the specified objects. | |
int | NEWS_SVC_DEC_keep_in_cache (NEWS_SVC_DEC_decoder_t decoder, unsigned long number_of_elements, unsigned short *object_ids) |
Set ids of objects to be kept in cache. |
|
object availability callback function
The object availability callback function will be called when the object availability status of one or more of the objects in the watch list changes.
|
|
news service decoder instance type
|
|
object availability status type
|
|
Create a news service decoder instance.
call this before anything else
|
|
Delete a news service decoder instance.
call this at shutdown time
|
|
Get a news object by id.
The object with id object_id will be written to nml and len will be set to its actual length in bytes (at most 2044).
|
|
Query the availability of objects.
Specify a list of objects (only the object ids have to be filled in) you want to query in query_list. on return the status field of query_list will be set.
|
|
Set ids of objects to be kept in cache.
Tell the memory management that the listed elements should be kept in memory (if possible). Candidates for keeping in memory are (in order of importance):
|
|
Put data into news decoder.
The input for the news decoder consists of one complete Journaline(R) object.
|
|
Set a watch on the specified objects.
When the status of an object with an id that is being watched on changes, a callback is done. To avoid nested upcalls the status at the calling time is returned in the watch_list's status field.
On output, the status field will be filled.
|