libfdt: Export accessors for header fields

This patch adds exported accessor macros for the various flat device
tree header fields to libfdt.h.  This necessitates moving some of the
byte-swapping functions.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

diff --git a/libfdt_env.h b/libfdt_env.h
index a9b196f..59f2536 100644
--- a/libfdt_env.h
+++ b/libfdt_env.h
@@ -1,3 +1,6 @@
+#ifndef _LIBFDT_ENV_H
+#define _LIBFDT_ENV_H
+
 #include <stddef.h>
 #include <stdint.h>
 #include <string.h>
@@ -16,4 +19,4 @@
 #define cpu_to_fdt64(x)		(bswap_64((x)))
 #endif
 
-#include "libfdt.h"
+#endif /* _LIBFDT_ENV_H */