.\" -*- coding: UTF-8 -*- .\" Copyright (c) Bruno Haible .\" .\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA) .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as .\" published by the Free Software Foundation; either version 2 of .\" the License, or (at your option) any later version. .\" %%%LICENSE_END .\" .\" References consulted: .\" GNU glibc-2 source code and manual .\" Dinkumware C library reference http://www.dinkumware.com/ .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html .\" ISO/IEC 9899:1999 .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH WCRTOMB 3 "6 Marzo 2019" GNU "Manual del Programador de Linux" .SH NOMBRE wcrtomb \- convierte una carácter ancho a un secuencia multibyte .SH SINOPSIS .nf \fB#include \fP .PP \fBsize_t wcrtomb(char *\fP\fIs\fP\fB, wchar_t \fP\fIwc\fP\fB, mbstate_t *\fP\fIps\fP\fB);\fP .fi .SH DESCRIPCIÓN The main case for this function is when \fIs\fP is not NULL and \fIwc\fP is not a null wide character (L\(aq\e0\(aq). In this case, the \fBwcrtomb\fP() function converts the wide character \fIwc\fP to its multibyte representation and stores it at the beginning of the character array pointed to by \fIs\fP. It updates the shift state \fI*ps\fP, and returns the length of said multibyte representation, that is, the number of bytes written at \fIs\fP. .PP A different case is when \fIs\fP is not NULL, but \fIwc\fP is a null wide character (L\(aq\e0\(aq). In this case, the \fBwcrtomb\fP() function stores at the character array pointed to by \fIs\fP the shift sequence needed to bring \fI*ps\fP back to the initial state, followed by a \(aq\e0\(aq byte. It updates the shift state \fI*ps\fP (i.e., brings it into the initial state), and returns the length of the shift sequence plus one, that is, the number of bytes written at \fIs\fP. .PP Un tercer caso es cuando \fIs\fP es NULL. En este caso \fIwc\fP se ignora, y la función devuelve efectivamente .PP wcrtomb(buf, L\(aq\e0\(aq, ps) .PP donde \fIbuf\fP es un buffer anónimo interno. .PP In all of the above cases, if \fIps\fP is NULL, a static anonymous state known only to the \fBwcrtomb\fP() function is used instead. .SH "VALOR DEVUELTO" La función \fBwcrtomb\fP() devuelve el número de bytes que han sido o serían escritos en el array de bytes \fIs\fP. Si \fIwc\fP no se puede representar como un secuencia multibyte (de acuerdo a la localización actual), devuelve \fI(size_t)\ \-1\fP y \fIerrno\fP se pone con el valor \fBEILSEQ\fP. .SH ATRIBUTOS Para obtener una explicación de los términos usados en esta sección, véase \fBattributes\fP(7). .TS allbox; lb lb lbw26 l l l. Interfaz Atributo Valor T{ \fBwcrtomb\fP() T} Seguridad del hilo MT\-Unsafe race:wcrtomb/!ps .TE .sp 1 .SH "CONFORME A" POSIX.1\-2001, POSIX.1\-2008, C99. .SH NOTAS El comportamiento de \fBwcrtomb\fP() depende de la categoría \fBLC_CTYPE\fP de la localización actual. .PP Pasar NULL como valor de \fIps\fP no es seguro en un entorno multihilos. .SH "VÉASE TAMBIÉN" \fBmbsinit\fP(3), \fBwcsrtombs\fP(3) .SH COLOFÓN Esta página es parte de la versión 5.10 del proyecto Linux \fIman\-pages\fP. Puede encontrar una descripción del proyecto, información sobre cómo informar errores y la última versión de esta página en \%https://www.kernel.org/doc/man\-pages/. .SH TRADUCCIÓN La traducción al español de esta página del manual fue creada por Pedro Pablo Fábrega y Juan Piernas . Esta traducción es documentación libre; lea la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3 .UE o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD. Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a .MT debian-l10n-spanish@lists.debian.org>. .ME .