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