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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [newlib-1.17.0/] [newlib/] [libc/] [stdlib/] [btowc.c] - Rev 816

Compare with Previous | Blame | View Log

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

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.