Back to index

glibc  2.9
Classes | Defines | Typedefs | Functions | Variables
wchar.h File Reference
#include <features.h>
#include <stdio.h>
#include <stdarg.h>
#include <bits/wchar.h>
#include <stddef.h>

Go to the source code of this file.

Classes

struct  __mbstate_t
union  __mbstate_t.__value

Defines

#define _WCHAR_H   1
#define __need___FILE
#define __need___va_list
#define __need_size_t
#define __need_wchar_t
#define __need_NULL
#define __need_wint_t
#define _WINT_T
#define __mbstate_t_defined   1
#define WCHAR_MIN   __WCHAR_MIN
#define WCHAR_MAX   __WCHAR_MAX
#define WEOF   (0xffffffffu)

Typedefs

typedef unsigned int wint_t

Functions

__END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD wchar_t * 
wcscpy (wchar_t *__restrict __dest, __const wchar_t *__restrict __src) __THROW
wchar_t * wcsncpy (wchar_t *__restrict __dest, __const wchar_t *__restrict __src, size_t __n) __THROW
wchar_t * wcscat (wchar_t *__restrict __dest, __const wchar_t *__restrict __src) __THROW
wchar_t * wcsncat (wchar_t *__restrict __dest, __const wchar_t *__restrict __src, size_t __n) __THROW
int wcscmp (__const wchar_t *__s1, __const wchar_t *__s2) __THROW __attribute_pure__
int wcsncmp (__const wchar_t *__s1, __const wchar_t *__s2, size_t __n) __THROW __attribute_pure__
__END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD int 
wcscoll (__const wchar_t *__s1, __const wchar_t *__s2) __THROW
size_t wcsxfrm (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2, size_t __n) __THROW
__END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD wchar_t * 
wcschr (__const wchar_t *__wcs, wchar_t __wc) __THROW __attribute_pure__
wchar_t * wcsrchr (__const wchar_t *__wcs, wchar_t __wc) __THROW __attribute_pure__
__END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD size_t 
wcscspn (__const wchar_t *__wcs, __const wchar_t *__reject) __THROW __attribute_pure__
size_t wcsspn (__const wchar_t *__wcs, __const wchar_t *__accept) __THROW __attribute_pure__
wchar_t * wcspbrk (__const wchar_t *__wcs, __const wchar_t *__accept) __THROW __attribute_pure__
wchar_t * wcsstr (__const wchar_t *__haystack, __const wchar_t *__needle) __THROW __attribute_pure__
wchar_t * wcstok (wchar_t *__restrict __s, __const wchar_t *__restrict __delim, wchar_t **__restrict __ptr) __THROW
size_t wcslen (__const wchar_t *__s) __THROW __attribute_pure__
__END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD wchar_t * 
wmemchr (__const wchar_t *__s, wchar_t __c, size_t __n) __THROW __attribute_pure__
int wmemcmp (__const wchar_t *__restrict __s1, __const wchar_t *__restrict __s2, size_t __n) __THROW __attribute_pure__
wchar_t * wmemcpy (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2, size_t __n) __THROW
wchar_t * wmemmove (wchar_t *__s1, __const wchar_t *__s2, size_t __n) __THROW
wchar_t * wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW
__END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD wint_t 
btowc (int __c) __THROW
int wctob (wint_t __c) __THROW
int mbsinit (__const mbstate_t *__ps) __THROW __attribute_pure__
size_t mbrtowc (wchar_t *__restrict __pwc, __const char *__restrict __s, size_t __n, mbstate_t *__p) __THROW
size_t wcrtomb (char *__restrict __s, wchar_t __wc, mbstate_t *__restrict __ps) __THROW
size_t __mbrlen (__const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps) __THROW
size_t mbrlen (__const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps) __THROW
__END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD size_t 
mbsrtowcs (wchar_t *__restrict __dst, __const char **__restrict __src, size_t __len, mbstate_t *__restrict __ps) __THROW
size_t wcsrtombs (char *__restrict __dst, __const wchar_t **__restrict __src, size_t __len, mbstate_t *__restrict __ps) __THROW
__END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD double 
wcstod (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW
__END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD long int 
wcstol (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW
unsigned long int wcstoul (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) __THROW
__END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD wint_t 
fgetwc (__FILE *__stream)
wint_t getwc (__FILE *__stream)
wint_t getwchar (void)
wint_t fputwc (wchar_t __wc, __FILE *__stream)
wint_t putwc (wchar_t __wc, __FILE *__stream)
wint_t putwchar (wchar_t __wc)
wchar_t * fgetws (wchar_t *__restrict __ws, int __n, __FILE *__restrict __stream)
int fputws (__const wchar_t *__restrict __ws, __FILE *__restrict __stream)
wint_t ungetwc (wint_t __wc, __FILE *__stream)
__END_NAMESPACE_STD
__BEGIN_NAMESPACE_C99 size_t 
wcsftime (wchar_t *__restrict __s, size_t __maxsize, __const wchar_t *__restrict __format, __const struct tm *__restrict __tp) __THROW

Variables

__BEGIN_NAMESPACE_C99 typedef
__mbstate_t 
mbstate_t

Class Documentation

struct __mbstate_t

Definition at line 78 of file wchar.h.

Class Members
int __count
union __mbstate_t __value
union __mbstate_t.__value

Definition at line 81 of file wchar.h.

Class Members
wint_t __wch
char __wchb

Define Documentation

#define __mbstate_t_defined   1

Definition at line 76 of file wchar.h.

#define __need___FILE

Definition at line 33 of file wchar.h.

Definition at line 39 of file wchar.h.

#define __need_NULL

Definition at line 47 of file wchar.h.

#define __need_size_t

Definition at line 45 of file wchar.h.

#define __need_wchar_t

Definition at line 46 of file wchar.h.

#define __need_wint_t

Definition at line 51 of file wchar.h.

#define _WCHAR_H   1

Definition at line 27 of file wchar.h.

#define _WINT_T

Definition at line 61 of file wchar.h.

#define WCHAR_MAX   __WCHAR_MAX

Definition at line 110 of file wchar.h.

#define WCHAR_MIN   __WCHAR_MIN

Definition at line 109 of file wchar.h.

#define WEOF   (0xffffffffu)

Definition at line 114 of file wchar.h.


Typedef Documentation

typedef unsigned int wint_t

Definition at line 62 of file wchar.h.


Function Documentation

size_t __mbrlen ( __const char *__restrict  __s,
size_t  __n,
mbstate_t *__restrict  __ps 
)

Here is the caller graph for this function:

Here is the caller graph for this function:

wchar_t* fgetws ( wchar_t *__restrict  __ws,
int  __n,
__FILE *__restrict  __stream 
)

Definition at line 383 of file wchar2.h.

{
  if (__bos (__s) != (size_t) -1)
    {
      if (!__builtin_constant_p (__n) || __n <= 0)
       return __fgetws_chk (__s, __bos (__s) / sizeof (wchar_t),
                          __n, __stream);

      if ((size_t) __n > __bos (__s) / sizeof (wchar_t))
       return __fgetws_chk_warn (__s, __bos (__s) / sizeof (wchar_t),
                              __n, __stream);
    }
  return __fgetws_alias (__s, __n, __stream);
}

Here is the call graph for this function:

wint_t fputwc ( wchar_t  __wc,
__FILE *  __stream 
)
int fputws ( __const wchar_t *__restrict  __ws,
__FILE *__restrict  __stream 
)
wint_t getwc ( __FILE *  __stream)

Here is the caller graph for this function:

wint_t getwchar ( void  )

Definition at line 34 of file getwchar.c.

{
  wint_t result;
  _IO_acquire_lock (_IO_stdin);
  result = _IO_getwc_unlocked (_IO_stdin);
  _IO_release_lock (_IO_stdin);
  return result;
}
size_t mbrlen ( __const char *__restrict  __s,
size_t  __n,
mbstate_t *__restrict  __ps 
)

Here is the caller graph for this function:

size_t mbrtowc ( wchar_t *__restrict  __pwc,
__const char *__restrict  __s,
size_t  __n,
mbstate_t __p 
)

Here is the caller graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

wint_t putwc ( wchar_t  __wc,
__FILE *  __stream 
)
wint_t putwchar ( wchar_t  __wc)

Definition at line 23 of file putwchar.c.

{
  wint_t result;
  _IO_acquire_lock (_IO_stdout);
  result = _IO_putwc_unlocked (wc, _IO_stdout);
  _IO_release_lock (_IO_stdout);
  return result;
}
wint_t ungetwc ( wint_t  __wc,
__FILE *  __stream 
)
size_t wcrtomb ( char *__restrict  __s,
wchar_t  __wc,
mbstate_t *__restrict  __ps 
)

Here is the caller graph for this function:

wchar_t* wcscat ( wchar_t *__restrict  __dest,
__const wchar_t *__restrict  __src 
)

Here is the caller graph for this function:

__END_NAMESPACE_STD __BEGIN_NAMESPACE_STD wchar_t* wcschr ( __const wchar_t *  __wcs,
wchar_t  __wc 
)

Here is the caller graph for this function:

int wcscmp ( __const wchar_t *  __s1,
__const wchar_t *  __s2 
)

Here is the caller graph for this function:

__END_NAMESPACE_STD __BEGIN_NAMESPACE_STD int wcscoll ( __const wchar_t *  __s1,
__const wchar_t *  __s2 
)

Here is the caller graph for this function:

__END_NAMESPACE_STD __BEGIN_NAMESPACE_STD wchar_t* wcscpy ( wchar_t *__restrict  __dest,
__const wchar_t *__restrict  __src 
)

Here is the caller graph for this function:

__END_NAMESPACE_STD __BEGIN_NAMESPACE_STD size_t wcscspn ( __const wchar_t *  __wcs,
__const wchar_t *  __reject 
)

Here is the caller graph for this function:

__END_NAMESPACE_STD __BEGIN_NAMESPACE_C99 size_t wcsftime ( wchar_t *__restrict  __s,
size_t  __maxsize,
__const wchar_t *__restrict  __format,
__const struct tm *__restrict  __tp 
)
size_t wcslen ( __const wchar_t *  __s)

Here is the caller graph for this function:

wchar_t* wcsncat ( wchar_t *__restrict  __dest,
__const wchar_t *__restrict  __src,
size_t  __n 
)

Here is the caller graph for this function:

int wcsncmp ( __const wchar_t *  __s1,
__const wchar_t *  __s2,
size_t  __n 
)

Here is the caller graph for this function:

wchar_t* wcsncpy ( wchar_t *__restrict  __dest,
__const wchar_t *__restrict  __src,
size_t  __n 
)

Here is the caller graph for this function:

wchar_t* wcspbrk ( __const wchar_t *  __wcs,
__const wchar_t *  __accept 
)

Here is the caller graph for this function:

wchar_t* wcsrchr ( __const wchar_t *  __wcs,
wchar_t  __wc 
)
size_t wcsrtombs ( char *__restrict  __dst,
__const wchar_t **__restrict  __src,
size_t  __len,
mbstate_t *__restrict  __ps 
)

Here is the caller graph for this function:

size_t wcsspn ( __const wchar_t *  __wcs,
__const wchar_t *  __accept 
)

Here is the caller graph for this function:

wchar_t* wcsstr ( __const wchar_t *  __haystack,
__const wchar_t *  __needle 
)

Here is the caller graph for this function:

__END_NAMESPACE_STD __BEGIN_NAMESPACE_STD double wcstod ( __const wchar_t *__restrict  __nptr,
wchar_t **__restrict  __endptr 
)

Here is the caller graph for this function:

wchar_t* wcstok ( wchar_t *__restrict  __s,
__const wchar_t *__restrict  __delim,
wchar_t **__restrict  __ptr 
)

Here is the caller graph for this function:

__END_NAMESPACE_STD __BEGIN_NAMESPACE_STD long int wcstol ( __const wchar_t *__restrict  __nptr,
wchar_t **__restrict  __endptr,
int  __base 
)
unsigned long int wcstoul ( __const wchar_t *__restrict  __nptr,
wchar_t **__restrict  __endptr,
int  __base 
)
size_t wcsxfrm ( wchar_t *__restrict  __s1,
__const wchar_t *__restrict  __s2,
size_t  __n 
)

Here is the caller graph for this function:

int wctob ( wint_t  __c)

Definition at line 31 of file wctob.c.

{
  unsigned char buf[MB_LEN_MAX];
  struct __gconv_step_data data;
  wchar_t inbuf[1];
  wchar_t *inptr = inbuf;
  size_t dummy;
  int status;
  const struct gconv_fcts *fcts;

  if (c == WEOF)
    return EOF;

  /* We know that only ASCII compatible encodings are used for the
     locale and that the wide character encoding is ISO 10646.  */
  if (c >= L'\0' && c <= L'\x7f')
    return (int) c;

  /* Tell where we want the result.  */
  data.__outbuf = buf;
  data.__outbufend = buf + MB_LEN_MAX;
  data.__invocation_counter = 0;
  data.__internal_use = 1;
  data.__flags = __GCONV_IS_LAST;
  data.__statep = &data.__state;
  data.__trans = NULL;

  /* Make sure we start in the initial state.  */
  memset (&data.__state, '\0', sizeof (mbstate_t));

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

  /* Create the input string.  */
  inbuf[0] = c;

  const unsigned char *argptr = (const unsigned char *) inptr;
  __gconv_fct fct = fcts->tomb->__fct;
#ifdef PTR_DEMANGLE
  if (fcts->tomb->__shlib_handle != NULL)
    PTR_DEMANGLE (fct);
#endif
  status = DL_CALL_FCT (fct,
                     (fcts->tomb, &data, &argptr,
                      argptr + sizeof (inbuf[0]), NULL, &dummy, 0, 1));

  /* The conversion failed or the output is too long.  */
  if ((status != __GCONV_OK && status != __GCONV_FULL_OUTPUT
       && status != __GCONV_EMPTY_INPUT)
      || data.__outbuf != (unsigned char *) (buf + 1))
    return EOF;

  return buf[0];
}

Here is the call graph for this function:

Here is the caller graph for this function:

__END_NAMESPACE_STD __BEGIN_NAMESPACE_STD wchar_t* wmemchr ( __const wchar_t *  __s,
wchar_t  __c,
size_t  __n 
)

Here is the caller graph for this function:

int wmemcmp ( __const wchar_t *__restrict  __s1,
__const wchar_t *__restrict  __s2,
size_t  __n 
)

Here is the caller graph for this function:

wchar_t* wmemcpy ( wchar_t *__restrict  __s1,
__const wchar_t *__restrict  __s2,
size_t  __n 
)

Here is the caller graph for this function:

wchar_t* wmemmove ( wchar_t *  __s1,
__const wchar_t *  __s2,
size_t  __n 
)

Here is the caller graph for this function:

wchar_t* wmemset ( wchar_t *  __s,
wchar_t  __c,
size_t  __n 
)

Definition at line 24 of file wmemset.c.

{
  register wchar_t *wp = s;

  while (n >= 4)
    {
      wp[0] = c;
      wp[1] = c;
      wp[2] = c;
      wp[3] = c;
      wp += 4;
      n -= 4;
    }

  if (n > 0)
    {
      wp[0] = c;

      if (n > 1)
       {
         wp[1] = c;

         if (n > 2)
           wp[2] = c;
       }
    }

  return s;
}

Here is the caller graph for this function:


Variable Documentation

Definition at line 101 of file wchar.h.