diff options
author | Ulrich Drepper <drepper@redhat.com> | 2000-01-26 06:55:29 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2000-01-26 06:55:29 +0000 |
commit | 4e2e99997a2890df8ab5d7b86646a2b067eb8723 (patch) | |
tree | 30c16b2a54b2c166e03f136f4bd99a13db915032 /wcsmbs | |
parent | c36897fb5bef95d586557f960840ee0c614adabf (diff) | |
download | glibc-4e2e99997a2890df8ab5d7b86646a2b067eb8723.tar.gz glibc-4e2e99997a2890df8ab5d7b86646a2b067eb8723.tar.xz glibc-4e2e99997a2890df8ab5d7b86646a2b067eb8723.zip |
Update.
* libio/fileops.c (_IO_new_file_open): Recognize ,ccs= in mode string and load appropriate conversions. * libio/iofwide.c (__libio_codecvt): Renamed from libio_codecvt and made global. * libio/libioP.h: Declare __libio_codecvt. * manual/stdio.texi: Document ,ccs= option for fopen. * wcsmbs/wcsmbsload.c (__wcsmbs_named_conv): New function. * wcsmbs/wcsmbsload.h (__wcsmbs_named_conv): Declare. * libio/iofclose.c: Free conversion data if stream was wide-oriented. * sysdeps/unix/sysv/linux/i386/Dist: Add sys/io.h.
Diffstat (limited to 'wcsmbs')
-rw-r--r-- | wcsmbs/wcsmbsload.c | 28 | ||||
-rw-r--r-- | wcsmbs/wcsmbsload.h | 6 |
2 files changed, 32 insertions, 2 deletions
diff --git a/wcsmbs/wcsmbsload.c b/wcsmbs/wcsmbsload.c index 26633e0de2..719bd1b5cf 100644 --- a/wcsmbs/wcsmbsload.c +++ b/wcsmbs/wcsmbsload.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. @@ -250,3 +250,29 @@ __wcsmbs_clone_conv (struct gconv_fcts *copy) __libc_lock_unlock (lock); } + + +/* Clone the current conversion function set. */ +int +internal_function +__wcsmbs_named_conv (struct gconv_fcts *copy, const char *name) +{ + copy->towc = getfct ("INTERNAL", name); + if (copy->towc != NULL) + { + copy->tomb = getfct (name, "INTERNAL"); + if (copy->tomb == NULL) + __gconv_close_transform (copy->towc, 1); + } + + if (copy->towc == NULL || copy->tomb == NULL) + return 1; + + /* Now increment the usage counters. */ + if (copy->towc->__shlib_handle != NULL) + ++copy->towc->__counter; + if (copy->tomb->__shlib_handle != NULL) + ++copy->tomb->__counter; + + return 0; +} diff --git a/wcsmbs/wcsmbsload.h b/wcsmbs/wcsmbsload.h index a3652d22ac..a4d35053d2 100644 --- a/wcsmbs/wcsmbsload.h +++ b/wcsmbs/wcsmbsload.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. @@ -45,6 +45,10 @@ extern void __wcsmbs_load_conv (const struct locale_data *new_category) extern void __wcsmbs_clone_conv (struct gconv_fcts *copy) internal_function; +/* Find the conversion functions for converting to and from NAME. */ +extern int __wcsmbs_named_conv (struct gconv_fcts *copy, const char *name) + internal_function; + /* Check whether the LC_CTYPE locale changed since the last call. Update the pointers appropriately. */ |