~svn/ubuntu/raring/subversion/ppa

« back to all changes in this revision

Viewing changes to subversion/libsvn_fs_fs/fs.h

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:26:14 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205012614-qom4xfypgtsqc2xq
Tags: 1.2.3dfsg1-3ubuntu1
Merge with the final Debian release of 1.2.3dfsg1-3, bringing in
fixes to the clean target, better documentation of the libdb4.3
upgrade and build fixes to work with swig1.3_1.3.27.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* fs.h : interface to Subversion filesystem, private to libsvn_fs
 
2
 *
 
3
 * ====================================================================
 
4
 * Copyright (c) 2000-2004 CollabNet.  All rights reserved.
 
5
 *
 
6
 * This software is licensed as described in the file COPYING, which
 
7
 * you should have received as part of this distribution.  The terms
 
8
 * are also available at http://subversion.tigris.org/license-1.html.
 
9
 * If newer versions of this license are posted there, you may use a
 
10
 * newer version instead, at your option.
 
11
 *
 
12
 * This software consists of voluntary contributions made by many
 
13
 * individuals.  For exact contribution history, see the revision
 
14
 * history and logs, available at http://subversion.tigris.org/.
 
15
 * ====================================================================
 
16
 */
 
17
 
 
18
#ifndef SVN_LIBSVN_FS_FS_H
 
19
#define SVN_LIBSVN_FS_FS_H
 
20
 
 
21
#include <apr_pools.h>
 
22
#include <apr_hash.h>
 
23
#include <apr_md5.h>
 
24
#include <apr_thread_mutex.h>
 
25
#include "svn_fs.h"
 
26
 
 
27
#ifdef __cplusplus
 
