/* This function will find specified name object from object container. */
rt_object_t rt_object_find(const char *name, rt_uint8_t type)
/* This function will find specified name object from object container. */
rt_object_t rt_object_find(const char *name, rt_uint8_t type)
{
    struct rt_object *object;
    struct rt_list_node *node;
    struct rt_object_information *information;
    extern volatile rt_uint8_t rt_interrupt_nest;
    if ((name == RT_NULL) || (type > RT_Object_Class_Unknown))
        return RT_NULL;
    if (rt_interrupt_nest != 0)
        RT_ASSERT(0);
    rt_enter_critical();
    information = &rt_object_container[type];
    for (node  = information->object_list.next;
         node != &(information->object_list);
         node  = node->next)
    {
        object = rt_list_entry(node, struct rt_object, list);
        if (rt_strncmp(object->name, name, RT_NAME_MAX) == 0)
        {
            rt_exit_critical();
            return object;
        }
    }
    rt_exit_critical();
    return RT_NULL;
}