summaryrefslogtreecommitdiff
path: root/subversion/include/svn_version.h
blob: c43f483d3899efec4ac05e9158a3ad342e793413 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
/**
 * @copyright
 * ====================================================================
 *    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.
 * ====================================================================
 * @endcopyright
 *
 * @file svn_version.h
 * @brief Version information.
 */

#ifndef SVN_VERSION_H
#define SVN_VERSION_H

/* Hack to prevent the resource compiler from including
   apr and other headers. */
#ifndef SVN_WIN32_RESOURCE_COMPILATION
#include <apr_general.h>
#include <apr_tables.h>

#include "svn_types.h"
#endif

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */


/* Symbols that define the version number. */

/* Version numbers: <major>.<minor>.<micro>
 *
 * The version numbers in this file follow the rules established by:
 *
 *   http://apr.apache.org/versioning.html
 */

/** Major version number.
 *
 * Modify when incompatible changes are made to published interfaces.
 */
#define SVN_VER_MAJOR      1

/** Minor version number.
 *
 * Modify when new functionality is added or new interfaces are
 * defined, but all changes are backward compatible.
 */
#define SVN_VER_MINOR      13

/**
 * Patch number.
 *
 * Modify for every released patch.
 *
 * @since New in 1.1.
 */
#define SVN_VER_PATCH      0


/** @deprecated Provided for backward compatibility with the 1.0 API. */
#define SVN_VER_MICRO      SVN_VER_PATCH

/** @deprecated Provided for backward compatibility with the 1.0 API. */
#define SVN_VER_LIBRARY    SVN_VER_MAJOR


/** 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.
 */
#define SVN_VER_TAG        " (r1867053)"


/** 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.
 */
#define SVN_VER_NUMTAG     ""


/** 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.
 */
#define SVN_VER_REVISION   1867053


/* Version strings composed from the above definitions. */

/** Version number */
#define SVN_VER_NUM        APR_STRINGIFY(SVN_VER_MAJOR) \
                           "." APR_STRINGIFY(SVN_VER_MINOR) \
                           "." APR_STRINGIFY(SVN_VER_PATCH)

/** Version number with tag (contains no whitespace) */
#define SVN_VER_NUMBER     SVN_VER_NUM SVN_VER_NUMTAG

/** Complete version string */
#define SVN_VERSION        SVN_VER_NUMBER SVN_VER_TAG



/* Version queries and compatibility checks */

/**
 * Version information. Each library contains a function called
 * svn_<i>libname</i>_version() that returns a pointer to a statically
 * allocated object of this type.
 *
 * @since New in 1.1.
 */
struct svn_version_t
{
  int major;                    /**< Major version number */
  int minor;                    /**< Minor version number */
  int patch;                    /**< Patch number */

  /**
   * The version tag (#SVN_VER_NUMTAG). Must always point to a
   * statically allocated string.
   */
  const char *tag;
};

/**
 * Define a static svn_version_t object.
 *
 * @since New in 1.1.
 */
#define SVN_VERSION_DEFINE(name) \
  static const svn_version_t name = \
    { \
      SVN_VER_MAJOR, \
      SVN_VER_MINOR, \
      SVN_VER_PATCH, \
      SVN_VER_NUMTAG \
    } \

/**
 * Generate the implementation of a version query function.
 *
 * @since New in 1.1.
 * @since Since 1.9, embeds a string into the compiled object
 *        file that can be queried with the 'what' utility.
 */
#define SVN_VERSION_BODY            \
  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

/**
 * Check library version compatibility. Return #TRUE if the client's
 * version, given in @a my_version, is compatible with the library
 * version, provided in @a 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.@a comparator interface.
 *
 * @since New in 1.1.
 */
svn_boolean_t
svn_ver_compatible(const svn_version_t *my_version,
                   const svn_version_t *lib_version);

/**
 * Check if @a my_version and @a lib_version encode the same version number.
 *
 * @note Implements the #svn_ver_check_list2.@a comparator interface.
 *
 * @since New in 1.2.
 */
svn_boolean_t
svn_ver_equal(const svn_version_t *my_version,
              const svn_version_t *lib_version);


/**
 * An entry in the compatibility checklist.
 * @see svn_ver_check_list()
 *
 * @since New in 1.1.
 */
typedef struct svn_version_checklist_t
{
  const char *label;            /**< Entry label */

  /** Version query function for this entry */
  const svn_version_t *(*version_query)(void);
} svn_version_checklist_t;


