hmmer-3.3/easel/esl_sqio_ncbi.c
/* Function:  parse_accept()
 * Synopsis:  Check if the next bytes to parse match
 * Incept:    MSF, Mon Dec 10, 2009 [Janelia]
 *
 * Purpose:   Check if the next <len> bytes to parse match the bytes
 *            in <str>.  If the bytes match, they are consumed and the
 *            parsers pointer is advanced.
 *
 * Returns:   <eslOK> on success
 *            <eslEFORMAT> if the bytes to not match.
 */
parse_accept()
Synopsis:  Check if the next bytes to parse match
Incept:    MSF, Mon Dec 10, 2009 [Janelia]

Check if the next  bytes to parse match the bytes
in .  If the bytes match, they are consumed and the
parsers pointer is advanced.

 on success
 if the bytes to not match.
parse_accept () Synopsis : Check if the next bytes to parse match Incept : MSF Mon Dec 10 2009 [ Janelia ] Check if the next bytes to parse match the bytes in . If the bytes match they are consumed and the parsers pointer is advanced . on success if the bytes to not match .
static int
parse_accept(ESL_SQNCBI_DATA *ncbi, void *str, int len)
{
  int i;
  int size;
  unsigned char *c;
  unsigned char *limit;
  size  = ncbi->hoff - ncbi->roff;
  limit = ncbi->hdr_buf + size;
  if (ncbi->hdr_ptr + len > limit)  return eslEFORMAT;
  c = (unsigned char *) str;
  for (i = 0; i < len; ++i) {
    if (ncbi->hdr_ptr[i] != c[i])   return eslEFORMAT;
  }
  ncbi->hdr_ptr += len;
  return eslOK;
}
static int parse_accept ( ESL_SQNCBI_DATA * ncbi , void * str , int len ) { int i ; int size ; unsigned char * c ; unsigned char * limit ; size = ncbi -> hoff - ncbi -> roff ; limit = ncbi -> hdr_buf + size ; if ( ncbi -> hdr_ptr + len > limit ) return eslEFORMAT ; c = ( unsigned char * ) str ; for ( i = 0 ; i < len ; ++ i ) { if ( ncbi -> hdr_ptr [ i ] != c [ i ] ) return eslEFORMAT ; } ncbi -> hdr_ptr += len ; return eslOK ; }
Function:  parse_accept()
 Synopsis:  Check if the next bytes to parse match
 Incept:    MSF, Mon Dec 10, 2009 [Janelia]
Function : parse_accept () Synopsis : Check if the next bytes to parse match Incept : MSF Mon Dec 10 2009 [ Janelia ]
/* check the buffer matches the token string */ /* verify the buffer matches the token string without advancing
   * the buffer pointers until we have a complete match.
   */