1/* miscellaneous-table.h : internal interface to ops on `miscellaneous' table
2 *
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
11 *
12 *      http://www.apache.org/licenses/LICENSE-2.0
13 *
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
19 *    under the License.
20 * ====================================================================
21 */
22
23#ifndef SVN_LIBSVN_FS_MISCELLANEOUS_TABLE_H
24#define SVN_LIBSVN_FS_MISCELLANEOUS_TABLE_H
25
26#include "svn_fs.h"
27#include "svn_error.h"
28#include "../trail.h"
29#include "../fs.h"
30
31#ifdef __cplusplus
32extern "C" {
33#endif /* __cplusplus */
34
35
36/* Open a `miscellaneous' table in ENV.  If CREATE is non-zero, create
37   one if it doesn't exist.  Set *MISCELLANEOUS_P to the new table.
38   Return a Berkeley DB error code.  */
39int
40svn_fs_bdb__open_miscellaneous_table(DB **miscellaneous_p,
41                                     DB_ENV *env,
42                                     svn_boolean_t create);
43
44
45/* Add data to the `miscellaneous' table in FS, as part of TRAIL.
46
47   KEY and VAL should be NULL-terminated strings.  If VAL is NULL,
48   the key is removed from the table. */
49svn_error_t *
50svn_fs_bdb__miscellaneous_set(svn_fs_t *fs,
51                              const char *key,
52                              const char *val,
53                              trail_t *trail,
54                              apr_pool_t *pool);
55
56
57/* Set *VAL to the value of data cooresponding to KEY in the
58   `miscellaneous' table of FS, or to NULL if that key isn't found. */
59svn_error_t *
60svn_fs_bdb__miscellaneous_get(const char **val,
61                              svn_fs_t *fs,
62                              const char *key,
63                              trail_t *trail,
64                              apr_pool_t *pool);
65
66
67#ifdef __cplusplus
68}
69#endif /* __cplusplus */
70
71#endif /* SVN_LIBSVN_FS_MISCELLANEOUS_TABLE_H */
72