TortoiseGitMerge: Updated libsvn stuff
[TortoiseGit.git] / src / TortoiseMerge / svninclude / svn_types.h
blobb5982d1402486eaca5380ad0ee2ae3f5e30a8896
1 /**
2 * @copyright
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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 * @endcopyright
23 * @file svn_types.h
24 * @brief Subversion's data types
27 #ifndef SVN_TYPES_H
28 #define SVN_TYPES_H
30 /* ### this should go away, but it causes too much breakage right now */
31 #include <stdlib.h>
32 #include <limits.h> /* for ULONG_MAX */
34 #include <apr.h> /* for apr_size_t, apr_int64_t, ... */
35 #include <apr_errno.h> /* for apr_status_t */
36 #include <apr_pools.h> /* for apr_pool_t */
37 #include <apr_hash.h> /* for apr_hash_t */
38 #include <apr_tables.h> /* for apr_array_push() */
39 #include <apr_time.h> /* for apr_time_t */
40 #include <apr_strings.h> /* for apr_atoi64() */
42 #ifdef __cplusplus
43 extern "C" {
44 #endif /* __cplusplus */
48 /** Macro used to mark deprecated functions.
50 * @since New in 1.6.
52 #ifndef SVN_DEPRECATED
53 # if !defined(SWIGPERL) && !defined(SWIGPYTHON) && !defined(SWIGRUBY)
54 # if defined(__GNUC__) && (__GNUC__ >= 4 || (__GNUC__==3 && __GNUC_MINOR__>=1))
55 # define SVN_DEPRECATED __attribute__((deprecated))
56 # elif defined(_MSC_VER) && _MSC_VER >= 1300
57 # define SVN_DEPRECATED __declspec(deprecated)
58 # else
59 # define SVN_DEPRECATED
60 # endif
61 # else
62 # define SVN_DEPRECATED
63 # endif
64 #endif
67 /** Indicate whether the current platform supports unaligned data access.
69 * On the majority of machines running SVN (x86 / x64), unaligned access
70 * is much cheaper than repeated aligned access. Define this macro to 1
71 * on those machines.
72 * Unaligned access on other machines (e.g. IA64) will trigger memory
73 * access faults or simply misbehave.
75 * @since New in 1.7.
77 #ifndef SVN_UNALIGNED_ACCESS_IS_OK
78 # if defined(_M_IX86) || defined(_M_X64) || defined(i386) || defined(__x86_64)
79 # define SVN_UNALIGNED_ACCESS_IS_OK 1
80 # else
81 # define SVN_UNALIGNED_ACCESS_IS_OK 0
82 # endif
83 #endif
87 /** YABT: Yet Another Boolean Type */
88 typedef int svn_boolean_t;
90 #ifndef TRUE
91 /** uhh... true */
92 #define TRUE 1
93 #endif /* TRUE */
95 #ifndef FALSE
96 /** uhh... false */
97 #define FALSE 0
98 #endif /* FALSE */
102 /** Subversion error object.
104 * Defined here, rather than in svn_error.h, to avoid a recursive @#include
105 * situation.
107 typedef struct svn_error_t
109 /** APR error value; possibly an SVN_ custom error code (see
110 * `svn_error_codes.h' for a full listing).
112 apr_status_t apr_err;
114 /** Details from the producer of error.
116 * Note that if this error was generated by Subversion's API, you'll
117 * probably want to use svn_err_best_message() to get a single
118 * descriptive string for this error chain (see the @a child member)
119 * or svn_handle_error2() to print the error chain in full. This is
120 * because Subversion's API functions sometimes add many links to
121 * the error chain that lack details (used only to produce virtual
122 * stack traces). (Use svn_error_purge_tracing() to remove those
123 * trace-only links from the error chain.)
125 const char *message;
127 /** Pointer to the error we "wrap" (may be @c NULL). Via this
128 * member, individual error object can be strung together into an
129 * "error chain".
131 struct svn_error_t *child;
133 /** The pool in which this error object is allocated. (If
134 * Subversion's APIs are used to manage error chains, then this pool
135 * will contain the whole error chain of which this object is a
136 * member.) */
137 apr_pool_t *pool;
139 /** Source file where the error originated (iff @c SVN_DEBUG;
140 * undefined otherwise).
142 const char *file;
144 /** Source line where the error originated (iff @c SVN_DEBUG;
145 * undefined otherwise).
147 long line;
149 } svn_error_t;
153 /* See svn_version.h.
154 Defined here to avoid including svn_version.h from all public headers. */
155 typedef struct svn_version_t svn_version_t;
159 /** @defgroup APR_ARRAY_compat_macros APR Array Compatibility Helper Macros
160 * These macros are provided by APR itself from version 1.3.
161 * Definitions are provided here for when using older versions of APR.
162 * @{
165 /** index into an apr_array_header_t */
166 #ifndef APR_ARRAY_IDX
167 #define APR_ARRAY_IDX(ary,i,type) (((type *)(ary)->elts)[i])
168 #endif
170 /** easier array-pushing syntax */
171 #ifndef APR_ARRAY_PUSH
172 #define APR_ARRAY_PUSH(ary,type) (*((type *)apr_array_push(ary)))
173 #endif
175 /** @} */
179 /** @defgroup apr_hash_utilities APR Hash Table Helpers
180 * These functions enable the caller to dereference an APR hash table index
181 * without type casts or temporary variables.
183 * ### These are private, and may go away when APR implements them natively.
184 * @{
187 /** Return the key of the hash table entry indexed by @a hi. */
188 const void *
189 svn__apr_hash_index_key(const apr_hash_index_t *hi);
191 /** Return the key length of the hash table entry indexed by @a hi. */
192 apr_ssize_t
193 svn__apr_hash_index_klen(const apr_hash_index_t *hi);
195 /** Return the value of the hash table entry indexed by @a hi. */
196 void *
197 svn__apr_hash_index_val(const apr_hash_index_t *hi);
199 /** @} */
203 /** On Windows, APR_STATUS_IS_ENOTDIR includes several kinds of
204 * invalid-pathname error but not ERROR_INVALID_NAME, so we include it.
205 * We also include ERROR_DIRECTORY as that was not included in apr versions
206 * before 1.4.0 and this fix is not backported */
207 /* ### These fixes should go into APR. */
208 #ifndef WIN32
209 #define SVN__APR_STATUS_IS_ENOTDIR(s) APR_STATUS_IS_ENOTDIR(s)
210 #else
211 #define SVN__APR_STATUS_IS_ENOTDIR(s) (APR_STATUS_IS_ENOTDIR(s) \
212 || ((s) == APR_OS_START_SYSERR + ERROR_DIRECTORY) \
213 || ((s) == APR_OS_START_SYSERR + ERROR_INVALID_NAME))
214 #endif
216 /** @} */
220 /** The various types of nodes in the Subversion filesystem. */
221 typedef enum svn_node_kind_t
223 /** absent */
224 svn_node_none,
226 /** regular file */
227 svn_node_file,
229 /** directory */
230 svn_node_dir,
232 /** something's here, but we don't know what */
233 svn_node_unknown,
236 * symbolic link
237 * @note This value is not currently used by the public API.
238 * @since New in 1.8.
240 svn_node_symlink
241 } svn_node_kind_t;
243 /** Return a constant string expressing @a kind as an English word, e.g.,
244 * "file", "dir", etc. The string is not localized, as it may be used for
245 * client<->server communications. If the kind is not recognized, return
246 * "unknown".
248 * @since New in 1.6.
250 const char *
251 svn_node_kind_to_word(svn_node_kind_t kind);
253 /** Return the appropriate node_kind for @a word. @a word is as
254 * returned from svn_node_kind_to_word(). If @a word does not
255 * represent a recognized kind or is @c NULL, return #svn_node_unknown.
257 * @since New in 1.6.
259 svn_node_kind_t
260 svn_node_kind_from_word(const char *word);
263 /** Generic three-state property to represent an unknown value for values
264 * that are just like booleans. The values have been set deliberately to
265 * make tristates disjoint from #svn_boolean_t.
267 * @note It is unsafe to use apr_pcalloc() to allocate these, since '0' is
268 * not a valid value.
270 * @since New in 1.7. */
271 typedef enum svn_tristate_t
273 svn_tristate_false = 2,
274 svn_tristate_true,
275 svn_tristate_unknown
276 } svn_tristate_t;
278 /** Return a constant string "true", "false" or NULL representing the value of
279 * @a tristate.
281 * @since New in 1.7.
283 const char *
284 svn_tristate__to_word(svn_tristate_t tristate);
286 /** Return the appropriate tristate for @a word. If @a word is "true", returns
287 * #svn_tristate_true; if @a word is "false", returns #svn_tristate_false,
288 * for all other values (including NULL) returns #svn_tristate_unknown.
290 * @since New in 1.7.
292 svn_tristate_t
293 svn_tristate__from_word(const char * word);
297 /** About Special Files in Subversion
299 * Subversion denotes files that cannot be portably created or
300 * modified as "special" files (svn_node_special). It stores these
301 * files in the repository as a plain text file with the svn:special
302 * property set. The file contents contain: a platform-specific type
303 * string, a space character, then any information necessary to create
304 * the file on a supported platform. For example, if a symbolic link
305 * were being represented, the repository file would have the
306 * following contents:
308 * "link /path/to/link/target"
310 * Where 'link' is the identifier string showing that this special
311 * file should be a symbolic link and '/path/to/link/target' is the
312 * destination of the symbolic link.
314 * Special files are stored in the text-base exactly as they are
315 * stored in the repository. The platform specific files are created
316 * in the working copy at EOL/keyword translation time using
317 * svn_subst_copy_and_translate2(). If the current platform does not
318 * support a specific special file type, the file is copied into the
319 * working copy as it is seen in the repository. Because of this,
320 * users of other platforms can still view and modify the special
321 * files, even if they do not have their unique properties.
323 * New types of special files can be added by:
324 * 1. Implementing a platform-dependent routine to create a uniquely
325 * named special file and one to read the special file in
326 * libsvn_subr/io.c.
327 * 2. Creating a new textual name similar to
328 * SVN_SUBST__SPECIAL_LINK_STR in libsvn_subr/subst.c.
329 * 3. Handling the translation/detranslation case for the new type in
330 * create_special_file and detranslate_special_file, using the
331 * routines from 1.
336 /** A revision number. */
337 typedef long int svn_revnum_t;
339 /** Valid revision numbers begin at 0 */
340 #define SVN_IS_VALID_REVNUM(n) ((n) >= 0)
342 /** The 'official' invalid revision num */
343 #define SVN_INVALID_REVNUM ((svn_revnum_t) -1)
345 /** Not really invalid...just unimportant -- one day, this can be its
346 * own unique value, for now, just make it the same as
347 * #SVN_INVALID_REVNUM.
349 #define SVN_IGNORED_REVNUM ((svn_revnum_t) -1)
351 /** Convert NULL-terminated C string @a str to a revision number. */
352 #define SVN_STR_TO_REV(str) ((svn_revnum_t) atol(str))
355 * Parse NULL-terminated C string @a str as a revision number and
356 * store its value in @a rev. If @a endptr is non-NULL, then the
357 * address of the first non-numeric character in @a str is stored in
358 * it. If there are no digits in @a str, then @a endptr is set (if
359 * non-NULL), and the error #SVN_ERR_REVNUM_PARSE_FAILURE error is
360 * returned. Negative numbers parsed from @a str are considered
361 * invalid, and result in the same error.
363 * @since New in 1.5.
365 svn_error_t *
366 svn_revnum_parse(svn_revnum_t *rev,
367 const char *str,
368 const char **endptr);
370 /** Originally intended to be used in printf()-style functions to format
371 * revision numbers. Deprecated due to incompatibilities with language
372 * translation tools (e.g. gettext).
374 * New code should use a bare "%ld" format specifier for formatting revision
375 * numbers.
377 * @deprecated Provided for backward compatibility with the 1.0 API.
379 #define SVN_REVNUM_T_FMT "ld"
383 /** The size of a file in the Subversion FS. */
384 typedef apr_int64_t svn_filesize_t;
386 /** The 'official' invalid file size constant. */
387 #define SVN_INVALID_FILESIZE ((svn_filesize_t) -1)
389 /** In printf()-style functions, format file sizes using this. */
390 #define SVN_FILESIZE_T_FMT APR_INT64_T_FMT
392 #ifndef DOXYGEN_SHOULD_SKIP_THIS
393 /* Parse a base-10 numeric string into a 64-bit unsigned numeric value. */
394 /* NOTE: Private. For use by Subversion's own code only. See issue #1644. */
395 /* FIXME: APR should supply a function to do this, such as "apr_atoui64". */
396 #define svn__atoui64(X) ((apr_uint64_t) apr_atoi64(X))
397 #endif
401 /** An enum to indicate whether recursion is needed. */
402 enum svn_recurse_kind
404 svn_nonrecursive = 1,
405 svn_recursive
408 /** The concept of depth for directories.
410 * @note This is similar to, but not exactly the same as, the WebDAV
411 * and LDAP concepts of depth.
413 * @since New in 1.5.
415 typedef enum svn_depth_t
417 /* The order of these depths is important: the higher the number,
418 the deeper it descends. This allows us to compare two depths
419 numerically to decide which should govern. */
421 /** Depth undetermined or ignored. In some contexts, this means the
422 client should choose an appropriate default depth. The server
423 will generally treat it as #svn_depth_infinity. */
424 svn_depth_unknown = -2,
426 /** Exclude (i.e., don't descend into) directory D.
427 @note In Subversion 1.5, svn_depth_exclude is *not* supported
428 anywhere in the client-side (libsvn_wc/libsvn_client/etc) code;
429 it is only supported as an argument to set_path functions in the
430 ra and repos reporters. (This will enable future versions of
431 Subversion to run updates, etc, against 1.5 servers with proper
432 svn_depth_exclude behavior, once we get a chance to implement
433 client-side support for svn_depth_exclude.)
435 svn_depth_exclude = -1,
437 /** Just the named directory D, no entries. Updates will not pull in
438 any files or subdirectories not already present. */
439 svn_depth_empty = 0,
441 /** D + its file children, but not subdirs. Updates will pull in any
442 files not already present, but not subdirectories. */
443 svn_depth_files = 1,
445 /** D + immediate children (D and its entries). Updates will pull in
446 any files or subdirectories not already present; those
447 subdirectories' this_dir entries will have depth-empty. */
448 svn_depth_immediates = 2,
450 /** D + all descendants (full recursion from D). Updates will pull
451 in any files or subdirectories not already present; those
452 subdirectories' this_dir entries will have depth-infinity.
453 Equivalent to the pre-1.5 default update behavior. */
454 svn_depth_infinity = 3
456 } svn_depth_t;
458 /** Return a constant string expressing @a depth as an English word,
459 * e.g., "infinity", "immediates", etc. The string is not localized,
460 * as it may be used for client<->server communications.
462 * @since New in 1.5.
464 const char *
465 svn_depth_to_word(svn_depth_t depth);
467 /** Return the appropriate depth for @a depth_str. @a word is as
468 * returned from svn_depth_to_word(). If @a depth_str does not
469 * represent a recognized depth, return #svn_depth_unknown.
471 * @since New in 1.5.
473 svn_depth_t
474 svn_depth_from_word(const char *word);
476 /** Return #svn_depth_infinity if boolean @a recurse is TRUE, else
477 * return #svn_depth_files.
479 * @note New code should never need to use this, it is called only
480 * from pre-depth APIs, for compatibility.
482 * @since New in 1.5.
484 #define SVN_DEPTH_INFINITY_OR_FILES(recurse) \
485 ((recurse) ? svn_depth_infinity : svn_depth_files)
487 /** Return #svn_depth_infinity if boolean @a recurse is TRUE, else
488 * return #svn_depth_immediates.
490 * @note New code should never need to use this, it is called only
491 * from pre-depth APIs, for compatibility.
493 * @since New in 1.5.
495 #define SVN_DEPTH_INFINITY_OR_IMMEDIATES(recurse) \
496 ((recurse) ? svn_depth_infinity : svn_depth_immediates)
498 /** Return #svn_depth_infinity if boolean @a recurse is TRUE, else
499 * return #svn_depth_empty.
501 * @note New code should never need to use this, it is called only
502 * from pre-depth APIs, for compatibility.
504 * @since New in 1.5.
506 #define SVN_DEPTH_INFINITY_OR_EMPTY(recurse) \
507 ((recurse) ? svn_depth_infinity : svn_depth_empty)
509 /** Return a recursion boolean based on @a depth.
511 * Although much code has been converted to use depth, some code still
512 * takes a recurse boolean. In most cases, it makes sense to treat
513 * unknown or infinite depth as recursive, and any other depth as
514 * non-recursive (which in turn usually translates to #svn_depth_files).
516 #define SVN_DEPTH_IS_RECURSIVE(depth) \
517 ((depth) == svn_depth_infinity || (depth) == svn_depth_unknown)
522 * It is sometimes convenient to indicate which parts of an #svn_dirent_t
523 * object you are actually interested in, so that calculating and sending
524 * the data corresponding to the other fields can be avoided. These values
525 * can be used for that purpose.
527 * @defgroup svn_dirent_fields Dirent fields
528 * @{
531 /** An indication that you are interested in the @c kind field */
532 #define SVN_DIRENT_KIND 0x00001
534 /** An indication that you are interested in the @c size field */
535 #define SVN_DIRENT_SIZE 0x00002
537 /** An indication that you are interested in the @c has_props field */
538 #define SVN_DIRENT_HAS_PROPS 0x00004
540 /** An indication that you are interested in the @c created_rev field */
541 #define SVN_DIRENT_CREATED_REV 0x00008
543 /** An indication that you are interested in the @c time field */
544 #define SVN_DIRENT_TIME 0x00010
546 /** An indication that you are interested in the @c last_author field */
547 #define SVN_DIRENT_LAST_AUTHOR 0x00020
549 /** A combination of all the dirent fields */
550 #define SVN_DIRENT_ALL ~((apr_uint32_t ) 0)
552 /** @} */
554 /** A general subversion directory entry.
556 * @note To allow for extending the #svn_dirent_t structure in future
557 * releases, always use svn_dirent_create() to allocate the stucture.
559 * @since New in 1.6.
561 typedef struct svn_dirent_t
563 /** node kind */
564 svn_node_kind_t kind;
566 /** length of file text, or 0 for directories */
567 svn_filesize_t size;
569 /** does the node have props? */
570 svn_boolean_t has_props;
572 /** last rev in which this node changed */
573 svn_revnum_t created_rev;
575 /** time of created_rev (mod-time) */
576 apr_time_t time;
578 /** author of created_rev */
579 const char *last_author;
581 /* IMPORTANT: If you extend this struct, check svn_dirent_dup(). */
582 } svn_dirent_t;
584 /** Return a deep copy of @a dirent, allocated in @a pool.
586 * @since New in 1.4.
588 svn_dirent_t *
589 svn_dirent_dup(const svn_dirent_t *dirent,
590 apr_pool_t *pool);
593 * Create a new svn_dirent_t instance with all values initialized to their
594 * not-available values.
596 * @since New in 1.8.
598 svn_dirent_t *
599 svn_dirent_create(apr_pool_t *result_pool);
602 /** Keyword substitution.
604 * All the keywords Subversion recognizes.
606 * Note that there is a better, more general proposal out there, which
607 * would take care of both internationalization issues and custom
608 * keywords (e.g., $NetBSD$). See
610 * @verbatim
611 http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=8921
612 =====
613 From: "Jonathan M. Manning" <jmanning@alisa-jon.net>
614 To: dev@subversion.tigris.org
615 Date: Fri, 14 Dec 2001 11:56:54 -0500
616 Message-ID: <87970000.1008349014@bdldevel.bl.bdx.com>
617 Subject: Re: keywords @endverbatim
619 * and Eric Gillespie's support of same:
621 * @verbatim
622 http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=8757
623 =====
624 From: "Eric Gillespie, Jr." <epg@pretzelnet.org>
625 To: dev@subversion.tigris.org
626 Date: Wed, 12 Dec 2001 09:48:42 -0500
627 Message-ID: <87k7vsebp1.fsf@vger.pretzelnet.org>
628 Subject: Re: Customizable Keywords @endverbatim
630 * However, it is considerably more complex than the scheme below.
631 * For now we're going with simplicity, hopefully the more general
632 * solution can be done post-1.0.
634 * @defgroup svn_types_keywords Keyword definitions
635 * @{
638 /** The maximum size of an expanded or un-expanded keyword. */
639 #define SVN_KEYWORD_MAX_LEN 255
641 /** The most recent revision in which this file was changed. */
642 #define SVN_KEYWORD_REVISION_LONG "LastChangedRevision"
644 /** Short version of LastChangedRevision */
645 #define SVN_KEYWORD_REVISION_SHORT "Rev"
647 /** Medium version of LastChangedRevision, matching the one CVS uses.
648 * @since New in 1.1. */
649 #define SVN_KEYWORD_REVISION_MEDIUM "Revision"
651 /** The most recent date (repository time) when this file was changed. */
652 #define SVN_KEYWORD_DATE_LONG "LastChangedDate"
654 /** Short version of LastChangedDate */
655 #define SVN_KEYWORD_DATE_SHORT "Date"
657 /** Who most recently committed to this file. */
658 #define SVN_KEYWORD_AUTHOR_LONG "LastChangedBy"
660 /** Short version of LastChangedBy */
661 #define SVN_KEYWORD_AUTHOR_SHORT "Author"
663 /** The URL for the head revision of this file. */
664 #define SVN_KEYWORD_URL_LONG "HeadURL"
666 /** Short version of HeadURL */
667 #define SVN_KEYWORD_URL_SHORT "URL"
669 /** A compressed combination of the other four keywords. */
670 #define SVN_KEYWORD_ID "Id"
672 /** A full combination of the first four keywords.
673 * @since New in 1.6. */
674 #define SVN_KEYWORD_HEADER "Header"
676 /** @} */
680 /** All information about a commit.
682 * @note Objects of this type should always be created using the
683 * svn_create_commit_info() function.
685 * @since New in 1.3.
687 typedef struct svn_commit_info_t
689 /** just-committed revision. */
690 svn_revnum_t revision;
692 /** server-side date of the commit. */
693 const char *date;
695 /** author of the commit. */
696 const char *author;
698 /** error message from post-commit hook, or NULL. */
699 const char *post_commit_err;
701 /** repository root, may be @c NULL if unknown.
702 @since New in 1.7. */
703 const char *repos_root;
705 } svn_commit_info_t;
708 * Allocate an object of type #svn_commit_info_t in @a pool and
709 * return it.
711 * The @c revision field of the new struct is set to #SVN_INVALID_REVNUM.
712 * All other fields are initialized to @c NULL.
714 * @note Any object of the type #svn_commit_info_t should
715 * be created using this function.
716 * This is to provide for extending the svn_commit_info_t in
717 * the future.
719 * @since New in 1.3.
721 svn_commit_info_t *
722 svn_create_commit_info(apr_pool_t *pool);
725 * Return a deep copy @a src_commit_info allocated in @a pool.
727 * @since New in 1.4.
729 svn_commit_info_t *
730 svn_commit_info_dup(const svn_commit_info_t *src_commit_info,
731 apr_pool_t *pool);
736 * A structure to represent a path that changed for a log entry.
738 * @note To allow for extending the #svn_log_changed_path2_t structure in
739 * future releases, always use svn_log_changed_path2_create() to allocate
740 * the structure.
742 * @since New in 1.6.
744 typedef struct svn_log_changed_path2_t
746 /** 'A'dd, 'D'elete, 'R'eplace, 'M'odify */
747 char action;
749 /** Source path of copy (if any). */
750 const char *copyfrom_path;
752 /** Source revision of copy (if any). */
753 svn_revnum_t copyfrom_rev;
755 /** The type of the node, may be svn_node_unknown. */
756 svn_node_kind_t node_kind;
758 /** Is the text modified, may be svn_tristate_unknown.
759 * @since New in 1.7. */
760 svn_tristate_t text_modified;
762 /** Are properties modified, may be svn_tristate_unknown.
763 * @since New in 1.7. */
764 svn_tristate_t props_modified;
766 /* NOTE: Add new fields at the end to preserve binary compatibility.
767 Also, if you add fields here, you have to update
768 svn_log_changed_path2_dup(). */
769 } svn_log_changed_path2_t;
772 * Returns an #svn_log_changed_path2_t, allocated in @a pool with all fields
773 * initialized to NULL, None or empty values.
775 * @note To allow for extending the #svn_log_changed_path2_t structure in
776 * future releases, this function should always be used to allocate the
777 * structure.
779 * @since New in 1.6.
781 svn_log_changed_path2_t *
782 svn_log_changed_path2_create(apr_pool_t *pool);
785 * Return a deep copy of @a changed_path, allocated in @a pool.
787 * @since New in 1.6.
789 svn_log_changed_path2_t *
790 svn_log_changed_path2_dup(const svn_log_changed_path2_t *changed_path,
791 apr_pool_t *pool);
794 * A structure to represent a path that changed for a log entry. Same as
795 * the first three fields of #svn_log_changed_path2_t.
797 * @deprecated Provided for backward compatibility with the 1.5 API.
799 typedef struct svn_log_changed_path_t
801 /** 'A'dd, 'D'elete, 'R'eplace, 'M'odify */
802 char action;
804 /** Source path of copy (if any). */
805 const char *copyfrom_path;
807 /** Source revision of copy (if any). */
808 svn_revnum_t copyfrom_rev;
810 } svn_log_changed_path_t;
813 * Return a deep copy of @a changed_path, allocated in @a pool.
815 * @since New in 1.3.
816 * @deprecated Provided for backward compatibility with the 1.5 API.
818 SVN_DEPRECATED
819 svn_log_changed_path_t *
820 svn_log_changed_path_dup(const svn_log_changed_path_t *changed_path,
821 apr_pool_t *pool);
824 * A structure to represent all the information about a particular log entry.
826 * @note To allow for extending the #svn_log_entry_t structure in future
827 * releases, always use svn_log_entry_create() to allocate the structure.
829 * @since New in 1.5.
831 typedef struct svn_log_entry_t
833 /** A hash containing as keys every path committed in @a revision; the
834 * values are (#svn_log_changed_path_t *) structures.
836 * The subversion core libraries will always set this field to the same
837 * value as changed_paths2 for compatibility reasons.
839 * @deprecated Provided for backward compatibility with the 1.5 API.
841 apr_hash_t *changed_paths;
843 /** The revision of the commit. */
844 svn_revnum_t revision;
846 /** The hash of requested revision properties, which may be NULL if it
847 * would contain no revprops. Maps (const char *) property name to
848 * (svn_string_t *) property value. */
849 apr_hash_t *revprops;
852 * Whether or not this message has children.
854 * When a log operation requests additional merge information, extra log
855 * entries may be returned as a result of this entry. The new entries, are
856 * considered children of the original entry, and will follow it. When
857 * the HAS_CHILDREN flag is set, the receiver should increment its stack
858 * depth, and wait until an entry is provided with SVN_INVALID_REVNUM which
859 * indicates the end of the children.
861 * For log operations which do not request additional merge information, the
862 * HAS_CHILDREN flag is always FALSE.
864 * For more information see:
865 * https://svn.apache.org/repos/asf/subversion/trunk/notes/merge-tracking/design.html#commutative-reporting
867 svn_boolean_t has_children;
869 /** A hash containing as keys every path committed in @a revision; the
870 * values are (#svn_log_changed_path2_t *) structures.
872 * If this value is not @c NULL, it MUST have the same value as
873 * changed_paths or svn_log_entry_dup() will not create an identical copy.
875 * The subversion core libraries will always set this field to the same
876 * value as changed_paths for compatibility with users assuming an older
877 * version.
879 * @note See http://svn.haxx.se/dev/archive-2010-08/0362.shtml for
880 * further explanation.
882 * @since New in 1.6.
884 apr_hash_t *changed_paths2;
887 * Whether @a revision should be interpreted as non-inheritable in the
888 * same sense of #svn_merge_range_t.
890 * Only set when this #svn_log_entry_t instance is returned by the
891 * libsvn_client mergeinfo apis. Currently always FALSE when the
892 * #svn_log_entry_t instance is reported by the ra layer.
894 * @since New in 1.7.
896 svn_boolean_t non_inheritable;
899 * Whether @a revision is a merged revision resulting from a reverse merge.
901 * @since New in 1.7.
903 svn_boolean_t subtractive_merge;
905 /* NOTE: Add new fields at the end to preserve binary compatibility.
906 Also, if you add fields here, you have to update
907 svn_log_entry_dup(). */
908 } svn_log_entry_t;
911 * Returns an #svn_log_entry_t, allocated in @a pool with all fields
912 * initialized to NULL values.
914 * @note To allow for extending the #svn_log_entry_t structure in future
915 * releases, this function should always be used to allocate the structure.
917 * @since New in 1.5.
919 svn_log_entry_t *
920 svn_log_entry_create(apr_pool_t *pool);
922 /** Return a deep copy of @a log_entry, allocated in @a pool.
924 * The resulting svn_log_entry_t has @c changed_paths set to the same
925 * value as @c changed_path2. @c changed_paths will be @c NULL if
926 * @c changed_paths2 was @c NULL.
928 * @since New in 1.6.
930 svn_log_entry_t *
931 svn_log_entry_dup(const svn_log_entry_t *log_entry, apr_pool_t *pool);
933 /** The callback invoked by log message loopers, such as
934 * #svn_ra_plugin_t.get_log() and svn_repos_get_logs().
936 * This function is invoked once on each log message, in the order
937 * determined by the caller (see above-mentioned functions).
939 * @a baton is what you think it is, and @a log_entry contains relevant
940 * information for the log message. Any of @a log_entry->author,
941 * @a log_entry->date, or @a log_entry->message may be @c NULL.
943 * If @a log_entry->date is neither NULL nor the empty string, it was
944 * generated by svn_time_to_cstring() and can be converted to
945 * @c apr_time_t with svn_time_from_cstring().
947 * If @a log_entry->changed_paths is non-@c NULL, then it contains as keys
948 * every path committed in @a log_entry->revision; the values are
949 * (#svn_log_changed_path_t *) structures.
951 * If @a log_entry->has_children is @c TRUE, the message will be followed
952 * immediately by any number of merged revisions (child messages), which are
953 * terminated by an invocation with SVN_INVALID_REVNUM. This usage may
954 * be recursive.
956 * Use @a pool for temporary allocation. If the caller is iterating
957 * over log messages, invoking this receiver on each, we recommend the
958 * standard pool loop recipe: create a subpool, pass it as @a pool to
959 * each call, clear it after each iteration, destroy it after the loop
960 * is done. (For allocation that must last beyond the lifetime of a
961 * given receiver call, use a pool in @a baton.)
963 * @since New in 1.5.
965 typedef svn_error_t *(*svn_log_entry_receiver_t)(
966 void *baton,
967 svn_log_entry_t *log_entry,
968 apr_pool_t *pool);
971 * Similar to #svn_log_entry_receiver_t, except this uses separate
972 * parameters for each part of the log entry.
974 * @deprecated Provided for backward compatibility with the 1.4 API.
976 typedef svn_error_t *(*svn_log_message_receiver_t)(
977 void *baton,
978 apr_hash_t *changed_paths,
979 svn_revnum_t revision,
980 const char *author,
981 const char *date, /* use svn_time_from_cstring() if need apr_time_t */
982 const char *message,
983 apr_pool_t *pool);
987 /** Callback function type for commits.
989 * When a commit succeeds, an instance of this is invoked with the
990 * @a commit_info, along with the @a baton closure.
991 * @a pool can be used for temporary allocations.
993 * @since New in 1.4.
995 typedef svn_error_t *(*svn_commit_callback2_t)(
996 const svn_commit_info_t *commit_info,
997 void *baton,
998 apr_pool_t *pool);
1000 /** Same as #svn_commit_callback2_t, but uses individual
1001 * data elements instead of the #svn_commit_info_t structure
1003 * @deprecated Provided for backward compatibility with the 1.3 API.
1005 typedef svn_error_t *(*svn_commit_callback_t)(
1006 svn_revnum_t new_revision,
1007 const char *date,
1008 const char *author,
1009 void *baton);
1013 /** A buffer size that may be used when processing a stream of data.
1015 * @note We don't use this constant any longer, since it is considered to be
1016 * unnecessarily large.
1018 * @deprecated Provided for backwards compatibility with the 1.3 API.
1020 #define SVN_STREAM_CHUNK_SIZE 102400
1022 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1024 * The maximum amount we (ideally) hold in memory at a time when
1025 * processing a stream of data.
1027 * For example, when copying data from one stream to another, do it in
1028 * blocks of this size.
1030 * NOTE: This is an internal macro, put here for convenience.
1031 * No public API may depend on the particular value of this macro.
1033 #define SVN__STREAM_CHUNK_SIZE 16384
1034 #endif
1036 /** The maximum amount we can ever hold in memory. */
1037 /* FIXME: Should this be the same as SVN_STREAM_CHUNK_SIZE? */
1038 #define SVN_MAX_OBJECT_SIZE (((apr_size_t) -1) / 2)
1042 /* ### Note: despite being about mime-TYPES, these probably don't
1043 * ### belong in svn_types.h. However, no other header is more
1044 * ### appropriate, and didn't feel like creating svn_validate.h for
1045 * ### so little.
1048 /** Validate @a mime_type.
1050 * If @a mime_type does not contain a "/", or ends with non-alphanumeric
1051 * data, return #SVN_ERR_BAD_MIME_TYPE, else return success.
1053 * Use @a pool only to find error allocation.
1055 * Goal: to match both "foo/bar" and "foo/bar; charset=blah", without
1056 * being too strict about it, but to disallow mime types that have
1057 * quotes, newlines, or other garbage on the end, such as might be
1058 * unsafe in an HTTP header.
1060 svn_error_t *
1061 svn_mime_type_validate(const char *mime_type,
1062 apr_pool_t *pool);
1064 /** Return FALSE iff @a mime_type is a textual type.
1066 * All mime types that start with "text/" are textual, plus some special
1067 * cases (for example, "image/x-xbitmap").
1069 svn_boolean_t
1070 svn_mime_type_is_binary(const char *mime_type);
1074 /** A user defined callback that subversion will call with a user defined
1075 * baton to see if the current operation should be continued. If the operation
1076 * should continue, the function should return #SVN_NO_ERROR, if not, it
1077 * should return #SVN_ERR_CANCELLED.
1079 typedef svn_error_t *(*svn_cancel_func_t)(void *cancel_baton);
1084 * A lock object, for client & server to share.
1086 * A lock represents the exclusive right to add, delete, or modify a
1087 * path. A lock is created in a repository, wholly controlled by the
1088 * repository. A "lock-token" is the lock's UUID, and can be used to
1089 * learn more about a lock's fields, and or/make use of the lock.
1090 * Because a lock is immutable, a client is free to not only cache the
1091 * lock-token, but the lock's fields too, for convenience.
1093 * Note that the 'is_dav_comment' field is wholly ignored by every
1094 * library except for mod_dav_svn. The field isn't even marshalled
1095 * over the network to the client. Assuming lock structures are
1096 * created with apr_pcalloc(), a default value of 0 is universally safe.
1098 * @note in the current implementation, only files are lockable.
1100 * @since New in 1.2.
1102 typedef struct svn_lock_t
1104 const char *path; /**< the path this lock applies to */
1105 const char *token; /**< unique URI representing lock */
1106 const char *owner; /**< the username which owns the lock */
1107 const char *comment; /**< (optional) description of lock */
1108 svn_boolean_t is_dav_comment; /**< was comment made by generic DAV client? */
1109 apr_time_t creation_date; /**< when lock was made */
1110 apr_time_t expiration_date; /**< (optional) when lock will expire;
1111 If value is 0, lock will never expire. */
1112 } svn_lock_t;
1115 * Returns an #svn_lock_t, allocated in @a pool with all fields initialized
1116 * to NULL values.
1118 * @note To allow for extending the #svn_lock_t structure in the future
1119 * releases, this function should always be used to allocate the structure.
1121 * @since New in 1.2.
1123 svn_lock_t *
1124 svn_lock_create(apr_pool_t *pool);
1127 * Return a deep copy of @a lock, allocated in @a pool.
1129 * @since New in 1.2.
1131 svn_lock_t *
1132 svn_lock_dup(const svn_lock_t *lock, apr_pool_t *pool);
1137 * Return a formatted Universal Unique IDentifier (UUID) string.
1139 * @since New in 1.4.
1141 const char *
1142 svn_uuid_generate(apr_pool_t *pool);
1147 * Mergeinfo representing a merge of a range of revisions.
1149 * @since New in 1.5
1151 typedef struct svn_merge_range_t
1154 * If the 'start' field is less than the 'end' field then 'start' is
1155 * exclusive and 'end' inclusive of the range described. This is termed
1156 * a forward merge range. If 'start' is greater than 'end' then the
1157 * opposite is true. This is termed a reverse merge range. If 'start'
1158 * equals 'end' the meaning of the range is not defined.
1160 svn_revnum_t start;
1161 svn_revnum_t end;
1164 * Whether this merge range should be inherited by treewise
1165 * descendants of the path to which the range applies. */
1166 svn_boolean_t inheritable;
1167 } svn_merge_range_t;
1170 * Return a copy of @a range, allocated in @a pool.
1172 * @since New in 1.5.
1174 svn_merge_range_t *
1175 svn_merge_range_dup(const svn_merge_range_t *range, apr_pool_t *pool);
1178 * Returns true if the changeset committed in revision @a rev is one
1179 * of the changesets in the range @a range.
1181 * @since New in 1.5.
1183 svn_boolean_t
1184 svn_merge_range_contains_rev(const svn_merge_range_t *range, svn_revnum_t rev);
1188 /** @defgroup node_location_seg_reporting Node location segment reporting.
1189 * @{ */
1192 * A representation of a segment of an object's version history with an
1193 * emphasis on the object's location in the repository as of various
1194 * revisions.
1196 * @since New in 1.5.
1198 typedef struct svn_location_segment_t
1200 /** The beginning (oldest) and ending (youngest) revisions for this
1201 segment, both inclusive. */
1202 svn_revnum_t range_start;
1203 svn_revnum_t range_end;
1205 /** The absolute (sans leading slash) path for this segment. May be
1206 NULL to indicate gaps in an object's history. */
1207 const char *path;
1209 } svn_location_segment_t;
1212 * A callback invoked by generators of #svn_location_segment_t
1213 * objects, used to report information about a versioned object's
1214 * history in terms of its location in the repository filesystem over
1215 * time.
1217 typedef svn_error_t *(*svn_location_segment_receiver_t)(
1218 svn_location_segment_t *segment,
1219 void *baton,
1220 apr_pool_t *pool);
1223 * Return a deep copy of @a segment, allocated in @a pool.
1225 * @since New in 1.5.
1227 svn_location_segment_t *
1228 svn_location_segment_dup(const svn_location_segment_t *segment,
1229 apr_pool_t *pool);
1231 /** @} */
1235 /** A line number, such as in a file or a stream.
1237 * @since New in 1.7.
1239 typedef unsigned long svn_linenum_t;
1241 /** The maximum value of an svn_linenum_t.
1243 * @since New in 1.7.
1245 #define SVN_LINENUM_MAX_VALUE ULONG_MAX
1249 #ifdef __cplusplus
1251 #endif /* __cplusplus */
1255 * Everybody and their brother needs to deal with svn_error_t, the error
1256 * codes, and whatever else. While they *should* go and include svn_error.h
1257 * in order to do that... bah. Let's just help everybody out and include
1258 * that header whenever somebody grabs svn_types.h.
1260 * Note that we do this at the END of this header so that its contents
1261 * are available to svn_error.h (our guards will prevent the circular
1262 * include). We also need to do the include *outside* of the cplusplus
1263 * guard.
1265 #include "svn_error.h"
1269 * Subversion developers may want to use some additional debugging facilities
1270 * while working on the code. We'll pull that in here, so individual source
1271 * files don't have to include this header manually.
1273 #ifdef SVN_DEBUG
1274 #include "private/svn_debug.h"
1275 #endif
1278 #endif /* SVN_TYPES_H */