The following unary C APIs take an input sequence and produce a result sequence of the same type, or, in the case of
mco_seq_match()
, takes a third character string argument pattern and returns a boolean result sequence.
mco_seq_abs_TYPE() The element of the result sequence is the absolute value of the corresponding element in input.
MCO_RET mco_seq_abs_TYPE(mco_seq_iterator_h result, mco_seq_iterator_h input);mco_seq_neg_TYPE() The element of the result sequence is the negative of the corresponding element in input.
MCO_RET mco_seq_neg_TYPE(mco_seq_iterator_h result, mco_seq_iterator_h input);mco_seq_match() Match the elements of a sequence of characters with the specified pattern and return a sequence of boolean values.
MCO_RET mco_seq_match(mco_seq_iterator_h result, mco_seq_iterator_h input, const char* pattern);Example
Following is an example code snippet demonstrating a unary operator function:
{ mco_trans_h trans; mco_cursor_t quote_cursor; Quote quote; mco_seq_iterator_t close_iterator, abs_iterator; MCO_RET rc; ... for (rc = mco_cursor_first(trans, "e_cursor); rc != MCO_S_CURSOR_END; rc = mco_cursor_next(trans, "e_cursor)) { Quote_from_cursor(trans, "e_cursor, "e); ... Quote_close_iterator("e, &close_iterator)); ... rc = mco_seq_abs_float(&abs_iterator, &close_iterator); ... } ... }