Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

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_lock_t
 A lock object, for client & server to share. 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...just unimportant -- one day, this can be its own unique value, for now, just make it the same as SVN_INVALID_REVNUM.
#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"
 In printf()-style functions, format revision numbers using this.
#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_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
 The maximum amount we (ideally) hold in memory at a time 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 svn_error_t svn_error_t
 Subversion error object.
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_dirent_t svn_dirent_t
 A general subversion directory entry.
typedef svn_commit_info_t svn_commit_info_t
 All information about a commit.
typedef svn_log_changed_path_t svn_log_changed_path_t
 A structure to represent a path that changed for a log entry.
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)
 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_commit_callback_t )(svn_revnum_t new_revision, const char *date, const char *author, void *baton)
 Callback function type for commits.
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_lock_t svn_lock_t
 A lock object, for client & server to share.

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.
enum  svn_recurse_kind {
  svn_nonrecursive = 1,
  svn_recursive
}
 An enum to indicate whether recursion is needed.

Functions

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_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_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.


Detailed Description

Subversion's data types.

Definition in file svn_types.h.


Define Documentation

#define FALSE   0
 

uhh...

false

Definition at line 191 of file svn_types.h.

#define SVN_REVNUM_T_FMT   "ld"
 

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.

Definition at line 161 of file svn_types.h.

#define SVN_STREAM_CHUNK_SIZE   102400
 

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.

Definition at line 424 of file svn_types.h.

#define TRUE   1
 

uhh...

true

Definition at line 186 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 468 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)
 

Callback function type for commits.

When a commit succeeds, an instance of this is invoked on the new_revision, date, and author of the commit, along with the baton closure.

Definition at line 411 of file svn_types.h.

typedef struct svn_commit_info_t svn_commit_info_t
 

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_error_t svn_error_t
 

Subversion error object.

Defined here, rather than in svn_error.h, to avoid a recursive #include situation.

typedef struct svn_lock_t svn_lock_t
 

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 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)
 

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, revision, author, date, and message are what you think they are. Any of author, date, or message may be NULL.

If date is neither null nor the empty string, it was generated by svn_time_to_string() and can be converted to apr_time_t with svn_time_from_string().

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

### The only reason 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 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 pool to each call, clear it after each iteration, destroy it after the loop is done.)

Definition at line 396 of file svn_types.h.


Function Documentation

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_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_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.


Generated on Mon Jun 5 17:10:18 2006 for Subversion by  doxygen 1.3.9.1