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
This commit is contained in:
David 'Digit' Turner
2012-01-13 13:26:50 +01:00
parent 68d03fdbd8
commit 11f3d5a431
4 changed files with 149 additions and 2 deletions

View File

@@ -50,6 +50,16 @@ extern struct __res_state *__res_state(void);
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 @@ extern void _resolv_flush_cache_for_default_iface();
/* 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_ */