FreeBSD/contrib/subversion/subversion/libsvn_fs_x/noderevs.c
/* Serialize all representations in REP.  Store checksums in DIGEST_STREAM,
 * put all other fields into REP_STREAM.
 */
Serialize all representations in REP.  Store checksums in DIGEST_STREAM,
put all other fields into REP_STREAM.
Serialize all representations in REP . Store checksums in DIGEST_STREAM put all other fields into REP_STREAM .
static void
write_reps(svn_packed__int_stream_t *rep_stream,
           svn_packed__byte_stream_t *digest_stream,
           apr_array_header_t *reps)
{
  int i;
  for (i = 0; i < reps->nelts; ++i)
    {
      svn_fs_x__representation_t *rep
        = &APR_ARRAY_IDX(reps, i, svn_fs_x__representation_t);
      svn_packed__add_uint(rep_stream, rep->has_sha1);
      svn_packed__add_uint(rep_stream, rep->id.change_set);
      svn_packed__add_uint(rep_stream, rep->id.number);
      svn_packed__add_uint(rep_stream, rep->size);
      svn_packed__add_uint(rep_stream, rep->expanded_size);
      svn_packed__add_bytes(digest_stream,
                            (const char *)rep->md5_digest,
                            sizeof(rep->md5_digest));
      if (rep->has_sha1)
        svn_packed__add_bytes(digest_stream,
                              (const char *)rep->sha1_digest,
                              sizeof(rep->sha1_digest));
    }
}
static void write_reps ( svn_packed__int_stream_t * rep_stream , svn_packed__byte_stream_t * digest_stream , apr_array_header_t * reps ) { int i ; for ( i = 0 ; i < reps -> nelts ; ++ i ) { svn_fs_x__representation_t * rep = & APR_ARRAY_IDX ( reps , i , svn_fs_x__representation_t ) ; svn_packed__add_uint ( rep_stream , rep -> has_sha1 ) ; svn_packed__add_uint ( rep_stream , rep -> id . change_set ) ; svn_packed__add_uint ( rep_stream , rep -> id . number ) ; svn_packed__add_uint ( rep_stream , rep -> size ) ; svn_packed__add_uint ( rep_stream , rep -> expanded_size ) ; svn_packed__add_bytes ( digest_stream , ( const char * ) rep -> md5_digest , sizeof ( rep -> md5_digest ) ) ; if ( rep -> has_sha1 ) svn_packed__add_bytes ( digest_stream , ( const char * ) rep -> sha1_digest , sizeof ( rep -> sha1_digest ) ) ; } }
Serialize all representations in REP.  Store checksums in DIGEST_STREAM,
 put all other fields into REP_STREAM.
Serialize all representations in REP . Store checksums in DIGEST_STREAM put all other fields into REP_STREAM .