3 * ====================================================================
\r
4 * Copyright (c) 2000-2008 CollabNet. All rights reserved.
\r
6 * This software is licensed as described in the file COPYING, which
\r
7 * you should have received as part of this distribution. The terms
\r
8 * are also available at http://subversion.tigris.org/license-1.html.
\r
9 * If newer versions of this license are posted there, you may use a
\r
10 * newer version instead, at your option.
\r
12 * This software consists of voluntary contributions made by many
\r
13 * individuals. For exact contribution history, see the revision
\r
14 * history and logs, available at http://subversion.tigris.org/.
\r
15 * ====================================================================
\r
19 * @brief Subversion's data types
\r
25 /* ### this should go away, but it causes too much breakage right now */
\r
28 #include <apr.h> /* for apr_size_t, apr_int64_t, ... */
\r
29 #include <apr_errno.h> /* for apr_status_t */
\r
30 #include <apr_pools.h> /* for apr_pool_t */
\r
31 #include <apr_hash.h> /* for apr_hash_t */
\r
32 #include <apr_tables.h> /* for apr_array_push() */
\r
33 #include <apr_time.h> /* for apr_time_t */
\r
34 #include <apr_strings.h> /* for apr_atoi64() */
\r
40 #endif /* __cplusplus */
\r
44 /** Macro used to mark deprecated functions.
\r
46 * @since New in 1.6.
\r
48 #ifndef SVN_DEPRECATED
\r
49 #if !defined(SWIGPERL) && !defined(SWIGPYTHON) && !defined(SWIGRUBY)
\r
50 #if defined(__GNUC__) && (__GNUC__ >= 4 || (__GNUC__==3 && __GNUC_MINOR__>=1))
\r
51 #define SVN_DEPRECATED __attribute__((deprecated))
\r
52 #elif defined(_MSC_VER) && _MSC_VER >= 1300
\r
53 #define SVN_DEPRECATED __declspec(deprecated)
\r
55 #define SVN_DEPRECATED
\r
58 #define SVN_DEPRECATED
\r
64 /** Subversion error object.
\r
66 * Defined here, rather than in svn_error.h, to avoid a recursive @#include
\r
69 typedef struct svn_error_t
\r
71 /** APR error value, possibly SVN_ custom err */
\r
72 apr_status_t apr_err;
\r
74 /** details from producer of error */
\r
75 const char *message;
\r
77 /** ptr to the error we "wrap" */
\r
78 struct svn_error_t *child;
\r
80 /** The pool holding this error and any child errors it wraps */
\r
83 /** Source file where the error originated. Only used iff @c SVN_DEBUG. */
\r
86 /** Source line where the error originated. Only used iff @c SVN_DEBUG. */
\r
93 /** @defgroup APR_ARRAY_compat_macros APR Array Compatibility Helper Macros
\r
94 * These macros are provided by APR itself from version 1.3.
\r
95 * Definitions are provided here for when using older versions of APR.
\r
99 /** index into an apr_array_header_t */
\r
100 #ifndef APR_ARRAY_IDX
\r
101 #define APR_ARRAY_IDX(ary,i,type) (((type *)(ary)->elts)[i])
\r
104 /** easier array-pushing syntax */
\r
105 #ifndef APR_ARRAY_PUSH
\r
106 #define APR_ARRAY_PUSH(ary,type) (*((type *)apr_array_push(ary)))
\r
111 /** The various types of nodes in the Subversion filesystem. */
\r
117 /** regular file */
\r
123 /** something's here, but we don't know what */
\r
127 /** Return a constant string expressing @a kind as an English word, e.g.,
\r
128 * "file", "dir", etc. The string is not localized, as it may be used for
\r
129 * client<->server communications. If the kind is not recognized, return
\r
132 * @since New in 1.6.
\r
135 svn_node_kind_to_word(svn_node_kind_t kind);
\r
137 /** Return the appropriate node_kind for @a word. @a word is as
\r
138 * returned from svn_node_kind_to_word(). If @a word does not
\r
139 * represent a recognized kind or is @c NULL, return @c svn_node_unknown.
\r
141 * @since New in 1.6.
\r
144 svn_node_kind_from_word(const char *word);
\r
146 /** About Special Files in Subversion
\r
148 * Subversion denotes files that cannot be portably created or
\r
149 * modified as "special" files (svn_node_special). It stores these
\r
150 * files in the repository as a plain text file with the svn:special
\r
151 * property set. The file contents contain: a platform-specific type
\r
152 * string, a space character, then any information necessary to create
\r
153 * the file on a supported platform. For example, if a symbolic link
\r
154 * were being represented, the repository file would have the
\r
155 * following contents:
\r
157 * "link /path/to/link/target"
\r
159 * Where 'link' is the identifier string showing that this special
\r
160 * file should be a symbolic link and '/path/to/link/target' is the
\r
161 * destination of the symbolic link.
\r
163 * Special files are stored in the text-base exactly as they are
\r
164 * stored in the repository. The platform specific files are created
\r
165 * in the working copy at EOL/keyword translation time using
\r
166 * svn_subst_copy_and_translate2(). If the current platform does not
\r
167 * support a specific special file type, the file is copied into the
\r
168 * working copy as it is seen in the repository. Because of this,
\r
169 * users of other platforms can still view and modify the special
\r
170 * files, even if they do not have their unique properties.
\r
172 * New types of special files can be added by:
\r
173 * 1. Implementing a platform-dependent routine to create a uniquely
\r
174 * named special file and one to read the special file in
\r
175 * libsvn_subr/io.c.
\r
176 * 2. Creating a new textual name similar to
\r
177 * SVN_SUBST__SPECIAL_LINK_STR in libsvn_subr/subst.c.
\r
178 * 3. Handling the translation/detranslation case for the new type in
\r
179 * create_special_file and detranslate_special_file, using the
\r
183 /** A revision number. */
\r
184 typedef long int svn_revnum_t;
\r
186 /** Valid revision numbers begin at 0 */
\r
187 #define SVN_IS_VALID_REVNUM(n) ((n) >= 0)
\r
189 /** The 'official' invalid revision num */
\r
190 #define SVN_INVALID_REVNUM ((svn_revnum_t) -1)
\r
192 /** Not really invalid...just unimportant -- one day, this can be its
\r
193 * own unique value, for now, just make it the same as
\r
194 * @c SVN_INVALID_REVNUM.
\r
196 #define SVN_IGNORED_REVNUM ((svn_revnum_t) -1)
\r
198 /** Convert NULL-terminated C string @a str to a revision number. */
\r
199 #define SVN_STR_TO_REV(str) ((svn_revnum_t) atol(str))
\r
202 * Parse NULL-terminated C string @a str as a revision number and
\r
203 * store its value in @a rev. If @a endptr is non-NULL, then the
\r
204 * address of the first non-numeric character in @a str is stored in
\r
205 * it. If there are no digits in @a str, then @a endptr is set (if
\r
206 * non-NULL), and the error @c SVN_ERR_REVNUM_PARSE_FAILURE error is
\r
207 * returned. Negative numbers parsed from @a str are considered
\r
208 * invalid, and result in the same error.
\r
210 * @since New in 1.5.
\r
213 svn_revnum_parse(svn_revnum_t *rev,
\r
215 const char **endptr);
\r
217 /** Originally intended to be used in printf()-style functions to format
\r
218 * revision numbers. Deprecated due to incompatibilities with language
\r
219 * translation tools (e.g. gettext).
\r
221 * New code should use a bare "%ld" format specifier for formatting revision
\r
224 * @deprecated Provided for backward compatibility with the 1.0 API.
\r
226 #define SVN_REVNUM_T_FMT "ld"
\r
229 /** The size of a file in the Subversion FS. */
\r
230 typedef apr_int64_t svn_filesize_t;
\r
232 /** The 'official' invalid file size constant. */
\r
233 #define SVN_INVALID_FILESIZE ((svn_filesize_t) -1)
\r
235 /** In printf()-style functions, format file sizes using this. */
\r
236 #define SVN_FILESIZE_T_FMT APR_INT64_T_FMT
\r
238 #ifndef DOXYGEN_SHOULD_SKIP_THIS
\r
239 /* Parse a base-10 numeric string into a 64-bit unsigned numeric value. */
\r
240 /* NOTE: Private. For use by Subversion's own code only. See issue #1644. */
\r
241 /* FIXME: APR should supply a function to do this, such as "apr_atoui64". */
\r
242 #define svn__atoui64(X) ((apr_uint64_t) apr_atoi64(X))
\r
246 /** YABT: Yet Another Boolean Type */
\r
247 typedef int svn_boolean_t;
\r
255 /** uhh... false */
\r
260 /** An enum to indicate whether recursion is needed. */
\r
261 enum svn_recurse_kind
\r
263 svn_nonrecursive = 1,
\r
267 /** The concept of depth for directories.
\r
269 * @note This is similar to, but not exactly the same as, the WebDAV
\r
270 * and LDAP concepts of depth.
\r
272 * @since New in 1.5.
\r
276 /* The order of these depths is important: the higher the number,
\r
277 the deeper it descends. This allows us to compare two depths
\r
278 numerically to decide which should govern. */
\r
280 /* Depth undetermined or ignored. In some contexts, this means the
\r
281 client should choose an appropriate default depth. The server
\r
282 will generally treat it as @c svn_depth_infinity. */
\r
283 svn_depth_unknown = -2,
\r
285 /* Exclude (i.e., don't descend into) directory D. */
\r
286 /* NOTE: In Subversion 1.5, svn_depth_exclude is *not* supported
\r
287 anywhere in the client-side (libsvn_wc/libsvn_client/etc) code;
\r
288 it is only supported as an argument to set_path functions in the
\r
289 ra and repos reporters. (This will enable future versions of
\r
290 Subversion to run updates, etc, against 1.5 servers with proper
\r
291 svn_depth_exclude behavior, once we get a chance to implement
\r
292 client-side support for svn_depth_exclude.)
\r
294 svn_depth_exclude = -1,
\r
296 /* Just the named directory D, no entries. Updates will not pull in
\r
297 any files or subdirectories not already present. */
\r
298 svn_depth_empty = 0,
\r
300 /* D + its file children, but not subdirs. Updates will pull in any
\r
301 files not already present, but not subdirectories. */
\r
302 svn_depth_files = 1,
\r
304 /* D + immediate children (D and its entries). Updates will pull in
\r
305 any files or subdirectories not already present; those
\r
306 subdirectories' this_dir entries will have depth-empty. */
\r
307 svn_depth_immediates = 2,
\r
309 /* D + all descendants (full recursion from D). Updates will pull
\r
310 in any files or subdirectories not already present; those
\r
311 subdirectories' this_dir entries will have depth-infinity.
\r
312 Equivalent to the pre-1.5 default update behavior. */
\r
313 svn_depth_infinity = 3
\r
318 /** Return a constant string expressing @a depth as an English word,
\r
319 * e.g., "infinity", "immediates", etc. The string is not localized,
\r
320 * as it may be used for client<->server communications.
\r
322 * @since New in 1.5.
\r
325 svn_depth_to_word(svn_depth_t depth);
\r
328 /** Return the appropriate depth for @a depth_str. @a word is as
\r
329 * returned from svn_depth_to_word(). If @a depth_str does not
\r
330 * represent a recognized depth, return @c svn_depth_unknown.
\r
332 * @since New in 1.5.
\r
335 svn_depth_from_word(const char *word);
\r
338 /* Return @c svn_depth_infinity if boolean @a recurse is TRUE, else
\r
339 * return @c svn_depth_files.
\r
341 * @note New code should never need to use this, it is called only
\r
342 * from pre-depth APIs, for compatibility.
\r
344 * @since New in 1.5.
\r
346 #define SVN_DEPTH_INFINITY_OR_FILES(recurse) \
\r
347 ((recurse) ? svn_depth_infinity : svn_depth_files)
\r
350 /* Return @c svn_depth_infinity if boolean @a recurse is TRUE, else
\r
351 * return @c svn_depth_immediates.
\r
353 * @note New code should never need to use this, it is called only
\r
354 * from pre-depth APIs, for compatibility.
\r
356 * @since New in 1.5.
\r
358 #define SVN_DEPTH_INFINITY_OR_IMMEDIATES(recurse) \
\r
359 ((recurse) ? svn_depth_infinity : svn_depth_immediates)
\r
362 /* Return @c svn_depth_infinity if boolean @a recurse is TRUE, else
\r
363 * return @c svn_depth_empty.
\r
365 * @note New code should never need to use this, it is called only
\r
366 * from pre-depth APIs, for compatibility.
\r
368 * @since New in 1.5.
\r
370 #define SVN_DEPTH_INFINITY_OR_EMPTY(recurse) \
\r
371 ((recurse) ? svn_depth_infinity : svn_depth_empty)
\r
374 /* Return a recursion boolean based on @a depth.
\r
376 * Although much code has been converted to use depth, some code still
\r
377 * takes a recurse boolean. In most cases, it makes sense to treat
\r
378 * unknown or infinite depth as recursive, and any other depth as
\r
379 * non-recursive (which in turn usually translates to @c svn_depth_files).
\r
381 #define SVN_DEPTH_IS_RECURSIVE(depth) \
\r
382 (((depth) == svn_depth_infinity || (depth) == svn_depth_unknown) \
\r
387 * It is sometimes convenient to indicate which parts of an @c svn_dirent_t
\r
388 * object you are actually interested in, so that calculating and sending
\r
389 * the data corresponding to the other fields can be avoided. These values
\r
390 * can be used for that purpose.
\r
392 * @defgroup svn_dirent_fields Dirent fields
\r
396 /** An indication that you are interested in the @c kind field */
\r
397 #define SVN_DIRENT_KIND 0x00001
\r
399 /** An indication that you are interested in the @c size field */
\r
400 #define SVN_DIRENT_SIZE 0x00002
\r
402 /** An indication that you are interested in the @c has_props field */
\r
403 #define SVN_DIRENT_HAS_PROPS 0x00004
\r
405 /** An indication that you are interested in the @c created_rev field */
\r
406 #define SVN_DIRENT_CREATED_REV 0x00008
\r
408 /** An indication that you are interested in the @c time field */
\r
409 #define SVN_DIRENT_TIME 0x00010
\r
411 /** An indication that you are interested in the @c last_author field */
\r
412 #define SVN_DIRENT_LAST_AUTHOR 0x00020
\r
414 /** A combination of all the dirent fields */
\r
415 #define SVN_DIRENT_ALL ~((apr_uint32_t ) 0)
\r
419 /** A general subversion directory entry. */
\r
420 typedef struct svn_dirent_t
\r
423 svn_node_kind_t kind;
\r
425 /** length of file text, or 0 for directories */
\r
426 svn_filesize_t size;
\r
428 /** does the node have props? */
\r
429 svn_boolean_t has_props;
\r
431 /** last rev in which this node changed */
\r
432 svn_revnum_t created_rev;
\r
434 /** time of created_rev (mod-time) */
\r
437 /** author of created_rev */
\r
438 const char *last_author;
\r
440 /* IMPORTANT: If you extend this struct, check svn_dirent_dup(). */
\r
444 /** Return a deep copy of @a dirent, allocated in @a pool.
\r
446 * @since New in 1.4.
\r
449 svn_dirent_dup(const svn_dirent_t *dirent,
\r
454 /** Keyword substitution.
\r
456 * All the keywords Subversion recognizes.
\r
458 * Note that there is a better, more general proposal out there, which
\r
459 * would take care of both internationalization issues and custom
\r
460 * keywords (e.g., $NetBSD$). See
\r
463 http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=8921
\r
465 From: "Jonathan M. Manning" <jmanning@alisa-jon.net>
\r
466 To: dev@subversion.tigris.org
\r
467 Date: Fri, 14 Dec 2001 11:56:54 -0500
\r
468 Message-ID: <87970000.1008349014@bdldevel.bl.bdx.com>
\r
469 Subject: Re: keywords @endverbatim
\r
471 * and Eric Gillespie's support of same:
\r
474 http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=8757
\r
476 From: "Eric Gillespie, Jr." <epg@pretzelnet.org>
\r
477 To: dev@subversion.tigris.org
\r
478 Date: Wed, 12 Dec 2001 09:48:42 -0500
\r
479 Message-ID: <87k7vsebp1.fsf@vger.pretzelnet.org>
\r
480 Subject: Re: Customizable Keywords @endverbatim
\r
482 * However, it is considerably more complex than the scheme below.
\r
483 * For now we're going with simplicity, hopefully the more general
\r
484 * solution can be done post-1.0.
\r
486 * @defgroup svn_types_keywords Keyword definitions
\r
490 /** The maximum size of an expanded or un-expanded keyword. */
\r
491 #define SVN_KEYWORD_MAX_LEN 255
\r
493 /** The most recent revision in which this file was changed. */
\r
494 #define SVN_KEYWORD_REVISION_LONG "LastChangedRevision"
\r
496 /** Short version of LastChangedRevision */
\r
497 #define SVN_KEYWORD_REVISION_SHORT "Rev"
\r
499 /** Medium version of LastChangedRevision, matching the one CVS uses.
\r
500 * @since New in 1.1. */
\r
501 #define SVN_KEYWORD_REVISION_MEDIUM "Revision"
\r
503 /** The most recent date (repository time) when this file was changed. */
\r
504 #define SVN_KEYWORD_DATE_LONG "LastChangedDate"
\r
506 /** Short version of LastChangedDate */
\r
507 #define SVN_KEYWORD_DATE_SHORT "Date"
\r
509 /** Who most recently committed to this file. */
\r
510 #define SVN_KEYWORD_AUTHOR_LONG "LastChangedBy"
\r
512 /** Short version of LastChangedBy */
\r
513 #define SVN_KEYWORD_AUTHOR_SHORT "Author"
\r
515 /** The URL for the head revision of this file. */
\r
516 #define SVN_KEYWORD_URL_LONG "HeadURL"
\r
518 /** Short version of HeadURL */
\r
519 #define SVN_KEYWORD_URL_SHORT "URL"
\r
521 /** A compressed combination of the other four keywords. */
\r
522 #define SVN_KEYWORD_ID "Id"
\r
524 /** A full combination of the first four keywords.
\r
525 * @since New in 1.6. */
\r
526 #define SVN_KEYWORD_HEADER "Header"
\r
531 /** All information about a commit.
\r
533 * @note Objects of this type should always be created using the
\r
534 * svn_create_commit_info() function.
\r
536 * @since New in 1.3.
\r
538 typedef struct svn_commit_info_t
\r
540 /** just-committed revision. */
\r
541 svn_revnum_t revision;
\r
543 /** server-side date of the commit. */
\r
546 /** author of the commit. */
\r
547 const char *author;
\r
549 /** error message from post-commit hook, or NULL. */
\r
550 const char *post_commit_err;
\r
552 } svn_commit_info_t;
\r
556 * Allocate an object of type @c svn_commit_info_t in @a pool and
\r
559 * The @c revision field of the new struct is set to @c
\r
560 * SVN_INVALID_REVNUM. All other fields are initialized to @c NULL.
\r
562 * @note Any object of the type @c svn_commit_info_t should
\r
563 * be created using this function.
\r
564 * This is to provide for extending the svn_commit_info_t in
\r
567 * @since New in 1.3.
\r
569 svn_commit_info_t *
\r
570 svn_create_commit_info(apr_pool_t *pool);
\r
574 * Return a deep copy @a src_commit_info allocated in @a pool.
\r
576 * @since New in 1.4.
\r
578 svn_commit_info_t *
\r
579 svn_commit_info_dup(const svn_commit_info_t *src_commit_info,
\r
584 * A structure to represent a path that changed for a log entry.
\r
586 * @note To allow for extending the @c svn_log_changed_path2_t structure in
\r
587 * future releases, always use svn_log_changed_path2_create() to allocate
\r
590 * @since New in 1.6.
\r
592 typedef struct svn_log_changed_path2_t
\r
594 /** 'A'dd, 'D'elete, 'R'eplace, 'M'odify */
\r
597 /** Source path of copy (if any). */
\r
598 const char *copyfrom_path;
\r
600 /** Source revision of copy (if any). */
\r
601 svn_revnum_t copyfrom_rev;
\r
603 /** The type of the node, may be svn_node_unknown. */
\r
604 svn_node_kind_t node_kind;
\r
606 /* NOTE: Add new fields at the end to preserve binary compatibility.
\r
607 Also, if you add fields here, you have to update
\r
608 svn_log_changed_path2_dup(). */
\r
609 } svn_log_changed_path2_t;
\r
612 * Returns an @c svn_log_changed_path2_t, allocated in @a pool with all fields
\r
613 * initialized to NULL, None or empty values.
\r
615 * @note To allow for extending the @c svn_log_changed_path2_t structure in
\r
616 * future releases, this function should always be used to allocate the
\r
619 * @since New in 1.6.
\r
621 svn_log_changed_path2_t *
\r
622 svn_log_changed_path2_create(apr_pool_t *pool);
\r
625 * Return a deep copy of @a changed_path, allocated in @a pool.
\r
627 * @since New in 1.6.
\r
629 svn_log_changed_path2_t *
\r
630 svn_log_changed_path2_dup(const svn_log_changed_path2_t *changed_path,
\r
634 * A structure to represent a path that changed for a log entry. Same as
\r
635 * @c svn_log_changed_path2_t, but without the node kind.
\r
637 * @deprecated Provided for backward compatibility with the 1.5 API.
\r
639 typedef struct svn_log_changed_path_t
\r
641 /** 'A'dd, 'D'elete, 'R'eplace, 'M'odify */
\r
644 /** Source path of copy (if any). */
\r
645 const char *copyfrom_path;
\r
647 /** Source revision of copy (if any). */
\r
648 svn_revnum_t copyfrom_rev;
\r
650 } svn_log_changed_path_t;
\r
654 * Return a deep copy of @a changed_path, allocated in @a pool.
\r
656 * @since New in 1.3.
\r
657 * @deprecated Provided for backward compatibility with the 1.5 API.
\r
660 svn_log_changed_path_t *
\r
661 svn_log_changed_path_dup(const svn_log_changed_path_t *changed_path,
\r
665 * A structure to represent all the information about a particular log entry.
\r
667 * @note To allow for extending the @c svn_log_entry_t structure in future
\r
668 * releases, always use svn_log_entry_create() to allocate the structure.
\r
670 * @since New in 1.5.
\r
672 typedef struct svn_log_entry_t
\r
674 /** A hash containing as keys every path committed in @a revision; the
\r
675 * values are (@c svn_log_changed_path_t *) stuctures.
\r
677 * The subversion core libraries will always set this field to the same
\r
678 * value as changed_paths2 for compatibity reasons.
\r
680 * @deprecated Provided for backward compatibility with the 1.5 API.
\r
682 apr_hash_t *changed_paths;
\r
684 /** The revision of the commit. */
\r
685 svn_revnum_t revision;
\r
687 /** The hash of requested revision properties, which may be NULL if it
\r
688 * would contain no revprops. */
\r
689 apr_hash_t *revprops;
\r
692 * Whether or not this message has children.
\r
694 * When a log operation requests additional merge information, extra log
\r
695 * entries may be returned as a result of this entry. The new entries, are
\r
696 * considered children of the original entry, and will follow it. When
\r
697 * the HAS_CHILDREN flag is set, the receiver should increment its stack
\r
698 * depth, and wait until an entry is provided with SVN_INVALID_REVNUM which
\r
699 * indicates the end of the children.
\r
701 * For log operations which do not request additional merge information, the
\r
702 * HAS_CHILDREN flag is always FALSE.
\r
704 * For more information see:
\r
705 * http://subversion.tigris.org/merge-tracking/design.html#commutative-reporting
\r
707 svn_boolean_t has_children;
\r
709 /** A hash containing as keys every path committed in @a revision; the
\r
710 * values are (@c svn_log_changed_path2_t *) stuctures.
\r
712 * If this value is not @c NULL, it MUST have the same value as
\r
713 * changed_paths or svn_log_entry_dup() will not create an identical copy.
\r
715 * The subversion core libraries will always set this field to the same
\r
716 * value as changed_paths for compatibity with users assuming an older
\r
719 * @since New in 1.6.
\r
721 apr_hash_t *changed_paths2;
\r
723 /* NOTE: Add new fields at the end to preserve binary compatibility.
\r
724 Also, if you add fields here, you have to update
\r
725 svn_log_entry_dup(). */
\r
729 * Returns an @c svn_log_entry_t, allocated in @a pool with all fields
\r
730 * initialized to NULL values.
\r
732 * @note To allow for extending the @c svn_log_entry_t structure in future
\r
733 * releases, this function should always be used to allocate the structure.
\r
735 * @since New in 1.5.
\r
738 svn_log_entry_create(apr_pool_t *pool);
\r
740 /** Return a deep copy of @a log_entry, allocated in @a pool.
\r
742 * The resulting svn_log_entry_t has @c changed_paths set to the same
\r
743 * value as @c changed_path2. @c changed_paths will be @c NULL if
\r
744 * @c changed_paths2 was @c NULL.
\r
746 * @since New in 1.6.
\r
749 svn_log_entry_dup(svn_log_entry_t *log_entry, apr_pool_t *pool);
\r
751 /** The callback invoked by log message loopers, such as
\r
752 * @c svn_ra_plugin_t.get_log() and svn_repos_get_logs().
\r
754 * This function is invoked once on each log message, in the order
\r
755 * determined by the caller (see above-mentioned functions).
\r
757 * @a baton is what you think it is, and @a log_entry contains relevent
\r
758 * information for the log message. Any of @a log_entry->author,
\r
759 * @a log_entry->date, or @a log_entry->message may be @c NULL.
\r
761 * If @a log_entry->date is neither NULL nor the empty string, it was
\r
762 * generated by svn_time_to_cstring() and can be converted to
\r
763 * @c apr_time_t with svn_time_from_cstring().
\r
765 * If @a log_entry->changed_paths is non-@c NULL, then it contains as keys
\r
766 * every path committed in @a log_entry->revision; the values are
\r
767 * (@c svn_log_changed_path_t *) structures.
\r
769 * If @a log_entry->has_children is @c TRUE, the message will be followed
\r
770 * immediately by any number of merged revisions (child messages), which are
\r
771 * terminated by an invocation with SVN_INVALID_REVNUM. This usage may
\r
774 * Use @a pool for temporary allocation. If the caller is iterating
\r
775 * over log messages, invoking this receiver on each, we recommend the
\r
776 * standard pool loop recipe: create a subpool, pass it as @a pool to
\r
777 * each call, clear it after each iteration, destroy it after the loop
\r
778 * is done. (For allocation that must last beyond the lifetime of a
\r
779 * given receiver call, use a pool in @a baton.)
\r
781 * @since New in 1.5.
\r
784 typedef svn_error_t *(*svn_log_entry_receiver_t)
\r
786 svn_log_entry_t *log_entry,
\r
790 * Similar to @c svn_log_entry_receiver_t, except this uses separate
\r
791 * parameters for each part of the log entry.
\r
793 * @deprecated Provided for backward compatibility with the 1.4 API.
\r
795 typedef svn_error_t *(*svn_log_message_receiver_t)
\r
797 apr_hash_t *changed_paths,
\r
798 svn_revnum_t revision,
\r
799 const char *author,
\r
800 const char *date, /* use svn_time_from_cstring() if need apr_time_t */
\r
801 const char *message,
\r
805 /** Callback function type for commits.
\r
807 * When a commit succeeds, an instance of this is invoked with the
\r
808 * @a commit_info, along with the @a baton closure.
\r
809 * @a pool can be used for temporary allocations.
\r
811 * @since New in 1.4.
\r
813 typedef svn_error_t *(*svn_commit_callback2_t)
\r
814 (const svn_commit_info_t *commit_info,
\r
818 /** Same as @c svn_commit_callback2_t, but uses individual
\r
819 * data elements instead of the @c svn_commit_info_t structure
\r
821 * @deprecated Provided for backward compatibility with the 1.3 API.
\r
823 typedef svn_error_t *(*svn_commit_callback_t)
\r
824 (svn_revnum_t new_revision,
\r
826 const char *author,
\r
830 /** A buffer size that may be used when processing a stream of data.
\r
832 * @note We don't use this constant any longer, since it is considered to be
\r
833 * unnecessarily large.
\r
835 * @deprecated Provided for backwards compatibility with the 1.3 API.
\r
837 #define SVN_STREAM_CHUNK_SIZE 102400
\r
839 #ifndef DOXYGEN_SHOULD_SKIP_THIS
\r
841 * The maximum amount we (ideally) hold in memory at a time when
\r
842 * processing a stream of data.
\r
844 * For example, when copying data from one stream to another, do it in
\r
845 * blocks of this size.
\r
847 * NOTE: This is an internal macro, put here for convenience.
\r
848 * No public API may depend on the particular value of this macro.
\r
850 #define SVN__STREAM_CHUNK_SIZE 16384
\r
853 /** The maximum amount we can ever hold in memory. */
\r
854 /* FIXME: Should this be the same as SVN_STREAM_CHUNK_SIZE? */
\r
855 #define SVN_MAX_OBJECT_SIZE (((apr_size_t) -1) / 2)
\r
859 /* ### Note: despite being about mime-TYPES, these probably don't
\r
860 * ### belong in svn_types.h. However, no other header is more
\r
861 * ### appropriate, and didn't feel like creating svn_validate.h for
\r
865 /** Validate @a mime_type.
\r
867 * If @a mime_type does not contain a "/", or ends with non-alphanumeric
\r
868 * data, return @c SVN_ERR_BAD_MIME_TYPE, else return success.
\r
870 * Use @a pool only to find error allocation.
\r
872 * Goal: to match both "foo/bar" and "foo/bar; charset=blah", without
\r
873 * being too strict about it, but to disallow mime types that have
\r
874 * quotes, newlines, or other garbage on the end, such as might be
\r
875 * unsafe in an HTTP header.
\r
878 svn_mime_type_validate(const char *mime_type,
\r
882 /** Return FALSE iff @a mime_type is a textual type.
\r
884 * All mime types that start with "text/" are textual, plus some special
\r
885 * cases (for example, "image/x-xbitmap").
\r
888 svn_mime_type_is_binary(const char *mime_type);
\r
892 /** A user defined callback that subversion will call with a user defined
\r
893 * baton to see if the current operation should be continued. If the operation
\r
894 * should continue, the function should return @c SVN_NO_ERROR, if not, it
\r
895 * should return @c SVN_ERR_CANCELLED.
\r
897 typedef svn_error_t *(*svn_cancel_func_t)(void *cancel_baton);
\r
902 * A lock object, for client & server to share.
\r
904 * A lock represents the exclusive right to add, delete, or modify a
\r
905 * path. A lock is created in a repository, wholly controlled by the
\r
906 * repository. A "lock-token" is the lock's UUID, and can be used to
\r
907 * learn more about a lock's fields, and or/make use of the lock.
\r
908 * Because a lock is immutable, a client is free to not only cache the
\r
909 * lock-token, but the lock's fields too, for convenience.
\r
911 * Note that the 'is_dav_comment' field is wholly ignored by every
\r
912 * library except for mod_dav_svn. The field isn't even marshalled
\r
913 * over the network to the client. Assuming lock structures are
\r
914 * created with apr_pcalloc(), a default value of 0 is universally safe.
\r
916 * @note in the current implementation, only files are lockable.
\r
918 * @since New in 1.2.
\r
920 typedef struct svn_lock_t
\r
922 const char *path; /**< the path this lock applies to */
\r
923 const char *token; /**< unique URI representing lock */
\r
924 const char *owner; /**< the username which owns the lock */
\r
925 const char *comment; /**< (optional) description of lock */
\r
926 svn_boolean_t is_dav_comment; /**< was comment made by generic DAV client? */
\r
927 apr_time_t creation_date; /**< when lock was made */
\r
928 apr_time_t expiration_date; /**< (optional) when lock will expire;
\r
929 If value is 0, lock will never expire. */
\r
933 * Returns an @c svn_lock_t, allocated in @a pool with all fields initialized
\r
936 * @note To allow for extending the @c svn_lock_t structure in the future
\r
937 * releases, this function should always be used to allocate the structure.
\r
939 * @since New in 1.2.
\r
942 svn_lock_create(apr_pool_t *pool);
\r
945 * Return a deep copy of @a lock, allocated in @a pool.
\r
947 * @since New in 1.2.
\r
950 svn_lock_dup(const svn_lock_t *lock, apr_pool_t *pool);
\r
953 * Return a formatted Universal Unique IDentifier (UUID) string.
\r
955 * @since New in 1.4.
\r
958 svn_uuid_generate(apr_pool_t *pool);
\r
961 * Mergeinfo representing a merge of a range of revisions.
\r
963 * @since New in 1.5
\r
965 typedef struct svn_merge_range_t
\r
968 * If the 'start' field is less than the 'end' field then 'start' is
\r
969 * exclusive and 'end' inclusive of the range described. This is termed
\r
970 * a forward merge range. If 'start' is greater than 'end' then the
\r
971 * opposite is true. This is termed a reverse merge range. If 'start'
\r
972 * equals 'end' the meaning of the range is not defined.
\r
974 svn_revnum_t start;
\r
978 * Whether this merge range should be inherited by treewise
\r
979 * descendants of the path to which the range applies. */
\r
980 svn_boolean_t inheritable;
\r
981 } svn_merge_range_t;
\r
984 * Return a copy of @a range, allocated in @a pool.
\r
986 * @since New in 1.5.
\r
988 svn_merge_range_t *
\r
989 svn_merge_range_dup(svn_merge_range_t *range, apr_pool_t *pool);
\r
992 * Returns true if the changeset committed in revision @a rev is one
\r
993 * of the changesets in the range @a range.
\r
995 * @since New in 1.5.
\r
998 svn_merge_range_contains_rev(svn_merge_range_t *range, svn_revnum_t rev);
\r
1002 /** @defgroup node_location_seg_reporting Node location segment reporting.
\r
1006 * A representation of a segment of a object's version history with an
\r
1007 * emphasis on the object's location in the repository as of various
\r
1010 * @since New in 1.5.
\r
1012 typedef struct svn_location_segment_t
\r
1014 /** The beginning (oldest) and ending (youngest) revisions for this
\r
1016 svn_revnum_t range_start;
\r
1017 svn_revnum_t range_end;
\r
1019 /** The absolute (sans leading slash) path for this segment. May be
\r
1020 NULL to indicate gaps in an object's history. */
\r
1023 } svn_location_segment_t;
\r
1027 * A callback invoked by generators of @c svn_location_segment_t
\r
1028 * objects, used to report information about a versioned object's
\r
1029 * history in terms of its location in the repository filesystem over
\r
1032 typedef svn_error_t *(*svn_location_segment_receiver_t)
\r
1033 (svn_location_segment_t *segment,
\r
1035 apr_pool_t *pool);
\r
1039 * Return a deep copy of @a segment, allocated in @a pool.
\r
1041 * @since New in 1.5.
\r
1043 svn_location_segment_t *
\r
1044 svn_location_segment_dup(svn_location_segment_t *segment,
\r
1045 apr_pool_t *pool);
\r
1049 #ifdef __cplusplus
\r
1051 #endif /* __cplusplus */
\r
1055 * Everybody and their brother needs to deal with svn_error_t, the error
\r
1056 * codes, and whatever else. While they *should* go and include svn_error.h
\r
1057 * in order to do that... bah. Let's just help everybody out and include
\r
1058 * that header whenever somebody grabs svn_types.h.
\r
1060 * Note that we do this at the END of this header so that its contents
\r
1061 * are available to svn_error.h (our guards will prevent the circular
\r
1062 * include). We also need to do the include *outside* of the cplusplus
\r
1065 #include "svn_error.h"
\r
1068 #endif /* SVN_TYPES_H */
\r