svn_types.h

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

Generated on Tue Oct 7 04:09:55 2008 for Subversion by  doxygen 1.3.9.1