MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ng_package_msg_self

Function ng_package_msg_self

lib/ff_ng_base.c:3694–3720  ·  view source on GitHub ↗

* special case to send a message to self (e.g. destroy node) * Possibly indicate an arrival hook too. * Useful for removing that hook :-) */

Source from the content-addressed store, hash-verified

3692 * Useful for removing that hook :-)
3693 */
3694item_p
3695ng_package_msg_self(node_p here, hook_p hook, struct ng_mesg *msg)
3696{
3697 item_p item;
3698
3699 /*
3700 * Find the target node.
3701 * If there is a HOOK argument, then use that in preference
3702 * to the address.
3703 */
3704 if ((item = ng_alloc_item(NGQF_MESG, NG_NOFLAGS)) == NULL) {
3705 NG_FREE_MSG(msg);
3706 return (NULL);
3707 }
3708
3709 /* Fill out the contents */
3710 item->el_flags |= NGQF_WRITER;
3711 NG_NODE_REF(here);
3712 NGI_SET_NODE(item, here);
3713 if (hook) {
3714 NG_HOOK_REF(hook);
3715 NGI_SET_HOOK(item, hook);
3716 }
3717 NGI_MSG(item) = msg;
3718 NGI_RETADDR(item) = ng_node2ID(here);
3719 return (item);
3720}
3721
3722/*
3723 * Send ng_item_fn function call to the specified node.

Callers

nothing calls this directly

Calls 2

ng_alloc_itemFunction · 0.70
ng_node2IDFunction · 0.70

Tested by

no test coverage detected