【发布时间】:2014-01-24 02:42:22
【问题描述】:
libc_hidden_builtin_def (strspn)
我在glibc-2.18/string/strspn.c 中找到了上面的代码。
有人可以解释这是什么意思。这对其余代码很重要吗?
这里是文件strspn.c的内容:
#include <string.h>
#undef strspn
/* Return the length of the maximum initial segment
of S which contains only characters in ACCEPT. */
size_t strspn (s, accept) const char *s; const char *accept; {
const char *p;
const char *a;
size_t count = 0;
for (p = s; *p != '\0'; ++p) {
for (a = accept; *a != '\0'; ++a) {
if (*p == *a)
break;
if (*a == '\0')
return count;
else
++count;
}
}
return count;
}
libc_hidden_builtin_def (strspn)
【问题讨论】: