19 #define PC_INDEX_FROM_ID(content_id) ((content_id)-1) 61 for(i = 0; i < contents_num ; i ++) {
92 if(!notify || publish_type == 0) {
93 DEBUG_ERRPRINT(
"There is no notification information, please set it!\n");
108 if(!notify || publish_type == 0) {
109 DEBUG_ERRPRINT(
"There is no notification information, please set it!\n");
void publisher_free(void)
free All publisher content
SubscriberAccount class member definition, to get by publisher_subscribe.
void publish_content_subscribe_oneshot(PublishContent this, int publish_type, void(*notify)(int publish_type, void *detail, void *ctx), void *ctx)
int publisher_new(size_t contents_num)
new Publisher content, user can get notify to subscribe.
PublishContent publish_content_new(void)
void(* free)(EventInstance this)
void publisher_subscribe_oneshot(int content_id, int publish_type, void(*notify)(int publish_type, void *detail, void *ctx), void *ctx)
subscribe only oneshot
static PublishContent publisher_get_content(int content_id)
get content from id
PublishContent * contents
content cnt, to use fail safe (care list size)
struct publisher_mng_t publisher_g
void publisher_unsubscribe(int content_id, SubscriberAccount account)
unsubscribe, if you want to stop subscribe, please call it
void publish_content_publish(PublishContent this, int publish_type, void *detail)
#define PUBLISHER_SUCCESS
SubscriberAccount publisher_subscribe(int content_id, int publish_type, void(*notify)(int publish_type, void *detail, void *ctx), void *ctx)
subscribe
SubscriberAccount publish_content_subscribe(PublishContent this, int publish_type, void(*notify)(int publish_type, void *detail, void *ctx), void *ctx)
void publish_content_free(PublishContent this)
void publish_content_unsubscribe(PublishContent this, SubscriberAccount account)
This is API for PublishContent class which managed in Publisher.
#define DEBUG_ERRPRINT(...)
#define PC_INDEX_FROM_ID(content_id)
void publisher_publish(int content_id, int publish_type, void *detail)
publish, Publisher call subscriber's notify if type is same