/**
 * Perform a series of version compatibility checks. Checks if @a
 * my_version is compatible with each entry in @a checklist. @a
 * checklist must end with an entry whose label is @c NULL.
 *
 * @a my_version is considered to be compatible with a version in @a checklist
 * if @a comparator returns #TRUE when called with @a my_version as the first
 * parammeter and the @a checklist version as the second parameter.
 *
 * @see svn_ver_compatible(), svn_ver_equal()
 *
 * @note Subversion's own code invariably uses svn_ver_equal() as @a 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 @a comparator.
 *
 * @since New in 1.9.
 */
svn_error_t *
svn_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 *));

/** Similar to svn_ver_check_list2(), with @a comparator set to
 * #svn_ver_compatible.
 *
 * @deprecated Provided for backward compatibility with 1.8 API.
 */
SVN_DEPRECATED
svn_error_t *
svn_ver_check_list(const svn_version_t *my_version,
                   const svn_version_checklist_t *checklist);


/**
 * Type of function returning library version.
 *
 * @since New in 1.6.
 */
typedef const svn_version_t *(*svn_version_func_t)(void);


/* libsvn_subr doesn't have an svn_subr header, so put the prototype here. */
/**
 * Get libsvn_subr version information.
 *
 * @since New in 1.1.
 */
const svn_version_t *
svn_subr_version(void);


/**
 * Extended version information, including info about the running system.
 *
 * @since New in 1.8.
 */
typedef struct svn_version_extended_t svn_version_extended_t;

/**
 * Return version information for the running program.  If @a verbose
 * is #TRUE, collect extra information that may be expensive to
 * retrieve (for example, the OS release name, list of shared
 * libraries, etc.).  Use @a pool for all allocations.
 *
 * @note This function may allocate significant auxiliary resources
 * (memory and file descriptors) in @a pool.  It is recommended to
 * copy the returned data to suitable longer-lived memory and clear
 * @a pool after calling this function.
 *
 * @since New in 1.8.
 */
const svn_version_extended_t *
svn_version_extended(svn_boolean_t verbose,
                     apr_pool_t *pool);


/**
 * Accessor for svn_version_extended_t.
 *
 * @return The date when the libsvn_subr library was compiled, in the
 * format defined by the C standard macro @c __DATE__.
 *
 * @since New in 1.8.
 */
const char *
svn_version_ext_build_date(const svn_version_extended_t *ext_info);

/**
 * Accessor for svn_version_extended_t.
 *
 * @return The time when the libsvn_subr library was compiled, in the
 * format defined by the C standard macro @c __TIME__.
 *
 * @since New in 1.8.
 */
const char *
svn_version_ext_build_time(const svn_version_extended_t *ext_info);

/**
 * Accessor for svn_version_extended_t.
 *
 * @return 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.
 */
const char *
svn_version_ext_build_host(const svn_version_extended_t *ext_info);

/**
 * Accessor for svn_version_extended_t.
 *
 * @return The localized copyright notice.
 *
 * @since New in 1.8.
 */
const char *
svn_version_ext_copyright(const svn_version_extended_t *ext_info);

/**
 * Accessor for svn_version_extended_t.
 *
 * @return 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.
 */
const char *
svn_version_ext_runtime_host(const svn_version_extended_t *ext_info);

/**
 * Accessor for svn_version_extended_t.
 *
 * @return 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 @c NULL.
 *
 * @since New in 1.8.
 */
const char *
svn_version_ext_runtime_osname(const svn_version_extended_t *ext_info);

/**
 * Dependent library information.
 * Describes the name and versions of known dependencies
 * used by libsvn_subr.
 *
 * @since New in 1.8.
 */
typedef struct svn_version_ext_linked_lib_t
{
  const char *name;             /**< Library name */
  const char *compiled_version; /**< Compile-time version string */
  const char *runtime_version;  /**< Run-time version string (optional) */
} svn_version_ext_linked_lib_t;

/**
 * Accessor for svn_version_extended_t.
 *
 * @return Array of svn_version_ext_linked_lib_t describing dependent
 * libraries.  The returned value may be @c NULL.
 *
 * @since New in 1.8.
 */
const apr_array_header_t *
svn_version_ext_linked_libs(const svn_version_extended_t *ext_info);


/**
 * 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.
 */
typedef struct svn_version_ext_loaded_lib_t
{
  const char *name;             /**< Library name */
  const char *version;          /**< Library version (optional) */
} svn_version_ext_loaded_lib_t;


/**
 * Accessor for svn_version_extended_t.
 *
 * @return Array of svn_version_ext_loaded_lib_t describing loaded
 * shared libraries.  The returned value may be @c NULL.
 *
 * @note On Mac OS X, the loaded frameworks, private frameworks and
 * system libraries will not be listed.
 *
 * @since New in 1.8.
 */
const apr_array_header_t *
svn_version_ext_loaded_libs(const svn_version_extended_t *ext_info);


#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* SVN_VERSION_H */