24#define _(String) gettext (String)
57 DBG_PRINTF(
"p_list=%p, p_name=%s",p_list,p_name);
62 while ((p_list!=
NULL)&&((l_cmp=strcmp(p_list->
name,p_name))<0)) {
65 DBG_PRINTF(
"p_list=%p, l_cmp=%d",p_list,l_cmp);
67 p_list = p_list->
next;
70 return (l_cmp==0?p_list:
NULL);
89 DBG_PRINTF(
"p_list=%p, p_service=%p",p_list,p_service);
94 while ((*p_list)&&((l_cmp=strcmp((*p_list)->name,p_service->
name))<0))
95 p_list = &(*p_list)->
next;
97 if ((*p_list==
NULL)||(l_cmp>0)) {
99 p_service->
next = *p_list;
111static void svcmgr_rdelete(
service_t* p_service)
124 svcmgr_rdelete(l_svc);
147 DBG_PRINTF(
"p_list=%p, p_name=%s",p_list,p_name);
152 while ((*p_list)&&((l_cmp=strcmp((*p_list)->name,p_name))<0))
153 p_list = &(*p_list)->
next;
155 if ((*p_list!=
NULL)&&(l_cmp==0)) {
157 *p_list = (*p_list)->
next;
158 svcmgr_rdelete(l_svc);
167 printf(
"%s%s\n",p_prefix, p_list->
name);
169 char l_fullname[256];
170 snprintf(l_fullname,255,
"%s%s/",p_prefix,p_list->
name);
173 p_list = p_list->
next;
192 DBG_PRINTF(
"p_endpoint=%s, p_svcfunc=%p",p_endpoint,p_svcfunc);
194 l_endpoint =
strdup(p_endpoint);
197 DBG_PRINTF(
"l_head=%p, *l_head=%p",l_head,*l_head);
201 while ((l_token = strtok_r(l_endpoint,
"/",&l_endpoint))) {
209 if (strlen(l_endpoint)) {
226 if (l_svc!=(l_retsvc=svcmgr_insert(l_head, l_svc)))
230 DBG_PRINTF(
"l_head=%p, *l_head=%p",l_head,*l_head);
242 l_svc=svcmgr_find(services, p_endpoint);
249 va_start(l_ap, p_endpoint);
261 svcmgr_delete(&services, p_endpoint);
#define DBG_TRACE
Checkpoint on stderr.
#define DBG_PRINTF(p_Format,...)
Log a timestamped debugging message on stderr.
#define ASSERT(condition)
Assertion check macro.
#define DBG_MSG(msg)
Checkpoint on stderr with a static message.
Tracks memory allocation and leaks when compiled without NDEBUG.
#define malloc(size)
Same syntaxt and same behavior than regular malloc function, with memory leaks tracking.
#define strdup(chaine)
Same syntaxt and same behavior than regular strdup function, with memory leaks tracking.
#define free(ptr)
Same syntaxt and same behavior than regular free function, with memory leaks tracking.
struct service_s * children
void svcmgr_dump(const char *p_prefix, service_t *p_list)
struct service_s service_t
void svcmgr_unregister(const char *p_endpoint)
void svcmgr_register(const char *p_endpoint, svcfunc_t *p_svcfunc)
uint8_t svcmgr_call(const char *p_endpoint,...)
uint8_t svcfunc_t(va_list p_ap)