src/util/user.c
/**
 * user_registry_ref_user() - search user in registry
 * @registry:           registry to query
 * @userp:              output argument for user object
 * @uid:                uid of user to search for
 *
 * This searches for a user object with UID @uid in @registry, takes a
 * reference and returns it in @userp.
 *
 * Return: 0 on success, error code on failure.
 */
search user in registry
@registry:           registry to query
@userp:              output argument for user object
@uid:                uid of user to search for

This searches for a user object with UID @uid in @registry, takes a
reference and returns it in @userp.

0 on success, error code on failure.
search user in registry @registry : registry to query @userp : output argument for user object @uid : uid of user to search for This searches for a user object with UID @uid in @registry takes a reference and returns it in @userp . 0 on success error code on failure .
int user_registry_ref_user(UserRegistry *registry, User **userp, uid_t uid) {
        User *user;
        CRBNode **slot, *parent;
        int r;
        slot = c_rbtree_find_slot(&registry->user_tree, user_compare, &uid, &parent);
        if (slot) {
                r = user_new(&user, registry, uid);
                if (r)
                        return error_trace(r);
                user_link(user, parent, slot);
        } else {
                user = c_container_of(parent, User, registry_node);
                user_ref(user);
        }
        *userp = user;
        return 0;
}
int user_registry_ref_user ( UserRegistry * registry , User * * userp , uid_t uid ) { User * user ; CRBNode * * slot , * parent ; int r ; slot = c_rbtree_find_slot ( & registry -> user_tree , user_compare , & uid , & parent ) ; if ( slot ) { r = user_new ( & user , registry , uid ) ; if ( r ) return error_trace ( r ) ; user_link ( user , parent , slot ) ; } else { user = c_container_of ( parent , User , registry_node ) ; user_ref ( user ) ; } * userp = user ; return 0 ; }
user_registry_ref_user() - search user in registry
 @registry:           registry to query
 @userp:              output argument for user object
 @uid:                uid of user to search for
user_registry_ref_user () - search user in registry @registry : registry to query @userp : output argument for user object @uid : uid of user to search for