FreeBSD/contrib/subversion/subversion/libsvn_subr/utf_validate.c
/* Scan MAX_LEN bytes in *DATA for chars that are not in the octet
 * category 0 (FSM_START).  Return the position of the first such char
 * or DATA + MAX_LEN if all were cat 0.
 */
Scan MAX_LEN bytes in *DATA for chars that are not in the octet
category 0 (FSM_START).  Return the position of the first such char
or DATA + MAX_LEN if all were cat 0.
Scan MAX_LEN bytes in * DATA for chars that are not in the octet category 0 ( FSM_START ) . Return the position of the first such char or DATA + MAX_LEN if all were cat 0 .
static const char *
first_non_fsm_start_char(const char *data, apr_size_t max_len)
{
#if SVN_UNALIGNED_ACCESS_IS_OK
  for (; max_len > sizeof(apr_uintptr_t)
       ; data += sizeof(apr_uintptr_t), max_len -= sizeof(apr_uintptr_t))
    if (*(const apr_uintptr_t *)data & SVN__BIT_7_SET)
      break;
#endif
  for (; max_len > 0; ++data, --max_len)
    if ((unsigned char)*data >= 0x80)
      break;
  return data;
}
static const char * first_non_fsm_start_char ( const char * data , apr_size_t max_len ) { #if SVN_UNALIGNED_ACCESS_IS_OK for ( ; max_len > sizeof ( apr_uintptr_t ) ; data += sizeof ( apr_uintptr_t ) , max_len -= sizeof ( apr_uintptr_t ) ) if ( * ( const apr_uintptr_t * ) data & SVN__BIT_7_SET ) break ; #endif for ( ; max_len > 0 ; ++ data , -- max_len ) if ( ( unsigned char ) * data >= 0x80 ) break ; return data ; }
Scan MAX_LEN bytes in *DATA for chars that are not in the octet
 category 0 (FSM_START).
Scan MAX_LEN bytes in * DATA for chars that are not in the octet category 0 ( FSM_START ) .
/* Scan the input one machine word at a time. */ /* The remaining odd bytes will be examined the naive way: */