|
struct nsLocalMailCopyState
{
char *m_dataBuffer;
}
nsLocalMailCopyState *mCopyState;
char *start = mCopyState->m_dataBuffer + 1;
char *endBuffer = mCopyState->m_dataBuffer + mCopyState->m_leftOver + 1;
char *end = PL_strnpbrk(start, "\r\n", endBuffer - start);
如:
start指向下面字符串
Received: from hechengjin (114.255.44.132) by Bjmail2.kingsoft.cn
(192.168.12.58) with Microsoft SMTP Server (TLS) id 8.3.83.0; Fri, 9 Oct 2015
则end指向下面字符串
\r\n
(192.168.12.58) with Microsoft SMTP Server (TLS) id 8.3.83.0; Fri, 9 Oct 2015
PR_IMPLEMENT(char *)
PL_strnpbrk(const char *s, const char *list, PRUint32 max)
{
const char *p;
if( ((const char *)0 == s) || ((const char *)0 == list) ) return (char *)0;
for( ; max && *s; s++, max-- )
for( p = list; *p; p++ )
if( *s == *p )
return (char *)s;
return (char *)0;
}
|
|