libc: Copy private C library declarations to private/

This patch is the first in a series that aims at cleaning up the
public C library headers (which end up being distributed with the NDK).

<resolv.h> and <time.h> contain declarations that should not be public.
They are used by other parts of the platform, but NDK applications should
not use or rely on them.

So copy them to private <bionic_time.h> and <resolv_iface.h> headers
and use a guard macro to avoid conflicts when both headers are included
at the same time.

The idea is that we're going to fix the other platform modules to
include these private headers. After this is done, we will remove the
duplicate definitions from <resolv.h> and <time.h>

Change-Id: I121c11936951c98ca7165e811126ed8a4a3a394d
diff --git a/libc/include/resolv.h b/libc/include/resolv.h
index bb21c23..5463ce6 100644
--- a/libc/include/resolv.h
+++ b/libc/include/resolv.h
@@ -50,6 +50,16 @@
 extern int   b64_ntop(u_char const *, size_t, char *, size_t);
 extern int   b64_pton(char const *, u_char *, size_t);
 
+
+/* The following declarations should *not* be part of the public C library
+ * headers, and are also in bionic/libc/private/resolv_iface.h
+ *
+ * Use a guard macro to prevent duplication until we modify system/netd
+ * to use the proper header.
+ */
+#ifndef _BIONIC_RESOLV_IFACE_FUNCTIONS_DECLARED
+#define _BIONIC_RESOLV_IFACE_FUNCTIONS_DECLARED
+
 /* Set name of default interface */
 extern void _resolv_set_default_iface(const char* ifname);
 
@@ -65,6 +75,8 @@
 /* flush the cache associated with a certain interface */
 extern void _resolv_flush_cache_for_iface(const char* ifname);
 
+#endif /* _BIONIC_RESOLV_IFACE_FUNCTIONS_DECLARED */
+
 __END_DECLS
 
 #endif /* _RESOLV_H_ */
diff --git a/libc/include/time.h b/libc/include/time.h
index 4ad4f7b..011d161 100644
--- a/libc/include/time.h
+++ b/libc/include/time.h
@@ -79,7 +79,17 @@
 extern char*       strptime(const char *buf, const char *fmt, struct tm *tm);
 extern size_t      strftime(char *s, size_t max, const char *format, const struct tm *tm);
 
-/* ANDROID-BEGIN */
+/* The following declarations should not be part of the C library's public
+ * headers. They are duplicated under bionic/libc/private/bionic_time.h and
+ * will be removed from here when we modify system/libcutils to use the
+ * proper header instead.
+ *
+ * Use a guard macro to avoid compilation error when both headers are
+ * included.
+ */
+#ifndef _BIONIC_STRFTIME_TZ_DECLARED
+#define _BIONIC_STRFTIME_TZ_DECLARED
+
 struct strftime_locale {
     const char *  mon[12];
     const char *  month[12];
@@ -95,7 +105,8 @@
 };
 
 extern size_t      strftime_tz(char *s, size_t max, const char *format, const struct tm *tm, const struct strftime_locale*  lc);
-/* ANDROID-END */
+
+#endif /* _BIONIC_STRFTIME_TZ_DECLARED */
 
 extern char *ctime(const time_t *timep);
 extern char *ctime_r(const time_t *timep, char *buf);