blncache.h revision 299742
1/*
2 * blncache.h: DAV baseline information cache.
3 *
4 * ====================================================================
5 *    Licensed to the Apache Software Foundation (ASF) under one
6 *    or more contributor license agreements.  See the NOTICE file
7 *    distributed with this work for additional information
8 *    regarding copyright ownership.  The ASF licenses this file
9 *    to you under the Apache License, Version 2.0 (the
10 *    "License"); you may not use this file except in compliance
11 *    with the License.  You may obtain a copy of the License at
12 *
13 *      http://www.apache.org/licenses/LICENSE-2.0
14 *
15 *    Unless required by applicable law or agreed to in writing,
16 *    software distributed under the License is distributed on an
17 *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18 *    KIND, either express or implied.  See the License for the
19 *    specific language governing permissions and limitations
20 *    under the License.
21 * ====================================================================
22 */
23
24#ifndef SVN_LIBSVN_RA_SERF_BLNCACHE_H
25#define SVN_LIBSVN_RA_SERF_BLNCACHE_H
26
27#include <apr_pools.h>
28
29#include "svn_types.h"
30
31#ifdef __cplusplus
32extern "C" {
33#endif /* __cplusplus */
34
35/* Baseline information cache. Baseline information cache holds information
36 * about DAV baseline (bln):
37 * 1. URL of the baseline (bln)
38 * 2. Revision number associated with baseline
39 * 3. URL of baseline collection (bc).
40 */
41typedef struct svn_ra_serf__blncache_t svn_ra_serf__blncache_t;
42
43/* Creates new instance of baseline cache. Sets BLNCACHE_P with
44 * a pointer to new instance, allocated in POOL.
45 */
46svn_error_t *
47svn_ra_serf__blncache_create(svn_ra_serf__blncache_t **blncache_p,
48                             apr_pool_t *pool);
49
50/* Add information about baseline. BLNCACHE is a pointer to
51 * baseline cache previously created using svn_ra_serf__blncache_create
52 * function. BASELINE_URL is URL of baseline (can be NULL if unknown).
53 * REVNUM is revision number associated with baseline. Use SVN_INVALID_REVNUM
54 * to indicate that revision is unknown.
55 * BC_URL is URL of baseline collection (can be NULL if unknwon).
56 */
57svn_error_t *
58svn_ra_serf__blncache_set(svn_ra_serf__blncache_t *blncache,
59                          const char *baseline_url,
60                          svn_revnum_t revnum,
61                          const char *bc_url,
62                          apr_pool_t *scratch_pool);
63
64/* Sets *BC_URL_P with a pointer to baseline collection URL for the given
65 * REVNUM. *BC_URL_P will be NULL if cache doesn't have information about
66 * this baseline.
67 */
68svn_error_t *
69svn_ra_serf__blncache_get_bc_url(const char **bc_url_p,
70                                 svn_ra_serf__blncache_t *blncache,
71                                 svn_revnum_t revnum,
72                                 apr_pool_t *result_pool);
73
74/* Sets *BC_URL_P with pointer to baseline collection URL and *REVISION_P
75 * with revision number of baseline BASELINE_URL. *BC_URL_P will be NULL,
76 * *REVNUM_P will SVN_INVALID_REVNUM if cache doesn't have such
77 * information.
78 */
79svn_error_t *
80svn_ra_serf__blncache_get_baseline_info(const char **bc_url_p,
81                                        svn_revnum_t *revnum_p,
82                                        svn_ra_serf__blncache_t *blncache,
83                                        const char *baseline_url,
84                                        apr_pool_t *pool);
85
86#ifdef __cplusplus
87}
88#endif /* __cplusplus */
89
90#endif /* SVN_LIBSVN_RA_SERF_BLNCACHE_H*/
91