Revision 5c6cb22f src/urt_core.c
| src/urt_core.c | ||
|---|---|---|
| 244 | 244 |
* @return Returns a pointer to the requested service. Returns NULL if no service matches the given ID. |
| 245 | 245 |
*/ |
| 246 | 246 |
#if (URT_CFG_PUBSUB_ENABLED) |
| 247 |
urt_topic_t* urtCoreGetTopic(urt_topicid_t id) {return urt_topic_t;}
|
|
| 247 |
urt_topic_t* urtCoreGetTopic(urt_topicid_t id) |
|
| 248 |
{
|
|
| 249 |
urtMutexLock(&core._lock); |
|
| 250 |
urt_topic_t* topic = core._topics; |
|
| 251 |
while (topic != NULL && topic->id < id) |
|
| 252 |
topic = topic->next; |
|
| 253 |
urtMutexUnlock(&core._lock); |
|
| 254 |
if (topic != NULL && topic->id == id) |
|
| 255 |
return topic; |
|
| 256 |
else |
|
| 257 |
return NULL; |
|
| 258 |
} |
|
| 248 | 259 |
#endif /* URT_CFG_PUBSUB_ENABLED */ |
| 249 | 260 |
|
| 250 | 261 |
|
Also available in: Unified diff