func: unsigned int svn_cstring__similarity(const char *stra,const char *strb,svn_membuf_t *buffer,apr_size_t *rlcs) svn_string_t stringa ; stringa . data = stra; stringa . len = strlen ( stra ); return svn_string__similarity ( ( & stringa ) , ( & stringb ) , buffer , rlcs ) ; unsigned int svn_string__similarity(const svn_string_t *stringa,const svn_string_t *stringb,svn_membuf_t *buffer,apr_size_t *rlcs) const char * stra = stringa -> data ; const char * strb = stringb -> data ; const apr_size_t lena = stringa -> len ; const apr_size_t lenb = stringb -> len ; const apr_size_t total = lena + lenb ; const char * enda = stra + lena ; const char * endb = strb + lenb ; while ( stra < enda && strb < endb && ( * stra ) == ( * strb ) )  while ( stra < enda && strb < endb )  if ( ( * enda ) != ( * endb ) )  if ( stra < enda && strb < endb )  const apr_size_t resta = ( enda - stra ) ; const apr_size_t restb = ( endb - strb ) ; const apr_size_t slots = resta > restb ? restb : resta ; if ( resta < restb )  pstr = stra; stra = strb; strb = pstr; pstr = enda; enda = endb; endb = pstr; svn_membuf__ensure ( buffer , 2 * ( slots + 1 ) * sizeof ( apr_size_t ) ); void svn_membuf__ensure(svn_membuf_t *membuf,apr_size_t size) membuf_ensure ( & membuf -> data , & membuf -> size , size , membuf -> pool ); inline static void membuf_ensure(void **data,apr_size_t *size,apr_size_t minimum_size,apr_pool_t *pool) if ( minimum_size > * size )  apr_size_t new_size = * size ; if ( new_size == 0 )  new_size = minimum_size; while ( new_size < minimum_size )  const apr_size_t prev_size = new_size ; new_size *= 2; if ( prev_size > new_size )  new_size = minimum_size; membuf_create ( data , size , new_size , pool ); inline static void membuf_create(void **data,apr_size_t *size,apr_size_t minimum_size,apr_pool_t *pool) minimum_size = minimum_size + ( 8 - 1 ) & ( ~ ( 8 - 1 ) ); * data = ( ! minimum_size ? ( ( void * ) 0 ) : apr_palloc ( pool , minimum_size ) ); * size = minimum_size; svn_membuf__nzero ( buffer , ( slots + 2 ) * sizeof ( apr_size_t ) ); #undef svn_membuf__nzero svn_membuf_t * const _m_b_f_ = membuf const apr_size_t _s_z_ = size ; if ( _s_z_ > _m_b_f_ -> size )  memset ( _m_b_f_ -> data , 0 , _m_b_f_ -> size ); memset ( _m_b_f_ -> data , 0 , _s_z_ ); prev = ( buffer -> data ); curr = prev + slots + 1; for (pstr = stra; pstr < enda; ++pstr) for (i = 1; i <= slots; ++i) if ( ( * pstr ) == strb [ i - 1 ] )  curr [ i ] = prev [ i - 1 ] + 1; curr [ i ] = ( curr [ i - 1 ] > prev [ i ] ? curr [ i - 1 ] : prev [ i ] ); apr_size_t * const temp = prev prev = curr; curr = temp; lcs += prev [ slots ]; if ( rlcs )  * rlcs = lcs; if ( total )  return ( unsigned int ) ( ( 2000 * lcs + total / 2 ) / total ) ; 