-int bcmp __P((const void *, const void *, size_t));
-int ffs __P((int));
-int locc __P((int, char *, u_int));
-u_long random __P((void));
-char *rindex __P((const char *, int));
-int scanc __P((u_int, u_char *, u_char *, int));
-int skpc __P((int, int, char *));
-char *strcat __P((char *, const char *));
-char *strcpy __P((char *, const char *));
-size_t strlen __P((const char *));
-char *strncpy __P((char *, const char *, size_t));
-long strtol __P((const char*, char **, int));
+extern int ffs(int);
+extern u_int32_t random(void);
+extern int scanc(u_int, u_char *, const u_char *, int);
+extern int skpc(int, int, char *);
+extern long strtol(const char*, char **, int);
+extern u_long strtoul(const char *, char **, int);
+extern quad_t strtoq(const char *, char **, int);
+extern u_quad_t strtouq(const char *, char **, int);
+extern char *strsep(char **, const char *);
+extern void *memchr(const void *, int, size_t);
+
+int snprintf(char *, size_t, const char *, ...) __printflike(3,4);
+
+/* sprintf() is being deprecated. Please use snprintf() instead. */
+int sprintf(char *bufp, const char *, ...) __deprecated;
+int sscanf(const char *, char const *, ...) __scanflike(2,3);
+int printf(const char *, ...) __printflike(1,2);
+
+#if KERNEL_PRIVATE
+int _consume_printf_args(int, ...);
+#endif
+
+#if CONFIG_NO_PRINTF_STRINGS
+#if KERNEL_PRIVATE
+#define printf(x, ...) _consume_printf_args( 0, ## __VA_ARGS__ )
+#else
+#define printf(x, ...) do {} while (0)
+#endif
+#endif
+
+uint32_t crc32(uint32_t crc, const void *bufp, size_t len);
+
+int copystr(const void *kfaddr, void *kdaddr, size_t len, size_t *done);
+int copyinstr(const user_addr_t uaddr, void *kaddr, size_t len, size_t *done);
+int copyoutstr(const void *kaddr, user_addr_t udaddr, size_t len, size_t *done);
+int copyin(const user_addr_t uaddr, void *kaddr, size_t len);
+int copyout(const void *kaddr, user_addr_t udaddr, size_t len);
+
+int vsscanf(const char *, char const *, va_list);
+
+extern int vprintf(const char *, va_list);
+extern int vsnprintf(char *, size_t, const char *, va_list);
+
+/* vsprintf() is being deprecated. Please use vsnprintf() instead. */
+extern int vsprintf(char *bufp, const char *, va_list) __deprecated;
+
+#ifdef KERNEL_PRIVATE
+extern void invalidate_icache(vm_offset_t, unsigned, int);
+extern void flush_dcache(vm_offset_t, unsigned, int);
+#else
+extern void invalidate_icache(vm_offset_t, unsigned, int);
+extern void flush_dcache(vm_offset_t, unsigned, int);
+#endif
+extern void invalidate_icache64(addr64_t, unsigned, int);
+extern void flush_dcache64(addr64_t, unsigned, int);
+
+
+/*
+ * assembly versions of clz... ideally we would just call
+ * __builtin_clz(num), unfortunately this one is ill defined
+ * by gcc for num=0
+ */
+static __inline__ unsigned int
+clz(unsigned int num)
+{
+ return num?__builtin_clz(num):__builtin_clz(0);
+}
+
+