headers MAINTENANCE headers/include cleanup

- add missing extern "C" in some of the public headers for use in C++
- includes cleanup and fix ordering
diff --git a/src/printer.h b/src/printer.h
index f50a7a1..4c15f7f 100644
--- a/src/printer.h
+++ b/src/printer.h
@@ -20,6 +20,10 @@
 
 #include "log.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * @brief Printer output structure specifying where the data are printed.
  */
@@ -218,4 +222,8 @@
  */
 void ly_out_free(struct ly_out *out, void (*clb_arg_destructor)(void *arg), int destroy);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* LY_PRINTER_H_ */