File tree Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Original file line number Diff line number Diff line change 3737
3838#include "compat.h"
3939#include "tree_schema_internal.h"
40+ #include "version.h"
4041#include "xml.h"
4142
43+ LIBYANG_API_DEF struct ly_version ly_version_so = {
44+ .major = LY_VERSION_MAJOR ,
45+ .minor = LY_VERSION_MINOR ,
46+ .micro = LY_VERSION_MICRO ,
47+ .str = LY_VERSION
48+ };
49+
50+ LIBYANG_API_DEF struct ly_version ly_version_proj = {
51+ .major = LY_PROJ_VERSION_MAJOR ,
52+ .minor = LY_PROJ_VERSION_MINOR ,
53+ .micro = LY_PROJ_VERSION_MICRO ,
54+ .str = LY_PROJ_VERSION
55+ };
56+
4257void *
4358ly_realloc (void * ptr , size_t size )
4459{
Original file line number Diff line number Diff line change 11/**
22 * @file version.h
33 * @author Radek Krejci <[email protected] > 4+ * @author Michal Vasko <[email protected] > 45 * @brief libyang version definitions
56 *
6- * Copyright (c) 2020 CESNET, z.s.p.o.
7+ * Copyright (c) 2020 - 2024 CESNET, z.s.p.o.
78 *
89 * This source code is licensed under BSD 3-Clause License (the "License").
910 * You may not use this file except in compliance with the License.
1516#ifndef LY_VERSION_H_
1617#define LY_VERSION_H_
1718
19+ #ifdef __cplusplus
20+ extern "C" {
21+ #endif
22+
1823#define LY_VERSION_MAJOR @LIBYANG_MAJOR_SOVERSION@ /**< libyang major version number */
1924#define LY_VERSION_MINOR @LIBYANG_MINOR_SOVERSION@ /**< libyang minor version number */
2025#define LY_VERSION_MICRO @LIBYANG_MICRO_SOVERSION@ /**< libyang micro version number */
2530#define LY_PROJ_VERSION_MICRO @LIBYANG_MICRO_VERSION@ /**< project micro version number */
2631#define LY_PROJ_VERSION "@LIBYANG_VERSION@" /**< project version string */
2732
33+ struct ly_version {
34+ uint32_t major ; /**< Major version number */
35+ uint32_t minor ; /**< Minor version number */
36+ uint32_t micro ; /**< Micro version number */
37+ const char * str ; /**< Version string */
38+ };
39+
40+ /**
41+ * @brief libyang SO version.
42+ */
43+ LIBYANG_API_DECL extern struct ly_version ly_version_so ;
44+
45+ /**
46+ * @brief libyang project version.
47+ */
48+ LIBYANG_API_DECL extern struct ly_version ly_version_proj ;
49+
50+ #ifdef __cplusplus
51+ }
52+ #endif
53+
2854#endif /* LY_VERSION_H_ */
You can’t perform that action at this time.
0 commit comments