Back to index

glibc  2.9
Functions
wcsspn.c File Reference
#include <wchar.h>

Go to the source code of this file.

Functions

size_t wcsspn (wchar_t *wcs, const wchar_t *accept) const

Function Documentation

size_t wcsspn ( wchar_t *  wcs,
const wchar_t *  accept 
) const

Definition at line 26 of file wcsspn.c.

{
  register const wchar_t *p;
  register const wchar_t *a;
  register size_t count = 0;

  for (p = wcs; *p != L'\0'; ++p)
    {
      for (a = accept; *a != L'\0'; ++a)
       if (*p == *a)
         break;
      if (*a == L'\0')
       return count;
      else
       ++count;
    }

  return count;
}