📄 svn_types.h
字号:
/** The most recent date (repository time) when this file was changed. */#define SVN_KEYWORD_DATE_LONG "LastChangedDate"/** Short version of LastChangedDate */#define SVN_KEYWORD_DATE_SHORT "Date"/** Who most recently committed to this file. */#define SVN_KEYWORD_AUTHOR_LONG "LastChangedBy"/** Short version of LastChangedBy */#define SVN_KEYWORD_AUTHOR_SHORT "Author"/** The URL for the head revision of this file. */#define SVN_KEYWORD_URL_LONG "HeadURL"/** Short version of HeadURL */#define SVN_KEYWORD_URL_SHORT "URL"/** A compressed combination of the other four keywords. */#define SVN_KEYWORD_ID "Id"/** @} *//** All information about a commit. * * @note Objects of this type should always be created using the * svn_create_commit_info() function. * * @since New in 1.3. */typedef struct svn_commit_info_t{ /** just-committed revision. */ svn_revnum_t revision; /** server-side date of the commit. */ const char *date; /** author of the commit. */ const char *author; /** error message from post-commit hook, or NULL. */ const char *post_commit_err;} svn_commit_info_t;/** * Allocate an object of type @c svn_commit_info_t in @a pool and * return it. * * The @c revision field of the new struct is set to @c * SVN_INVALID_REVNUM. All other fields are initialized to @c NULL. * * @note Any object of the type @c svn_commit_info_t should * be created using this function. * This is to provide for extending the svn_commit_info_t in * the future. * * @since New in 1.3. */svn_commit_info_t *svn_create_commit_info(apr_pool_t *pool);/** * Return a deep copy @a src_commit_info allocated in @a pool. * * @since New in 1.4. */svn_commit_info_t *svn_commit_info_dup(const svn_commit_info_t *src_commit_info, apr_pool_t *pool);/** A structure to represent a path that changed for a log entry. */typedef struct svn_log_changed_path_t{ /** 'A'dd, 'D'elete, 'R'eplace, 'M'odify */ char action; /** Source path of copy (if any). */ const char *copyfrom_path; /** Source revision of copy (if any). */ svn_revnum_t copyfrom_rev;} svn_log_changed_path_t;/** * Return a deep copy of @a changed_path, allocated in @a pool. * * @since New in 1.3. */svn_log_changed_path_t *svn_log_changed_path_dup(const svn_log_changed_path_t *changed_path, apr_pool_t *pool);/** The callback invoked by log message loopers, such as * @c svn_ra_plugin_t.get_log() and svn_repos_get_logs(). * * This function is invoked once on each log message, in the order * determined by the caller (see above-mentioned functions). * * @a baton, @a revision, @a author, @a date, and @a message are what you * think they are. Any of @a author, @a date, or @a message may be @c NULL. * * If @a date is neither null nor the empty string, it was generated by * svn_time_to_cstring() and can be converted to @c apr_time_t with * svn_time_from_cstring(). * * If @a changed_paths is non-@c NULL, then it contains as keys every path * committed in @a revision; the values are (@c svn_log_changed_path_t *) * structures. * * ### The only reason @a changed_paths is not qualified with `const' is * that we usually want to loop over it, and apr_hash_first() doesn't * take a const hash, for various reasons. I'm not sure that those * "various reasons" are actually even relevant anymore, and if * they're not, it might be nice to change apr_hash_first() so * read-only uses of hashes can be protected via the type system. * * Use @a pool for all allocation. (If the caller is iterating over log * messages, invoking this receiver on each, we recommend the standard * pool loop recipe: create a subpool, pass it as @a pool to each call, * clear it after each iteration, destroy it after the loop is done.) */typedef svn_error_t *(*svn_log_message_receiver_t) (void *baton, apr_hash_t *changed_paths, svn_revnum_t revision, const char *author, const char *date, /* use svn_time_from_cstring() if need apr_time_t */ const char *message, apr_pool_t *pool);/** Callback function type for commits. * * When a commit succeeds, an instance of this is invoked with the * @a commit_info, along with the @a baton closure. * @a pool can be used for temporary allocations. * * @since New in 1.4. */typedef svn_error_t *(*svn_commit_callback2_t) (const svn_commit_info_t *commit_info, void *baton, apr_pool_t *pool);/** Same as @c svn_commit_callback2_t, but uses individual * data elements instead of the @c svn_commit_info_t structure * * @deprecated Provided for backward compatibility with the 1.3 API. */typedef svn_error_t *(*svn_commit_callback_t) (svn_revnum_t new_revision, const char *date, const char *author, void *baton);/** Return, in @a *callback2 and @a *callback2_baton a function/baton that * will call @a callback/@a callback_baton, allocating the @a *callback2_baton * in @a pool. * * @note This is used by compatibility wrappers, which exist in more than * Subversion core library. * * @since New in 1.4. */void svn_compat_wrap_commit_callback(svn_commit_callback2_t *callback2, void **callback2_baton, svn_commit_callback_t callback, void *callback_baton, apr_pool_t *pool);/** A buffer size that may be used when processing a stream of data. * * @note We don't use this constant any longer, since it is considered to be * unnecessarily large. * * @deprecated Provided for backwards compatibility with the 1.3 API. */#define SVN_STREAM_CHUNK_SIZE 102400#ifndef DOXYGEN_SHOULD_SKIP_THIS/* * The maximum amount we (ideally) hold in memory at a time when * processing a stream of data. * * For example, when copying data from one stream to another, do it in * blocks of this size. * * NOTE: This is an internal macro, put here for convenience. * No public API may depend on the particular value of this macro. */#define SVN__STREAM_CHUNK_SIZE 16384#endif/** The maximum amount we can ever hold in memory. *//* FIXME: Should this be the same as SVN_STREAM_CHUNK_SIZE? */#define SVN_MAX_OBJECT_SIZE (((apr_size_t) -1) / 2)/* ### Note: despite being about mime-TYPES, these probably don't * ### belong in svn_types.h. However, no other header is more * ### appropriate, and didn't feel like creating svn_validate.h for * ### so little. *//** Validate @a mime_type. * * If @a mime_type does not contain a "/", or ends with non-alphanumeric * data, return @c SVN_ERR_BAD_MIME_TYPE, else return success. * * Use @a pool only to find error allocation. * * Goal: to match both "foo/bar" and "foo/bar; charset=blah", without * being too strict about it, but to disallow mime types that have * quotes, newlines, or other garbage on the end, such as might be * unsafe in an HTTP header. */svn_error_t *svn_mime_type_validate(const char *mime_type, apr_pool_t *pool);/** Return false iff @a mime_type is a textual type. * * All mime types that start with "text/" are textual, plus some special * cases (for example, "image/x-xbitmap"). */svn_boolean_t svn_mime_type_is_binary(const char *mime_type);/** A user defined callback that subversion will call with a user defined * baton to see if the current operation should be continued. If the operation * should continue, the function should return @c SVN_NO_ERROR, if not, it * should return @c SVN_ERR_CANCELLED. */typedef svn_error_t *(*svn_cancel_func_t)(void *cancel_baton);/** * A lock object, for client & server to share. * * A lock represents the exclusive right to add, delete, or modify a * path. A lock is created in a repository, wholly controlled by the * repository. A "lock-token" is the lock's UUID, and can be used to * learn more about a lock's fields, and or/make use of the lock. * Because a lock is immutable, a client is free to not only cache the * lock-token, but the lock's fields too, for convenience. * * Note that the 'is_dav_comment' field is wholly ignored by every * library except for mod_dav_svn. The field isn't even marshalled * over the network to the client. Assuming lock structures are * created with apr_pcalloc(), a default value of 0 is universally safe. * * @note in the current implementation, only files are lockable. * * @since New in 1.2. */typedef struct svn_lock_t{ const char *path; /**< the path this lock applies to */ const char *token; /**< unique URI representing lock */ const char *owner; /**< the username which owns the lock */ const char *comment; /**< (optional) description of lock */ svn_boolean_t is_dav_comment; /**< was comment made by generic DAV client? */ apr_time_t creation_date; /**< when lock was made */ apr_time_t expiration_date; /**< (optional) when lock will expire; If value is 0, lock will never expire. */} svn_lock_t;/** * Returns an @c svn_lock_t, allocated in @a pool with all fields initialized * to null values. * * @note To allow for extending the @c svn_lock_t structure in the future * releases, this function should always be used to allocate the structure. * * @since New in 1.2. */svn_lock_t *svn_lock_create(apr_pool_t *pool);/** * Return a deep copy of @a lock, allocated in @a pool. * * @since New in 1.2. */svn_lock_t *svn_lock_dup(const svn_lock_t *lock, apr_pool_t *pool);/** * Return a formatted Universal Unique IDentifier (UUID) string. * * @since New in 1.4. */const char *svn_uuid_generate(apr_pool_t *pool);#ifdef __cplusplus}#endif /* __cplusplus */#endif /* SVN_TYPES_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -