?? string.c
字號:
/* * File : string.c * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2008, RT-Thread Development Team * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rt-thread.org/license/LICENSE * * Change Logs: * Date Author Notes * 2008-08-14 Bernard the first version */#include <rtthread.h>#if !defined (RT_USING_NEWLIB) && defined (RT_USING_MINILIBC)#include "string.h"/* there is no strcpy and strcmp implementation in RT-Thread */char *strcpy(char *dest, const char *src){ return rt_strncpy(dest, src, rt_strlen(src) + 1);}int strcmp (const char *s1, const char *s2){ while (*s1 && *s1 == *s2) s1++, s2++; return (*s1 - *s2);}#ifdef RT_USING_HEAPchar *strdup(const char *s){ size_t len = strlen(s) + 1; char *tmp = (char *)rt_malloc(len); if(!tmp) return NULL; rt_memcpy(tmp, s, len); return tmp;}#endif#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -