1 /* changes.h --- FSX changed paths lists container
3 * ====================================================================
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
20 * ====================================================================
23 #ifndef SVN_LIBSVN_FS__CHANGES_H
24 #define SVN_LIBSVN_FS__CHANGES_H
29 /* Entries in a revision's change list tend to be widely redundant (similar
30 * changes to similar paths). Even more so, change lists from a larger
31 * revision range also tend to overlap.
33 * In its serialized form, the svn_fs_x__changes_t container extracts most
34 * of that redundancy and the run-time representation is also much smaller
35 * than sum of the respective svn_fs_x__change_t* arrays.
37 * As with other containers, this one has two modes: 'construction', in
38 * which you may add data to it, and 'getter' in which there is only r/o
42 /* An opaque collection of change lists (apr_array_header_t * of
43 * svn_fs_x__change_t *).
45 typedef struct svn_fs_x__changes_t svn_fs_x__changes_t;
47 /* Create and populate changes containers. */
49 /* Create and return a new changes container with an initial capacity of
50 * INITIAL_COUNT svn_fs_x__change_t objects.
51 * Allocate the result in RESULT_POOL.
54 svn_fs_x__changes_create(apr_size_t initial_count,
55 apr_pool_t *result_pool);
57 /* Start a new change list CHANGES (implicitly terminating the previous one)
58 * and return its index in *LIST_INDEX. Append all changes from LIST to
59 * that new change list.
62 svn_fs_x__changes_append_list(apr_size_t *list_index,
63 svn_fs_x__changes_t *changes,
64 apr_array_header_t *list);
66 /* Return a rough estimate in bytes for the serialized representation
70 svn_fs_x__changes_estimate_size(const svn_fs_x__changes_t *changes);
72 /* Read changes containers. */
74 /* From CHANGES, extract the change list with the given IDX. Allocate
75 * the result in POOL and return it in *LIST.
78 svn_fs_x__changes_get_list(apr_array_header_t **list,
79 const svn_fs_x__changes_t *changes,
85 /* Write a serialized representation of CHANGES to STREAM.
86 * Use SCRATCH_POOL for temporary allocations.
89 svn_fs_x__write_changes_container(svn_stream_t *stream,
90 const svn_fs_x__changes_t *changes,
91 apr_pool_t *scratch_pool);
93 /* Read a changes container from its serialized representation in STREAM.
94 * Allocate the result in RESULT_POOL and return it in *CHANGES_P. Use
95 * SCRATCH_POOL for temporary allocations.
98 svn_fs_x__read_changes_container(svn_fs_x__changes_t **changes_p,
100 apr_pool_t *result_pool,
101 apr_pool_t *scratch_pool);
103 /* Implements #svn_cache__serialize_func_t for svn_fs_x__changes_t objects.
106 svn_fs_x__serialize_changes_container(void **data,
107 apr_size_t *data_len,
111 /* Implements #svn_cache__deserialize_func_t for svn_fs_x__changes_t objects.
114 svn_fs_x__deserialize_changes_container(void **out,
119 /* Implements svn_cache__partial_getter_func_t for svn_fs_x__changes_t,
120 * setting *OUT to the change list (apr_array_header_t *) selected by
121 * the apr_uint32_t index passed in as *BATON. This function is similar
122 * to svn_fs_x__changes_get_list but operates on the cache serialized
123 * representation of the container.
126 svn_fs_x__changes_get_list_func(void **out,