svn_types.h File Reference

Subversion's data types. More...

#include <stdlib.h>
#include <apr.h>
#include <apr_pools.h>
#include <apr_hash.h>
#include <apr_tables.h>
#include <apr_time.h>

Go to the source code of this file.

Data Structures

struct  svn_error_t
 Subversion error object. More...
struct  svn_dirent_t
 A general subversion directory entry. More...
struct  svn_commit_info_t
 All information about a commit. More...
struct  svn_log_changed_path_t
 A structure to represent a path that changed for a log entry. More...
struct  svn_log_entry_t
 A structure to represent all the information about a particular log entry. More...
struct  svn_lock_t
 A lock object, for client & server to share. More...
struct  svn_merge_range_t
 Mergeinfo representing a merge of a range of revisions. More...
struct  svn_location_segment_t
 A representation of a segment of a object's version history with an emphasis on the object's location in the repository as of various revisions. More...

Defines

#define APR_ARRAY_IDX(ary, i, type)   (((type *)(ary)->elts)[i])
 index into an apr_array_header_t
#define APR_ARRAY_PUSH(ary, type)   (*((type *)apr_array_push(ary)))
 easier array-pushing syntax
#define SVN_IS_VALID_REVNUM(n)   ((n) >= 0)
 Valid revision numbers begin at 0.
#define SVN_INVALID_REVNUM   ((svn_revnum_t) -1)
 The 'official' invalid revision num.
#define SVN_IGNORED_REVNUM   ((svn_revnum_t) -1)
 Not really invalid.
#define SVN_STR_TO_REV(str)   ((svn_revnum_t) atol(str))
 Convert NULL-terminated C string str to a revision number.
#define SVN_REVNUM_T_FMT   "ld"
 Originally intended to be used in printf()-style functions to format revision numbers.
#define SVN_INVALID_FILESIZE   ((svn_filesize_t) -1)
 The 'official' invalid file size constant.
#define SVN_FILESIZE_T_FMT   APR_INT64_T_FMT
 In printf()-style functions, format file sizes using this.
#define TRUE   1
 uhh.
#define FALSE   0
 uhh.
#define SVN_DEPTH_INFINITY_OR_FILES(recurse)   ((recurse) ? svn_depth_infinity : svn_depth_files)
#define SVN_DEPTH_INFINITY_OR_IMMEDIATES(recurse)   ((recurse) ? svn_depth_infinity : svn_depth_immediates)
#define SVN_DEPTH_INFINITY_OR_EMPTY(recurse)   ((recurse) ? svn_depth_infinity : svn_depth_empty)
#define SVN_DEPTH_IS_RECURSIVE(depth)
#define SVN_DIRENT_KIND   0x00001
 An indication that you are interested in the kind field.
#define SVN_DIRENT_SIZE   0x00002
 An indication that you are interested in the size field.
#define SVN_DIRENT_HAS_PROPS   0x00004
 An indication that you are interested in the has_props field.
#define SVN_DIRENT_CREATED_REV   0x00008
 An indication that you are interested in the created_rev field.
#define SVN_DIRENT_TIME   0x00010
 An indication that you are interested in the time field.
#define SVN_DIRENT_LAST_AUTHOR   0x00020
 An indication that you are interested in the last_author field.
#define SVN_DIRENT_ALL   ~((apr_uint32_t ) 0)
 A combination of all the dirent fields.
#define SVN_KEYWORD_MAX_LEN   255
 The maximum size of an expanded or un-expanded keyword.
#define SVN_KEYWORD_REVISION_LONG   "LastChangedRevision"
 The most recent revision in which this file was changed.
#define SVN_KEYWORD_REVISION_SHORT   "Rev"
 Short version of LastChangedRevision.
#define SVN_KEYWORD_REVISION_MEDIUM   "Revision"
 Medium version of LastChangedRevision, matching the one CVS uses.
#define SVN_KEYWORD_DATE_LONG   "LastChangedDate"
 The most recent date (repository time) when this file was changed.
#define SVN_KEYWORD_DATE_SHORT   "Date"
 Short version of LastChangedDate.
#define SVN_KEYWORD_AUTHOR_LONG   "LastChangedBy"
 Who most recently committed to this file.
#define SVN_KEYWORD_AUTHOR_SHORT   "Author"
 Short version of LastChangedBy.
