iPXE
version.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 Michael Brown <mbrown@fensystems.co.uk>.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of the
7  * License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  * 02110-1301, USA.
18  *
19  * You can also choose to distribute this program under the terms of
20  * the Unmodified Binary Distribution Licence (as given in the file
21  * COPYING.UBDL), provided that you have satisfied its requirements.
22  */
23 
24 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
25 
26 /** @file
27  *
28  * Version number
29  *
30  */
31 
32 #include <wchar.h>
33 #include <ipxe/features.h>
34 #include <ipxe/version.h>
35 #include <config/general.h>
36 #include <config/branding.h>
37 
38 /**
39  * Create wide-character version of string
40  *
41  * @v string String
42  * @ret wstring Wide-character version of string
43  */
44 #define WSTRING( string ) _WSTRING ( string )
45 #define _WSTRING( string ) L ## string
46 
47 /** Version number feature */
48 FEATURE_VERSION ( VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH );
49 
50 /** Build timestamp (generated by linker) */
51 extern char _build_timestamp[];
52 
53 /** Build ID (generated by linker) */
54 extern char _build_id[];
55 
56 /** Build timestamp */
57 unsigned long build_timestamp = ( ( unsigned long ) _build_timestamp );
58 
59 /** Build ID */
60 unsigned long build_id = ( ( unsigned long ) _build_id );
61 
62 /** Product major version */
63 const int product_major_version = VERSION_MAJOR;
64 
65 /** Product minor version */
66 const int product_minor_version = VERSION_MINOR;
67 
68 /** Product version string */
69 const char product_version[] = VERSION;
70 
71 /** Product name string */
72 const char product_name[] = PRODUCT_NAME;
73 
74 /** Product short name string */
76 
77 /** Build name string */
78 const char build_name[] = BUILD_NAME;
79 
80 /** Wide-character product version string */
81 const wchar_t product_wversion[] = WSTRING ( VERSION );
82 
83 /** Wide-character product name string */
84 const wchar_t product_wname[] = WSTRING ( PRODUCT_NAME );
85 
86 /** Wide-character product short name string */
88 
89 /** Wide-character build name string */
90 const wchar_t build_wname[] = WSTRING ( BUILD_NAME );
91 
92 /** Copy of build name string within ".prefix" */
93 const char build_name_prefix[] __attribute__ (( section ( ".prefix.name" ) ))
94  = BUILD_NAME;
const char product_short_name[]
Product short name string.
Definition: version.c:75
#define __attribute__(x)
Definition: compiler.h:10
#define PRODUCT_SHORT_NAME
Definition: branding.h:28
const char build_name[]
Build name string.
Definition: version.c:78
const wchar_t product_short_wname[]
Wide-character product short name string.
Definition: version.c:87
char _build_timestamp[]
Build timestamp (generated by linker)
struct netvsc_rx_buffer_section section[1]
Section descriptors.
Definition: netvsc.h:18
Branding configuration.
#define WSTRING(string)
Create wide-character version of string.
Definition: version.c:44
const wchar_t product_wname[]
Wide-character product name string.
Definition: version.c:84
unsigned long build_id
Build ID.
Definition: version.c:60
Feature list.
unsigned long build_timestamp
Build timestamp.
Definition: version.c:57
FEATURE_VERSION(VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)
Version number feature.
char _build_id[]
Build ID (generated by linker)
const char product_version[]
Product version string.
Definition: version.c:69
Version number.
const wchar_t build_wname[]
Wide-character build name string.
Definition: version.c:90
const int product_major_version
Product major version.
Definition: version.c:63
#define PRODUCT_NAME
Definition: branding.h:27
General configuration.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
const wchar_t product_wversion[]
Wide-character product version string.
Definition: version.c:81
const char build_name_prefix[]
Copy of build name string within ".prefix".
Definition: version.c:94
const char product_name[]
Product name string.
Definition: version.c:72
const int product_minor_version
Product minor version.
Definition: version.c:66