Start documenting libc.
Bug: N/A
Test: N/A
Change-Id: I17345cb72a5ffc3af1688cf5874589cfb1e1fea0
diff --git a/libc/include/strings.h b/libc/include/strings.h
index c2e0a5e..ccdac04 100644
--- a/libc/include/strings.h
+++ b/libc/include/strings.h
@@ -36,8 +36,12 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef _STRINGS_H_
-#define _STRINGS_H_
+#pragma once
+
+/**
+ * @file strings.h
+ * @brief Extra string functions.
+ */
#include <sys/types.h>
#include <sys/cdefs.h>
@@ -46,20 +50,28 @@
#include <bits/strcasecmp.h>
__BEGIN_DECLS
+
#if defined(__BIONIC_FORTIFY)
+/** Deprecated. Use memmove() instead. */
#define bcopy(b1, b2, len) (void)(__builtin___memmove_chk((b2), (b1), (len), __bos0(b2)))
+/** Deprecated. Use memset() instead. */
#define bzero(b, len) (void)(__builtin___memset_chk((b), '\0', (len), __bos0(b)))
#else
+/** Deprecated. Use memmove() instead. */
#define bcopy(b1, b2, len) (void)(__builtin_memmove((b2), (b1), (len)))
+/** Deprecated. Use memset() instead. */
#define bzero(b, len) (void)(__builtin_memset((b), '\0', (len)))
#endif
#if !defined(__i386__) || __ANDROID_API__ >= __ANDROID_API_J_MR2__
+/**
+ * [ffs(3)](http://man7.org/linux/man-pages/man3/ffs.3.html) finds the first set bit in `__i`.
+ *
+ * Returns 0 if no bit is set, or the index of the lowest set bit (counting from 1) otherwise.
+ */
int ffs(int __i) __INTRODUCED_IN_X86(18);
#endif
__END_DECLS
#include <android/legacy_strings_inlines.h>
-
-#endif