mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
libs/libc: Breakdown LIBC_BUILD_STRING into specific string operations macro.
Provide a way to only customize specific string operations, such as for memcpy with the DMA capability by ROM. Signed-off-by: yangdongdong <yangdongdong@xiaomi.com>
This commit is contained in:
@@ -46,7 +46,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_LIBC_ARCH_MEMCHR) && defined(LIBC_BUILD_STRING)
|
||||
#if !defined(CONFIG_LIBC_ARCH_MEMCHR) && defined(LIBC_BUILD_MEMCHR)
|
||||
#undef memchr /* See mm/README.txt */
|
||||
FAR void *memchr(FAR const void *s, int c, size_t n)
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_LIBC_ARCH_MEMCMP) && defined(LIBC_BUILD_STRING)
|
||||
#if !defined(CONFIG_LIBC_ARCH_MEMCMP) && defined(LIBC_BUILD_MEMCMP)
|
||||
#undef memcmp /* See mm/README.txt */
|
||||
no_builtin("memcmp")
|
||||
int memcmp(FAR const void *s1, FAR const void *s2, size_t n)
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
* Name: memcpy
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_LIBC_ARCH_MEMCPY) && defined(LIBC_BUILD_STRING)
|
||||
#if !defined(CONFIG_LIBC_ARCH_MEMCPY) && defined(LIBC_BUILD_MEMCPY)
|
||||
#undef memcpy /* See mm/README.txt */
|
||||
no_builtin("memcpy")
|
||||
FAR void *memcpy(FAR void *dest, FAR const void *src, size_t n)
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_LIBC_ARCH_MEMMOVE) && defined(LIBC_BUILD_STRING)
|
||||
#if !defined(CONFIG_LIBC_ARCH_MEMMOVE) && defined(LIBC_BUILD_MEMMOVE)
|
||||
#undef memmove /* See mm/README.txt */
|
||||
no_builtin("memmove")
|
||||
FAR void *memmove(FAR void *dest, FAR const void *src, size_t count)
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_LIBC_ARCH_MEMSET) && defined(LIBC_BUILD_STRING)
|
||||
#if !defined(CONFIG_LIBC_ARCH_MEMSET) && defined(LIBC_BUILD_MEMSET)
|
||||
#undef memset /* See mm/README.txt */
|
||||
no_builtin("memset")
|
||||
FAR void *memset(FAR void *s, int c, size_t n)
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRCASECMP) && defined(LIBC_BUILD_STRING)
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRCASECMP) && defined(LIBC_BUILD_STRCASECMP)
|
||||
#undef strcasecmp /* See mm/README.txt */
|
||||
int strcasecmp(FAR const char *cs, FAR const char *ct)
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRCAT) && defined(LIBC_BUILD_STRING)
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRCAT) && defined(LIBC_BUILD_STRCAT)
|
||||
#undef strcat /* See mm/README.txt */
|
||||
FAR char *strcat(FAR char *dest, FAR const char *src)
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRCHR) && defined(LIBC_BUILD_STRING)
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRCHR) && defined(LIBC_BUILD_STRCHR)
|
||||
#undef strchr /* See mm/README.txt */
|
||||
FAR char *strchr(FAR const char *s, int c)
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRCHRNUL) && defined(LIBC_BUILD_STRING)
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRCHRNUL) && defined(LIBC_BUILD_STRCHRNUL)
|
||||
#undef strchrnul /* See mm/README.txt */
|
||||
FAR char *strchrnul(FAR const char *s, int c)
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRCMP) && defined(LIBC_BUILD_STRING)
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRCMP) && defined(LIBC_BUILD_STRCMP)
|
||||
#undef strcmp /* See mm/README.txt */
|
||||
int strcmp(FAR const char *cs, FAR const char *ct)
|
||||
{
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRCPY) && defined(LIBC_BUILD_STRING)
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRCPY) && defined(LIBC_BUILD_STRCPY)
|
||||
#undef strcpy /* See mm/README.txt */
|
||||
FAR char *strcpy(FAR char *dest, FAR const char *src)
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRLCAT) && defined(LIBC_BUILD_STRING)
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRLCAT) && defined(LIBC_BUILD_STRLCAT)
|
||||
#undef strlcat /* See mm/README.txt */
|
||||
size_t strlcat(FAR char *dst, FAR const char *src, size_t dsize)
|
||||
{
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRLCPY) && defined(LIBC_BUILD_STRING)
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRLCPY) && defined(LIBC_BUILD_STRLCPY)
|
||||
#undef strlcpy /* See mm/README.txt */
|
||||
size_t strlcpy(FAR char *dst, FAR const char *src, size_t dsize)
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRLEN) && defined(LIBC_BUILD_STRING)
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRLEN) && defined(LIBC_BUILD_STRLEN)
|
||||
#undef strlen /* See mm/README.txt */
|
||||
size_t strlen(FAR const char *s)
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRNCASECMP) && defined(LIBC_BUILD_STRING)
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRNCASECMP) && defined(LIBC_BUILD_STRNCASECMP)
|
||||
#undef strncasecmp /* See mm/README.txt */
|
||||
int strncasecmp(FAR const char *cs, FAR const char *ct, size_t nb)
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRNCAT) && defined(LIBC_BUILD_STRING)
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRNCAT) && defined(LIBC_BUILD_STRNCAT)
|
||||
#undef strncat /* See mm/README.txt */
|
||||
FAR char *strncat(FAR char *dest, FAR const char *src, size_t n)
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRNCMP) && defined(LIBC_BUILD_STRING)
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRNCMP) && defined(LIBC_BUILD_STRNCMP)
|
||||
#undef strncmp /* See mm/README.txt */
|
||||
int strncmp(FAR const char *cs, FAR const char *ct, size_t nb)
|
||||
{
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRNCPY) && defined(LIBC_BUILD_STRING)
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRNCPY) && defined(LIBC_BUILD_STRNCPY)
|
||||
#undef strncpy /* See mm/README.txt */
|
||||
FAR char *strncpy(FAR char *dest, FAR const char *src, size_t n)
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRNLEN) && defined(LIBC_BUILD_STRING)
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRNLEN) && defined(LIBC_BUILD_STRNLEN)
|
||||
#undef strnlen /* See mm/README.txt */
|
||||
size_t strnlen(FAR const char *s, size_t maxlen)
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
* occurrence of the character c in the string s.
|
||||
*/
|
||||
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRRCHR) && defined(LIBC_BUILD_STRING)
|
||||
#if !defined(CONFIG_LIBC_ARCH_STRRCHR) && defined(LIBC_BUILD_STRRCHR)
|
||||
#undef strrchr /* See mm/README.txt */
|
||||
FAR char *strrchr(FAR const char *s, int c)
|
||||
{
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
#include "libc.h"
|
||||
|
||||
#if !defined(CONFIG_LIBC_ARCH_MEMCPY) && defined(LIBC_BUILD_STRING)
|
||||
#if !defined(CONFIG_LIBC_ARCH_MEMCPY) && defined(LIBC_BUILD_MEMCPY)
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
||||
Reference in New Issue
Block a user