예제 #1
0
파일: option.c 프로젝트: waruqi/tbox
tb_uint64_t tb_option_item_uint64(tb_option_ref_t option, tb_char_t const* name)
{
    // check
    tb_option_impl_t* impl = (tb_option_impl_t*)option;
    tb_assert_and_check_return_val(impl && impl->list && name, 0);

    // the option item
    tb_object_ref_t item = tb_oc_dictionary_value(impl->list, name);
    tb_check_return_val(item, 0);
    tb_assert_and_check_return_val(tb_object_type(item) == TB_OBJECT_TYPE_NUMBER, 0);

    // the option item value
    return tb_oc_number_uint64(item);
}
예제 #2
0
파일: number.c 프로젝트: ljx0305/tbox
tb_uint32_t tb_oc_number_uint32(tb_object_ref_t object)
{
    return (tb_uint32_t)tb_oc_number_uint64(object);
}