#define SVN_KEYWORD_URL_LONG   "HeadURL"
 The URL for the head revision of this file.
#define SVN_KEYWORD_URL_SHORT   "URL"
 Short version of HeadURL.
#define SVN_KEYWORD_ID   "Id"
 A compressed combination of the other four keywords.
#define SVN_STREAM_CHUNK_SIZE   102400
 A buffer size that may be used when processing a stream of data.
#define SVN_MAX_OBJECT_SIZE   (((apr_size_t) -1) / 2)
 The maximum amount we can ever hold in memory.

Typedefs

typedef long int svn_revnum_t
 A revision number.
typedef apr_int64_t svn_filesize_t
 The size of a file in the Subversion FS.
typedef int svn_boolean_t
 YABT: Yet Another Boolean Type.
typedef svn_error_t *(*) svn_log_entry_receiver_t (void *baton, svn_log_entry_t *log_entry, apr_pool_t *pool)
 The callback invoked by log message loopers, such as svn_ra_plugin_t.get_log() and svn_repos_get_logs().
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, const char *message, apr_pool_t *pool)
 Similar to svn_log_entry_receiver_t, except this uses separate parameters for each part of the log entry.
typedef svn_error_t *(*) svn_commit_callback2_t (const svn_commit_info_t *commit_info, void *baton, apr_pool_t *pool)
 Callback function type for commits.
typedef svn_error_t *(*) svn_commit_callback_t (svn_revnum_t new_revision, const char *date, const char *author, void *baton)
 Same as svn_commit_callback2_t, but uses individual data elements instead of the svn_commit_info_t structure.
typedef svn_error_t *(*) svn_cancel_func_t (void *cancel_baton)
 A user defined callback that subversion will call with a user defined baton to see if the current operation should be continued.
typedef svn_error_t *(*) svn_location_segment_receiver_t (svn_location_segment_t *segment, void *baton, apr_pool_t *pool)
 A callback invoked by generators of svn_location_segment_t objects, used to report information about a versioned object's history in terms of its location in the repository filesystem over time.

Enumerations

enum  svn_node_kind_t {
  svn_node_none,
  svn_node_file,
  svn_node_dir,
  svn_node_unknown
}
 The various types of nodes in the Subversion filesystem. More...
enum  svn_recurse_kind {
  svn_nonrecursive = 1,
  svn_recursive
}
 An enum to indicate whether recursion is needed.
enum  svn_depth_t {
  svn_depth_unknown = -2,
  svn_depth_exclude = -1,
  svn_depth_empty = 0,
  svn_depth_files = 1,
  svn_depth_immediates = 2,
  svn_depth_infinity = 3
}
 The concept of depth for directories. More...

Functions

svn_error_tsvn_revnum_parse (svn_revnum_t *rev, const char *str, const char **endptr)
 Parse NULL-terminated C string str as a revision number and store its value in rev.
const char * svn_depth_to_word (svn_depth_t depth)
 Return a constant string expressing depth as an English word, e.g., "infinity", "immediates", etc.
svn_depth_t svn_depth_from_word (const char *word)
 Return the appropriate depth for depth_str.
svn_dirent_tsvn_dirent_dup (const svn_dirent_t *dirent, apr_pool_t *pool)
 Return a deep copy of dirent, allocated in pool.
svn_commit_info_tsvn_create_commit_info (apr_pool_t *pool)
 Allocate an object of type svn_commit_info_t in pool and return it.
svn_commit_info_tsvn_commit_info_dup (const svn_commit_info_t *src_commit_info, apr_pool_t *pool)
 Return a deep copy src_commit_info allocated in pool.
svn_log_changed_path_tsvn_log_changed_path_dup (const svn_log_changed_path_t *changed_path, apr_pool_t *pool)
 Return a deep copy of changed_path, allocated in pool.
svn_log_entry_tsvn_log_entry_create (apr_pool_t *pool)
 Returns an svn_log_entry_t, allocated in pool with all fields initialized to NULL values.
svn_error_tsvn_mime_type_validate (const char *mime_type, apr_pool_t *pool)
 Validate mime_type.
svn_boolean_t svn_mime_type_is_binary (const char *mime_type)
 Return FALSE iff mime_type is a textual type.
