Conversion C Sequence Functions

The following conversion C functions take one sequence input of TYPE1 and produce the result sequence of TYPE2 where the allowed types are listed in the Analytics Functions page. The mco_seq_print_char() API takes an additional integer element_size argument and a character string format argument and returns a character result sequence.

TYPE1_to_TYPE2()

The element of the result sequence is the TYPE2 equivalent of the corresponding TYPE1 element in input.

The function signature is as follows:

 
    MCO_RET mco_seq_TYPE1_to_TYPE2(mco_seq_iterator_h result, 
            mco_seq_iterator_h input);
 
TYPE2_from_TYPE1()

The element of the result sequence is the TYPE2 equivalent of the corresponding TYPE1 element in input.

The function signature is as follows:

 
    MCO_RET mco_seq_TYPE2_from_TYPE1(mco_seq_iterator_h result, 
            mco_seq_iterator_h input);
 
mco_seq_print_char() Print data from the input sequence into the result sequence according to the printf() compatible format string.

The function signature is as follows:

 
    MCO_RET mco_seq_print_char(mco_seq_iterator_h result, 
            mco_seq_iterator_h input, 
            mco_size_t elem_size, 
            const char* format);
 

Example

Following is an example code snippet demonstrating a conversion operator function:

         
    {
        mco_trans_h trans;
        mco_cursor_t quote_cursor;
        Quote quote;
        mco_seq_iterator_t volume_iterator,  result_iterator;
        MCO_RET rc;
        ...
         
        for (rc = mco_cursor_first(trans, &quote_cursor); 
            rc != MCO_S_CURSOR_END; 
            rc = mco_cursor_next(trans, &quote_cursor)) 
        {
            Quote_from_cursor(trans, &quote_cursor, &quote);
            Quote_volume_iterator(&quote, &volume_iterator);
            ...
            rc = mco_seq_uint4_to_float(&result_iterator, &volume_iterator);
            
            ...
        }
        ...
    }