libyang MAINTENANCE headers includes cleanup

iwyu_tool.py used
diff --git a/src/context.c b/src/context.c
index e8d0eb3..8d074f5 100644
--- a/src/context.c
+++ b/src/context.c
@@ -23,6 +23,7 @@
 
 #include <errno.h>
 #include <pthread.h>
+#include <stdarg.h>
 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/src/path.h b/src/path.h
index 9074191..55b18da 100644
--- a/src/path.h
+++ b/src/path.h
@@ -23,9 +23,10 @@
 #include "tree_data.h"
 
 struct ly_ctx;
-struct lys_module;
-struct lysc_node;
 struct lys_glob_unres;
+struct lys_module;
+struct lysc_ext_instance;
+struct lysc_node;
 struct lyxp_expr;
 
 enum ly_path_pred_type {
diff --git a/src/plugins.c b/src/plugins.c
index bb59839..762ad42 100644
--- a/src/plugins.c
+++ b/src/plugins.c
@@ -24,13 +24,16 @@
 #include <limits.h>
 #include <pthread.h>
 #include <stddef.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
-#include <sys/types.h>
 
 #include "config.h"
 #include "common.h"
 #include "plugins_exts.h"
 #include "plugins_types.h"
+#include "set.h"
 
 /*
  * internal type plugins records
diff --git a/src/plugins_exts.c b/src/plugins_exts.c
index 1cac204..e084c98 100644
--- a/src/plugins_exts.c
+++ b/src/plugins_exts.c
@@ -17,7 +17,6 @@
 #include "plugins_exts_print.h"
 
 #include <stdint.h>
-#include <string.h>
 
 extern struct lyplg_ext metadata_plugin; /* plugins_exts_metadata.c */
 extern struct lyplg_ext nacm_plugin;     /* plugins_exts_nacm.c */
@@ -25,7 +24,6 @@
 
 /* internal libyang headers - do not make them accessible to the extension plugins in plugins_exts_*.c */
 #include "common.h"
-#include "plugins_internal.h"
 #include "printer_internal.h"
 #include "schema_compile.h"
 
diff --git a/src/plugins_exts.h b/src/plugins_exts.h
index 9cdd39b..2da8b4d 100644
--- a/src/plugins_exts.h
+++ b/src/plugins_exts.h
@@ -26,6 +26,9 @@
 struct ly_ctx;
 struct lyd_node;
 struct lysc_ctx;
+struct lysc_ext_instance;
+struct lysc_ext_substmt;
+struct lysp_ext_instance;
 struct lyspr_ctx;
 
 #ifdef __cplusplus
diff --git a/src/plugins_types.c b/src/plugins_types.c
index 12e41fe..561ac42 100644
--- a/src/plugins_types.c
+++ b/src/plugins_types.c
@@ -17,7 +17,6 @@
 
 #include "plugins_types.h"
 
-#include <assert.h>
 #include <ctype.h>
 #include <inttypes.h>
 #include <stdio.h>
@@ -34,7 +33,6 @@
 #include "tree.h"
 #include "tree_data.h"
 #include "tree_data_internal.h"
-#include "tree_edit.h"
 #include "tree_schema.h"
 #include "tree_schema_internal.h"
 #include "xml.h"
diff --git a/src/plugins_types.h b/src/plugins_types.h
index fc1d03b..9ef55c9 100644
--- a/src/plugins_types.h
+++ b/src/plugins_types.h
@@ -37,11 +37,9 @@
 struct lysc_ident;
 struct lysc_node;
 struct lysc_pattern;
-struct lysc_prefix;
 struct lysc_range;
 struct lysc_type;
 struct lysc_type_leafref;
-struct lysp_module;
 
 /**
  * @page howtoPluginsTypes Type Plugins
diff --git a/src/plugins_types_bits.c b/src/plugins_types_bits.c
index ca08d64..675b744 100644
--- a/src/plugins_types_bits.c
+++ b/src/plugins_types_bits.c
@@ -16,7 +16,6 @@
 
 #include "plugins_types.h"
 
-#include <assert.h>
 #include <ctype.h>
 #include <stdint.h>
 #include <stdio.h>
diff --git a/src/schema_compile.c b/src/schema_compile.c
index 19e8a3a..ab376ec 100644
--- a/src/schema_compile.c
+++ b/src/schema_compile.c
@@ -31,6 +31,7 @@
 #include "log.h"
 #include "parser_schema.h"
 #include "path.h"
+#include "plugins.h"
 #include "plugins_exts.h"
 #include "plugins_exts_compile.h"
 #include "plugins_internal.h"
diff --git a/src/schema_compile_node.c b/src/schema_compile_node.c
index bf2f209..9221ab4 100644
--- a/src/schema_compile_node.c
+++ b/src/schema_compile_node.c
@@ -29,7 +29,7 @@
 #include "compat.h"
 #include "dict.h"
 #include "log.h"
-#include "plugins_exts.h"
+#include "plugins.h"
 #include "plugins_exts_compile.h"
 #include "plugins_internal.h"
 #include "plugins_types.h"
diff --git a/src/tree_data.c b/src/tree_data.c
index fbbeed0..199ae17 100644
--- a/src/tree_data.c
+++ b/src/tree_data.c
@@ -37,7 +37,7 @@
 #include "parser_data.h"
 #include "parser_internal.h"
 #include "path.h"
-#include "plugins_exts.h"
+#include "plugins.h"
 #include "plugins_exts_metadata.h"
 #include "plugins_internal.h"
 #include "plugins_types.h"
diff --git a/src/tree_data_helpers.c b/src/tree_data_helpers.c
index 7272725..10374ee 100644
--- a/src/tree_data_helpers.c
+++ b/src/tree_data_helpers.c
@@ -26,7 +26,6 @@
 #include "log.h"
 #include "lyb.h"
 #include "parser_data.h"
-#include "plugins_types.h"
 #include "printer_data.h"
 #include "set.h"
 #include "tree.h"
@@ -34,6 +33,7 @@
 #include "tree_data_internal.h"
 #include "tree_edit.h"
 #include "tree_schema.h"
+#include "tree_schema_internal.h"
 #include "validation.h"
 #include "xml.h"
 
diff --git a/src/tree_schema.c b/src/tree_schema.c
index c145c04..0840b7e 100644
--- a/src/tree_schema.c
+++ b/src/tree_schema.c
@@ -38,7 +38,6 @@
 #include "parser_internal.h"
 #include "parser_schema.h"
 #include "path.h"
-#include "plugins_exts.h"
 #include "schema_compile.h"
 #include "schema_features.h"
 #include "set.h"
diff --git a/tests/plugins/simple.c b/tests/plugins/simple.c
index 2b37ca2..18c289e 100644
--- a/tests/plugins/simple.c
+++ b/tests/plugins/simple.c
@@ -12,9 +12,7 @@
  *     https://opensource.org/licenses/BSD-3-Clause
  */
 
-#include <stdint.h>
 #include <stdlib.h>
-#include <string.h>
 
 #include "libyang.h"
 #include "plugins_exts.h"
diff --git a/tests/plugins/validate.c b/tests/plugins/validate.c
index 374f856..4f34e53 100644
--- a/tests/plugins/validate.c
+++ b/tests/plugins/validate.c
@@ -12,9 +12,7 @@
  *     https://opensource.org/licenses/BSD-3-Clause
  */
 
-#include <stdint.h>
 #include <stdlib.h>
-#include <string.h>
 
 #include "libyang.h"
 #include "plugins_exts.h"