hmmer-3.3/easel/esl_mem.c
/* Function:  esl_memspn()
 * Synopsis:  Finds length of prefix consisting only of given chars
 *
 * Purpose:   For line <p> of length <n>, return the length of
 *            a prefix that consists only of characters in the
 *            string <allow>. 
 *            
 *            A commonly used idiom for "buffer is all whitespace"
 *            is <esl_memspn(p, n, " \t\r\n") == n>.
 */
esl_memspn()
Synopsis:  Finds length of prefix consisting only of given chars

For line  of length , return the length of
a prefix that consists only of characters in the
string .

A commonly used idiom for "buffer is all whitespace"
is .
esl_memspn () Synopsis : Finds length of prefix consisting only of given chars For line of length return the length of a prefix that consists only of characters in the string . A commonly used idiom for " buffer is all whitespace " is .
esl_pos_t
esl_memspn(char *p, esl_pos_t n, const char *allow)
{
  esl_pos_t so;
  for (so = 0; so < n; so++) if (strchr(allow, p[so]) == NULL) break;
  return so;
}
esl_pos_t esl_memspn ( char * p , esl_pos_t n , const char * allow ) { esl_pos_t so ; for ( so = 0 ; so < n ; so ++ ) if ( strchr ( allow , p [ so ] ) == NULL ) break ; return so ; }
Function:  esl_memspn()
 Synopsis:  Finds length of prefix consisting only of given chars
Function : esl_memspn () Synopsis : Finds length of prefix consisting only of given chars