Subversion
Data Structures | Macros | Typedefs | Functions | Variables
svn_version.h File Reference

Version information. More...

#include <apr_general.h>
#include <apr_tables.h>
#include "svn_types.h"

Go to the source code of this file.

Data Structures

struct  svn_version_t
 Version information. More...
 
struct  svn_version_checklist_t
 An entry in the compatibility checklist. More...
 
struct  svn_version_ext_linked_lib_t
 Dependent library information. More...
 
struct  svn_version_ext_loaded_lib_t
 Loaded shared library information. More...
 

Macros

#define SVN_VER_MAJOR   1
 Major version number. More...
 
#define SVN_VER_MINOR   14
 Minor version number. More...
 
#define SVN_VER_PATCH   2
 Patch number. More...
 
#define SVN_VER_MICRO   SVN_VER_PATCH
 
#define SVN_VER_LIBRARY   SVN_VER_MAJOR
 
#define SVN_VER_TAG   " (under development)"
 Version tag: a string describing the version. More...
 
#define SVN_VER_NUMTAG   "-dev"
 Number tag: a string describing the version. More...
 
#define SVN_VER_REVISION   0
 Revision number: The repository revision number of this release. More...
 
#define SVN_VER_NUM
 Version number. More...
 
#define SVN_VER_NUMBER   SVN_VER_NUM SVN_VER_NUMTAG
 Version number with tag (contains no whitespace)
 
#define SVN_VERSION   SVN_VER_NUMBER SVN_VER_TAG
 Complete version string.
 
#define SVN_VERSION_DEFINE(name)
 Define a static svn_version_t object. More...
 
#define SVN_VERSION_BODY
 Generate the implementation of a version query function. More...
 

Typedefs

typedef struct svn_version_checklist_t svn_version_checklist_t
 An entry in the compatibility checklist. More...
 
typedef struct svn_version_extended_t svn_version_extended_t
 Extended version information, including info about the running system. More...
 
typedef struct svn_version_ext_linked_lib_t svn_version_ext_linked_lib_t
 Dependent library information. More...
 
typedef struct svn_version_ext_loaded_lib_t svn_version_ext_loaded_lib_t
 Loaded shared library information. More...
 

Functions

svn_boolean_t svn_ver_compatible (const svn_version_t *my_version, const svn_version_t *lib_version)
 Check library version compatibility. More...
 
svn_boolean_t svn_ver_equal (const svn_version_t *my_version, const svn_version_t *lib_version)
 Check if my_version and lib_version encode the same version number. More...
 
svn_error_tsvn_ver_check_list2 (const svn_version_t *my_version, const svn_version_checklist_t *checklist, svn_boolean_t(*comparator)(const svn_version_t *, const svn_version_t *))
 Perform a series of version compatibility checks. More...
 
svn_error_tsvn_ver_check_list (const svn_version_t *my_version, const svn_version_checklist_t *checklist)
 Similar to svn_ver_check_list2(), with comparator set to svn_ver_compatible. More...
 
const svn_version_tsvn_subr_version (void)
 Get libsvn_subr version information. More...
 
const svn_version_extended_tsvn_version_extended (svn_boolean_t verbose, apr_pool_t *pool)
 Return version information for the running program. More...
 
const char * svn_version_ext_build_date (const svn_version_extended_t *ext_info)
 Accessor for svn_version_extended_t. More...
 
const char * svn_version_ext_build_time (const svn_version_extended_t *ext_info)
 Accessor for svn_version_extended_t. More...
 
const char * svn_version_ext_build_host (const svn_version_extended_t *ext_info)
 Accessor for svn_version_extended_t. More...
 
const char * svn_version_ext_copyright (const svn_version_extended_t *ext_info)
 Accessor for svn_version_extended_t. More...
 
const char * svn_version_ext_runtime_host (const svn_version_extended_t *ext_info)
 Accessor for svn_version_extended_t. More...
 
const char * svn_version_ext_runtime_osname (const svn_version_extended_t *ext_info)
 Accessor for svn_version_extended_t. More...
 
const apr_array_header_t * svn_version_ext_linked_libs (const svn_version_extended_t *ext_info)
 Accessor for svn_version_extended_t. More...
 
const apr_array_header_t * svn_version_ext_loaded_libs (const svn_version_extended_t *ext_info)
 Accessor for svn_version_extended_t. More...
 

Variables

const typedef svn_version_t *(* svn_version_func_t )(void)
 Type of function returning library version. More...
 

Detailed Description

Version information.

@if copyrights

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations

under the License.

Definition in file svn_version.h.

Macro Definition Documentation

◆ SVN_VER_LIBRARY

#define SVN_VER_LIBRARY   SVN_VER_MAJOR
Deprecated:
Provided for backward compatibility with the 1.0 API.

Definition at line 80 of file svn_version.h.

◆ SVN_VER_MAJOR

#define SVN_VER_MAJOR   1

Major version number.

Modify when incompatible changes are made to published interfaces.

Definition at line 57 of file svn_version.h.