svn_lock_tsvn_lock_create (apr_pool_t *pool)
 Returns an svn_lock_t, allocated in pool with all fields initialized to NULL values.
svn_lock_tsvn_lock_dup (const svn_lock_t *lock, apr_pool_t *pool)
 Return a deep copy of lock, allocated in pool.
const char * svn_uuid_generate (apr_pool_t *pool)
 Return a formatted Universal Unique IDentifier (UUID) string.
svn_merge_range_tsvn_merge_range_dup (svn_merge_range_t *range, apr_pool_t *pool)
 Return a copy of range, allocated in pool.
svn_boolean_t svn_merge_range_contains_rev (svn_merge_range_t *range, svn_revnum_t rev)
 Returns true if the changeset committed in revision rev is one of the changesets in the range range.
svn_location_segment_tsvn_location_segment_dup (svn_location_segment_t *segment, apr_pool_t *pool)
 Return a deep copy of segment, allocated in pool.


Detailed Description

Subversion's data types.

Definition in file svn_types.h.


Define Documentation

#define FALSE   0

uhh.

.. false

Definition at line 213 of file svn_types.h.

#define SVN_DEPTH_IS_RECURSIVE ( depth   ) 

Value:

(((depth) == svn_depth_infinity || (depth) == svn_depth_unknown) \
   ? TRUE : FALSE)

Definition at line 336 of file svn_types.h.

#define SVN_IGNORED_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 SVN_INVALID_REVNUM.

Definition at line 153 of file svn_types.h.

#define SVN_REVNUM_T_FMT   "ld"

Originally intended to be used in printf()-style functions to format revision numbers.

Deprecated due to incompatibilities with language translation tools (e.g. gettext).

New code should use a bare "%ld" format specifier for formatting revision numbers.

Deprecated:
Provided for backward compatibility with the 1.0 API.

Definition at line 183 of file svn_types.h.

#define SVN_STREAM_CHUNK_SIZE   102400

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.

Definition at line 701 of file svn_types.h.

#define TRUE   1

uhh.

.. true

Definition at line 208 of file svn_types.h.


Typedef Documentation

typedef svn_error_t*(*) svn_cancel_func_t(void *cancel_baton)

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 SVN_NO_ERROR, if not, it should return SVN_ERR_CANCELLED.

Definition at line 759 of file svn_types.h.

typedef svn_error_t*(*) svn_commit_callback2_t(const svn_commit_info_t *commit_info, void *baton, apr_pool_t *pool)

Callback function type for commits.

When a commit succeeds, an instance of this is invoked with the commit_info, along with the baton closure. pool can be used for temporary allocations.

Since:
New in 1.4.

Definition at line 678 of file svn_types.h.

typedef svn_error_t*(*) svn_commit_callback_t(svn_revnum_t new_revision, const char *date, const char *author, void *baton)

Same as svn_commit_callback2_t, but uses individual data elements instead of the svn_commit_info_t structure.

Deprecated:
Provided for backward compatibility with the 1.3 API.

Definition at line 688 of file svn_types.h.

typedef svn_error_t*(*) svn_log_entry_receiver_t(void *baton, svn_log_entry_t *log_entry, apr_pool_t *pool)

The callback invoked by log message loopers, such as 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).

baton is what you think it is, and log_entry contains relevent information for the log message. Any of log_entry->author, log_entry->date, or log_entry->message may be NULL.

If log_entry->date is neither NULL nor the empty string, it was generated by svn_time_to_cstring() and can be converted to apr_time_t with svn_time_from_cstring().

If log_entry->changed_paths is non-NULL, then it contains as keys every path committed in log_entry->revision; the values are (svn_log_changed_path_t *) structures.

If log_entry->has_children is TRUE, the message will be followed immediately by any number of merged revisions (child messages), which are terminated by an invocation with SVN_INVALID_REVNUM. This usage may be recursive.

Use pool for temporary 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 pool to each call, clear it after each iteration, destroy it after the loop is done. (For allocation that must last beyond the lifetime of a given receiver call, use a pool in baton.)

Since:
New in 1.5.

Definition at line 649 of file svn_types.h.

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,const char *message, apr_pool_t *pool)

Similar to svn_log_entry_receiver_t, except this uses separate parameters for each part of the log entry.

Deprecated:
Provided for backward compatibility with the 1.4 API.

Definition at line 660 of file svn_types.h.


Enumeration Type Documentation

enum svn_depth_t

The concept of depth for directories.

Note:
This is similar to, but not exactly the same as, the WebDAV and LDAP concepts of depth.
Since:
New in 1.5.

Definition at line 231 of file svn_types.h.

enum svn_node_kind_t

The various types of nodes in the Subversion filesystem.

Enumerator:
svn_node_none  absent
svn_node_file  regular file
svn_node_dir  directory
svn_node_unknown  something's here, but we don't know what

Definition at line 88 of file svn_types.h.


Function Documentation

svn_commit_info_t* svn_commit_info_dup ( const svn_commit_info_t src_commit_info,
apr_pool_t *  pool 
)

Return a deep copy src_commit_info allocated in pool.

Since:
New in 1.4.

svn_commit_info_t* svn_create_commit_info ( apr_pool_t *  pool  ) 

Allocate an object of type svn_commit_info_t in pool and return it.

The revision field of the new struct is set to SVN_INVALID_REVNUM. All other fields are initialized to NULL.

Note:
Any object of the type 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_depth_t svn_depth_from_word ( const char *  word  ) 

Return the appropriate depth for depth_str.

word is as returned from svn_depth_to_word(). If depth_str does not represent a recognized depth, return svn_depth_unknown.

Since:
New in 1.5.

const char* svn_depth_to_word ( svn_depth_t  depth  ) 

Return a constant string expressing depth as an English word, e.g., "infinity", "immediates", etc.

The string is not localized, as it may be used for client<->server communications.

Since:
New in 1.5.

svn_dirent_t* svn_dirent_dup ( const svn_dirent_t dirent,
apr_pool_t *  pool 
)

Return a deep copy of dirent, allocated in pool.

Since:
New in 1.4.

svn_lock_t* svn_lock_create ( apr_pool_t *  pool  ) 

Returns an svn_lock_t, allocated in pool with all fields initialized to NULL values.

Note:
To allow for extending the 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_dup ( const svn_lock_t lock,
apr_pool_t *  pool 
)

Return a deep copy of lock, allocated in pool.

Since:
New in 1.2.

svn_log_changed_path_t* svn_log_changed_path_dup ( const svn_log_changed_path_t changed_path,
apr_pool_t *  pool 
)

Return a deep copy of changed_path, allocated in pool.

Since:
New in 1.3.

svn_log_entry_t* svn_log_entry_create ( apr_pool_t *  pool  ) 

Returns an svn_log_entry_t, allocated in pool with all fields initialized to NULL values.

Note:
To allow for extending the svn_log_entry_t structure in future releases, this function should always be used to allocate the structure.
Since:
New in 1.5.

svn_boolean_t svn_merge_range_contains_rev ( svn_merge_range_t range,
svn_revnum_t  rev 
)

Returns true if the changeset committed in revision rev is one of the changesets in the range range.

Since:
New in 1.5.

svn_merge_range_t* svn_merge_range_dup ( svn_merge_range_t range,
apr_pool_t *  pool 
)

Return a copy of range, allocated in pool.

Since:
New in 1.5.

svn_boolean_t svn_mime_type_is_binary ( const char *  mime_type  ) 

Return FALSE iff 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_error_t* svn_mime_type_validate ( const char *  mime_type,
apr_pool_t *  pool 
)

Validate mime_type.

If mime_type does not contain a "/", or ends with non-alphanumeric data, return SVN_ERR_BAD_MIME_TYPE, else return success.

Use 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_revnum_parse ( svn_revnum_t rev,
const char *  str,
const char **  endptr 
)

Parse NULL-terminated C string str as a revision number and store its value in rev.

If endptr is non-NULL, then the address of the first non-numeric character in str is stored in it. If there are no digits in str, then endptr is set (if non-NULL), and the error SVN_ERR_REVNUM_PARSE_FAILURE error is returned. Negative numbers parsed from str are considered invalid, and result in the same error.

Since:
New in 1.5.

const char* svn_uuid_generate ( apr_pool_t *  pool  ) 

Return a formatted Universal Unique IDentifier (UUID) string.

Since:
New in 1.4.


Generated on Wed Oct 22 14:54:31 2008 for Subversion by  doxygen 1.4.7