28
extern "C" {
 
29
#endif /* __cplusplus */
 
30
 
 
31
 
 
32
/*** The filesystem structure.  ***/
 
33
 
 
34
/* The format number of this filesystem.
 
35
   This is independent of the repository format number, and
 
36
   independent of any other FS back ends. */
 
37
#define SVN_FS_FS__FORMAT_NUMBER   1
 
38
 
 
39
typedef struct
 
40
{
 
41
  /* A cache of the last directory opened within the filesystem. */
 
42
  svn_fs_id_t *dir_cache_id;
 
43
  apr_hash_t *dir_cache;
 
44
  apr_pool_t *dir_cache_pool;
 
45
 
 
46
  /* The format number of this FS. */
 
47
  int format;
 
48
 
 
49
  /* The uuid of this FS. */
 
50
  const char *uuid;
 
51
 
 
52
#if APR_HAS_THREADS
 
53
  /* A lock for intra-process synchronization when grabbing the
 
54
     repository write lock.  Common to all repositories with the same
 
55
     uuid; discovered using the serialized_init function. */
 
56
  apr_thread_mutex_t *lock;
 
57
#endif
 
58
} fs_fs_data_t;
 
59
 
 
60
 
 
61
/* Return a canonicalized version of a filesystem PATH, allocated in
 
62
   POOL.  While the filesystem API is pretty flexible about the
 
63
   incoming paths (they must be UTF-8 with '/' as separators, but they
 
64
   don't have to begin with '/', and multiple contiguous '/'s are
 
65
   ignored) we want any paths that are physically stored in the
 
66
   underlying database to look consistent.  Specifically, absolute
 
67
   filesystem paths should begin with '/', and all redundant and trailing '/'
 
68
   characters be removed.  */
 
69
const char *
 
70
svn_fs_fs__canonicalize_abspath (const char *path, apr_pool_t *pool);
 
71
 
 
72
 
 
73
/*** Filesystem Revision ***/
 
74
typedef struct
 
75
{
 
76
  /* id of the transaction that was committed to create this
 
77
     revision. */
 
78
  const char *txn_id;
 
79
 
 
80
} revision_t;
 
81
 
 
82
 
 
83
/*** Transaction Kind ***/
 
84
typedef enum
 
85
{
 
86
  transaction_kind_normal = 1,  /* normal, uncommitted */
 
87
  transaction_kind_committed,   /* committed */
 
88
  transaction_kind_dead         /* uncommitted and dead */
 
89
 
 
90
} transaction_kind_t;
 
91
 
 
92
 
 
93
/*** Filesystem Transaction ***/
 
94
typedef struct
 
95
{
 
96
  /* kind of transaction. */
 
97
  transaction_kind_t kind;
 
98
 
 
99
  /* property list (const char * name, svn_string_t * value).
 
100
     may be NULL if there are no properties.  */
 
101
  apr_hash_t *proplist;
 
102
 
 
103
  /* node revision id of the root node.  */
 
104
  const svn_fs_id_t *root_id;
 
105
 
 
106
  /* node revision id of the node which is the root of the revision
 
107
     upon which this txn is base.  (unfinished only) */
 
108
  const svn_fs_id_t *base_id;
 
109
 
 
110
  /* copies list (const char * copy_ids), or NULL if there have been
 
111
     no copies in this transaction.  */
 
112
  apr_array_header_t *copies;
 
113
 
 
114
} transaction_t;
 
115
 
 
116
/*** Copy Kind ***/
 
117
typedef enum
 
118
{
 
119
  copy_kind_real = 1, /* real copy */
 
120
  copy_kind_soft      /* soft copy */
 
121
 
 
122
} copy_kind_t;
 
123
 
 
124
 
 
125
/*** Representation ***/
 
126
typedef struct
 
127
{
 
128
  /* MD5 checksum for the contents produced by this representation.
 
129
     This checksum is for the contents the rep shows to consumers,
 
130
     regardless of how the rep stores the data under the hood.  It is
 
131
     independent of the storage (fulltext, delta, whatever). 
 
132
 
 
133
     If all the bytes are 0, then for compatibility behave as though
 
134
     this checksum matches the expected checksum. */
 
135
  unsigned char checksum[APR_MD5_DIGESTSIZE];
 
136
 
 
137
  /* Revision where this representation is located. */
 
138
  svn_revnum_t revision;
 
139
 
 
140
  /* Offset into the revision file where it is located. */
 
141
  apr_off_t offset;
 
142
 
 
143
  /* The size of the representation in bytes as seen in the revision
 
144
     file. */
 
145
  svn_filesize_t size;
 
146
 
 
147
  /* The size of the fulltext of the representation. */
 
148
  svn_filesize_t expanded_size;
 
149
 
 
150
  /* Is this representation a transaction? */
 
151
  const char *txn_id;
 
152
 
 
153
} representation_t;
 
154
 
 
155
 
 
156
/*** Node-Revision ***/
 
157
typedef struct
 
158
{
 
159
  /* node kind */
 
160
  svn_node_kind_t kind;
 
161
 
 
162
  /* The node-id for this node-rev. */
 
163
  const svn_fs_id_t *id;
 
164
 
 
165
  /* predecessor node revision id, or NULL if there is no predecessor
 
166
     for this node revision */
 
167
  const svn_fs_id_t *predecessor_id;
 
168
 
 
169
  /* If this node-rev is a copy, where was it copied from? */
 
170
  const char *copyfrom_path;
 
171
  svn_revnum_t copyfrom_rev;
 
172
 
 
173
  /* Helper for history tracing, root of the parent tree from whence
 
174
     this node-rev was copied. */
 
175
  svn_revnum_t copyroot_rev;
 
176
  const char *copyroot_path;
 
177
  
 
178
  /* number of predecessors this node revision has (recursively), or
 
179
     -1 if not known (for backward compatibility). */
 
180
  int predecessor_count;
 
181
 
 
182
  /* representation key for this node's properties.  may be NULL if
 
183
     there are no properties.  */
 
184
  representation_t *prop_rep;
 
185
 
 
186
  /* representation for this node's data.  may be NULL if there is
 
187
     no data. */
 
188
  representation_t *data_rep;
 
189
  
 
190
  /* path at which this node first came into existence.  */
 
191
  const char *created_path;
 
192
 
 
193
} node_revision_t;
 
194
 
 
195
 
 
196
/*** Representation Kind ***/
 
197
typedef enum
 
198
{
 
199
  rep_kind_fulltext = 1, /* fulltext */
 
200
  rep_kind_delta         /* delta */
 
201
 
 
202
} rep_kind_t;
 
203
 
 
204
 
 
205
/*** "Delta" Offset/Window Chunk ***/
 
206
typedef struct 
 
207
{
 
208
  /* diff format version number ### at this point, "svndiff" is the
 
209
     only format used. */
 
210
  apr_byte_t version;
 
211
 
 
212
  /* starting offset of the data represented by this chunk */
 
213
  svn_filesize_t offset;
 
214
 
 
215
  /* string-key to which this representation points. */
 
216
  const char *string_key; 
 
217
 
 
218
  /* size of the fulltext data represented by this delta window. */
 
219
  apr_size_t size;
 
220
 
 
221
  /* represenatation-key to use when needed source data for
 
222
     undeltification. */
 
223
  const char *rep_key;
 
224
 
 
225
  /* apr_off_t rep_offset;  ### not implemented */
 
226
 
 
227
} rep_delta_chunk_t;
 
228
 
 
229
 
 
230
 
 
231
 
 
232
/*** Copy ***/
 
233
typedef struct
 
234
{
 
235
  /* What kind of copy occurred. */
 
236
  copy_kind_t kind;
 
237
 
 
238
  /* Path of copy source. */
 
239
  const char *src_path;
 
240
 
 
241
  /* Transaction id of copy source. */
 
242
  const char *src_txn_id;
 
243
 
 
244
  /* Node-revision of copy destination. */
 
245
  const svn_fs_id_t *dst_noderev_id;
 
246
 
 
247
} copy_t;
 
248
 
 
249
 
 
250
/*** Change ***/
 
251
typedef struct
 
252
{
 
253
  /* Path of the change. */
 
254
  const char *path;
 
255
 
 
256
  /* Node revision ID of the change. */
 
257
  const svn_fs_id_t *noderev_id;
 
258
 
 
259
  /* The kind of change. */
 
260
  svn_fs_path_change_kind_t kind;
 
261
 
 
262
  /* Text or property mods? */
 
263
  svn_boolean_t text_mod;
 
264
  svn_boolean_t prop_mod;
 
265
 
 
266
  /* Copyfrom revision and path. */
 
267
  svn_revnum_t copyfrom_rev;
 
268
  const char * copyfrom_path;
 
269
 
 
270
} change_t;
 
271
 
 
272
 
 
273
#ifdef __cplusplus
 
274
}
 
275
#endif /* __cplusplus */
 
276
 
 
277
#endif /* SVN_LIBSVN_FS_FS_H */