In the command-line client, forbid
[svn.git] / subversion / libsvn_fs_fs / id.h
blob01ee28cdfadcd6dc7cc141692803d91c75290af5
1 /* id.h : interface to node ID functions, private to libsvn_fs_fs
3 * ====================================================================
4 * Copyright (c) 2000-2004 CollabNet. All rights reserved.
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.
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 * ====================================================================
18 #ifndef SVN_LIBSVN_FS_FS_ID_H
19 #define SVN_LIBSVN_FS_FS_ID_H
21 #include "svn_fs.h"
23 #ifdef __cplusplus
24 extern "C" {
25 #endif /* __cplusplus */
28 /*** ID accessor functions. ***/
30 /* Get the "node id" portion of ID. */
31 const char *svn_fs_fs__id_node_id(const svn_fs_id_t *id);
33 /* Get the "copy id" portion of ID. */
34 const char *svn_fs_fs__id_copy_id(const svn_fs_id_t *id);
36 /* Get the "txn id" portion of ID, or NULL if it is a permanent ID. */
37 const char *svn_fs_fs__id_txn_id(const svn_fs_id_t *id);
39 /* Get the "rev" portion of ID, or SVN_INVALID_REVNUM if it is a
40 transaction ID. */
41 svn_revnum_t svn_fs_fs__id_rev(const svn_fs_id_t *id);
43 /* Access the "offset" portion of the ID, or -1 if it is a transaction
44 ID. */
45 apr_off_t svn_fs_fs__id_offset(const svn_fs_id_t *id);
47 /* Convert ID into string form, allocated in POOL. */
48 svn_string_t *svn_fs_fs__id_unparse(const svn_fs_id_t *id,
49 apr_pool_t *pool);
51 /* Return true if A and B are equal. */
52 svn_boolean_t svn_fs_fs__id_eq(const svn_fs_id_t *a,
53 const svn_fs_id_t *b);
55 /* Return true if A and B are related. */
56 svn_boolean_t svn_fs_fs__id_check_related(const svn_fs_id_t *a,
57 const svn_fs_id_t *b);
59 /* Return 0 if A and B are equal, 1 if they are related, -1 otherwise. */
60 int svn_fs_fs__id_compare(const svn_fs_id_t *a,
61 const svn_fs_id_t *b);
63 /* Create an ID within a transaction based on NODE_ID, COPY_ID, and
64 TXN_ID, allocated in POOL. */
65 svn_fs_id_t *svn_fs_fs__id_txn_create(const char *node_id,
66 const char *copy_id,
67 const char *txn_id,
68 apr_pool_t *pool);
70 /* Create a permanent ID based on NODE_ID, COPY_ID, REV, and OFFSET,
71 allocated in POOL. */
72 svn_fs_id_t *svn_fs_fs__id_rev_create(const char *node_id,
73 const char *copy_id,
74 svn_revnum_t rev,
75 apr_off_t offset,
76 apr_pool_t *pool);
78 /* Return a copy of ID, allocated from POOL. */
79 svn_fs_id_t *svn_fs_fs__id_copy(const svn_fs_id_t *id,
80 apr_pool_t *pool);
82 /* Return an ID resulting from parsing the string DATA (with length
83 LEN), or NULL if DATA is an invalid ID string. */
84 svn_fs_id_t *svn_fs_fs__id_parse(const char *data,
85 apr_size_t len,
86 apr_pool_t *pool);
88 #ifdef __cplusplus
90 #endif /* __cplusplus */
92 #endif /* SVN_LIBSVN_FS_FS_ID_H */