/*****************************************************************************/ /* */ /* UNIT: matches (Utility interface level library routine) */ /* */ /* Author: Nikola Stojanovic */ /* */ /* Revision: 08 SEP 94 Version 1.0 */ /* */ /* Function: */ /* */ /* Procedure interfaces user programs with the "ntl" library utilities; */ /* checks whether the given pattern (including all predefined "ambiguity" */ /* codes) matches the given string (within which ambiguity codes are */ /* permitted, as well); match direction (direct, inverse complement or both) */ /* is as requested in the input; returns the position (1-n) at which the */ /* first match has been found, if any, 0 if there is no match, and negative */ /* number as error code if there were any errors */ /* */ /*****************************************************************************/ #include #include #include "ntl4.h" /*****************************************************************************/ /* */ /* PROCEDURE: matches */ /* */ /* Execution of unit code; returns the position at which the match has been */ /* found, if any, 0 if there was no match and negative number if there was */ /* any error detected at lower levels */ int matches (char *sequence, char *pattern, int direction, float precision) { errind exec_status; int error_status, match; if ((exec_status = NTL3_Matches (sequence, pattern, direction, precision, &match)) == NULL) return match; else { error_status = exec_status -> code; free (exec_status -> message); free (exec_status); return error_status; } }