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] - Rev 148

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

#include <reent.h>
#include <wchar.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
 
int
wctob (wint_t c)
{
  mbstate_t mbs;
  int retval = 0;
  unsigned char pwc;
 
  /* Put mbs in initial state. */
  memset (&mbs, '\0', sizeof (mbs));
 
  _REENT_CHECK_MISC(_REENT);
 
  retval = _wctomb_r (_REENT, &pwc, c, &mbs);
 
  if (c == EOF || retval != 1)
    return WEOF;
  else
    return (int)pwc;
}
 

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

powered by: WebSVN 2.1.0

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