DPDK  18.11.11
rte_version.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2014 Intel Corporation
3  */
4 
10 #ifndef _RTE_VERSION_H_
11 #define _RTE_VERSION_H_
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 #include <stdint.h>
18 #include <string.h>
19 #include <stdio.h>
20 #include <rte_common.h>
21 
25 #define RTE_VER_PREFIX "DPDK"
26 
30 #define RTE_VER_YEAR 18
31 
35 #define RTE_VER_MONTH 11
36 
40 #define RTE_VER_MINOR 11
41 
45 #define RTE_VER_SUFFIX ""
46 
52 #define RTE_VER_RELEASE 16
53 
57 #define RTE_VERSION_NUM(a,b,c,d) ((a) << 24 | (b) << 16 | (c) << 8 | (d))
58 
62 #define RTE_VERSION RTE_VERSION_NUM( \
63  RTE_VER_YEAR, \
64  RTE_VER_MONTH, \
65  RTE_VER_MINOR, \
66  RTE_VER_RELEASE)
67 
73 static inline const char *
75 {
76  static char version[32];
77  if (version[0] != 0)
78  return version;
79  if (strlen(RTE_VER_SUFFIX) == 0)
80  snprintf(version, sizeof(version), "%s %d.%02d.%d",
85  else
86  snprintf(version, sizeof(version), "%s %d.%02d.%d%s%d",
92  RTE_VER_RELEASE < 16 ?
94  RTE_VER_RELEASE - 16);
95  return version;
96 }
97 
98 #ifdef __cplusplus
99 }
100 #endif
101 
102 #endif /* RTE_VERSION_H */
#define RTE_VER_YEAR
Definition: rte_version.h:30
static const char * rte_version(void)
Definition: rte_version.h:74
#define RTE_VER_PREFIX
Definition: rte_version.h:25
#define RTE_VER_SUFFIX
Definition: rte_version.h:45
#define RTE_VER_MINOR
Definition: rte_version.h:40
#define RTE_VER_MONTH
Definition: rte_version.h:35
#define RTE_VER_RELEASE
Definition: rte_version.h:52