GME  13
svn_hash.h
Go to the documentation of this file.
00001 
00028 #ifndef SVN_HASH_H
00029 #define SVN_HASH_H
00030 
00031 #include <apr.h>
00032 #include <apr_pools.h>
00033 #include <apr_hash.h>
00034 #include <apr_tables.h>
00035 #include <apr_file_io.h>  /* for apr_file_t */
00036 
00037 #include "svn_types.h"
00038 #include "svn_io.h"       /* for svn_stream_t */
00039 
00040 
00041 #ifdef __cplusplus
00042 extern "C" {
00043 #endif /* __cplusplus */
00044 
00045 
00047 #define SVN_KEYLINE_MAXLEN 100
00048 
00054 /*----------------------------------------------------*/
00055 
00067 #define SVN_HASH_TERMINATOR "END"
00068 
00080 svn_error_t *
00081 svn_hash_read2(apr_hash_t *hash,
00082                svn_stream_t *stream,
00083                const char *terminator,
00084                apr_pool_t *pool);
00085 
00094 svn_error_t *
00095 svn_hash_write2(apr_hash_t *hash,
00096                 svn_stream_t *stream,
00097                 const char *terminator,
00098                 apr_pool_t *pool);
00099 
00107 svn_error_t *
00108 svn_hash_read_incremental(apr_hash_t *hash,
00109                           svn_stream_t *stream,
00110                           const char *terminator,
00111                           apr_pool_t *pool);
00112 
00121 svn_error_t *
00122 svn_hash_write_incremental(apr_hash_t *hash,
00123                            apr_hash_t *oldhash,
00124                            svn_stream_t *stream,
00125                            const char *terminator,
00126                            apr_pool_t *pool);
00127 
00136 SVN_DEPRECATED
00137 svn_error_t *
00138 svn_hash_read(apr_hash_t *hash,
00139               apr_file_t *srcfile,
00140               apr_pool_t *pool);
00141 
00148 SVN_DEPRECATED
00149 svn_error_t *
00150 svn_hash_write(apr_hash_t *hash,
00151                apr_file_t *destfile,
00152                apr_pool_t *pool);
00153 
00156 
00164 enum svn_hash_diff_key_status
00165   {
00166     /* Key is present in both hashes. */
00167     svn_hash_diff_key_both,
00168 
00169     /* Key is present in first hash only. */
00170     svn_hash_diff_key_a,
00171 
00172     /* Key is present in second hash only. */
00173     svn_hash_diff_key_b
00174   };
00175 
00176 
00178 typedef svn_error_t *(*svn_hash_diff_func_t)
00179   (const void *key, apr_ssize_t klen,
00180    enum svn_hash_diff_key_status status,
00181    void *baton);
00182 
00183 
00201 svn_error_t *
00202 svn_hash_diff(apr_hash_t *hash_a,
00203               apr_hash_t *hash_b,
00204               svn_hash_diff_func_t diff_func,
00205               void *diff_func_baton,
00206               apr_pool_t *pool);
00207 
00210 
00225 svn_error_t *
00226 svn_hash_keys(apr_array_header_t **array,
00227               apr_hash_t *hash,
00228               apr_pool_t *pool);
00229 
00238 svn_error_t *
00239 svn_hash_from_cstring_keys(apr_hash_t **hash,
00240                            const apr_array_header_t *keys,
00241                            apr_pool_t *pool);
00242 
00247 #define svn_hash_gets(ht, key) \
00248             apr_hash_get(ht, key, APR_HASH_KEY_STRING)
00249 
00254 #define svn_hash_sets(ht, key, val) \
00255             apr_hash_set(ht, key, APR_HASH_KEY_STRING, val)
00256 
00261 #ifdef __cplusplus
00262 }
00263 #endif /* __cplusplus */
00264 
00265 #endif /* SVN_HASH_H */