FreeBSD/contrib/subversion/subversion/libsvn_fs_fs/index.c
/* Write the log-2-phys index page description for the l2p_page_entry_t
 * array ENTRIES, starting with element START up to but not including END.
 * Write the resulting representation into BUFFER.  Use SCRATCH_POOL for
 * temporary allocations.
 */
Write the log-2-phys index page description for the l2p_page_entry_t
array ENTRIES, starting with element START up to but not including END.
Write the resulting representation into BUFFER.  Use SCRATCH_POOL for
temporary allocations.
Write the log - 2 - phys index page description for the l2p_page_entry_t array ENTRIES starting with element START up to but not including END . Write the resulting representation into BUFFER . Use SCRATCH_POOL for temporary allocations .
static svn_error_t *
encode_l2p_page(apr_array_header_t *entries,
                int start,
                int end,
                svn_spillbuf_t *buffer,
                apr_pool_t *scratch_pool)
{
  unsigned char encoded[ENCODED_INT_LENGTH];
  int i;
  const apr_uint64_t *values = (const apr_uint64_t *)entries->elts;
  apr_uint64_t last_value = 0;
  for (i = start; i < end; ++i)
    {
      apr_int64_t diff = values[i] - last_value;
      last_value = values[i];
      SVN_ERR(svn_spillbuf__write(buffer, (const char *)encoded,
                                  encode_int(encoded, diff), scratch_pool));
    }
  return SVN_NO_ERROR;
}
static svn_error_t * encode_l2p_page ( apr_array_header_t * entries , int start , int end , svn_spillbuf_t * buffer , apr_pool_t * scratch_pool ) { unsigned char encoded [ ENCODED_INT_LENGTH ] ; int i ; const apr_uint64_t * values = ( const apr_uint64_t * ) entries -> elts ; apr_uint64_t last_value = 0 ; for ( i = start ; i < end ; ++ i ) { apr_int64_t diff = values [ i ] - last_value ; last_value = values [ i ] ; SVN_ERR ( svn_spillbuf__write ( buffer , ( const char * ) encoded , encode_int ( encoded , diff ) , scratch_pool ) ) ; } return SVN_NO_ERROR ; }
Write the log-2-phys index page description for the l2p_page_entry_t
 array ENTRIES, starting with element START up to but not including END.
Write the log - 2 - phys index page description for the l2p_page_entry_t array ENTRIES starting with element START up to but not including END .
/* encode items */