src/bus/name.c
/**
 * name_registry_ref_name() - reference name object
 * @registry:           registry to operate on
 * @namep:              output argument for name object
 * @name_str:           name to lookup
 *
 * This either creates a new name object with a single reference, or creates a
 * new reference to the name, if it already exists.
 *
 * The pointer to the name is returned in @namep.
 *
 * Return: 0 on success, negative error code on failure.
 */
reference name object
@registry:           registry to operate on
@namep:              output argument for name object
@name_str:           name to lookup

This either creates a new name object with a single reference, or creates a
new reference to the name, if it already exists.

The pointer to the name is returned in @namep.

0 on success, negative error code on failure.
reference name object @registry : registry to operate on @namep : output argument for name object @name_str : name to lookup This either creates a new name object with a single reference or creates a new reference to the name if it already exists . The pointer to the name is returned in @namep . 0 on success negative error code on failure .
int name_registry_ref_name(NameRegistry *registry, Name **namep, const char *name_str) {
        CRBNode **slot, *parent;
        int r;
        slot = c_rbtree_find_slot(&registry->name_tree, name_compare, name_str, &parent);
        if (!slot) {
                *namep = name_ref(c_container_of(parent, Name, registry_node));
        } else {
                r = name_new(namep, registry, name_str);
                if (r)
                        return error_trace(r);
                name_link(*namep, parent, slot);
        }
        return 0;
}
int name_registry_ref_name ( NameRegistry * registry , Name * * namep , const char * name_str ) { CRBNode * * slot , * parent ; int r ; slot = c_rbtree_find_slot ( & registry -> name_tree , name_compare , name_str , & parent ) ; if ( ! slot ) { * namep = name_ref ( c_container_of ( parent , Name , registry_node ) ) ; } else { r = name_new ( namep , registry , name_str ) ; if ( r ) return error_trace ( r ) ; name_link ( * namep , parent , slot ) ; } return 0 ; }
name_registry_ref_name() - reference name object
 @registry:           registry to operate on
 @namep:              output argument for name object
 @name_str:           name to lookup
name_registry_ref_name () - reference name object @registry : registry to operate on @namep : output argument for name object @name_str : name to lookup