forked from wanrenqi/PASII
49 lines
1.2 KiB
C
49 lines
1.2 KiB
C
|
/*************************************************************************************************
|
|||
|
**Filename:
|
|||
|
**Version :
|
|||
|
**Author :
|
|||
|
**Date :
|
|||
|
**Description:
|
|||
|
**
|
|||
|
*************************************************************************************************/
|
|||
|
/*********************************************************************
|
|||
|
* Include (include files)
|
|||
|
*/
|
|||
|
#include "common.h"
|
|||
|
|
|||
|
/************************************************************************************************
|
|||
|
* Function : stringLength
|
|||
|
* Param in : none
|
|||
|
* Param out: none
|
|||
|
* Return : none
|
|||
|
* Describe : <EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
int stringLength (const char *string)
|
|||
|
{
|
|||
|
const char *cptr = string;
|
|||
|
|
|||
|
while ( *cptr )
|
|||
|
++cptr;
|
|||
|
return cptr - string;
|
|||
|
}
|
|||
|
/************************************************************************************************
|
|||
|
* Function : str_cmp
|
|||
|
* Param in : none
|
|||
|
* Param out: none
|
|||
|
* Return : none
|
|||
|
* Describe : <EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
unsigned char str_cmp(unsigned char *p1,unsigned char *p2,unsigned char len)
|
|||
|
{
|
|||
|
unsigned char i=0;
|
|||
|
|
|||
|
while(i<len){
|
|||
|
if(p1[i]!=p2[i])
|
|||
|
return 0;
|
|||
|
i++;
|
|||
|
}
|
|||
|
return 1;
|
|||
|
}
|
|||
|
|
|||
|
/*************************************************************************************************/
|