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