📄 svn_types.h
字号:
/** * @copyright * ==================================================================== * Copyright (c) 2000-2004 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals. For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright * * @file svn_types.h * @brief Subversion's data types */#ifndef SVN_TYPES_H#define SVN_TYPES_H/* ### this should go away, but it causes too much breakage right now */#include <stdlib.h>#include <apr.h> /* for apr_size_t */#include <apr_pools.h>#include <apr_hash.h>#include <apr_tables.h>#include <apr_time.h>#ifdef __cplusplusextern "C" {#endif /* __cplusplus *//** Subversion error object. * * Defined here, rather than in svn_error.h, to avoid a recursive @#include * situation. */typedef struct svn_error_t{ /** APR error value, possibly SVN_ custom err */ apr_status_t apr_err; /** details from producer of error */ const char *message; /** ptr to the error we "wrap" */ struct svn_error_t *child; /** The pool holding this error and any child errors it wraps */ apr_pool_t *pool; /** Source file where the error originated. Only used iff @c SVN_DEBUG. */ const char *file; /** Source line where the error originated. Only used iff @c SVN_DEBUG. */ long line;} svn_error_t;/** @defgroup APR_ARRAY_compat_macros APR Array Compatibility Helper Macros * These macros are provided by APR itself from version 1.3. * Definitions are provided here for when using older versions of APR. * @{ *//** index into an apr_array_header_t */#ifndef APR_ARRAY_IDX#define APR_ARRAY_IDX(ary,i,type) (((type *)(ary)->elts)[i])#endif/** easier array-pushing syntax */#ifndef APR_ARRAY_PUSH#define APR_ARRAY_PUSH(ary,type) (*((type *)apr_array_push(ary)))#endif/** @} *//** The various types of nodes in the Subversion filesystem. */typedef enum{ /* absent */ svn_node_none, /* regular file */ svn_node_file, /* directory */ svn_node_dir, /* something's here, but we don't know what */ svn_node_unknown} svn_node_kind_t;/** About Special Files in Subversion * * Subversion denotes files that cannot be portably created or * modified as "special" files (svn_node_special). It stores these * files in the repository as a plain text file with the svn:special * property set. The file contents contain: a platform-specific type * string, a space character, then any information necessary to create * the file on a supported platform. For example, if a symbolic link * were being represented, the repository file would have the * following contents: * * "link /path/to/link/target" * * Where 'link' is the identifier string showing that this special * file should be a symbolic link and '/path/to/link/target' is the * destination of the symbolic link. * * Special files are stored in the text-base exactly as they are * stored in the repository. The platform specific files are created * in the working copy at EOL/keyword translation time using * svn_subst_copy_and_translate2(). If the current platform does not * support a specific special file type, the file is copied into the * working copy as it is seen in the repository. Because of this, * users of other platforms can still view and modify the special * files, even if they do not have their unique properties. * * New types of special files can be added by: * 1. Implementing a platform-dependent routine to create a uniquely * named special file and one to read the special file in * libsvn_subr/io.c. * 2. Creating a new textual name similar to * SVN_SUBST__SPECIAL_LINK_STR in libsvn_subr/subst.c. * 3. Handling the translation/detranslation case for the new type in * create_special_file and detranslate_special_file, using the * routines from 1. *//** A revision number. */typedef long int svn_revnum_t;/** Valid revision numbers begin at 0 */#define SVN_IS_VALID_REVNUM(n) ((n) >= 0)/** The 'official' invalid revision num */#define SVN_INVALID_REVNUM ((svn_revnum_t) -1)/** Not really invalid...just unimportant -- one day, this can be its * own unique value, for now, just make it the same as * @c SVN_INVALID_REVNUM. */#define SVN_IGNORED_REVNUM ((svn_revnum_t) -1) /** Convert null-terminated C string @a str to a revision number. */#define SVN_STR_TO_REV(str) ((svn_revnum_t) atol(str))/** In printf()-style functions, format revision numbers using this. * Do not use this macro within the Subversion project source code, because * the language translation tools have trouble parsing it. */#define SVN_REVNUM_T_FMT "ld"/** The size of a file in the Subversion FS. */typedef apr_int64_t svn_filesize_t;/** The 'official' invalid file size constant. */#define SVN_INVALID_FILESIZE ((svn_filesize_t) -1)/** In printf()-style functions, format file sizes using this. */#define SVN_FILESIZE_T_FMT APR_INT64_T_FMT#ifndef DOXYGEN_SHOULD_SKIP_THIS/* Parse a base-10 numeric string into a 64-bit unsigned numeric value. *//* NOTE: Private. For use by Subversion's own code only. See issue #1644. *//* FIXME: APR should supply a function to do this, such as "apr_atoui64". */#define svn__atoui64(X) ((apr_uint64_t) apr_atoi64(X))#endif/** YABT: Yet Another Boolean Type */typedef int svn_boolean_t;#ifndef TRUE/** uhh... true */#define TRUE 1#endif /* TRUE */#ifndef FALSE/** uhh... false */#define FALSE 0#endif /* FALSE *//** An enum to indicate whether recursion is needed. */enum svn_recurse_kind{ svn_nonrecursive = 1, svn_recursive};/** * It is sometimes convenient to indicate which parts of an @c svn_dirent_t * object you are actually interested in, so that calculating and sending * the data corresponding to the other fields can be avoided. These values * can be used for that purpose. * * @defgroup svn_dirent_fields dirent fields * @{ *//** An indication that you are interested in the @c kind field */#define SVN_DIRENT_KIND 0x00001/** An indication that you are interested in the @c size field */#define SVN_DIRENT_SIZE 0x00002/** An indication that you are interested in the @c has_props field */#define SVN_DIRENT_HAS_PROPS 0x00004/** An indication that you are interested in the @c created_rev field */#define SVN_DIRENT_CREATED_REV 0x00008/** An indication that you are interested in the @c time field */#define SVN_DIRENT_TIME 0x00010/** An indication that you are interested in the @c last_author field */#define SVN_DIRENT_LAST_AUTHOR 0x00020/** A combination of all the dirent fields */#define SVN_DIRENT_ALL ~((apr_uint32_t ) 0)/** @} *//** A general subversion directory entry. */typedef struct svn_dirent_t{ /** node kind */ svn_node_kind_t kind; /** length of file text, or 0 for directories */ svn_filesize_t size; /** does the node have props? */ svn_boolean_t has_props; /** last rev in which this node changed */ svn_revnum_t created_rev; /** time of created_rev (mod-time) */ apr_time_t time; /** author of created_rev */ const char *last_author; /* IMPORTANT: If you extend this struct, check svn_dirent_dup(). */} svn_dirent_t;/** Return a deep copy of @a dirent, allocated in @a pool. * * @since New in 1.4. */svn_dirent_t *svn_dirent_dup(const svn_dirent_t *dirent, apr_pool_t *pool);/** Keyword substitution. * * All the keywords Subversion recognizes. * * Note that there is a better, more general proposal out there, which * would take care of both internationalization issues and custom * keywords (e.g., $NetBSD$). See * *<pre> http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=8921 * ===== * From: "Jonathan M. Manning" <jmanning@alisa-jon.net> * To: dev@subversion.tigris.org * Date: Fri, 14 Dec 2001 11:56:54 -0500 * Message-ID: <87970000.1008349014@bdldevel.bl.bdx.com> * Subject: Re: keywords</pre> * * and Eric Gillespie's support of same: * *<pre> http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=8757 * ===== * From: "Eric Gillespie, Jr." <epg@pretzelnet.org> * To: dev@subversion.tigris.org * Date: Wed, 12 Dec 2001 09:48:42 -0500 * Message-ID: <87k7vsebp1.fsf@vger.pretzelnet.org> * Subject: Re: Customizable Keywords</pre> * * However, it is considerably more complex than the scheme below. * For now we're going with simplicity, hopefully the more general * solution can be done post-1.0. * * @defgroup svn_types_keywords keywords * @{ *//** The maximum size of an expanded or un-expanded keyword. */#define SVN_KEYWORD_MAX_LEN 255/** The most recent revision in which this file was changed. */#define SVN_KEYWORD_REVISION_LONG "LastChangedRevision"/** Short version of LastChangedRevision */#define SVN_KEYWORD_REVISION_SHORT "Rev"/** Medium version of LastChangedRevision, matching the one CVS uses. * @since New in 1.1. */#define SVN_KEYWORD_REVISION_MEDIUM "Revision"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -