Blame wcsmbs/wcsmbsload.h

Packit Service 82fcde
/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
Packit Service 82fcde
   This file is part of the GNU C Library.
Packit Service 82fcde
   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is free software; you can redistribute it and/or
Packit Service 82fcde
   modify it under the terms of the GNU Lesser General Public
Packit Service 82fcde
   License as published by the Free Software Foundation; either
Packit Service 82fcde
   version 2.1 of the License, or (at your option) any later version.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service 82fcde
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 82fcde
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 82fcde
   Lesser General Public License for more details.
Packit Service 82fcde
Packit Service 82fcde
   You should have received a copy of the GNU Lesser General Public
Packit Service 82fcde
   License along with the GNU C Library; if not, see
Packit Service 82fcde
   <http://www.gnu.org/licenses/>.  */
Packit Service 82fcde
Packit Service 82fcde
#ifndef _WCSMBSLOAD_H
Packit Service 82fcde
#define _WCSMBSLOAD_H	1
Packit Service 82fcde
Packit Service 82fcde
#include <locale.h>
Packit Service 82fcde
#include <wchar.h>
Packit Service 82fcde
#include <locale/localeinfo.h>
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
/* Contains pointers to the used functions in the `gconv' modules.  */
Packit Service 82fcde
struct gconv_fcts
Packit Service 82fcde
  {
Packit Service 82fcde
    struct __gconv_step *towc;
Packit Service 82fcde
    size_t towc_nsteps;
Packit Service 82fcde
    struct __gconv_step *tomb;
Packit Service 82fcde
    size_t tomb_nsteps;
Packit Service 82fcde
  };
Packit Service 82fcde
Packit Service 82fcde
/* Set of currently active conversion functions.  */
Packit Service 82fcde
extern const struct gconv_fcts __wcsmbs_gconv_fcts_c attribute_hidden;
Packit Service 82fcde
Packit Service 82fcde
/* Load conversion functions for the currently selected locale.  */
Packit Service 82fcde
extern void __wcsmbs_load_conv (struct __locale_data *new_category)
Packit Service 82fcde
     attribute_hidden;
Packit Service 82fcde
Packit Service 82fcde
/* Clone the current `__wcsmbs_load_conv' value.  */
Packit Service 82fcde
extern void __wcsmbs_clone_conv (struct gconv_fcts *copy)
Packit Service 82fcde
     attribute_hidden;
Packit Service 82fcde
Packit Service 82fcde
/* Find the conversion functions for converting to and from NAME.  */
Packit Service 82fcde
extern int __wcsmbs_named_conv (struct gconv_fcts *copy, const char *name)
Packit Service 82fcde
     attribute_hidden;
Packit Service 82fcde
Packit Service 82fcde
/* Function used for the `private.cleanup' hook.  */
Packit Service 82fcde
extern void _nl_cleanup_ctype (struct __locale_data *) attribute_hidden;
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
#include <iconv/gconv_int.h>
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
/* Load the function implementation if necessary.  */
Packit Service 82fcde
extern struct __gconv_step *__wcsmbs_getfct (const char *to, const char *from,
Packit Service 82fcde
					     size_t *nstepsp)
Packit Service 82fcde
     attribute_hidden;
Packit Service 82fcde
Packit Service 82fcde
extern const struct __locale_data _nl_C_LC_CTYPE attribute_hidden;
Packit Service 82fcde
Packit Service 82fcde
/* Check whether the LC_CTYPE locale changed since the last call.
Packit Service 82fcde
   Update the pointers appropriately.  */
Packit Service 82fcde
static inline const struct gconv_fcts *
Packit Service 82fcde
get_gconv_fcts (struct __locale_data *data)
Packit Service 82fcde
{
Packit Service 82fcde
  if (__glibc_unlikely (data->private.ctype == NULL))
Packit Service 82fcde
    {
Packit Service 82fcde
      if (__glibc_unlikely (data == &_nl_C_LC_CTYPE))
Packit Service 82fcde
	return &__wcsmbs_gconv_fcts_c;
Packit Service 82fcde
      __wcsmbs_load_conv (data);
Packit Service 82fcde
    }
Packit Service 82fcde
  return data->private.ctype;
Packit Service 82fcde
}
Packit Service 82fcde
Packit Service 82fcde
#endif	/* wcsmbsload.h */