Subversion 1.6.16
Defines | Functions

Reading and writing hashtables to disk

Hash table serialization support

Reading/writing hashtables to disk. More...

Defines

#define SVN_HASH_TERMINATOR   "END"
 The conventional terminator for hash dumps.

Functions

svn_error_tsvn_hash_read2 (apr_hash_t *hash, svn_stream_t *stream, const char *terminator, apr_pool_t *pool)
 Read a hash table from stream, storing the resultants names and values in hash.
svn_error_tsvn_hash_write2 (apr_hash_t *hash, svn_stream_t *stream, const char *terminator, apr_pool_t *pool)
 Dump hash to stream.
svn_error_tsvn_hash_read_incremental (apr_hash_t *hash, svn_stream_t *stream, const char *terminator, apr_pool_t *pool)
 Similar to svn_hash_read2(), but allows stream to contain deletion lines which remove entries from hash as well as adding to it.
svn_error_tsvn_hash_write_incremental (apr_hash_t *hash, apr_hash_t *oldhash, svn_stream_t *stream, const char *terminator, apr_pool_t *pool)
 Similar to svn_hash_write2(), but only writes out entries for keys which differ between hash and oldhash, and also writes out deletion lines for keys which are present in oldhash but not in hash.
svn_error_tsvn_hash_read (apr_hash_t *hash, apr_file_t *srcfile, apr_pool_t *pool)
 This function behaves like svn_hash_read2(), but it only works on an apr_file_t input, empty files are accepted, and the hash is expected to be terminated with a line containing "END" or "PROPS-END".
svn_error_tsvn_hash_write (apr_hash_t *hash, apr_file_t *destfile, apr_pool_t *pool)
 This function behaves like svn_hash_write2(), but it only works on an apr_file_t output, and the terminator is always "END".

Detailed Description

Reading/writing hashtables to disk.


Define Documentation

#define SVN_HASH_TERMINATOR   "END"

The conventional terminator for hash dumps.

Since:
New in 1.1.

Definition at line 62 of file svn_hash.h.


Function Documentation

svn_error_t* svn_hash_read ( apr_hash_t *  hash,
apr_file_t *  srcfile,
apr_pool_t *  pool 
)

This function behaves like svn_hash_read2(), but it only works on an apr_file_t input, empty files are accepted, and the hash is expected to be terminated with a line containing "END" or "PROPS-END".

Deprecated:
Provided for backward compatibility with the 1.0 API.
svn_error_t* svn_hash_read2 ( apr_hash_t *  hash,
svn_stream_t stream,
const char *  terminator,
apr_pool_t *  pool 
)

Read a hash table from stream, storing the resultants names and values in hash.

Use a pool for all allocations. hash will have const char * keys and svn_string_t * values. If terminator is NULL, expect the hash to be terminated by the end of the stream; otherwise, expect the hash to be terminated by a line containing terminator. Pass SVN_HASH_TERMINATOR to use the conventional terminator "END".

Since:
New in 1.1.
svn_error_t* svn_hash_read_incremental ( apr_hash_t *  hash,
svn_stream_t stream,
const char *  terminator,
apr_pool_t *  pool 
)

Similar to svn_hash_read2(), but allows stream to contain deletion lines which remove entries from hash as well as adding to it.

Since:
New in 1.1.
svn_error_t* svn_hash_write ( apr_hash_t *  hash,
apr_file_t *  destfile,
apr_pool_t *  pool 
)

This function behaves like svn_hash_write2(), but it only works on an apr_file_t output, and the terminator is always "END".

Deprecated:
Provided for backward compatibility with the 1.0 API.
svn_error_t* svn_hash_write2 ( apr_hash_t *  hash,
svn_stream_t stream,
const char *  terminator,
apr_pool_t *  pool 
)

Dump hash to stream.

Use pool for all allocations. hash has const char * keys and svn_string_t * values. If terminator is not NULL, terminate the hash with a line containing terminator.

Since:
New in 1.1.
svn_error_t* svn_hash_write_incremental ( apr_hash_t *  hash,
apr_hash_t *  oldhash,
svn_stream_t stream,
const char *  terminator,
apr_pool_t *  pool 
)

Similar to svn_hash_write2(), but only writes out entries for keys which differ between hash and oldhash, and also writes out deletion lines for keys which are present in oldhash but not in hash.

Since:
New in 1.1.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines