libyang UPDATE add prefix for common and config files
To avoid include conflicts.
diff --git a/src/context.c b/src/context.c
index 0c41019..9d379c6 100644
--- a/src/context.c
+++ b/src/context.c
@@ -32,10 +32,10 @@
#include <sys/stat.h>
#include <unistd.h>
-#include "common.h"
#include "compat.h"
#include "hash_table.h"
#include "in.h"
+#include "ly_common.h"
#include "parser_data.h"
#include "plugins_internal.h"
#include "plugins_types.h"
diff --git a/src/dict.c b/src/dict.c
index e1426ca..bf49561 100644
--- a/src/dict.c
+++ b/src/dict.c
@@ -21,9 +21,9 @@
#include <stdlib.h>
#include <string.h>
-#include "common.h"
#include "compat.h"
#include "log.h"
+#include "ly_common.h"
/* starting size of the dictionary */
#define LYDICT_MIN_SIZE 1024
diff --git a/src/diff.c b/src/diff.c
index 637ce06..e522c9e 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -22,10 +22,10 @@
#include <stdlib.h>
#include <string.h>
-#include "common.h"
#include "compat.h"
#include "context.h"
#include "log.h"
+#include "ly_common.h"
#include "plugins_exts.h"
#include "plugins_exts/metadata.h"
#include "plugins_types.h"
diff --git a/src/hash_table.c b/src/hash_table.c
index 9655bd6..f951e6a 100644
--- a/src/hash_table.c
+++ b/src/hash_table.c
@@ -21,10 +21,10 @@
#include <stdlib.h>
#include <string.h>
-#include "common.h"
#include "compat.h"
#include "dict.h"
#include "log.h"
+#include "ly_common.h"
LIBYANG_API_DEF uint32_t
lyht_hash_multi(uint32_t hash, const char *key_part, size_t len)
diff --git a/src/in.c b/src/in.c
index 431c10a..38b42a8 100644
--- a/src/in.c
+++ b/src/in.c
@@ -27,10 +27,10 @@
#include <string.h>
#include <unistd.h>
-#include "common.h"
#include "compat.h"
#include "dict.h"
#include "log.h"
+#include "ly_common.h"
#include "parser_data.h"
#include "parser_internal.h"
#include "set.h"
diff --git a/src/json.c b/src/json.c
index 53f41dc..f5e8bac 100644
--- a/src/json.c
+++ b/src/json.c
@@ -20,9 +20,9 @@
#include <string.h>
#include <sys/types.h>
-#include "common.h"
#include "in_internal.h"
#include "json.h"
+#include "ly_common.h"
#include "tree_schema_internal.h"
const char *
diff --git a/src/log.c b/src/log.c
index f66873d..955fa1a 100644
--- a/src/log.c
+++ b/src/log.c
@@ -26,9 +26,9 @@
#include <stdlib.h>
#include <string.h>
-#include "common.h"
#include "compat.h"
#include "in_internal.h"
+#include "ly_common.h"
#include "plugins_exts.h"
#include "set.h"
#include "tree_data.h"
diff --git a/src/log.h b/src/log.h
index 8999910..b02a290 100644
--- a/src/log.h
+++ b/src/log.h
@@ -18,7 +18,7 @@
#include <stdint.h>
-#include "config.h"
+#include "ly_config.h"
#ifdef __cplusplus
extern "C" {
diff --git a/src/common.c b/src/ly_common.c
similarity index 99%
rename from src/common.c
rename to src/ly_common.c
index 03dd81c..e80ca93 100644
--- a/src/common.c
+++ b/src/ly_common.c
@@ -1,9 +1,9 @@
/**
- * @file common.c
+ * @file ly_common.c
* @author Michal Vasko <mvasko@cesnet.cz>
* @brief common internal definitions for libyang
*
- * Copyright (c) 2018 CESNET, z.s.p.o.
+ * Copyright (c) 2018 - 2024 CESNET, z.s.p.o.
*
* This source code is licensed under BSD 3-Clause License (the "License").
* You may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
#define _GNU_SOURCE
-#include "common.h"
+#include "ly_common.h"
#include <assert.h>
#include <ctype.h>
@@ -26,9 +26,11 @@
#include <stdlib.h>
#include <string.h>
#ifndef _WIN32
-#include <sys/mman.h>
+# ifdef HAVE_MMAP
+# include <sys/mman.h>
+# endif
#else
-#include <io.h>
+# include <io.h>
#endif
#include <sys/stat.h>
#include <unistd.h>
diff --git a/src/common.h b/src/ly_common.h
similarity index 99%
rename from src/common.h
rename to src/ly_common.h
index 0157d26..358efb8 100644
--- a/src/common.h
+++ b/src/ly_common.h
@@ -1,10 +1,10 @@
/**
- * @file common.h
+ * @file ly_common.h
* @author Radek Krejci <rkrejci@cesnet.cz>
* @author Michal Vasko <mvasko@cesnet.cz>
* @brief common internal definitions for libyang
*
- * Copyright (c) 2015 - 2023 CESNET, z.s.p.o.
+ * Copyright (c) 2015 - 2024 CESNET, z.s.p.o.
*
* This source code is licensed under BSD 3-Clause License (the "License").
* You may not use this file except in compliance with the License.
@@ -22,10 +22,10 @@
#include <string.h>
#include "compat.h"
-#include "config.h"
#include "context.h"
#include "hash_table_internal.h"
#include "log.h"
+#include "ly_config.h"
#include "schema_compile.h"
#include "set.h"
#include "tree_data.h"
@@ -272,7 +272,7 @@
#define LY_VCODE_TRAILING_MOD LYVE_SYNTAX, "Trailing garbage \"%.*s%s\" after module, expected end-of-input."
#define LY_VCODE_TRAILING_SUBMOD LYVE_SYNTAX, "Trailing garbage \"%.*s%s\" after submodule, expected end-of-input."
-#define LY_VCODE_INVAL_MINMAX LYVE_SEMANTICS, "Invalid combination of min-elements and max-elements: min value %u is bigger than the max value %u."
+#define LY_VCODE_INVAL_MINMAX LYVE_SEMANTICS, "Invalid combination of min-elements and max-elements: min value %" PRIu32 " is bigger than the max value %" PRIu32 "."
#define LY_VCODE_NAME_COL LYVE_SEMANTICS, "Name collision between %s of name \"%s\"."
#define LY_VCODE_NAME2_COL LYVE_SEMANTICS, "Name collision between %s and %s of name \"%s\"."
@@ -305,12 +305,12 @@
#define LY_VCODE_SUBELEM_REDEF LYVE_SYNTAX_YIN, "Redefinition of \"%s\" sub-element in \"%s\" element."
#define LY_VCODE_XP_EOE LYVE_XPATH, "Unterminated string delimited with %c (%.15s)."
-#define LY_VCODE_XP_INEXPR LYVE_XPATH, "Invalid character '%c'[%u] of expression \'%s\'."
+#define LY_VCODE_XP_INEXPR LYVE_XPATH, "Invalid character '%c'[%" PRIu32 "] of expression \'%s\'."
#define LY_VCODE_XP_EOF LYVE_XPATH, "Unexpected XPath expression end."
#define LY_VCODE_XP_INTOK LYVE_XPATH, "Unexpected XPath token \"%s\" (\"%.15s\")."
#define LY_VCODE_XP_INTOK2 LYVE_XPATH, "Unexpected XPath token \"%s\" (\"%.15s\"), expected \"%s\"."
#define LY_VCODE_XP_INFUNC LYVE_XPATH, "Unknown XPath function \"%.*s\"."
-#define LY_VCODE_XP_INARGCOUNT LYVE_XPATH, "Invalid number of arguments (%d) for the XPath function %.*s."
+#define LY_VCODE_XP_INARGCOUNT LYVE_XPATH, "Invalid number of arguments (%" PRIu32 ") for the XPath function %.*s."
#define LY_VCODE_XP_INARGTYPE LYVE_XPATH, "Wrong type of argument #%d (%s) for the XPath function %s."
#define LY_VCODE_XP_INCTX LYVE_XPATH, "Invalid context type %s in %s."
#define LY_VCODE_XP_INOP_1 LYVE_XPATH, "Cannot apply XPath operation %s on %s."
diff --git a/src/config.h.in b/src/ly_config.h.in
similarity index 95%
rename from src/config.h.in
rename to src/ly_config.h.in
index af3d1f0..ca7552f 100644
--- a/src/config.h.in
+++ b/src/ly_config.h.in
@@ -1,9 +1,10 @@
/**
- * @file config.h
+ * @file ly_config.h
* @author Radek Krejci <rkrejci@cesnet.cz>
+ * @uathor Michal Vasko <mvasko@cesnet.cz>
* @brief Various variables provided by cmake and compile time options.
*
- * Copyright (c) 2021 CESNET, z.s.p.o.
+ * Copyright (c) 2021 - 2024 CESNET, z.s.p.o.
*
* This source code is licensed under BSD 3-Clause License (the "License").
* You may not use this file except in compliance with the License.
diff --git a/src/lyb.c b/src/lyb.c
index 59d379c..7ff4498 100644
--- a/src/lyb.c
+++ b/src/lyb.c
@@ -20,8 +20,8 @@
#include <stdlib.h>
#include <string.h>
-#include "common.h"
#include "compat.h"
+#include "ly_common.h"
#include "tree_schema.h"
/**
diff --git a/src/out.c b/src/out.c
index 84d84b3..a37bc94 100644
--- a/src/out.c
+++ b/src/out.c
@@ -26,9 +26,9 @@
#include <string.h>
#include <unistd.h>
-#include "common.h"
#include "compat.h"
#include "log.h"
+#include "ly_common.h"
#include "printer_data.h"
#include "tree_data.h"
#include "tree_schema.h"
diff --git a/src/parser_common.c b/src/parser_common.c
index 3215275..47810a0 100644
--- a/src/parser_common.c
+++ b/src/parser_common.c
@@ -38,11 +38,11 @@
#include <string.h>
#include <unistd.h>
-#include "common.h"
#include "compat.h"
#include "dict.h"
#include "in_internal.h"
#include "log.h"
+#include "ly_common.h"
#include "parser_data.h"
#include "path.h"
#include "plugins_exts/metadata.h"
diff --git a/src/parser_json.c b/src/parser_json.c
index 3655d4c..60fb29f 100644
--- a/src/parser_json.c
+++ b/src/parser_json.c
@@ -20,13 +20,13 @@
#include <stdlib.h>
#include <string.h>
-#include "common.h"
#include "compat.h"
#include "context.h"
#include "dict.h"
#include "in_internal.h"
#include "json.h"
#include "log.h"
+#include "ly_common.h"
#include "parser_data.h"
#include "parser_internal.h"
#include "plugins_exts.h"
diff --git a/src/parser_lyb.c b/src/parser_lyb.c
index 788be94..b0f6dcb 100644
--- a/src/parser_lyb.c
+++ b/src/parser_lyb.c
@@ -20,7 +20,6 @@
#include <stdlib.h>
#include <string.h>
-#include "common.h"
#include "compat.h"
#include "context.h"
#include "dict.h"
@@ -28,6 +27,7 @@
#include "in.h"
#include "in_internal.h"
#include "log.h"
+#include "ly_common.h"
#include "parser_data.h"
#include "parser_internal.h"
#include "plugins_exts.h"
diff --git a/src/parser_xml.c b/src/parser_xml.c
index 5d97c8e..887d9d5 100644
--- a/src/parser_xml.c
+++ b/src/parser_xml.c
@@ -20,12 +20,12 @@
#include <stdlib.h>
#include <string.h>
-#include "common.h"
#include "compat.h"
#include "context.h"
#include "dict.h"
#include "in_internal.h"
#include "log.h"
+#include "ly_common.h"
#include "parser_data.h"
#include "parser_internal.h"
#include "plugins_exts.h"
diff --git a/src/parser_yang.c b/src/parser_yang.c
index 28bd57b..91f9a93 100644
--- a/src/parser_yang.c
+++ b/src/parser_yang.c
@@ -21,11 +21,11 @@
#include <stdlib.h>
#include <string.h>
-#include "common.h"
#include "context.h"
#include "dict.h"
#include "in_internal.h"
#include "log.h"
+#include "ly_common.h"
#include "parser_schema.h"
#include "path.h"
#include "set.h"
diff --git a/src/parser_yin.c b/src/parser_yin.c
index 36b49f1..ac4c820 100644
--- a/src/parser_yin.c
+++ b/src/parser_yin.c
@@ -24,13 +24,13 @@
#include <stdlib.h>
#include <string.h>
-#include "common.h"
#include "compat.h"
#include "context.h"
#include "dict.h"
#include "in.h"
#include "in_internal.h"
#include "log.h"
+#include "ly_common.h"
#include "parser_internal.h"
#include "parser_schema.h"
#include "path.h"
diff --git a/src/path.c b/src/path.c
index 73883d7..bf68612 100644
--- a/src/path.c
+++ b/src/path.c
@@ -20,9 +20,9 @@
#include <stdlib.h>
#include <string.h>
-#include "common.h"
#include "compat.h"
#include "log.h"
+#include "ly_common.h"
#include "plugins_types.h"
#include "schema_compile.h"
#include "set.h"
diff --git a/src/plugins.c b/src/plugins.c
index 011e464..1e46d4d 100644
--- a/src/plugins.c
+++ b/src/plugins.c
@@ -29,8 +29,8 @@
#include <stdlib.h>
#include <string.h>
-#include "common.h"
-#include "config.h"
+#include "ly_common.h"
+#include "ly_config.h"
#include "plugins_exts.h"
#include "plugins_types.h"
#include "set.h"
diff --git a/src/plugins_exts.c b/src/plugins_exts.c
index f8cdeff..6797c15 100644
--- a/src/plugins_exts.c
+++ b/src/plugins_exts.c
@@ -19,8 +19,8 @@
#include <stdint.h>
#include <stdlib.h>
-#include "common.h"
#include "dict.h"
+#include "ly_common.h"
#include "parser_internal.h"
#include "printer_internal.h"
#include "schema_compile.h"
diff --git a/src/plugins_exts/schema_mount.c b/src/plugins_exts/schema_mount.c
index 352b29d..47a0631 100644
--- a/src/plugins_exts/schema_mount.c
+++ b/src/plugins_exts/schema_mount.c
@@ -20,11 +20,11 @@
#include <stdlib.h>
#include <string.h>
-#include "common.h"
#include "compat.h"
#include "dict.h"
#include "libyang.h"
#include "log.h"
+#include "ly_common.h"
#include "parser_data.h"
#include "plugins_exts.h"
#include "plugins_types.h"
diff --git a/src/plugins_types.c b/src/plugins_types.c
index 6fd4228..aa31530 100644
--- a/src/plugins_types.c
+++ b/src/plugins_types.c
@@ -24,10 +24,10 @@
#include <stdlib.h>
#include <string.h>
-#include "common.h"
#include "compat.h"
#include "context.h"
#include "dict.h"
+#include "ly_common.h"
#include "path.h"
#include "schema_compile.h"
#include "set.h"
diff --git a/src/plugins_types.h b/src/plugins_types.h
index e3b9545..c7ee194 100644
--- a/src/plugins_types.h
+++ b/src/plugins_types.h
@@ -18,8 +18,8 @@
#include <stddef.h>
#include <stdint.h>
-#include "config.h"
#include "log.h"
+#include "ly_config.h"
#include "plugins.h"
#include "set.h"
#include "tree.h"
diff --git a/src/plugins_types/binary.c b/src/plugins_types/binary.c
index 542b54b..bb407e2 100644
--- a/src/plugins_types/binary.c
+++ b/src/plugins_types/binary.c
@@ -24,8 +24,8 @@
#include "libyang.h"
/* additional internal headers for some useful simple macros */
-#include "common.h"
#include "compat.h"
+#include "ly_common.h"
#include "plugins_internal.h" /* LY_TYPE_*_STR */
/**
diff --git a/src/plugins_types/bits.c b/src/plugins_types/bits.c
index 2f87ed3..c6bdd70 100644
--- a/src/plugins_types/bits.c
+++ b/src/plugins_types/bits.c
@@ -24,8 +24,8 @@
#include "libyang.h"
/* additional internal headers for some useful simple macros */
-#include "common.h"
#include "compat.h"
+#include "ly_common.h"
#include "plugins_internal.h" /* LY_TYPE_*_STR */
/**
diff --git a/src/plugins_types/boolean.c b/src/plugins_types/boolean.c
index 415b8b9..d8276b3 100644
--- a/src/plugins_types/boolean.c
+++ b/src/plugins_types/boolean.c
@@ -20,8 +20,8 @@
#include "libyang.h"
/* additional internal headers for some useful simple macros */
-#include "common.h"
#include "compat.h"
+#include "ly_common.h"
#include "plugins_internal.h" /* LY_TYPE_*_STR */
/**
diff --git a/src/plugins_types/date_and_time.c b/src/plugins_types/date_and_time.c
index 594b0a8..4fb0c95 100644
--- a/src/plugins_types/date_and_time.c
+++ b/src/plugins_types/date_and_time.c
@@ -25,8 +25,9 @@
#include "libyang.h"
-#include "common.h"
#include "compat.h"
+#include "ly_common.h"
+#include "plugins_internal.h" /* LY_TYPE_*_STR */
/**
* @page howtoDataLYB LYB Binary Format
diff --git a/src/plugins_types/decimal64.c b/src/plugins_types/decimal64.c
index cbd6934..22f3ed0 100644
--- a/src/plugins_types/decimal64.c
+++ b/src/plugins_types/decimal64.c
@@ -20,8 +20,8 @@
#include "libyang.h"
/* additional internal headers for some useful simple macros */
-#include "common.h"
#include "compat.h"
+#include "ly_common.h"
#include "plugins_internal.h" /* LY_TYPE_*_STR */
/**
diff --git a/src/plugins_types/empty.c b/src/plugins_types/empty.c
index d84634f..45062d8 100644
--- a/src/plugins_types/empty.c
+++ b/src/plugins_types/empty.c
@@ -20,8 +20,8 @@
#include "libyang.h"
/* additional internal headers for some useful simple macros */
-#include "common.h"
#include "compat.h"
+#include "ly_common.h"
#include "plugins_internal.h" /* LY_TYPE_*_STR */
/**
diff --git a/src/plugins_types/enumeration.c b/src/plugins_types/enumeration.c
index 91ca822..2e7543c 100644
--- a/src/plugins_types/enumeration.c
+++ b/src/plugins_types/enumeration.c
@@ -23,8 +23,8 @@
#include "libyang.h"
/* additional internal headers for some useful simple macros */
-#include "common.h"
#include "compat.h"
+#include "ly_common.h"
#include "plugins_internal.h" /* LY_TYPE_*_STR */
/**
diff --git a/src/plugins_types/hex_string.c b/src/plugins_types/hex_string.c
index f72ce66..84b66a2 100644
--- a/src/plugins_types/hex_string.c
+++ b/src/plugins_types/hex_string.c
@@ -24,8 +24,9 @@
#include "libyang.h"
/* additional internal headers for some useful simple macros */
-#include "common.h"
#include "compat.h"
+#include "ly_common.h"
+#include "plugins_internal.h" /* LY_TYPE_*_STR */
/**
* @page howtoDataLYB LYB Binary Format
diff --git a/src/plugins_types/identityref.c b/src/plugins_types/identityref.c
index 588a969..39c9412 100644
--- a/src/plugins_types/identityref.c
+++ b/src/plugins_types/identityref.c
@@ -24,8 +24,8 @@
#include "libyang.h"
/* additional internal headers for some useful simple macros */
-#include "common.h"
#include "compat.h"
+#include "ly_common.h"
#include "plugins_internal.h" /* LY_TYPE_*_STR */
/**
diff --git a/src/plugins_types/instanceid.c b/src/plugins_types/instanceid.c
index e2d01e3..fba3787 100644
--- a/src/plugins_types/instanceid.c
+++ b/src/plugins_types/instanceid.c
@@ -21,8 +21,8 @@
#include "libyang.h"
/* additional internal headers for some useful simple macros */
-#include "common.h"
#include "compat.h"
+#include "ly_common.h"
#include "path.h"
#include "plugins_internal.h" /* LY_TYPE_*_STR */
diff --git a/src/plugins_types/instanceid_keys.c b/src/plugins_types/instanceid_keys.c
index 13f51c8..5d8f5a4 100644
--- a/src/plugins_types/instanceid_keys.c
+++ b/src/plugins_types/instanceid_keys.c
@@ -21,8 +21,8 @@
#include "libyang.h"
/* additional internal headers for some useful simple macros */
-#include "common.h"
#include "compat.h"
+#include "ly_common.h"
#include "path.h"
#include "plugins_internal.h" /* LY_TYPE_*_STR */
#include "xpath.h"
diff --git a/src/plugins_types/integer.c b/src/plugins_types/integer.c
index 05d6801..de36339 100644
--- a/src/plugins_types/integer.c
+++ b/src/plugins_types/integer.c
@@ -23,8 +23,8 @@
#include "libyang.h"
/* additional internal headers for some useful simple macros */
-#include "common.h"
#include "compat.h"
+#include "ly_common.h"
#include "plugins_internal.h" /* LY_TYPE_*_STR */
/**
diff --git a/src/plugins_types/ipv4_address.c b/src/plugins_types/ipv4_address.c
index 9e54a0b..1e485f3 100644
--- a/src/plugins_types/ipv4_address.c
+++ b/src/plugins_types/ipv4_address.c
@@ -34,8 +34,8 @@
#include "libyang.h"
-#include "common.h"
#include "compat.h"
+#include "ly_common.h"
/**
* @page howtoDataLYB LYB Binary Format
diff --git a/src/plugins_types/ipv4_address_no_zone.c b/src/plugins_types/ipv4_address_no_zone.c
index a693912..28331fc 100644
--- a/src/plugins_types/ipv4_address_no_zone.c
+++ b/src/plugins_types/ipv4_address_no_zone.c
@@ -33,8 +33,8 @@
#include "libyang.h"
-#include "common.h"
#include "compat.h"
+#include "ly_common.h"
/**
* @page howtoDataLYB LYB Binary Format
diff --git a/src/plugins_types/ipv4_prefix.c b/src/plugins_types/ipv4_prefix.c
index b8d77b5..6571590 100644
--- a/src/plugins_types/ipv4_prefix.c
+++ b/src/plugins_types/ipv4_prefix.c
@@ -32,8 +32,8 @@
#include "libyang.h"
-#include "common.h"
#include "compat.h"
+#include "ly_common.h"
/**
* @page howtoDataLYB LYB Binary Format
diff --git a/src/plugins_types/ipv6_address.c b/src/plugins_types/ipv6_address.c
index 344a7fc..26197d8 100644
--- a/src/plugins_types/ipv6_address.c
+++ b/src/plugins_types/ipv6_address.c
@@ -34,8 +34,8 @@
#include "libyang.h"
-#include "common.h"
#include "compat.h"
+#include "ly_common.h"
/**
* @page howtoDataLYB LYB Binary Format
diff --git a/src/plugins_types/ipv6_address_no_zone.c b/src/plugins_types/ipv6_address_no_zone.c
index 98ca754..ee3934d 100644
--- a/src/plugins_types/ipv6_address_no_zone.c
+++ b/src/plugins_types/ipv6_address_no_zone.c
@@ -33,8 +33,8 @@
#include "libyang.h"
-#include "common.h"
#include "compat.h"
+#include "ly_common.h"
/**
* @page howtoDataLYB LYB Binary Format
diff --git a/src/plugins_types/ipv6_prefix.c b/src/plugins_types/ipv6_prefix.c
index aaec395..cc48991 100644
--- a/src/plugins_types/ipv6_prefix.c
+++ b/src/plugins_types/ipv6_prefix.c
@@ -32,8 +32,8 @@
#include "libyang.h"
-#include "common.h"
#include "compat.h"
+#include "ly_common.h"
/**
* @page howtoDataLYB LYB Binary Format
diff --git a/src/plugins_types/leafref.c b/src/plugins_types/leafref.c
index f4e24ca..80ffcfc 100644
--- a/src/plugins_types/leafref.c
+++ b/src/plugins_types/leafref.c
@@ -22,8 +22,8 @@
#include "libyang.h"
/* additional internal headers for some useful simple macros */
-#include "common.h"
#include "compat.h"
+#include "ly_common.h"
#include "plugins_internal.h" /* LY_TYPE_*_STR */
#include "tree_data_internal.h" /* lyd_link_leafref_node */
diff --git a/src/plugins_types/node_instanceid.c b/src/plugins_types/node_instanceid.c
index 7833263..2fc91a5 100644
--- a/src/plugins_types/node_instanceid.c
+++ b/src/plugins_types/node_instanceid.c
@@ -20,8 +20,8 @@
#include "libyang.h"
/* additional internal headers for some useful simple macros */
-#include "common.h"
#include "compat.h"
+#include "ly_common.h"
#include "path.h"
#include "plugins_internal.h" /* LY_TYPE_*_STR */
#include "xpath.h"
diff --git a/src/plugins_types/string.c b/src/plugins_types/string.c
index f8143d0..b46e34a 100644
--- a/src/plugins_types/string.c
+++ b/src/plugins_types/string.c
@@ -21,8 +21,8 @@
#include "libyang.h"
/* additional internal headers for some useful simple macros */
-#include "common.h"
#include "compat.h"
+#include "ly_common.h"
#include "plugins_internal.h" /* LY_TYPE_*_STR */
/**
diff --git a/src/plugins_types/union.c b/src/plugins_types/union.c
index 03571b0..6be269d 100644
--- a/src/plugins_types/union.c
+++ b/src/plugins_types/union.c
@@ -24,8 +24,8 @@
#include "libyang.h"
/* additional internal headers for some useful simple macros */
-#include "common.h"
#include "compat.h"
+#include "ly_common.h"
#include "plugins_internal.h" /* LY_TYPE_*_STR */
/**
diff --git a/src/plugins_types/xpath1.0.c b/src/plugins_types/xpath1.0.c
index fdfc2a9..d289422 100644
--- a/src/plugins_types/xpath1.0.c
+++ b/src/plugins_types/xpath1.0.c
@@ -23,10 +23,8 @@
#include "libyang.h"
-#include "common.h"
#include "compat.h"
-
-/* internal headers */
+#include "ly_common.h"
#include "xml.h"
#include "xpath.h"
diff --git a/src/printer_data.c b/src/printer_data.c
index ea330c7..a0eeaea 100644
--- a/src/printer_data.c
+++ b/src/printer_data.c
@@ -16,8 +16,8 @@
#include <stdio.h>
-#include "common.h"
#include "log.h"
+#include "ly_common.h"
#include "out.h"
#include "out_internal.h"
#include "printer_internal.h"
diff --git a/src/printer_json.c b/src/printer_json.c
index 5b762dd..414fad0 100644
--- a/src/printer_json.c
+++ b/src/printer_json.c
@@ -18,9 +18,9 @@
#include <stdint.h>
#include <stdlib.h>
-#include "common.h"
#include "context.h"
#include "log.h"
+#include "ly_common.h"
#include "out.h"
#include "out_internal.h"
#include "parser_data.h"
diff --git a/src/printer_lyb.c b/src/printer_lyb.c
index 820e81e..5a062b1 100644
--- a/src/printer_lyb.c
+++ b/src/printer_lyb.c
@@ -20,11 +20,11 @@
#include <stdlib.h>
#include <string.h>
-#include "common.h"
#include "compat.h"
#include "context.h"
#include "hash_table.h"
#include "log.h"
+#include "ly_common.h"
#include "out.h"
#include "out_internal.h"
#include "plugins_exts/metadata.h"
diff --git a/src/printer_schema.c b/src/printer_schema.c
index 12213bb..21f1207 100644
--- a/src/printer_schema.c
+++ b/src/printer_schema.c
@@ -16,9 +16,9 @@
#include <stdio.h>
-#include "common.h"
#include "compat.h"
#include "log.h"
+#include "ly_common.h"
#include "out_internal.h"
#include "printer_internal.h"
#include "tree_schema.h"
diff --git a/src/printer_tree.c b/src/printer_tree.c
index 6aa2814..1e8b18b 100644
--- a/src/printer_tree.c
+++ b/src/printer_tree.c
@@ -90,8 +90,8 @@
#include <assert.h>
#include <string.h>
-#include "common.h"
#include "compat.h"
+#include "ly_common.h"
#include "out_internal.h"
#include "plugins_exts.h"
#include "plugins_types.h"
diff --git a/src/printer_xml.c b/src/printer_xml.c
index 217f8cb..d33a725 100644
--- a/src/printer_xml.c
+++ b/src/printer_xml.c
@@ -18,10 +18,10 @@
#include <stdlib.h>
#include <string.h>
-#include "common.h"
#include "context.h"
#include "dict.h"
#include "log.h"
+#include "ly_common.h"
#include "out.h"
#include "out_internal.h"
#include "parser_data.h"
diff --git a/src/printer_yang.c b/src/printer_yang.c
index 8e0af18..73802f1 100644
--- a/src/printer_yang.c
+++ b/src/printer_yang.c
@@ -23,9 +23,9 @@
#include <string.h>
#include <sys/types.h>
-#include "common.h"
#include "compat.h"
#include "log.h"
+#include "ly_common.h"
#include "out.h"
#include "out_internal.h"
#include "plugins_exts.h"
diff --git a/src/printer_yin.c b/src/printer_yin.c
index f047bee..a16db1f 100644
--- a/src/printer_yin.c
+++ b/src/printer_yin.c
@@ -19,9 +19,9 @@
#include <stdio.h>
#include <stdlib.h>
-#include "common.h"
#include "compat.h"
#include "log.h"
+#include "ly_common.h"
#include "out.h"
#include "out_internal.h"
#include "printer_internal.h"
diff --git a/src/schema_compile.c b/src/schema_compile.c
index 69a7b2a..dc59314 100644
--- a/src/schema_compile.c
+++ b/src/schema_compile.c
@@ -24,12 +24,12 @@
#include <stdlib.h>
#include <string.h>
-#include "common.h"
#include "compat.h"
#include "context.h"
#include "dict.h"
#include "in.h"
#include "log.h"
+#include "ly_common.h"
#include "parser_schema.h"
#include "path.h"
#include "plugins.h"
diff --git a/src/schema_compile_amend.c b/src/schema_compile_amend.c
index 07b5f1b..b05076c 100644
--- a/src/schema_compile_amend.c
+++ b/src/schema_compile_amend.c
@@ -23,9 +23,9 @@
#include <stdlib.h>
#include <string.h>
-#include "common.h"
#include "dict.h"
#include "log.h"
+#include "ly_common.h"
#include "schema_compile.h"
#include "schema_compile_node.h"
#include "schema_features.h"
diff --git a/src/schema_compile_node.c b/src/schema_compile_node.c
index a141286..7208c6a 100644
--- a/src/schema_compile_node.c
+++ b/src/schema_compile_node.c
@@ -25,10 +25,10 @@
#include <stdlib.h>
#include <string.h>
-#include "common.h"
#include "compat.h"
#include "dict.h"
#include "log.h"
+#include "ly_common.h"
#include "plugins.h"
#include "plugins_internal.h"
#include "plugins_types.h"
diff --git a/src/schema_features.c b/src/schema_features.c
index b4273df..9f6c368 100644
--- a/src/schema_features.c
+++ b/src/schema_features.c
@@ -23,8 +23,8 @@
#include <stdlib.h>
#include <string.h>
-#include "common.h"
#include "log.h"
+#include "ly_common.h"
#include "set.h"
#include "tree.h"
#include "tree_edit.h"
diff --git a/src/set.c b/src/set.c
index f36ab5f..a34444a 100644
--- a/src/set.c
+++ b/src/set.c
@@ -12,14 +12,14 @@
* https://opensource.org/licenses/BSD-3-Clause
*/
-#include "common.h"
+#include "set.h"
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "log.h"
-#include "set.h"
+#include "ly_common.h"
LIBYANG_API_DEF LY_ERR
ly_set_new(struct ly_set **set_p)
diff --git a/src/tree_data.c b/src/tree_data.c
index 17ba9c1..722c332 100644
--- a/src/tree_data.c
+++ b/src/tree_data.c
@@ -26,7 +26,6 @@
#include <stdlib.h>
#include <string.h>
-#include "common.h"
#include "compat.h"
#include "context.h"
#include "dict.h"
@@ -35,6 +34,7 @@
#include "in.h"
#include "in_internal.h"
#include "log.h"
+#include "ly_common.h"
#include "parser_data.h"
#include "parser_internal.h"
#include "path.h"
diff --git a/src/tree_data.h b/src/tree_data.h
index 745496d..6d89d7f 100644
--- a/src/tree_data.h
+++ b/src/tree_data.h
@@ -30,8 +30,8 @@
#include <stdint.h>
#include <time.h>
-#include "config.h"
#include "log.h"
+#include "ly_config.h"
#include "tree.h"
#include "tree_schema.h"
diff --git a/src/tree_data_common.c b/src/tree_data_common.c
index 672f720..26b6016 100644
--- a/src/tree_data_common.c
+++ b/src/tree_data_common.c
@@ -22,12 +22,12 @@
#include <string.h>
#include <time.h>
-#include "common.h"
#include "compat.h"
#include "context.h"
#include "dict.h"
#include "hash_table.h"
#include "log.h"
+#include "ly_common.h"
#include "lyb.h"
#include "parser_data.h"
#include "plugins_exts.h"
diff --git a/src/tree_data_free.c b/src/tree_data_free.c
index 80a02f2..40dd046 100644
--- a/src/tree_data_free.c
+++ b/src/tree_data_free.c
@@ -15,10 +15,10 @@
#include <assert.h>
#include <stdlib.h>
-#include "common.h"
#include "dict.h"
#include "hash_table.h"
#include "log.h"
+#include "ly_common.h"
#include "plugins_exts/metadata.h"
#include "plugins_types.h"
#include "tree.h"
diff --git a/src/tree_data_hash.c b/src/tree_data_hash.c
index 7235c27..ce237b1 100644
--- a/src/tree_data_hash.c
+++ b/src/tree_data_hash.c
@@ -17,10 +17,10 @@
#include <stdlib.h>
#include <string.h>
-#include "common.h"
#include "compat.h"
#include "hash_table.h"
#include "log.h"
+#include "ly_common.h"
#include "plugins_types.h"
#include "tree.h"
#include "tree_data.h"
diff --git a/src/tree_data_new.c b/src/tree_data_new.c
index 9a257bf..a7d26db 100644
--- a/src/tree_data_new.c
+++ b/src/tree_data_new.c
@@ -24,7 +24,6 @@
#include <stdlib.h>
#include <string.h>
-#include "common.h"
#include "compat.h"
#include "context.h"
#include "dict.h"
@@ -33,6 +32,7 @@
#include "in.h"
#include "in_internal.h"
#include "log.h"
+#include "ly_common.h"
#include "parser_data.h"
#include "parser_internal.h"
#include "path.h"
diff --git a/src/tree_schema.c b/src/tree_schema.c
index df89924..488a03f 100644
--- a/src/tree_schema.c
+++ b/src/tree_schema.c
@@ -27,13 +27,13 @@
#include <sys/stat.h>
#include <unistd.h>
-#include "common.h"
#include "compat.h"
#include "context.h"
#include "dict.h"
#include "in.h"
#include "in_internal.h"
#include "log.h"
+#include "ly_common.h"
#include "parser_internal.h"
#include "parser_schema.h"
#include "path.h"
diff --git a/src/tree_schema.h b/src/tree_schema.h
index e712239..0fdf109 100644
--- a/src/tree_schema.h
+++ b/src/tree_schema.h
@@ -23,8 +23,8 @@
#include <stdint.h>
#include <stdio.h>
-#include "config.h"
#include "log.h"
+#include "ly_config.h"
#include "tree.h"
#ifdef __cplusplus
diff --git a/src/tree_schema_common.c b/src/tree_schema_common.c
index a2ab277..94e91a4 100644
--- a/src/tree_schema_common.c
+++ b/src/tree_schema_common.c
@@ -23,7 +23,6 @@
#include <string.h>
#include <time.h>
-#include "common.h"
#include "compat.h"
#include "context.h"
#include "dict.h"
@@ -31,6 +30,7 @@
#include "in.h"
#include "in_internal.h"
#include "log.h"
+#include "ly_common.h"
#include "parser_schema.h"
#include "path.h"
#include "schema_compile.h"
diff --git a/src/tree_schema_free.c b/src/tree_schema_free.c
index 9eedecf..3af495f 100644
--- a/src/tree_schema_free.c
+++ b/src/tree_schema_free.c
@@ -18,10 +18,10 @@
#include <assert.h>
#include <stdlib.h>
-#include "common.h"
#include "compat.h"
#include "dict.h"
#include "log.h"
+#include "ly_common.h"
#include "plugins_exts.h"
#include "plugins_types.h"
#include "tree.h"
diff --git a/src/tree_schema_internal.h b/src/tree_schema_internal.h
index 0a2ad3f..fecccf5 100644
--- a/src/tree_schema_internal.h
+++ b/src/tree_schema_internal.h
@@ -17,7 +17,7 @@
#include <stdint.h>
-#include "common.h"
+#include "ly_common.h"
#include "set.h"
#include "tree_schema.h"
diff --git a/src/validation.c b/src/validation.c
index 35136ad..f150784 100644
--- a/src/validation.c
+++ b/src/validation.c
@@ -22,11 +22,11 @@
#include <stdlib.h>
#include <string.h>
-#include "common.h"
#include "compat.h"
#include "diff.h"
#include "hash_table.h"
#include "log.h"
+#include "ly_common.h"
#include "parser_data.h"
#include "parser_internal.h"
#include "plugins_exts.h"
diff --git a/src/xml.c b/src/xml.c
index 2bdbdf3..f509445 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -23,9 +23,9 @@
#include <stdlib.h>
#include <string.h>
-#include "common.h"
#include "compat.h"
#include "in_internal.h"
+#include "ly_common.h"
#include "out_internal.h"
#include "tree.h"
#include "tree_schema_internal.h"
diff --git a/src/xpath.c b/src/xpath.c
index 139cd0f..a1308d5 100644
--- a/src/xpath.c
+++ b/src/xpath.c
@@ -24,11 +24,11 @@
#include <stdlib.h>
#include <string.h>
-#include "common.h"
#include "compat.h"
#include "context.h"
#include "dict.h"
#include "hash_table.h"
+#include "ly_common.h"
#include "out.h"
#include "parser_data.h"
#include "path.h"