00001 /** 00002 * @copyright 00003 * ==================================================================== 00004 * Copyright (c) 2000-2008 CollabNet. All rights reserved. 00005 * 00006 * This software is licensed as described in the file COPYING, which 00007 * you should have received as part of this distribution. The terms 00008 * are also available at http://subversion.tigris.org/license-1.html. 00009 * If newer versions of this license are posted there, you may use a 00010 * newer version instead, at your option. 00011 * 00012 * This software consists of voluntary contributions made by many 00013 * individuals. For exact contribution history, see the revision 00014 * history and logs, available at http://subversion.tigris.org/. 00015 * ==================================================================== 00016 * @endcopyright 00017 * 00018 * @file svn_types.h 00019 * @brief Subversion's data types 00020 */ 00021 00022 #ifndef SVN_TYPES_H 00023 #define SVN_TYPES_H 00024 00025 /* ### this should go away, but it causes too much breakage right now */ 00026 #include <stdlib.h> 00027 00028 #include <apr.h> /* for apr_size_t */ 00029 #include <apr_pools.h> 00030 #include <apr_hash.h> 00031 #include <apr_tables.h> 00032 #include <apr_time.h> 00033 00034 #ifdef __cplusplus 00035 extern "C" { 00036 #endif /* __cplusplus */ 00037 00038 00039 00040 /** Subversion error object. 00041 * 00042 * Defined here, rather than in svn_error.h, to avoid a recursive @#include 00043 * situation. 00044 */ 00045 typedef struct svn_error_t 00046 { 00047 /** APR error value, possibly SVN_ custom err */ 00048 apr_status_t apr_err; 00049 00050 /** details from producer of error */ 00051 const char *message; 00052 00053 /** ptr to the error we "wrap" */ 00054 struct svn_error_t *child; 00055 00056 /** The pool holding this error and any child errors it wraps */ 00057 apr_pool_t *pool; 00058 00059 /** Source file where the error originated. Only used iff @c SVN_DEBUG. */ 00060 const char *file; 00061 00062 /** Source line where the error originated. Only used iff @c SVN_DEBUG. */ 00063 long line; 00064 00065 } svn_error_t; 00066 00067 00068 00069 /** @defgroup APR_ARRAY_compat_macros APR Array Compatibility Helper Macros 00070 * These macros are provided by APR itself from version 1.3. 00071 * Definitions are provided here for when using older versions of APR. 00072 * @{ 00073 */ 00074 00075 /** index into an apr_array_header_t */ 00076 #ifndef APR_ARRAY_IDX 00077 #define APR_ARRAY_IDX(ary,i,type) (((type *)(ary)->elts)[i]) 00078 #endif 00079 00080 /** easier array-pushing syntax */ 00081 #ifndef APR_ARRAY_PUSH 00082 #define APR_ARRAY_PUSH(ary,type) (*((type *)apr_array_push(ary))) 00083 #endif 00084 00085 /** @} */ 00086 00087 /** The various types of nodes in the Subversion filesystem. */ 00088 typedef enum 00089 { 00090 /** absent */ 00091 svn_node_none, 00092 00093 /** regular file */ 00094 svn_node_file, 00095 00096 /** directory */ 00097 svn_node_dir, 00098 00099 /** something's here, but we don't know what */ 00100 svn_node_unknown 00101 } svn_node_kind_t; 00102 00103 /** About Special Files in Subversion 00104 * 00105 * Subversion denotes files that cannot be portably created or 00106 * modified as "special" files (svn_node_special). It stores these 00107 * files in the repository as a plain text file with the svn:special 00108 * property set. The file contents contain: a platform-specific type 00109 * string, a space character, then any information necessary to create 00110 * the file on a supported platform. For example, if a symbolic link 00111 * were being represented, the repository file would have the 00112 * following contents: 00113 * 00114 * "link /path/to/link/target" 00115 * 00116 * Where 'link' is the identifier string showing that this special 00117 * file should be a symbolic link and '/path/to/link/target' is the 00118 * destination of the symbolic link. 00119 * 00120 * Special files are stored in the text-base exactly as they are 00121 * stored in the repository. The platform specific files are created 00122 * in the working copy at EOL/keyword translation time using 00123 * svn_subst_copy_and_translate2(). If the current platform does not 00124 * support a specific special file type, the file is copied into the 00125 * working copy as it is seen in the repository. Because of this, 00126 * users of other platforms can still view and modify the special 00127 * files, even if they do not have their unique properties. 00128 * 00129 * New types of special files can be added by: 00130 * 1. Implementing a platform-dependent routine to create a uniquely 00131 * named special file and one to read the special file in 00132 * libsvn_subr/io.c. 00133 * 2. Creating a new textual name similar to 00134 * SVN_SUBST__SPECIAL_LINK_STR in libsvn_subr/subst.c. 00135 * 3. Handling the translation/detranslation case for the new type in 00136 * create_special_file and detranslate_special_file, using the 00137 * routines from 1. 00138 */ 00139 00140 /** A revision number. */ 00141 typedef long int svn_revnum_t; 00142 00143 /** Valid revision numbers begin at 0 */ 00144 #define SVN_IS_VALID_REVNUM(n) ((n) >= 0) 00145 00146 /** The 'official' invalid revision num */ 00147 #define SVN_INVALID_REVNUM ((svn_revnum_t) -1) 00148 00149 /** Not really invalid...just unimportant -- one day, this can be its 00150 * own unique value, for now, just make it the same as 00151 * @c SVN_INVALID_REVNUM. 00152 */ 00153 #define SVN_IGNORED_REVNUM ((svn_revnum_t) -1) 00154 00155 /** Convert NULL-terminated C string @a str to a revision number. */ 00156 #define SVN_STR_TO_REV(str) ((svn_revnum_t) atol(str)) 00157 00158 /** 00159 * Parse NULL-terminated C string @a str as a revision number and 00160 * store its value in @a rev. If @a endptr is non-NULL, then the 00161 * address of the first non-numeric character in @a str is stored in 00162 * it. If there are no digits in @a str, then @a endptr is set (if 00163 * non-NULL), and the error @c SVN_ERR_REVNUM_PARSE_FAILURE error is 00164 * returned. Negative numbers parsed from @a str are considered 00165 * invalid, and result in the same error. 00166 * 00167 * @since New in 1.5. 00168 */ 00169 svn_error_t * 00170 svn_revnum_parse(svn_revnum_t *rev, 00171 const char *str, 00172 const char **endptr); 00173 00174 /** Originally intended to be used in printf()-style functions to format 00175 * revision numbers. Deprecated due to incompatibilities with language 00176 * translation tools (e.g. gettext). 00177 * 00178 * New code should use a bare "%ld" format specifier for formatting revision 00179 * numbers. 00180 * 00181 * @deprecated Provided for backward compatibility with the 1.0 API. 00182 */ 00183 #define SVN_REVNUM_T_FMT "ld" 00184 00185 00186 /** The size of a file in the Subversion FS. */ 00187 typedef apr_int64_t svn_filesize_t; 00188 00189 /** The 'official' invalid file size constant. */ 00190 #define SVN_INVALID_FILESIZE ((svn_filesize_t) -1) 00191 00192 /** In printf()-style functions, format file sizes using this. */ 00193 #define SVN_FILESIZE_T_FMT APR_INT64_T_FMT 00194 00195 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00196 /* Parse a base-10 numeric string into a 64-bit unsigned numeric value. */ 00197 /* NOTE: Private. For use by Subversion's own code only. See issue #1644. */ 00198 /* FIXME: APR should supply a function to do this, such as "apr_atoui64". */ 00199 #define svn__atoui64(X) ((apr_uint64_t) apr_atoi64(X)) 00200 #endif 00201 00202 00203 /** YABT: Yet Another Boolean Type */ 00204 typedef int svn_boolean_t; 00205 00206 #ifndef TRUE 00207 /** uhh... true */ 00208 #define TRUE 1 00209 #endif /* TRUE */ 00210 00211 #ifndef FALSE 00212 /** uhh... false */ 00213 #define FALSE 0 00214 #endif /* FALSE */ 00215 00216 00217 /** An enum to indicate whether recursion is needed. */ 00218 enum svn_recurse_kind 00219 { 00220 svn_nonrecursive = 1, 00221 svn_recursive 00222 }; 00223 00224 /** The concept of depth for directories. 00225 * 00226 * @note This is similar to, but not exactly the same as, the WebDAV 00227 * and LDAP concepts of depth. 00228 * 00229 * @since New in 1.5. 00230 */ 00231 typedef enum 00232 { 00233 /* The order of these depths is important: the higher the number, 00234 the deeper it descends. This allows us to compare two depths 00235 numerically to decide which should govern. */ 00236 00237 /* Depth undetermined or ignored. */ 00238 svn_depth_unknown = -2, 00239 00240 /* Exclude (i.e., don't descend into) directory D. */ 00241 /* NOTE: In Subversion 1.5, svn_depth_exclude is *not* supported 00242 anywhere in the client-side (libsvn_wc/libsvn_client/etc) code; 00243 it is only supported as an argument to set_path functions in the 00244 ra and repos reporters. (This will enable future versions of 00245 Subversion to run updates, etc, against 1.5 servers with proper 00246 svn_depth_exclude behavior, once we get a chance to implement 00247 client-side support for svn_depth_exclude.) 00248 */ 00249 svn_depth_exclude = -1, 00250 00251 /* Just the named directory D, no entries. Updates will not pull in 00252 any files or subdirectories not already present. */ 00253 svn_depth_empty = 0, 00254 00255 /* D + its file children, but not subdirs. Updates will pull in any 00256 files not already present, but not subdirectories. */ 00257 svn_depth_files = 1, 00258 00259 /* D + immediate children (D and its entries). Updates will pull in 00260 any files or subdirectories not already present; those 00261 subdirectories' this_dir entries will have depth-empty. */ 00262 svn_depth_immediates = 2, 00263 00264 /* D + all descendants (full recursion from D). Updates will pull 00265 in any files or subdirectories not already present; those 00266 subdirectories' this_dir entries will have depth-infinity. 00267 Equivalent to the pre-1.5 default update behavior. */ 00268 svn_depth_infinity = 3 00269 00270 } svn_depth_t; 00271 00272 00273 /** Return a constant string expressing @a depth as an English word, 00274 * e.g., "infinity", "immediates", etc. The string is not localized, 00275 * as it may be used for client<->server communications. 00276 * 00277 * @since New in 1.5. 00278 */ 00279 const char * 00280 svn_depth_to_word(svn_depth_t depth); 00281 00282 00283 /** Return the appropriate depth for @a depth_str. @a word is as 00284 * returned from svn_depth_to_word(). If @a depth_str does not 00285 * represent a recognized depth, return @c svn_depth_unknown. 00286 * 00287 * @since New in 1.5. 00288 */ 00289 svn_depth_t 00290 svn_depth_from_word(const char *word); 00291 00292 00293 /* Return @c svn_depth_infinity if boolean @a recurse is TRUE, else 00294 * return @c svn_depth_files. 00295 * 00296 * @note New code should never need to use this, it is called only 00297 * from pre-depth APIs, for compatibility. 00298 * 00299 * @since New in 1.5. 00300 */ 00301 #define SVN_DEPTH_INFINITY_OR_FILES(recurse) \ 00302 ((recurse) ? svn_depth_infinity : svn_depth_files) 00303 00304 00305 /* Return @c svn_depth_infinity if boolean @a recurse is TRUE, else 00306 * return @c svn_depth_immediates. 00307 * 00308 * @note New code should never need to use this, it is called only 00309 * from pre-depth APIs, for compatibility. 00310 * 00311 * @since New in 1.5. 00312 */ 00313 #define SVN_DEPTH_INFINITY_OR_IMMEDIATES(recurse) \ 00314 ((recurse) ? svn_depth_infinity : svn_depth_immediates) 00315 00316 00317 /* Return @c svn_depth_infinity if boolean @a recurse is TRUE, else 00318 * return @c svn_depth_empty. 00319 * 00320 * @note New code should never need to use this, it is called only 00321 * from pre-depth APIs, for compatibility. 00322 * 00323 * @since New in 1.5. 00324 */ 00325 #define SVN_DEPTH_INFINITY_OR_EMPTY(recurse) \ 00326 ((recurse) ? svn_depth_infinity : svn_depth_empty) 00327 00328 00329 /* Return a recursion boolean based on @a depth. 00330 * 00331 * Although much code has been converted to use depth, some code still 00332 * takes a recurse boolean. In most cases, it makes sense to treat 00333 * unknown or infinite depth as recursive, and any other depth as 00334 * non-recursive (which in turn usually translates to @c svn_depth_files). 00335 */ 00336 #define SVN_DEPTH_IS_RECURSIVE(depth) \ 00337 (((depth) == svn_depth_infinity || (depth) == svn_depth_unknown) \ 00338 ? TRUE : FALSE) 00339 00340 00341 /** 00342 * It is sometimes convenient to indicate which parts of an @c svn_dirent_t 00343 * object you are actually interested in, so that calculating and sending 00344 * the data corresponding to the other fields can be avoided. These values 00345 * can be used for that purpose. 00346 * 00347 * @defgroup svn_dirent_fields Dirent fields 00348 * @{ 00349 */ 00350 00351 /** An indication that you are interested in the @c kind field */ 00352 #define SVN_DIRENT_KIND 0x00001 00353 00354 /** An indication that you are interested in the @c size field */ 00355 #define SVN_DIRENT_SIZE 0x00002 00356 00357 /** An indication that you are interested in the @c has_props field */ 00358 #define SVN_DIRENT_HAS_PROPS 0x00004 00359 00360 /** An indication that you are interested in the @c created_rev field */ 00361 #define SVN_DIRENT_CREATED_REV 0x00008 00362 00363 /** An indication that you are interested in the @c time field */ 00364 #define SVN_DIRENT_TIME 0x00010 00365 00366 /** An indication that you are interested in the @c last_author field */ 00367 #define SVN_DIRENT_LAST_AUTHOR 0x00020 00368 00369 /** A combination of all the dirent fields */ 00370 #define SVN_DIRENT_ALL ~((apr_uint32_t ) 0) 00371 00372 /** @} */ 00373 00374 /** A general subversion directory entry. */ 00375 typedef struct svn_dirent_t 00376 { 00377 /** node kind */ 00378 svn_node_kind_t kind; 00379 00380 /** length of file text, or 0 for directories */ 00381 svn_filesize_t size; 00382 00383 /** does the node have props? */ 00384 svn_boolean_t has_props; 00385 00386 /** last rev in which this node changed */ 00387 svn_revnum_t created_rev; 00388 00389 /** time of created_rev (mod-time) */ 00390 apr_time_t time; 00391 00392 /** author of created_rev */ 00393 const char *last_author; 00394 00395 /* IMPORTANT: If you extend this struct, check svn_dirent_dup(). */ 00396 } svn_dirent_t; 00397 00398 00399 /** Return a deep copy of @a dirent, allocated in @a pool. 00400 * 00401 * @since New in 1.4. 00402 */ 00403 svn_dirent_t *svn_dirent_dup(const svn_dirent_t *dirent, 00404 apr_pool_t *pool); 00405 00406 00407 00408 /** Keyword substitution. 00409 * 00410 * All the keywords Subversion recognizes. 00411 * 00412 * Note that there is a better, more general proposal out there, which 00413 * would take care of both internationalization issues and custom 00414 * keywords (e.g., $NetBSD$). See 00415 * 00416 * @verbatim 00417 http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=8921 00418 ===== 00419 From: "Jonathan M. Manning" <jmanning@alisa-jon.net> 00420 To: dev@subversion.tigris.org 00421 Date: Fri, 14 Dec 2001 11:56:54 -0500 00422 Message-ID: <87970000.1008349014@bdldevel.bl.bdx.com> 00423 Subject: Re: keywords @endverbatim 00424 * 00425 * and Eric Gillespie's support of same: 00426 * 00427 * @verbatim 00428 http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=8757 00429 ===== 00430 From: "Eric Gillespie, Jr." <epg@pretzelnet.org> 00431 To: dev@subversion.tigris.org 00432 Date: Wed, 12 Dec 2001 09:48:42 -0500 00433 Message-ID: <87k7vsebp1.fsf@vger.pretzelnet.org> 00434 Subject: Re: Customizable Keywords @endverbatim 00435 * 00436 * However, it is considerably more complex than the scheme below. 00437 * For now we're going with simplicity, hopefully the more general 00438 * solution can be done post-1.0. 00439 * 00440 * @defgroup svn_types_keywords Keyword definitions 00441 * @{ 00442 */ 00443 00444 /** The maximum size of an expanded or un-expanded keyword. */ 00445 #define SVN_KEYWORD_MAX_LEN 255 00446 00447 /** The most recent revision in which this file was changed. */ 00448 #define SVN_KEYWORD_REVISION_LONG "LastChangedRevision" 00449 00450 /** Short version of LastChangedRevision */ 00451 #define SVN_KEYWORD_REVISION_SHORT "Rev" 00452 00453 /** Medium version of LastChangedRevision, matching the one CVS uses. 00454 * @since New in 1.1. */ 00455 #define SVN_KEYWORD_REVISION_MEDIUM "Revision" 00456 00457 /** The most recent date (repository time) when this file was changed. */ 00458 #define SVN_KEYWORD_DATE_LONG "LastChangedDate" 00459 00460 /** Short version of LastChangedDate */ 00461 #define SVN_KEYWORD_DATE_SHORT "Date" 00462 00463 /** Who most recently committed to this file. */ 00464 #define SVN_KEYWORD_AUTHOR_LONG "LastChangedBy" 00465 00466 /** Short version of LastChangedBy */ 00467 #define SVN_KEYWORD_AUTHOR_SHORT "Author" 00468 00469 /** The URL for the head revision of this file. */ 00470 #define SVN_KEYWORD_URL_LONG "HeadURL" 00471 00472 /** Short version of HeadURL */ 00473 #define SVN_KEYWORD_URL_SHORT "URL" 00474 00475 /** A compressed combination of the other four keywords. */ 00476 #define SVN_KEYWORD_ID "Id" 00477 00478 /** @} */ 00479 00480 00481 /** All information about a commit. 00482 * 00483 * @note Objects of this type should always be created using the 00484 * svn_create_commit_info() function. 00485 * 00486 * @since New in 1.3. 00487 */ 00488 typedef struct svn_commit_info_t 00489 { 00490 /** just-committed revision. */ 00491 svn_revnum_t revision; 00492 00493 /** server-side date of the commit. */ 00494 const char *date; 00495 00496 /** author of the commit. */ 00497 const char *author; 00498 00499 /** error message from post-commit hook, or NULL. */ 00500 const char *post_commit_err; 00501 00502 } svn_commit_info_t; 00503 00504 00505 /** 00506 * Allocate an object of type @c svn_commit_info_t in @a pool and 00507 * return it. 00508 * 00509 * The @c revision field of the new struct is set to @c 00510 * SVN_INVALID_REVNUM. All other fields are initialized to @c NULL. 00511 * 00512 * @note Any object of the type @c svn_commit_info_t should 00513 * be created using this function. 00514 * This is to provide for extending the svn_commit_info_t in 00515 * the future. 00516 * 00517 * @since New in 1.3. 00518 */ 00519 svn_commit_info_t * 00520 svn_create_commit_info(apr_pool_t *pool); 00521 00522 00523 /** 00524 * Return a deep copy @a src_commit_info allocated in @a pool. 00525 * 00526 * @since New in 1.4. 00527 */ 00528 svn_commit_info_t * 00529 svn_commit_info_dup(const svn_commit_info_t *src_commit_info, 00530 apr_pool_t *pool); 00531 00532 00533 /** A structure to represent a path that changed for a log entry. */ 00534 typedef struct svn_log_changed_path_t 00535 { 00536 /** 'A'dd, 'D'elete, 'R'eplace, 'M'odify */ 00537 char action; 00538 00539 /** Source path of copy (if any). */ 00540 const char *copyfrom_path; 00541 00542 /** Source revision of copy (if any). */ 00543 svn_revnum_t copyfrom_rev; 00544 00545 } svn_log_changed_path_t; 00546 00547 00548 /** 00549 * Return a deep copy of @a changed_path, allocated in @a pool. 00550 * 00551 * @since New in 1.3. 00552 */ 00553 svn_log_changed_path_t * 00554 svn_log_changed_path_dup(const svn_log_changed_path_t *changed_path, 00555 apr_pool_t *pool); 00556 00557 /** 00558 * A structure to represent all the information about a particular log entry. 00559 * 00560 * @note To allow for extending the @c svn_log_entry_t structure in future 00561 * releases, always use svn_log_entry_create() to allocate the structure. 00562 */ 00563 typedef struct svn_log_entry_t 00564 { 00565 /** A hash containing as keys every path committed in @a revision; the 00566 * values are (@c svn_log_changed_path_t *) stuctures. 00567 * 00568 * ### The only reason @a changed_paths is not qualified with `const' is 00569 * that we usually want to loop over it, and apr_hash_first() doesn't 00570 * take a const hash, for various reasons. I'm not sure that those 00571 * "various reasons" are actually even relevant anymore, and if 00572 * they're not, it might be nice to change apr_hash_first() so 00573 * read-only uses of hashes can be protected via the type system. 00574 */ 00575 apr_hash_t *changed_paths; 00576 00577 /** The revision of the commit. */ 00578 svn_revnum_t revision; 00579 00580 /** The hash of requested revision properties, which may be NULL if it 00581 * would contain no revprops. */ 00582 apr_hash_t *revprops; 00583 00584 /** 00585 * Whether or not this message has children. 00586 * 00587 * When a log operation requests additional merge information, extra log 00588 * entries may be returned as a result of this entry. The new entries, are 00589 * considered children of the original entry, and will follow it. When 00590 * the HAS_CHILDREN flag is set, the receiver should increment its stack 00591 * depth, and wait until an entry is provided with SVN_INVALID_REVNUM which 00592 * indicates the end of the children. 00593 * 00594 * For log operations which do not request additional merge information, the 00595 * HAS_CHILDREN flag is always FALSE. 00596 * 00597 * For more information see: 00598 * http://subversion.tigris.org/merge-tracking/design.html#commutative-reporting 00599 */ 00600 svn_boolean_t has_children; 00601 } svn_log_entry_t; 00602 00603 /** 00604 * Returns an @c svn_log_entry_t, allocated in @a pool with all fields 00605 * initialized to NULL values. 00606 * 00607 * @note To allow for extending the @c svn_log_entry_t structure in future 00608 * releases, this function should always be used to allocate the structure. 00609 * 00610 * @since New in 1.5. 00611 */ 00612 svn_log_entry_t * 00613 svn_log_entry_create(apr_pool_t *pool); 00614 00615 /** The callback invoked by log message loopers, such as 00616 * @c svn_ra_plugin_t.get_log() and svn_repos_get_logs(). 00617 * 00618 * This function is invoked once on each log message, in the order 00619 * determined by the caller (see above-mentioned functions). 00620 * 00621 * @a baton is what you think it is, and @a log_entry contains relevent 00622 * information for the log message. Any of @a log_entry->author, 00623 * @a log_entry->date, or @a log_entry->message may be @c NULL. 00624 * 00625 * If @a log_entry->date is neither NULL nor the empty string, it was 00626 * generated by svn_time_to_cstring() and can be converted to 00627 * @c apr_time_t with svn_time_from_cstring(). 00628 * 00629 * If @a log_entry->changed_paths is non-@c NULL, then it contains as keys 00630 * every path committed in @a log_entry->revision; the values are 00631 * (@c svn_log_changed_path_t *) structures. 00632 * 00633 * If @a log_entry->has_children is @c TRUE, the message will be followed 00634 * immediately by any number of merged revisions (child messages), which are 00635 * terminated by an invocation with SVN_INVALID_REVNUM. This usage may 00636 * be recursive. 00637 * 00638 * Use @a pool for temporary allocation. If the caller is iterating 00639 * over log messages, invoking this receiver on each, we recommend the 00640 * standard pool loop recipe: create a subpool, pass it as @a pool to 00641 * each call, clear it after each iteration, destroy it after the loop 00642 * is done. (For allocation that must last beyond the lifetime of a 00643 * given receiver call, use a pool in @a baton.) 00644 * 00645 * @since New in 1.5. 00646 */ 00647 00648 typedef svn_error_t *(*svn_log_entry_receiver_t) 00649 (void *baton, 00650 svn_log_entry_t *log_entry, 00651 apr_pool_t *pool); 00652 00653 /** 00654 * Similar to @c svn_log_entry_receiver_t, except this uses separate 00655 * parameters for each part of the log entry. 00656 * 00657 * @deprecated Provided for backward compatibility with the 1.4 API. 00658 */ 00659 typedef svn_error_t *(*svn_log_message_receiver_t) 00660 (void *baton, 00661 apr_hash_t *changed_paths, 00662 svn_revnum_t revision, 00663 const char *author, 00664 const char *date, /* use svn_time_from_cstring() if need apr_time_t */ 00665 const char *message, 00666 apr_pool_t *pool); 00667 00668 00669 /** Callback function type for commits. 00670 * 00671 * When a commit succeeds, an instance of this is invoked with the 00672 * @a commit_info, along with the @a baton closure. 00673 * @a pool can be used for temporary allocations. 00674 * 00675 * @since New in 1.4. 00676 */ 00677 typedef svn_error_t *(*svn_commit_callback2_t) 00678 (const svn_commit_info_t *commit_info, 00679 void *baton, 00680 apr_pool_t *pool); 00681 00682 /** Same as @c svn_commit_callback2_t, but uses individual 00683 * data elements instead of the @c svn_commit_info_t structure 00684 * 00685 * @deprecated Provided for backward compatibility with the 1.3 API. 00686 */ 00687 typedef svn_error_t *(*svn_commit_callback_t) 00688 (svn_revnum_t new_revision, 00689 const char *date, 00690 const char *author, 00691 void *baton); 00692 00693 00694 /** A buffer size that may be used when processing a stream of data. 00695 * 00696 * @note We don't use this constant any longer, since it is considered to be 00697 * unnecessarily large. 00698 * 00699 * @deprecated Provided for backwards compatibility with the 1.3 API. 00700 */ 00701 #define SVN_STREAM_CHUNK_SIZE 102400 00702 00703 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00704 /* 00705 * The maximum amount we (ideally) hold in memory at a time when 00706 * processing a stream of data. 00707 * 00708 * For example, when copying data from one stream to another, do it in 00709 * blocks of this size. 00710 * 00711 * NOTE: This is an internal macro, put here for convenience. 00712 * No public API may depend on the particular value of this macro. 00713 */ 00714 #define SVN__STREAM_CHUNK_SIZE 16384 00715 #endif 00716 00717 /** The maximum amount we can ever hold in memory. */ 00718 /* FIXME: Should this be the same as SVN_STREAM_CHUNK_SIZE? */ 00719 #define SVN_MAX_OBJECT_SIZE (((apr_size_t) -1) / 2) 00720 00721 00722 00723 /* ### Note: despite being about mime-TYPES, these probably don't 00724 * ### belong in svn_types.h. However, no other header is more 00725 * ### appropriate, and didn't feel like creating svn_validate.h for 00726 * ### so little. 00727 */ 00728 00729 /** Validate @a mime_type. 00730 * 00731 * If @a mime_type does not contain a "/", or ends with non-alphanumeric 00732 * data, return @c SVN_ERR_BAD_MIME_TYPE, else return success. 00733 * 00734 * Use @a pool only to find error allocation. 00735 * 00736 * Goal: to match both "foo/bar" and "foo/bar; charset=blah", without 00737 * being too strict about it, but to disallow mime types that have 00738 * quotes, newlines, or other garbage on the end, such as might be 00739 * unsafe in an HTTP header. 00740 */ 00741 svn_error_t *svn_mime_type_validate(const char *mime_type, 00742 apr_pool_t *pool); 00743 00744 00745 /** Return FALSE iff @a mime_type is a textual type. 00746 * 00747 * All mime types that start with "text/" are textual, plus some special 00748 * cases (for example, "image/x-xbitmap"). 00749 */ 00750 svn_boolean_t svn_mime_type_is_binary(const char *mime_type); 00751 00752 00753 00754 /** A user defined callback that subversion will call with a user defined 00755 * baton to see if the current operation should be continued. If the operation 00756 * should continue, the function should return @c SVN_NO_ERROR, if not, it 00757 * should return @c SVN_ERR_CANCELLED. 00758 */ 00759 typedef svn_error_t *(*svn_cancel_func_t)(void *cancel_baton); 00760 00761 00762 00763 /** 00764 * A lock object, for client & server to share. 00765 * 00766 * A lock represents the exclusive right to add, delete, or modify a 00767 * path. A lock is created in a repository, wholly controlled by the 00768 * repository. A "lock-token" is the lock's UUID, and can be used to 00769 * learn more about a lock's fields, and or/make use of the lock. 00770 * Because a lock is immutable, a client is free to not only cache the 00771 * lock-token, but the lock's fields too, for convenience. 00772 * 00773 * Note that the 'is_dav_comment' field is wholly ignored by every 00774 * library except for mod_dav_svn. The field isn't even marshalled 00775 * over the network to the client. Assuming lock structures are 00776 * created with apr_pcalloc(), a default value of 0 is universally safe. 00777 * 00778 * @note in the current implementation, only files are lockable. 00779 * 00780 * @since New in 1.2. 00781 */ 00782 typedef struct svn_lock_t 00783 { 00784 const char *path; /**< the path this lock applies to */ 00785 const char *token; /**< unique URI representing lock */ 00786 const char *owner; /**< the username which owns the lock */ 00787 const char *comment; /**< (optional) description of lock */ 00788 svn_boolean_t is_dav_comment; /**< was comment made by generic DAV client? */ 00789 apr_time_t creation_date; /**< when lock was made */ 00790 apr_time_t expiration_date; /**< (optional) when lock will expire; 00791 If value is 0, lock will never expire. */ 00792 } svn_lock_t; 00793 00794 /** 00795 * Returns an @c svn_lock_t, allocated in @a pool with all fields initialized 00796 * to NULL values. 00797 * 00798 * @note To allow for extending the @c svn_lock_t structure in the future 00799 * releases, this function should always be used to allocate the structure. 00800 * 00801 * @since New in 1.2. 00802 */ 00803 svn_lock_t * 00804 svn_lock_create(apr_pool_t *pool); 00805 00806 /** 00807 * Return a deep copy of @a lock, allocated in @a pool. 00808 * 00809 * @since New in 1.2. 00810 */ 00811 svn_lock_t * 00812 svn_lock_dup(const svn_lock_t *lock, apr_pool_t *pool); 00813 00814 /** 00815 * Return a formatted Universal Unique IDentifier (UUID) string. 00816 * 00817 * @since New in 1.4. 00818 */ 00819 const char * 00820 svn_uuid_generate(apr_pool_t *pool); 00821 00822 /** 00823 * Mergeinfo representing a merge of a range of revisions. 00824 * 00825 * @since New in 1.5 00826 */ 00827 typedef struct svn_merge_range_t 00828 { 00829 /* If the 'start' field is less than the 'end' field then 'start' is 00830 * exclusive and 'end' inclusive of the range described. If 'start' 00831 * is greater than 'end' then the opposite is true. If 'start' 00832 * equals 'end' the meaning of the range is not defined. 00833 */ 00834 svn_revnum_t start; 00835 svn_revnum_t end; 00836 00837 /* Whether this merge range should be inherited by treewise 00838 descendants of the path to which the range applies. */ 00839 svn_boolean_t inheritable; 00840 } svn_merge_range_t; 00841 00842 /** 00843 * Return a copy of @a range, allocated in @a pool. 00844 * 00845 * @since New in 1.5. 00846 */ 00847 svn_merge_range_t * 00848 svn_merge_range_dup(svn_merge_range_t *range, apr_pool_t *pool); 00849 00850 /** 00851 * Returns true if the changeset committed in revision @a rev is one 00852 * of the changesets in the range @a range. 00853 * 00854 * @since New in 1.5. 00855 */ 00856 svn_boolean_t 00857 svn_merge_range_contains_rev(svn_merge_range_t *range, svn_revnum_t rev); 00858 00859 00860 00861 /** @defgroup node_location_seg_reporting Node location segment reporting. 00862 * @{ */ 00863 00864 /** 00865 * A representation of a segment of a object's version history with an 00866 * emphasis on the object's location in the repository as of various 00867 * revisions. 00868 * 00869 * @since New in 1.5. 00870 */ 00871 typedef struct svn_location_segment_t 00872 { 00873 /* The beginning (oldest) and ending (youngest) revisions for this 00874 segment. */ 00875 svn_revnum_t range_start; 00876 svn_revnum_t range_end; 00877 00878 /* The absolute (sans leading slash) path for this segment. May be 00879 NULL to indicate gaps in an object's history. */ 00880 const char *path; 00881 00882 } svn_location_segment_t; 00883 00884 00885 /** 00886 * A callback invoked by generators of @c svn_location_segment_t 00887 * objects, used to report information about a versioned object's 00888 * history in terms of its location in the repository filesystem over 00889 * time. 00890 */ 00891 typedef svn_error_t *(*svn_location_segment_receiver_t) 00892 (svn_location_segment_t *segment, 00893 void *baton, 00894 apr_pool_t *pool); 00895 00896 00897 /** 00898 * Return a deep copy of @a segment, allocated in @a pool. 00899 * 00900 * @since New in 1.5. 00901 */ 00902 svn_location_segment_t * 00903 svn_location_segment_dup(svn_location_segment_t *segment, 00904 apr_pool_t *pool); 00905 /** @} */ 00906 00907 00908 #ifdef __cplusplus 00909 } 00910 #endif /* __cplusplus */ 00911 00912 #endif /* SVN_TYPES_H */