Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. #include <reent.h>
  2. #include <newlib.h>
  3. #include <wchar.h>
  4. #include <stdlib.h>
  5. #include <stdio.h>
  6. #include <errno.h>
  7.  
  8. size_t
  9. mbrlen(const char *__restrict s, size_t n, mbstate_t *__restrict ps)
  10. {
  11. #ifdef _MB_CAPABLE
  12.   if (ps == NULL)
  13.     {
  14.       struct _reent *reent = _REENT;
  15.  
  16.       _REENT_CHECK_MISC(reent);
  17.       ps = &(_REENT_MBRLEN_STATE(reent));
  18.     }
  19. #endif
  20.  
  21.   return mbrtowc(NULL, s, n, ps);
  22. }
  23.