◆ SVN_VER_MICRO

#define SVN_VER_MICRO   SVN_VER_PATCH
Deprecated:
Provided for backward compatibility with the 1.0 API.

Definition at line 77 of file svn_version.h.

◆ SVN_VER_MINOR

#define SVN_VER_MINOR   14

Minor version number.

Modify when new functionality is added or new interfaces are defined, but all changes are backward compatible.

Definition at line 64 of file svn_version.h.

◆ SVN_VER_NUM

#define SVN_VER_NUM
Value:
APR_STRINGIFY(SVN_VER_MAJOR) \
"." APR_STRINGIFY(SVN_VER_MINOR) \
"." APR_STRINGIFY(SVN_VER_PATCH)

Version number.

Definition at line 126 of file svn_version.h.

◆ SVN_VER_NUMTAG

#define SVN_VER_NUMTAG   "-dev"

Number tag: a string describing the version.

This tag is used to generate a version number string to identify the client and server in HTTP requests, for example. It must not contain any spaces. This value remains "-dev" in the repository.

When rolling a tarball, we automatically replace this text with "" for final releases; in prereleases, it becomes "-alpha1, "-beta1", etc., as appropriate.

Always change this at the same time as SVN_VER_TAG.

Definition at line 111 of file svn_version.h.

◆ SVN_VER_PATCH

#define SVN_VER_PATCH   2

Patch number.

Modify for every released patch.

Since
New in 1.1.

Definition at line 73 of file svn_version.h.

◆ SVN_VER_REVISION

#define SVN_VER_REVISION   0

Revision number: The repository revision number of this release.

This constant is used to generate the build number part of the Windows file version. Its value remains 0 in the repository except in release tags where it is the revision from which the tag was created.

Definition at line 120 of file svn_version.h.

◆ SVN_VER_TAG

#define SVN_VER_TAG   " (under development)"

Version tag: a string describing the version.

This tag remains " (under development)" in the repository so that we can always see from "svn --version" that the software has been built from the repository rather than a "blessed" distribution.

When rolling a tarball, we automatically replace this text with " (r1234)" (where 1234 is the last revision on the branch prior to the release) for final releases; in prereleases, it becomes " (Alpha 1)", " (Beta 1)", etc., as appropriate.

Always change this at the same time as SVN_VER_NUMTAG.

Definition at line 96 of file svn_version.h.

◆ SVN_VERSION_BODY

#define SVN_VERSION_BODY
Value:
static struct versioninfo_t \
{ \
const char *const str; \
const svn_version_t num; \
} const versioninfo = \
{ \
"@(#)" SVN_VERSION, \
{ \
SVN_VER_MAJOR, \
SVN_VER_MINOR, \
SVN_VER_PATCH, \
SVN_VER_NUMTAG \
} \
}; \
return &versioninfo.num

Generate the implementation of a version query function.

Since
New in 1.1.
Since 1.9, embeds a string into the compiled object file that can be queried with the 'what' utility.

Definition at line 181 of file svn_version.h.

◆ SVN_VERSION_DEFINE

#define SVN_VERSION_DEFINE (   name)
Value:
static const svn_version_t name = \
{ \
SVN_VER_MAJOR, \
SVN_VER_MINOR, \
SVN_VER_PATCH, \
SVN_VER_NUMTAG \
} \

Define a static svn_version_t object.

Since
New in 1.1.

Definition at line 165 of file svn_version.h.

Typedef Documentation

◆ svn_version_checklist_t

An entry in the compatibility checklist.

See also
svn_ver_check_list()
Since
New in 1.1.

◆ svn_version_ext_linked_lib_t

Dependent library information.

Describes the name and versions of known dependencies used by libsvn_subr.

Since
New in 1.8.

◆ svn_version_ext_loaded_lib_t

Loaded shared library information.

Describes the name and, where available, version of the shared libraries loaded by the running program.

Since
New in 1.8.

◆ svn_version_extended_t

Extended version information, including info about the running system.

Since
New in 1.8.

Definition at line 301 of file svn_version.h.

Function Documentation

◆ svn_subr_version()

const svn_version_t* svn_subr_version ( void  )

Get libsvn_subr version information.

Since
New in 1.1.

◆ svn_ver_check_list()

svn_error_t* svn_ver_check_list ( const svn_version_t my_version,
const svn_version_checklist_t checklist 
)

Similar to svn_ver_check_list2(), with comparator set to svn_ver_compatible.

Deprecated:
Provided for backward compatibility with 1.8 API.

◆ svn_ver_check_list2()

svn_error_t* svn_ver_check_list2 ( const svn_version_t my_version,
const svn_version_checklist_t checklist,
svn_boolean_t(*)(const svn_version_t *, const svn_version_t *)  comparator 
)

Perform a series of version compatibility checks.

Checks if my_version is compatible with each entry in checklist. checklist must end with an entry whose label is NULL.

my_version is considered to be compatible with a version in checklist if comparator returns TRUE when called with my_version as the first parammeter and the checklist version as the second parameter.

See also
svn_ver_compatible(), svn_ver_equal()
Note
Subversion's own code invariably uses svn_ver_equal() as comparator, since the cmdline tools sometimes use non-public APIs (such as utility functions that haven't been promoted to svn_cmdline.h). Third-party code SHOULD use svn_ver_compatible() as comparator.
Since
New in 1.9.

◆ svn_ver_compatible()

svn_boolean_t svn_ver_compatible ( const svn_version_t my_version,
const svn_version_t lib_version 
)

Check library version compatibility.

Return TRUE if the client's version, given in my_version, is compatible with the library version, provided in lib_version.

This function checks for version compatibility as per our guarantees, but requires an exact match when linking to an unreleased library. A development client is always compatible with a previous released library.

Note
Implements the svn_ver_check_list2.comparator interface.
Since
New in 1.1.

◆ svn_ver_equal()

svn_boolean_t svn_ver_equal ( const svn_version_t my_version,
const svn_version_t lib_version 
)

Check if my_version and lib_version encode the same version number.

Note
Implements the svn_ver_check_list2.comparator interface.
Since
New in 1.2.

◆ svn_version_ext_build_date()

const char* svn_version_ext_build_date ( const svn_version_extended_t ext_info)

Accessor for svn_version_extended_t.

Returns
The date when the libsvn_subr library was compiled, in the format defined by the C standard macro DATE.
Since
New in 1.8.

◆ svn_version_ext_build_host()

const char* svn_version_ext_build_host ( const svn_version_extended_t ext_info)

Accessor for svn_version_extended_t.

Returns
The canonical host triplet (arch-vendor-osname) of the system where libsvn_subr was compiled.
Note
On Unix-like systems (includng Mac OS X), this string is the same as the output of the config.guess script.
Since
New in 1.8.

◆ svn_version_ext_build_time()

const char* svn_version_ext_build_time ( const svn_version_extended_t ext_info)

Accessor for svn_version_extended_t.

Returns
The time when the libsvn_subr library was compiled, in the format defined by the C standard macro TIME.
Since
New in 1.8.

◆ svn_version_ext_copyright()

const char* svn_version_ext_copyright ( const svn_version_extended_t ext_info)

Accessor for svn_version_extended_t.

Returns
The localized copyright notice.
Since
New in 1.8.

◆ svn_version_ext_linked_libs()

const apr_array_header_t* svn_version_ext_linked_libs ( const svn_version_extended_t ext_info)

Accessor for svn_version_extended_t.

Returns
Array of svn_version_ext_linked_lib_t describing dependent libraries. The returned value may be NULL.
Since
New in 1.8.

◆ svn_version_ext_loaded_libs()

const apr_array_header_t* svn_version_ext_loaded_libs ( const svn_version_extended_t ext_info)

Accessor for svn_version_extended_t.

Returns
Array of svn_version_ext_loaded_lib_t describing loaded shared libraries. The returned value may be NULL.
Note
On Mac OS X, the loaded frameworks, private frameworks and system libraries will not be listed.
Since
New in 1.8.

◆ svn_version_ext_runtime_host()

const char* svn_version_ext_runtime_host ( const svn_version_extended_t ext_info)

Accessor for svn_version_extended_t.

Returns
The canonical host triplet (arch-vendor-osname) of the system where the current process is running.
Note
This string may not be the same as the output of config.guess on the same system.
Since
New in 1.8.

◆ svn_version_ext_runtime_osname()

const char* svn_version_ext_runtime_osname ( const svn_version_extended_t ext_info)

Accessor for svn_version_extended_t.

Returns
The "commercial" release name of the running operating system, if available. Not to be confused with, e.g., the output of "uname -v" or "uname -r". The returned value may be NULL.
Since
New in 1.8.

◆ svn_version_extended()

const svn_version_extended_t* svn_version_extended ( svn_boolean_t  verbose,
apr_pool_t *  pool 
)

Return version information for the running program.

If verbose is TRUE, collect extra information that may be expensive to retrieve (for example, the OS release name, list of shared libraries, etc.). Use pool for all allocations.

Note
This function may allocate significant auxiliary resources (memory and file descriptors) in pool. It is recommended to copy the returned data to suitable longer-lived memory and clear pool after calling this function.
Since
New in 1.8.

Variable Documentation

◆ svn_version_func_t

const typedef svn_version_t*(* svn_version_func_t) (void)

Type of function returning library version.

Since
New in 1.6.

Definition at line 283 of file svn_version.h.

SVN_VER_PATCH
#define SVN_VER_PATCH
Patch number.
Definition: svn_version.h:73
SVN_VERSION
#define SVN_VERSION
Complete version string.
Definition: svn_version.h:134
SVN_VER_MINOR
#define SVN_VER_MINOR
Minor version number.
Definition: svn_version.h:64
svn_version_t
Version information.
Definition: svn_version.h:147
SVN_VER_MAJOR
#define SVN_VER_MAJOR
Major version number.
Definition: svn_version.h:57