Back to index

glibc  2.9
Functions | Variables
wctomb.c File Reference
#include <stdlib.h>
#include <string.h>
#include <wchar.h>
#include <gconv.h>
#include <wcsmbs/wcsmbsload.h>

Go to the source code of this file.


int wctomb (char *s, wchar_t wchar)


mbstate_t __wctomb_state attribute_hidden

Function Documentation

int wctomb ( char *  s,
wchar_t  wchar 

Definition at line 38 of file wctomb.c.

  /* If S is NULL the function has to return null or not null
     depending on the encoding having a state depending encoding or
     not.  */
  if (s == NULL)
      const struct gconv_fcts *fcts;

      /* Get the conversion functions.  */
      fcts = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE));

      /* This is an extension in the Unix standard which does not directly
        violate ISO C.  */
      memset (&__wctomb_state, '\0', sizeof __wctomb_state);

      return fcts->tomb->__stateful;

  return __wcrtomb (s, wchar, &__wctomb_state);

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

mbstate_t __wctomb_state attribute_hidden

Definition at line 28 of file wctomb.c.