Followup to r29625: fix getopt tests.
[svn.git] / subversion / include / private / svn_wc_private.h
blobb2262b058cebb676472e125227a987cd51eb1caa
1 /**
2 * @copyright
3 * ====================================================================
4 * Copyright (c) 2007 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 * ====================================================================
16 * @endcopyright
18 * @file svn_wc_private.h
19 * @brief The Subversion Working Copy Library - Internal routines
21 * Requires:
22 * - A working copy
24 * Provides:
25 * - Ability to manipulate working copy's versioned data.
26 * - Ability to manipulate working copy's administrative files.
28 * Used By:
29 * - Clients.
32 #ifndef SVN_WC_PRIVATE_H
33 #define SVN_WC_PRIVATE_H
35 #include "svn_wc.h"
37 #ifdef __cplusplus
38 extern "C" {
39 #endif /* __cplusplus */
41 /** Internal function used by the svn_wc_entry_versioned() macro.
43 * @since New in 1.5.
45 svn_error_t *
46 svn_wc__entry_versioned_internal(const svn_wc_entry_t **entry,
47 const char *path,
48 svn_wc_adm_access_t *adm_access,
49 svn_boolean_t show_hidden,
50 const char *caller_filename,
51 int caller_lineno,
52 apr_pool_t *pool);
55 /** Same as svn_wc_entry() except that the entry returned
56 * is a non @c NULL entry.
58 * Returns an error when svn_wc_entry() would have returned a @c NULL entry.
60 * @since New in 1.5.
63 #ifdef SVN_DEBUG
64 #define svn_wc__entry_versioned(entry, path, adm_access, show_hidden, pool) \
65 svn_wc__entry_versioned_internal((entry), (path), (adm_access), \
66 (show_hidden), __FILE__, __LINE__, (pool))
67 #else
68 #define svn_wc__entry_versioned(entry, path, adm_access, show_hidden, pool) \
69 svn_wc__entry_versioned_internal((entry), (path), (adm_access), \
70 (show_hidden), NULL, 0, (pool))
71 #endif
73 /** If @a path's properties are modified with regard to the base revision set
74 * @a *which_props to a hashtable
75 * (<tt>const char *name</tt> -> <tt>const svn_string_t *value</tt>)
76 * that contains only the modified properties or an empty hash if there are
77 * no modifications. @a adm_access must be an access baton for @a path.
78 * @a *which_props is allocated in @a pool.
80 * @since New in 1.5.
82 svn_error_t *svn_wc__props_modified(const char *path,
83 apr_hash_t **which_props,
84 svn_wc_adm_access_t *adm_access,
85 apr_pool_t *pool);
87 /** Given a @a wcpath with its accompanying @a entry, set @a *switched to
88 * true if @a wcpath is switched, otherwise set @a *switched to false.
89 * If @a entry is an incomplete entry obtained from @a wcpath's parent return
90 * @c SVN_ERR_ENTRY_MISSING_URL. All allocations are done in @a pool.
92 * @since New in 1.5.
94 svn_error_t *
95 svn_wc__path_switched(const char *wcpath,
96 svn_boolean_t *switched,
97 const svn_wc_entry_t *entry,
98 apr_pool_t *pool);
101 /* Return the shallowest sufficient @c levels_to_lock value for @a depth;
102 * see the @a levels_to_lock parameter of svn_wc_adm_open3() and
103 * similar functions for more information.
105 #define SVN_WC__LEVELS_TO_LOCK_FROM_DEPTH(depth) \
106 (((depth) == svn_depth_empty || (depth) == svn_depth_files) \
107 ? 0 : (((depth) == svn_depth_immediates) ? 1 : -1))
110 /* Return TRUE iff CLHASH (a hash whose keys are const char *
111 changelist names) is NULL or if ENTRY->changelist (which may be
112 NULL) is a key in CLHASH. */
113 #define SVN_WC__CL_MATCH(clhash, entry) \
114 (((clhash == NULL) \
115 || (entry \
116 && entry->changelist \
117 && apr_hash_get(clhash, entry->changelist, \
118 APR_HASH_KEY_STRING))) ? TRUE : FALSE)
120 #ifdef __cplusplus
122 #endif /* __cplusplus */
124 #endif /* SVN_WC_PRIVATE_H */