OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [newlib/] [libc/] [stdlib/] [btowc.c] - Blame information for rev 297

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
#include <wchar.h>
2
#include <stdlib.h>
3
#include <stdio.h>
4
#include <reent.h>
5
#include <string.h>
6
#include "local.h"
7
 
8
wint_t
9
btowc (int c)
10
{
11
  mbstate_t mbs;
12
  int retval = 0;
13
  wchar_t pwc;
14
  unsigned char b;
15
 
16
  b = (unsigned char)c;
17
 
18
  /* Put mbs in initial state. */
19
  memset (&mbs, '\0', sizeof (mbs));
20
 
21
  _REENT_CHECK_MISC(_REENT);
22
 
23
  retval = __mbtowc (_REENT, &pwc, &b, 1, __locale_charset (), &mbs);
24
 
25
  if (c == EOF || retval != 1)
26
    return WEOF;
27
  else
28
    return (wint_t)pwc;
29
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.