Welcome to mirror list, hosted at ThFree Co, Russian Federation.

mbrlen.c « stdlib « libc « newlib - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4319875a1383a84118bc2a99122600f96fe7cb55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <reent.h>
#include <newlib.h>
#include <wchar.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>

size_t
mbrlen(const char *s, size_t n, mbstate_t *ps)
{
#ifdef _MB_CAPABLE
  if (ps == NULL)
    {
      struct _reent *reent = _REENT;

      _REENT_CHECK_MISC(reent);
      ps = &(_REENT_MBRLEN_STATE(reent));
    }
#endif

  return mbrtowc(NULL, s, n, ps);
}