]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - libelftc/elftc_version.3
Import ELF Tool Chain snapshot at r3668
[FreeBSD/FreeBSD.git] / libelftc / elftc_version.3
1 .\" Copyright (c) 2011,2012 Joseph Koshy.  All rights reserved.
2 .\"
3 .\" Redistribution and use in source and binary forms, with or without
4 .\" modification, are permitted provided that the following conditions
5 .\" are met:
6 .\" 1. Redistributions of source code must retain the above copyright
7 .\"    notice, this list of conditions and the following disclaimer.
8 .\" 2. Redistributions in binary form must reproduce the above copyright
9 .\"    notice, this list of conditions and the following disclaimer in the
10 .\"    documentation and/or other materials provided with the distribution.
11 .\"
12 .\" This software is provided by Joseph Koshy ``as is'' and
13 .\" any express or implied warranties, including, but not limited to, the
14 .\" implied warranties of merchantability and fitness for a particular purpose
15 .\" are disclaimed.  in no event shall Joseph Koshy be liable
16 .\" for any direct, indirect, incidental, special, exemplary, or consequential
17 .\" damages (including, but not limited to, procurement of substitute goods
18 .\" or services; loss of use, data, or profits; or business interruption)
19 .\" however caused and on any theory of liability, whether in contract, strict
20 .\" liability, or tort (including negligence or otherwise) arising in any way
21 .\" out of the use of this software, even if advised of the possibility of
22 .\" such damage.
23 .\"
24 .\" $Id: elftc_version.3 3645 2018-10-15 20:17:14Z jkoshy $
25 .\"
26 .Dd December 30, 2012
27 .Dt ELFTC_VERSION 3
28 .Os
29 .Sh NAME
30 .Nm elftc_version
31 .Nd return a project-wide version identifier string
32 .Sh LIBRARY
33 .Lb libelftc
34 .Sh SYNOPSIS
35 .In libelftc.h
36 .Ft const char *
37 .Fn elftc_version void
38 .Sh DESCRIPTION
39 Function
40 .Fn elftc_version
41 returns a project-wide identifier string that encodes the source
42 revision of the project source tree.
43 .Pp
44 The returned identifier has four space-separated fields:
45 .Bl -tag -width ".Em Project Branch"
46 .It Em "Project-Name"
47 This is always
48 .Dq elftoolchain .
49 .It Em "Project-Branch"
50 The branch name for the project source tree.
51 .It Em "Build-OS"
52 The operating system that the tool chain was compiled for.
53 .It Em "Version-Number"
54 A tree-wide version number extracted from the version control
55 system in use.
56 .El
57 .Sh RETURN VALUES
58 Function
59 .Fn elftc_program_version
60 returns a pointer to an internal character buffer.
61 .Sh EXAMPLES
62 To retrieve and print the current toolchain version identifier, use:
63 .Bd -literal -offset indent
64 #include <sys/types.h>
65 #include <libelftc.h>
66
67 (void) printf("%s\en", elftc_version());
68 .Ed
69 .Pp
70 On the HEAD branch of the project's sources, when checked out using
71 Subversion and compiled on a
72 .Nx
73 host, this would print:
74 .D1 Dq elftoolchain HEAD NetBSD svn: Ns Em REVINFO
75 where
76 .Em REVINFO
77 would be the current revision information for the project source tree.
78 .Sh ERRORS
79 Function
80 .Fn elftc_program_version
81 always succeeds.