11bd4fe43Sopenharmony_ci/** 21bd4fe43Sopenharmony_ci* @file hi_stdlib.h 31bd4fe43Sopenharmony_ci* 41bd4fe43Sopenharmony_ci* Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. 51bd4fe43Sopenharmony_ci* Licensed under the Apache License, Version 2.0 (the "License"); 61bd4fe43Sopenharmony_ci* you may not use this file except in compliance with the License. 71bd4fe43Sopenharmony_ci* You may obtain a copy of the License at 81bd4fe43Sopenharmony_ci* 91bd4fe43Sopenharmony_ci* http://www.apache.org/licenses/LICENSE-2.0 101bd4fe43Sopenharmony_ci* 111bd4fe43Sopenharmony_ci* Unless required by applicable law or agreed to in writing, software 121bd4fe43Sopenharmony_ci* distributed under the License is distributed on an "AS IS" BASIS, 131bd4fe43Sopenharmony_ci* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 141bd4fe43Sopenharmony_ci* See the License for the specific language governing permissions and 151bd4fe43Sopenharmony_ci* limitations under the License. 161bd4fe43Sopenharmony_ci* 171bd4fe43Sopenharmony_ci* Description: A parameter is added to the security C APIs based on the standard C interface, that is, the upper 181bd4fe43Sopenharmony_ci* limit of the write operation address space to prevent out-of-bounds write. 191bd4fe43Sopenharmony_ciCNcomment:安全C接口主要是基于标准C接口增加了一个参数,即写操作地址空间上限,从而防止写越界。CNend \n 201bd4fe43Sopenharmony_ci* Create: 2019-12-18 211bd4fe43Sopenharmony_ci*/ 221bd4fe43Sopenharmony_ci 231bd4fe43Sopenharmony_ci/** 241bd4fe43Sopenharmony_ci * @defgroup iot_secure_c Secure C library APIs 251bd4fe43Sopenharmony_ci * @ingroup iot_secure 261bd4fe43Sopenharmony_ci */ 271bd4fe43Sopenharmony_ci 281bd4fe43Sopenharmony_ci#ifndef __HI_STDLIB_H__ 291bd4fe43Sopenharmony_ci#define __HI_STDLIB_H__ 301bd4fe43Sopenharmony_ci#include <hi_types_base.h> 311bd4fe43Sopenharmony_ci 321bd4fe43Sopenharmony_ciHI_START_HEADER 331bd4fe43Sopenharmony_ci 341bd4fe43Sopenharmony_ci#ifndef EOK 351bd4fe43Sopenharmony_ci#define EOK 0 361bd4fe43Sopenharmony_ci#endif 371bd4fe43Sopenharmony_ci 381bd4fe43Sopenharmony_ci#ifndef errno_t 391bd4fe43Sopenharmony_citypedef int errno_t; 401bd4fe43Sopenharmony_ci#endif 411bd4fe43Sopenharmony_ci 421bd4fe43Sopenharmony_ci#ifndef size_t 431bd4fe43Sopenharmony_citypedef unsigned int size_t; 441bd4fe43Sopenharmony_ci#endif 451bd4fe43Sopenharmony_ci 461bd4fe43Sopenharmony_ci/** 471bd4fe43Sopenharmony_ci* @ingroup iot_secure_c 481bd4fe43Sopenharmony_ci* @brief Copies the source string to the destination buffer.CNcomment:复制源字符串到目的缓冲区。CNend 491bd4fe43Sopenharmony_ci* 501bd4fe43Sopenharmony_ci* @par 描述: Copies the source string to the destination buffer. 511bd4fe43Sopenharmony_ciCNcomment:复制源字符串到目的缓冲区。CNend 521bd4fe43Sopenharmony_ci* 531bd4fe43Sopenharmony_ci* @attention None 541bd4fe43Sopenharmony_ci* 551bd4fe43Sopenharmony_ci* @param dest [OUT] type #char *, Destination buffer.CNcomment:目的缓冲区。CNend 561bd4fe43Sopenharmony_ci* @param dest_max [IN] type #size_t, Size of the destination buffer.CNcomment:目的缓冲区大小。CNend 571bd4fe43Sopenharmony_ci* @param src [IN] type #const #char *, Source buffer.CNcomment:源缓冲区。CNend 581bd4fe43Sopenharmony_ci* 591bd4fe43Sopenharmony_ci* @retval #EOK Success 601bd4fe43Sopenharmony_ci* @retval #Other Failure 611bd4fe43Sopenharmony_ci* 621bd4fe43Sopenharmony_ci* @par 依赖: 631bd4fe43Sopenharmony_ci* @li hi_stdlib.h: This file declares the APIs.CNcomment:该接口声明所在的头文件。CNend 641bd4fe43Sopenharmony_ci* @see None 651bd4fe43Sopenharmony_ci*/ 661bd4fe43Sopenharmony_ciextern errno_t strcpy_s(char *dest, size_t dest_max, const char *src); 671bd4fe43Sopenharmony_ci 681bd4fe43Sopenharmony_ci/** 691bd4fe43Sopenharmony_ci* @ingroup iot_secure_c 701bd4fe43Sopenharmony_ci* @brief Copies the source string of a specified length to the destination buffer. 711bd4fe43Sopenharmony_ciCNcomment:复制指定长度源字符串到目的缓冲区。CNend 721bd4fe43Sopenharmony_ci* 731bd4fe43Sopenharmony_ci* @par 描述:Copies the source string of a specified length to the destination buffer. 741bd4fe43Sopenharmony_ciCNcomment:复制指定长度源字符串到目的缓冲区。CNend 751bd4fe43Sopenharmony_ci* @attention None 761bd4fe43Sopenharmony_ci* 771bd4fe43Sopenharmony_ci* @param dest [IN] type #char *, Destination buffer.CNcomment:目的缓冲区。CNend 781bd4fe43Sopenharmony_ci* @param dest_max [IN] type #size_t, Size of the destination buffer.CNcomment:目的缓冲区大小。CNend 791bd4fe43Sopenharmony_ci* @param src [IN] type #const #char *, Source buffer.CNcomment:源缓冲区。CNend 801bd4fe43Sopenharmony_ci* @param count [IN] type #size_t, Number of characters copied from the source buffer. 811bd4fe43Sopenharmony_ciCNcomment:从源缓冲区中复制的字符数。CNend 821bd4fe43Sopenharmony_ci* 831bd4fe43Sopenharmony_ci* @retval #EOK Success 841bd4fe43Sopenharmony_ci* @retval #Other Failure 851bd4fe43Sopenharmony_ci* 861bd4fe43Sopenharmony_ci* @par 依赖: 871bd4fe43Sopenharmony_ci* @li hi_stdlib.h: This file declares the APIs.CNcomment:该接口声明所在的头文件。CNend 881bd4fe43Sopenharmony_ci* @see None 891bd4fe43Sopenharmony_ci*/ 901bd4fe43Sopenharmony_ciextern errno_t strncpy_s(char *dest, size_t dest_max, const char *src, size_t count); 911bd4fe43Sopenharmony_ci 921bd4fe43Sopenharmony_ci/** 931bd4fe43Sopenharmony_ci* @ingroup iot_secure_c 941bd4fe43Sopenharmony_ci* @brief Concatenates the source string to the end of the destination string. 951bd4fe43Sopenharmony_ciCNcomment:将源字符串连接到目的字符串后面CNend 961bd4fe43Sopenharmony_ci* 971bd4fe43Sopenharmony_ci* @par 描述:Concatenates the source string to the end of the destination string. 981bd4fe43Sopenharmony_ciCNcomment:将源字符串连接到目的字符串后面。CNend 991bd4fe43Sopenharmony_ci* @attention None 1001bd4fe43Sopenharmony_ci* 1011bd4fe43Sopenharmony_ci* @param dest [IN] type #char *, Destination buffer.CNcomment:目的缓冲区。CNend 1021bd4fe43Sopenharmony_ci* @param dest_max [IN] type #size_t, Size of the destination buffer.CNcomment:目的缓冲区大小。CNend 1031bd4fe43Sopenharmony_ci* @param src [IN] type #const #char *, Source buffer.CNcomment:源缓冲区。CNend 1041bd4fe43Sopenharmony_ci* 1051bd4fe43Sopenharmony_ci* @retval #EOK Success 1061bd4fe43Sopenharmony_ci* @retval #Other Failure 1071bd4fe43Sopenharmony_ci* 1081bd4fe43Sopenharmony_ci* @par 依赖: 1091bd4fe43Sopenharmony_ci* @li hi_stdlib.h: This file declares the APIs.CNcomment:该接口声明所在的头文件。CNend 1101bd4fe43Sopenharmony_ci* @see None 1111bd4fe43Sopenharmony_ci*/ 1121bd4fe43Sopenharmony_ciextern errno_t strcat_s(char *dest, size_t dest_max, const char *src); 1131bd4fe43Sopenharmony_ci 1141bd4fe43Sopenharmony_ci/** 1151bd4fe43Sopenharmony_ci* @ingroup iot_secure_c 1161bd4fe43Sopenharmony_ci* @brief Concatenates the source string of a specified length to the end of the destination string. 1171bd4fe43Sopenharmony_ciCNcomment:将指定长度的源字符串连接到目的字符串后面。CNend 1181bd4fe43Sopenharmony_ci* 1191bd4fe43Sopenharmony_ci* @par 描述: Concatenates the source string of a specified length to the end of the destination string. 1201bd4fe43Sopenharmony_ciCNcomment:将指定长度的源字符串连接到目的字符串后面。CNend 1211bd4fe43Sopenharmony_ci* @attention None 1221bd4fe43Sopenharmony_ci* 1231bd4fe43Sopenharmony_ci* @param dest [IN] type #char *, Destination buffer.CNcomment:目的缓冲区。CNend 1241bd4fe43Sopenharmony_ci* @param dest_max [IN] type #size_t, Size of the destination buffer.CNcomment:目的缓冲区大小。CNend 1251bd4fe43Sopenharmony_ci* @param src [IN] type #const #char *, Source buffer.CNcomment:源缓冲区。CNend 1261bd4fe43Sopenharmony_ci* @param count [IN] type #size_t, Number of characters copied from the source buffer. 1271bd4fe43Sopenharmony_ciCNcomment:从源缓冲区连接的字符数。CNend 1281bd4fe43Sopenharmony_ci* 1291bd4fe43Sopenharmony_ci* @retval #EOK Success 1301bd4fe43Sopenharmony_ci* @retval #Other Failure 1311bd4fe43Sopenharmony_ci* 1321bd4fe43Sopenharmony_ci* @par 依赖: 1331bd4fe43Sopenharmony_ci* @li hi_stdlib.h: This file declares the APIs.CNcomment:该接口声明所在的头文件。CNend 1341bd4fe43Sopenharmony_ci* @see None 1351bd4fe43Sopenharmony_ci*/ 1361bd4fe43Sopenharmony_ciextern errno_t strncat_s(char *dest, size_t dest_max, const char *src, size_t count); 1371bd4fe43Sopenharmony_ci 1381bd4fe43Sopenharmony_ci/** 1391bd4fe43Sopenharmony_ci* @ingroup iot_secure_c 1401bd4fe43Sopenharmony_ci* @brief Copies the data from the source buffer to the destination buffer. 1411bd4fe43Sopenharmony_ciCNcomment:复制源缓冲区的数据到目的缓冲区。CNend 1421bd4fe43Sopenharmony_ci* 1431bd4fe43Sopenharmony_ci* @par 描述: Copies the data from the source buffer to the destination buffer. 1441bd4fe43Sopenharmony_ciCNcomment:复制源缓冲区的数据到目的缓冲区。CNend 1451bd4fe43Sopenharmony_ci* @attention None 1461bd4fe43Sopenharmony_ci* 1471bd4fe43Sopenharmony_ci* @param dest [IN] type #char *, Destination buffer.CNcomment:目的缓冲区。CNend 1481bd4fe43Sopenharmony_ci* @param dest_max [IN] type #size_t, Size of the destination buffer.CNcomment:目的缓冲区大小。CNend 1491bd4fe43Sopenharmony_ci* @param src [IN] type #const #char *, Source buffer.CNcomment:源缓冲区。CNend 1501bd4fe43Sopenharmony_ci* @param count [IN] type #size_t, Number of characters copied from the source buffer. 1511bd4fe43Sopenharmony_ciCNcomment:从源缓冲区中复制的字符数。CNend 1521bd4fe43Sopenharmony_ci* 1531bd4fe43Sopenharmony_ci* @retval #EOK Success 1541bd4fe43Sopenharmony_ci* @retval #Other Failure 1551bd4fe43Sopenharmony_ci* 1561bd4fe43Sopenharmony_ci* @par 依赖: 1571bd4fe43Sopenharmony_ci* @li hi_stdlib.h: This file declares the APIs.CNcomment:该接口声明所在的头文件。CNend 1581bd4fe43Sopenharmony_ci* @see None 1591bd4fe43Sopenharmony_ci*/ 1601bd4fe43Sopenharmony_ciextern errno_t memcpy_s(void *dest, size_t dest_max, const void *src, size_t count); 1611bd4fe43Sopenharmony_ci 1621bd4fe43Sopenharmony_ci/** 1631bd4fe43Sopenharmony_ci* @ingroup iot_secure_c 1641bd4fe43Sopenharmony_ci* @brief Sets the size of the destination buffer to a specific value. 1651bd4fe43Sopenharmony_ciCNcomment:设置目的缓冲区为特定值。CNend 1661bd4fe43Sopenharmony_ci* 1671bd4fe43Sopenharmony_ci* @par 描述: Sets the size of the destination buffer to a specific value. 1681bd4fe43Sopenharmony_ciCNcomment:设置目的缓冲区为特定值。CNend 1691bd4fe43Sopenharmony_ci* @attention None 1701bd4fe43Sopenharmony_ci* 1711bd4fe43Sopenharmony_ci* @param dest [IN] type #char *, Destination buffer.CNcomment:目的缓冲区。CNend 1721bd4fe43Sopenharmony_ci* @param dest_max [IN] type #size_t, Size of the destination buffer.CNcomment:目的缓冲区大小。CNend 1731bd4fe43Sopenharmony_ci* @param c [IN] type #const #char *, Source buffer.CNcomment:特定值。CNend 1741bd4fe43Sopenharmony_ci* @param count [IN] type #size_t, Number of characters copied from the source buffer. 1751bd4fe43Sopenharmony_ciCNcomment:设置为特定值的字符数。CNend 1761bd4fe43Sopenharmony_ci* 1771bd4fe43Sopenharmony_ci* @retval #EOK Success 1781bd4fe43Sopenharmony_ci* @retval #Other Failure 1791bd4fe43Sopenharmony_ci* 1801bd4fe43Sopenharmony_ci* @par 依赖: 1811bd4fe43Sopenharmony_ci* @li hi_stdlib.h: This file declares the APIs.CNcomment:该接口声明所在的头文件。CNend 1821bd4fe43Sopenharmony_ci* @see None 1831bd4fe43Sopenharmony_ci*/ 1841bd4fe43Sopenharmony_ciextern errno_t memset_s(void *dest, size_t dest_max, int c, size_t count); 1851bd4fe43Sopenharmony_ci 1861bd4fe43Sopenharmony_ci/** 1871bd4fe43Sopenharmony_ci* @ingroup iot_secure_c 1881bd4fe43Sopenharmony_ci* @brief Moves the data from the source buffer to the destination buffer. 1891bd4fe43Sopenharmony_ciCNcomment:移动源缓冲区的数据到目的缓冲区。CNend 1901bd4fe43Sopenharmony_ci* 1911bd4fe43Sopenharmony_ci* @par 描述:Moves the data from the source buffer to the destination buffer. 1921bd4fe43Sopenharmony_ciCNcomment:移动源缓冲区的数据到目的缓冲区。CNend 1931bd4fe43Sopenharmony_ci* @attention None 1941bd4fe43Sopenharmony_ci* 1951bd4fe43Sopenharmony_ci* @param dest [IN] type #char *, Destination buffer.CNcomment:目的缓冲区。CNend 1961bd4fe43Sopenharmony_ci* @param dest_max [IN] type #size_t, Size of the destination buffer.CNcomment:目的缓冲区大小。CNend 1971bd4fe43Sopenharmony_ci* @param src [IN] type #const #char *, Source buffer.CNcomment:源缓冲区。CNend 1981bd4fe43Sopenharmony_ci* @param count [IN] type #size_t, Number of characters copied from the source buffer. 1991bd4fe43Sopenharmony_ciCNcomment:从源缓冲区中移动的字符数。CNend 2001bd4fe43Sopenharmony_ci* 2011bd4fe43Sopenharmony_ci* @retval #EOK Success 2021bd4fe43Sopenharmony_ci* @retval #Other Failure 2031bd4fe43Sopenharmony_ci* 2041bd4fe43Sopenharmony_ci* @par 依赖: 2051bd4fe43Sopenharmony_ci* @li hi_stdlib.h: This file declares the APIs.CNcomment:该接口声明所在的头文件。CNend 2061bd4fe43Sopenharmony_ci* @see None 2071bd4fe43Sopenharmony_ci*/ 2081bd4fe43Sopenharmony_ciextern errno_t memmove_s(void *dest, size_t dest_max, const void *src, size_t count); 2091bd4fe43Sopenharmony_ci 2101bd4fe43Sopenharmony_ci/** 2111bd4fe43Sopenharmony_ci* @ingroup iot_secure_c 2121bd4fe43Sopenharmony_ci* @brief Splits a string into substrings according to the specified separators. 2131bd4fe43Sopenharmony_ciCNcomment:将字符串按照指定的分隔符分割成子字符串。CNend 2141bd4fe43Sopenharmony_ci* 2151bd4fe43Sopenharmony_ci* @par 描述: Splits a string into substrings according to the specified separators. 2161bd4fe43Sopenharmony_ciCNcomment:将字符串按照指定的分隔符分割成子字符串。CNend 2171bd4fe43Sopenharmony_ci* @attention None 2181bd4fe43Sopenharmony_ci* 2191bd4fe43Sopenharmony_ci* @param token [IN] type #char *。 String to be split.CNcomment:要分割的字符串。CNend 2201bd4fe43Sopenharmony_ci* @param delimit [IN] type #const char *。 String separator.CNcomment:字符串分隔符。CNend 2211bd4fe43Sopenharmony_ci* @param context [IN] type #char** 。Position information after a call to HI_strtok_s is saved. 2221bd4fe43Sopenharmony_ciCNcomment:保存调用HI_strtok_s后的位置信息。CNend 2231bd4fe43Sopenharmony_ci* 2241bd4fe43Sopenharmony_ci* @retval #char* Point to the next token. CNcomment:指向在token中的下一个token。CNend 2251bd4fe43Sopenharmony_ci* @retval #HI_NULL A specified substring is not found or an error occurs. 2261bd4fe43Sopenharmony_ciCNcomment:没有找到指定的子字符串或者发生错误。CNend 2271bd4fe43Sopenharmony_ci* 2281bd4fe43Sopenharmony_ci* @par 依赖: 2291bd4fe43Sopenharmony_ci* @li hi_stdlib.h: This file declares the APIs.CNcomment:该接口声明所在的头文件。CNend 2301bd4fe43Sopenharmony_ci* @see None 2311bd4fe43Sopenharmony_ci*/ 2321bd4fe43Sopenharmony_ciextern char *strtok_s(char *token, const char *delimit, char **context); 2331bd4fe43Sopenharmony_ci 2341bd4fe43Sopenharmony_ci/** 2351bd4fe43Sopenharmony_ci* @ingroup iot_secure_c 2361bd4fe43Sopenharmony_ci* @brief Formats the data and outputs it to the destination buffer. 2371bd4fe43Sopenharmony_ciCNcomment:将数据格式化输出到目的缓冲区。CNend 2381bd4fe43Sopenharmony_ci* 2391bd4fe43Sopenharmony_ci* @par 描述: Formats the data and outputs it to the destination buffer. 2401bd4fe43Sopenharmony_ciCNcomment:将数据格式化输出到目的缓冲区。CNend 2411bd4fe43Sopenharmony_ci* @attention None 2421bd4fe43Sopenharmony_ci* 2431bd4fe43Sopenharmony_ci* @param dest [OUT] type #char *。 Destination buffer.CNcomment:目的缓冲区。CNend 2441bd4fe43Sopenharmony_ci* @param dest_max [IN] type #size_t。 Size of the destination buffer.CNcomment:目的缓冲区大小。CNend 2451bd4fe43Sopenharmony_ci* @param format [IN] type #const #char *。 Formatting control string.CNcomment:格式化控制字符串。CNend 2461bd4fe43Sopenharmony_ci* @param ... [IN] Optional parameter CNcomment:可选参数。CNend 2471bd4fe43Sopenharmony_ci* 2481bd4fe43Sopenharmony_ci* @retval #>=0 Return the number of bytes stored in dest, not counting the terminating null character. 2491bd4fe43Sopenharmony_ciCNcomment:返回存储在dest的字节数,不包括结束符CNend 2501bd4fe43Sopenharmony_ci* @retval #-1 Failure 2511bd4fe43Sopenharmony_ci* 2521bd4fe43Sopenharmony_ci* @par 依赖: 2531bd4fe43Sopenharmony_ci* @li hi_stdlib.h: This file declares the APIs.CNcomment:该接口声明所在的头文件。CNend 2541bd4fe43Sopenharmony_ci* @see None 2551bd4fe43Sopenharmony_ci*/ 2561bd4fe43Sopenharmony_ciextern int sprintf_s(char *dest, size_t dest_max, const char *format, ...); 2571bd4fe43Sopenharmony_ci 2581bd4fe43Sopenharmony_ci/** 2591bd4fe43Sopenharmony_ci* @ingroup iot_secure_c 2601bd4fe43Sopenharmony_ci* @brief Formats the data according to a specified length and outputs the data to the destination buffer. 2611bd4fe43Sopenharmony_ciCNcomment:将数据按照指定长度格式化输出到目的缓冲区。CNend 2621bd4fe43Sopenharmony_ci* 2631bd4fe43Sopenharmony_ci* @par 描述: Formats the data according to a specified length and outputs the data to the destination buffer. 2641bd4fe43Sopenharmony_ciCNcomment:将数据按照指定长度格式化输出到目的缓冲区。CNend 2651bd4fe43Sopenharmony_ci* @attention None 2661bd4fe43Sopenharmony_ci* 2671bd4fe43Sopenharmony_ci* @param dest [OUT] type #char *。 Destination buffer.CNcomment:目的缓冲区。CNend 2681bd4fe43Sopenharmony_ci* @param dest_max [IN] type #size_t。 Size of the destination buffer.CNcomment:目的缓冲区大小。CNend 2691bd4fe43Sopenharmony_ci* @param count [IN] type #size_t。 Number of formatted characters to be output to the destination buffer. 2701bd4fe43Sopenharmony_ciCNcomment:要输出到目的缓冲区的格式化字符个数。CNend 2711bd4fe43Sopenharmony_ci* @param format [IN] type #const #char *。 Formatting control string.CNcomment:格式化控制字符串。CNend 2721bd4fe43Sopenharmony_ci* @param ... [IN] Optional parameter CNcomment:可选参数。CNend 2731bd4fe43Sopenharmony_ci* 2741bd4fe43Sopenharmony_ci* @retval #>=0 Return the number of bytes stored in dest, not counting the terminating null character. 2751bd4fe43Sopenharmony_ciCNcomment:返回存储在dest的字节数,不包括结束符CNend 2761bd4fe43Sopenharmony_ci* @retval #-1 Failure 2771bd4fe43Sopenharmony_ci* 2781bd4fe43Sopenharmony_ci* @par 依赖: 2791bd4fe43Sopenharmony_ci* @li hi_stdlib.h: This file declares the APIs.CNcomment:该接口声明所在的头文件。CNend 2801bd4fe43Sopenharmony_ci* @see None 2811bd4fe43Sopenharmony_ci*/ 2821bd4fe43Sopenharmony_ciextern int snprintf_s(char *dest, size_t dest_max, size_t count, const char *format, ...); 2831bd4fe43Sopenharmony_ci 2841bd4fe43Sopenharmony_ciextern int memcmp(const void *str1, const void *str2, size_t n); 2851bd4fe43Sopenharmony_ciextern size_t strlen(const char *src); 2861bd4fe43Sopenharmony_ciextern int strcmp(const char *str1, const char *str2); 2871bd4fe43Sopenharmony_ciextern int strncmp(const char *str1, const char *str2, size_t n); 2881bd4fe43Sopenharmony_ci 2891bd4fe43Sopenharmony_ci#if defined(HAVE_PCLINT_CHECK) 2901bd4fe43Sopenharmony_ci#define UT_CONST const 2911bd4fe43Sopenharmony_ci#else 2921bd4fe43Sopenharmony_ci#define UT_CONST 2931bd4fe43Sopenharmony_ci#endif 2941bd4fe43Sopenharmony_ci 2951bd4fe43Sopenharmony_ciextern unsigned long strtoul(const char *nptr, char **endptr, int base); 2961bd4fe43Sopenharmony_ciextern UT_CONST char *strstr(const char *str1, const char *str2); 2971bd4fe43Sopenharmony_ciextern UT_CONST char *strchr(const char *s, int c); 2981bd4fe43Sopenharmony_ciextern char *strcpy(char* dest, const char *src); 2991bd4fe43Sopenharmony_ciextern char* strsep(char** __s_ptr, const char* __delimiter); 3001bd4fe43Sopenharmony_ciextern long strtol(const char *nptr, char **endptr, int base); 3011bd4fe43Sopenharmony_ci 3021bd4fe43Sopenharmony_ciextern int atoi (const char *s); 3031bd4fe43Sopenharmony_ci 3041bd4fe43Sopenharmony_ciextern void *memset(void *s, int ch, size_t n); 3051bd4fe43Sopenharmony_ciextern void* memmove(void* dst, const void* src, size_t n); 3061bd4fe43Sopenharmony_ciextern void* memcpy(void* dst, const void* src, size_t n); 3071bd4fe43Sopenharmony_ci 3081bd4fe43Sopenharmony_ci 3091bd4fe43Sopenharmony_ciHI_END_HEADER 3101bd4fe43Sopenharmony_ci#endif /* __HI_STDLIB_H__ */ 3111bd4fe43Sopenharmony_ci 312