FreeBSD/contrib/subversion/subversion/libsvn_repos/dump.c
/* Write headers, in arbitrary order.
 * ### TODO: use a stable order
 * ### Modifies HEADERS.
 */
Write headers, in arbitrary order.
TODO: use a stable order
Modifies HEADERS.
Write headers in arbitrary order . TODO : use a stable order Modifies HEADERS .
static svn_error_t *
write_revision_headers(svn_stream_t *stream,
                       apr_hash_t *headers,
                       apr_pool_t *scratch_pool)
{
  const char **h;
  apr_hash_index_t *hi;
  static const char *revision_headers_order[] =
  {
    SVN_REPOS_DUMPFILE_REVISION_NUMBER,  
    NULL
  };
  for (h = revision_headers_order; *h; h++)
    {
      SVN_ERR(write_header(stream, headers, *h, scratch_pool));
      svn_hash_sets(headers, *h, NULL);
    }
  for (hi = apr_hash_first(scratch_pool, headers); hi; hi = apr_hash_next(hi))
    {
      const char *key = apr_hash_this_key(hi);
      if (strcmp(key, SVN_REPOS_DUMPFILE_CONTENT_LENGTH) != 0)
        SVN_ERR(write_header(stream, headers, key, scratch_pool));
    }
  SVN_ERR(write_header(stream, headers, SVN_REPOS_DUMPFILE_CONTENT_LENGTH,
                       scratch_pool));
  return SVN_NO_ERROR;
}
static svn_error_t * write_revision_headers ( svn_stream_t * stream , apr_hash_t * headers , apr_pool_t * scratch_pool ) { const char * * h ; apr_hash_index_t * hi ; static const char * revision_headers_order [ ] = { SVN_REPOS_DUMPFILE_REVISION_NUMBER , NULL } ; for ( h = revision_headers_order ; * h ; h ++ ) { SVN_ERR ( write_header ( stream , headers , * h , scratch_pool ) ) ; svn_hash_sets ( headers , * h , NULL ) ; } for ( hi = apr_hash_first ( scratch_pool , headers ) ; hi ; hi = apr_hash_next ( hi ) ) { const char * key = apr_hash_this_key ( hi ) ; if ( strcmp ( key , SVN_REPOS_DUMPFILE_CONTENT_LENGTH ) != 0 ) SVN_ERR ( write_header ( stream , headers , key , scratch_pool ) ) ; } SVN_ERR ( write_header ( stream , headers , SVN_REPOS_DUMPFILE_CONTENT_LENGTH , scratch_pool ) ) ; return SVN_NO_ERROR ; }
Write headers, in arbitrary order.
Write headers in arbitrary order .
/* must be first */ /* Write some headers in a given order */ /* Write any and all remaining headers except Content-length.
   * ### TODO: use a stable order
   */ /* Content-length must be last */