?? str.c
字號:
/*
filename : str.c
version : 1.0.1 release
author : eagle
web : www.embseek.com
*/
#include "str.h"
u16 es_strlen(u8 * str){
u16 ret=0;
while(*str!=0x00){
ret++;
str++;
}
return ret;
}
u8 es_strcmp(u8 * str1,u8 *str2){
u8 ret=1;
u8 i;
if(*str1==0||*str1==0&&*str1!=*str2) return 0;
for(i=0;i<20;i++){
if(*str1!=*str2){
ret=0;
}
if(*str1==0||*str2==0){
return ret;
}
str1++;
str2++;
}
return ret;
}
void es_strcpy(u8 *str,u8 *cpyto,u16 cpytolen){
u16 i=0;
while(1){
if(i<cpytolen&&*str!=0x00){
*cpyto=*str;
cpyto++;
str++;
*cpyto=0x00;
}else return;
i++;
if(*str==0x00){
return;
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -