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/] [wctob.c] - Blame information for rev 326

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

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

powered by: WebSVN 2.1.0

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