hmmer-3.3/easel/esl_mem.c
/* Function:  esl_memstrcontains()
 * Synopsis:  Return TRUE if memory line matches a string.
 *
 * Purpose:   Compare line <p> of length <n> to NUL-terminated
 *            string <s>. Return <TRUE> if <p> contains an exact
 *            match to <s> at any position.
 */
esl_memstrcontains()
Synopsis:  Return TRUE if memory line matches a string.

Compare line  of length  to NUL-terminated
string . Return  if  contains an exact
match to  at any position.
esl_memstrcontains () Synopsis : Return TRUE if memory line matches a string . Compare line of length to NUL - terminated string . Return if contains an exact match to at any position .
int 
esl_memstrcontains(const char *p, esl_pos_t n, const char *s)
{
  esl_pos_t s0, pos;
  if (! p || ! s) return FALSE;
  for (s0 = 0; s0 < n; s0++)
    {
      for (pos = 0; s0+pos < n && s[pos] != '\0'; pos++)
	if (p[s0+pos] != s[pos]) break;
      if (s[pos] == '\0') return TRUE;
    }
  return FALSE;
}
int esl_memstrcontains ( const char * p , esl_pos_t n , const char * s ) { esl_pos_t s0 , pos ; if ( ! p || ! s ) return FALSE ; for ( s0 = 0 ; s0 < n ; s0 ++ ) { for ( pos = 0 ; s0 + pos < n && s [ pos ] != ' \0 ' ; pos ++ ) if ( p [ s0 + pos ] != s [ pos ] ) break ; if ( s [ pos ] == ' \0 ' ) return TRUE ; } return FALSE ; }
Function:  esl_memstrcontains()
 Synopsis:  Return TRUE if memory line matches a string.
Function : esl_memstrcontains () Synopsis : Return TRUE if memory line matches a string .