1251881Speter/*
2251881Speter * blncache.h: DAV baseline information cache.
3251881Speter *
4251881Speter * ====================================================================
5251881Speter *    Licensed to the Apache Software Foundation (ASF) under one
6251881Speter *    or more contributor license agreements.  See the NOTICE file
7251881Speter *    distributed with this work for additional information
8251881Speter *    regarding copyright ownership.  The ASF licenses this file
9251881Speter *    to you under the Apache License, Version 2.0 (the
10251881Speter *    "License"); you may not use this file except in compliance
11251881Speter *    with the License.  You may obtain a copy of the License at
12251881Speter *
13251881Speter *      http://www.apache.org/licenses/LICENSE-2.0
14251881Speter *
15251881Speter *    Unless required by applicable law or agreed to in writing,
16251881Speter *    software distributed under the License is distributed on an
17251881Speter *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18251881Speter *    KIND, either express or implied.  See the License for the
19251881Speter *    specific language governing permissions and limitations
20251881Speter *    under the License.
21251881Speter * ====================================================================
22251881Speter */
23251881Speter
24251881Speter#ifndef SVN_LIBSVN_RA_SERF_BLNCACHE_H
25251881Speter#define SVN_LIBSVN_RA_SERF_BLNCACHE_H
26251881Speter
27251881Speter#include <apr_pools.h>
28251881Speter
29251881Speter#include "svn_types.h"
30251881Speter
31251881Speter#ifdef __cplusplus
32251881Speterextern "C" {
33251881Speter#endif /* __cplusplus */
34251881Speter
35251881Speter/* Baseline information cache. Baseline information cache holds information
36251881Speter * about DAV baseline (bln):
37251881Speter * 1. URL of the baseline (bln)
38251881Speter * 2. Revision number associated with baseline
39251881Speter * 3. URL of baseline collection (bc).
40251881Speter */
41251881Spetertypedef struct svn_ra_serf__blncache_t svn_ra_serf__blncache_t;
42251881Speter
43251881Speter/* Creates new instance of baseline cache. Sets BLNCACHE_P with
44251881Speter * a pointer to new instance, allocated in POOL.
45251881Speter */
46251881Spetersvn_error_t *
47251881Spetersvn_ra_serf__blncache_create(svn_ra_serf__blncache_t **blncache_p,
48251881Speter                             apr_pool_t *pool);
49251881Speter
50251881Speter/* Add information about baseline. BLNCACHE is a pointer to
51251881Speter * baseline cache previously created using svn_ra_serf__blncache_create
52251881Speter * function. BASELINE_URL is URL of baseline (can be NULL if unknown).
53251881Speter * REVNUM is revision number associated with baseline. Use SVN_INVALID_REVNUM
54251881Speter * to indicate that revision is unknown.
55251881Speter * BC_URL is URL of baseline collection (can be NULL if unknwon).
56251881Speter */
57251881Spetersvn_error_t *
58251881Spetersvn_ra_serf__blncache_set(svn_ra_serf__blncache_t *blncache,
59251881Speter                          const char *baseline_url,
60251881Speter                          svn_revnum_t revnum,
61251881Speter                          const char *bc_url,
62289180Speter                          apr_pool_t *scratch_pool);
63251881Speter
64251881Speter/* Sets *BC_URL_P with a pointer to baseline collection URL for the given
65251881Speter * REVNUM. *BC_URL_P will be NULL if cache doesn't have information about
66251881Speter * this baseline.
67251881Speter */
68251881Spetersvn_error_t *
69251881Spetersvn_ra_serf__blncache_get_bc_url(const char **bc_url_p,
70251881Speter                                 svn_ra_serf__blncache_t *blncache,
71251881Speter                                 svn_revnum_t revnum,
72289180Speter                                 apr_pool_t *result_pool);
73251881Speter
74251881Speter/* Sets *BC_URL_P with pointer to baseline collection URL and *REVISION_P
75251881Speter * with revision number of baseline BASELINE_URL. *BC_URL_P will be NULL,
76251881Speter * *REVNUM_P will SVN_INVALID_REVNUM if cache doesn't have such
77251881Speter * information.
78251881Speter */
79251881Spetersvn_error_t *
80251881Spetersvn_ra_serf__blncache_get_baseline_info(const char **bc_url_p,
81251881Speter                                        svn_revnum_t *revnum_p,
82251881Speter                                        svn_ra_serf__blncache_t *blncache,
83251881Speter                                        const char *baseline_url,
84251881Speter                                        apr_pool_t *pool);
85251881Speter
86251881Speter#ifdef __cplusplus
87251881Speter}
88251881Speter#endif /* __cplusplus */
89251881Speter
90251881Speter#endif /* SVN_LIBSVN_RA_SERF_BLNCACHE_H*/
91