Run Length Encryption C Sequence Functions

The RLE C functions take a variety of input arguments and produce result sequences or scalar types as described in the table below:

mco_seq_rle_count()

Returns the number of repeating items in the current tile for the iterator in the position pos. For regular non-rle sequences it always returns 1

 
    mco_seq_rle_count_t mco_seq_rle_count(mco_seq_iterator_h iterator,
             int pos);
     
mco_seq_is_rle()

Returns MCO_YES if RLE sequences are in use

     
    mco_bool mco_seq_is_rle(void);
     
mco_seq_rle_decode()

Convert an RLE sequence to a "normal" sequence

 
    MCO_RET mco_seq_rle_decode(mco_seq_iterator_h result, 
            mco_seq_iterator_h input);
     

 

Example

Following is an example code snippet demonstrating an RLE function:

         
    {
        mco_trans_h trans;
        mco_cursor_t quote_cursor;
        Quote quote;
        mco_seq_iterator_t rle_high_iterator, normal_high_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_high_iterator(&quote, &rle_high_iterator);
             
            rc = mco_seq_rle_decode(&normal_high_iterator, &rel_high_iterator)) != MCO_S_CURSOR_END) 
            ...
        }
        ...
    }