コード例 #1
0
ファイル: ccs_list_internal.c プロジェクト: aosm/Kerberos
static cc_int32 ccs_list_find_iterator_index (ccs_list_t        in_list,
                                              cci_identifier_t  in_identifier,
                                              cc_uint64        *out_object_index)
{
    cc_int32 err = ccNoError;
    cc_int32 found = 0;
    
    if (!in_list         ) { err = cci_check_error (ccErrBadParam); }
    if (!in_identifier   ) { err = cci_check_error (ccErrBadParam); }
    if (!out_object_index) { err = cci_check_error (ccErrBadParam); }
    
    if (!err && !found) {
        cc_uint64 i;
        
        for (i = 0; !err && i < cci_array_count (in_list->iterators); i++) {
            cc_uint32 equal = 0;
            ccs_list_iterator_t iterator = cci_array_object_at_index (in_list->iterators, i);
            
            err = cci_identifier_compare (iterator->identifier, in_identifier, &equal);
            
            if (!err && equal) {
                found = 1;
                *out_object_index = i;
            }
        }        
    }
    
    if (!err && !found) {
        err = cci_check_error (in_list->object_not_found_err); 
    }
    
    return cci_check_error (err);    
}
コード例 #2
0
static cc_int32 ccs_list_find_iterator_index (ccs_list_t        in_list,
                                              cci_identifier_t  in_identifier,
                                              cc_uint64        *out_object_index)
{
    cc_int32 err = ccNoError;
    cc_int32 found = 0;
    
    if (!in_list         ) { err = cci_check_error (ccErrBadParam); }
    if (!in_identifier   ) { err = cci_check_error (ccErrBadParam); }
    if (!out_object_index) { err = cci_check_error (ccErrBadParam); }
    
    if (!err && !found) {
        cc_uint64 i;
        
        for (i = 0; !err && i < cci_array_count (in_list->iterators); i++) {
            cc_uint32 equal = 0;
            ccs_list_iterator_t iterator = ccs_list_iterator_at_index (in_list, i);
            
            err = cci_identifier_compare (iterator->identifier, in_identifier, &equal);
            
            if (!err && equal) {
                found = 1;
                *out_object_index = i;
                break;
            }
        }        
    }
    
    if (!err && !found) {
        // Don't report this error to the log file.  Non-fatal.
        return in_list->object_not_found_err; 
    } else {
        return cci_check_error (err);    
    }
}
コード例 #3
0
ファイル: ccs_ccache.c プロジェクト: krb5/krb5
cc_int32 ccs_ccache_compare_identifier (ccs_ccache_t      in_ccache,
                                        cci_identifier_t  in_identifier,
                                        cc_uint32        *out_equal)
{
    cc_int32 err = ccNoError;

    if (!in_ccache    ) { err = cci_check_error (ccErrBadParam); }
    if (!in_identifier) { err = cci_check_error (ccErrBadParam); }
    if (!out_equal    ) { err = cci_check_error (ccErrBadParam); }

    if (!err) {
        err = cci_identifier_compare (in_ccache->identifier,
                                      in_identifier,
                                      out_equal);
    }

    return cci_check_error (err);
}
コード例 #4
0
ファイル: ccapi_iterator_test.c プロジェクト: aosm/Kerberos
static cc_int32 test_obj_compare_identifier (ccs_object_t      in_object,
                                             cci_identifier_t  in_identifier,
                                             cc_uint32        *out_equal)
{
    cc_int32 err = ccNoError;
    test_object_t object = (test_object_t) in_object;
    
    if (!in_object    ) { err = cci_check_error (ccErrBadParam); }
    if (!in_identifier) { err = cci_check_error (ccErrBadParam); }
    if (!out_equal    ) { err = cci_check_error (ccErrBadParam); }
    
    if (!err) {
        err = cci_identifier_compare (object->identifier, 
                                      in_identifier, 
                                      out_equal);
    }
    
    return cci_check_error (err);
}
コード例 #5
0
cc_int32 ccapi_ccache_compare (cc_ccache_t  in_ccache,
                               cc_ccache_t  in_compare_to_ccache,
                               cc_uint32   *out_equal)
{
    cc_int32 err = ccNoError;
    cci_ccache_t ccache = (cci_ccache_t) in_ccache;
    cci_ccache_t compare_to_ccache = (cci_ccache_t) in_compare_to_ccache;
    
    if (!in_ccache           ) { err = cci_check_error (ccErrBadParam); }
    if (!in_compare_to_ccache) { err = cci_check_error (ccErrBadParam); }
    if (!out_equal           ) { err = cci_check_error (ccErrBadParam); }
    
    if (!err) {
        err = cci_identifier_compare (ccache->identifier, 
                                      compare_to_ccache->identifier,
                                      out_equal);
    }
    
    return cci_check_error (err);
}