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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.17.0/] [newlib/] [libc/] [stdlib/] [wctob.c] - Blame information for rev 179

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

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

powered by: WebSVN 2.1.0

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