.\" -*- coding: UTF-8 -*- '\" t .\" Copyright (c) Bruno Haible .\" .\" SPDX-License-Identifier: GPL-2.0-or-later .\" .\" 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 wprintf 3 "5 Febrero 2023" "Páginas de manual de Linux 6.03" .SH NOMBRE wprintf, fwprintf, swprintf, vwprintf, vfwprintf, vswprintf \- conversión con formato de la salida de caracteres anchos .SH BIBLIOTECA Biblioteca Estándar C (\fIlibc\fP, \fI\-lc\fP) .SH SINOPSIS .nf \fB#include \fP \fB#include \fP .PP \fBint wprintf(const wchar_t *restrict \fP\fIformat\fP\fB, ...);\fP \fBint fwprintf(FILE *restrict \fP\fIstream\fP\fB,\fP \fB const wchar_t *restrict \fP\fIformat\fP\fB, ...);\fP \fBint swprintf(wchar_t \fP\fIwcs\fP\fB[restrict .\fP\fImaxlen\fP\fB], size_t \fP\fImaxlen\fP\fB,\fP \fB const wchar_t *restrict \fP\fIformat\fP\fB, ...);\fP .PP \fBint vwprintf(const wchar_t *restrict \fP\fIformat\fP\fB, va_list \fP\fIargs\fP\fB);\fP \fBint vfwprintf(FILE *restrict \fP\fIstream\fP\fB,\fP \fB const wchar_t *restrict \fP\fIformat\fP\fB, va_list \fP\fIargs\fP\fB);\fP \fBint vswprintf(wchar_t \fP\fIwcs\fP\fB[restrict .\fP\fImaxlen\fP\fB], size_t \fP\fImaxlen\fP\fB,\fP \fB const wchar_t *restrict \fP\fIformat\fP\fB, va_list \fP\fIargs\fP\fB);\fP .fi .PP .RS -4 Requisitos de Macros de Prueba de Características para glibc (véase \fBfeature_test_macros\fP(7)): .RE .PP .\" .BR wprintf (), .\" .BR fwprintf (), .\" .BR swprintf (), .\" .BR vwprintf (), .\" .BR vfwprintf (), .\" .BR vswprintf (): A continuación se muestran todas las funciones: .nf _XOPEN_SOURCE >= 500 || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L .fi .SH DESCRIPCIÓN La familia de funciones \fBwprintf\fP() es equivalente para caracteres anchos a la familia de funciones \fBprintf\fP(3). Realizan la salida con formato de caracteres anchos. .PP Las funciones \fBwprintf\fP() y \fBvwprintf\fP() realizan la salida de caracteres anchos a \fIstdout\fP. \fIstdout\fP no debe estar orientada a bytes. Vea \fBfwide\fP(3) para más información. .PP Las funciones \fBfwprintf\fP() y \fBvfwprintf\fP() realizan la salida de caracteres anchos a \fIstream\fP. \fIstream\fP no debe estar orientado a bytes. Vea \fBfwide\fP(3) para más información. .PP Las funciones \fBswprintf\fP() y \fBvswprintf\fP() realizan la salida de caracteres anchos a un array de caracteres anchos. El programador debe garantizar que hay espacio suficiente en \fIwcs\fP para, al menos, \fImaxlen\fP caracteres anchos. .PP Estas funciones son como las funciones \fBprintf\fP(3), \fBvprintf\fP(3), \fBfprintf\fP(3), \fBvfprintf\fP(3), \fBsprintf\fP(3) y \fBvsprintf\fP(3), salvo por las siguientes diferencias: .TP \fB\[bu]\fP La cadena \fIformat\fP es una cadena de caracteres anchos. .TP \fB\[bu]\fP La salida está formada por caracteres anchos, no por bytes. .TP \fB\[bu]\fP \fBswprintf\fP() y \fBvswprintf\fP() toman un argumento \fImaxlen\fP, \fBsprintf\fP(3) y \fBvsprintf\fP(3) no. (Las funciones \fBsnprintf\fP(3) y \fBvsnprintf\fP(3) toman un argumento \fImaxlen\fP, pero en Linux no devuelven \-1 ante un desbordamiento de buffer.) .PP El tratamiento de los caracteres de conversión \fBc\fP y \fBs\fP es distinto: .TP \fBc\fP Si no está presente un modificador \fBl\fP, el argumento \fIint\fP se convierte a un carácter ancho, mediante una llamada a la función \fBbtowc\fP(3), y se escribe el carácter ancho resultante. Si está presente un modificador \fBl\fP, se escribe el argumento (carácter ancho) \fIwint_t\fP. .TP \fBs\fP If no \fBl\fP modifier is present: the \fIconst\ char\ *\fP argument is expected to be a pointer to an array of character type (pointer to a string) containing a multibyte character sequence beginning in the initial shift state. Characters from the array are converted to wide characters (each by a call to the \fBmbrtowc\fP(3) function with a conversion state starting in the initial state before the first byte). The resulting wide characters are written up to (but not including) the terminating null wide character (L\[aq]\e0\[aq]). If a precision is specified, no more wide characters than the number specified are written. Note that the precision determines the number of \fIwide characters\fP written, not the number of \fIbytes\fP or \fIscreen positions\fP. The array must contain a terminating null byte (\[aq]\e0\[aq]), unless a precision is given and it is so small that the number of converted wide characters reaches it before the end of the array is reached. If an \fBl\fP modifier is present: the \fIconst\ wchar_t\ *\fP argument is expected to be a pointer to an array of wide characters. Wide characters from the array are written up to (but not including) a terminating null wide character. If a precision is specified, no more than the number specified are written. The array must contain a terminating null wide character, unless a precision is given and it is smaller than or equal to the number of wide characters in the array. .SH "VALOR DEVUELTO" Las funciones devuelven el número de caracteres anchos escritos, excluyendo el carácter ancho terminador nulo en el caso de las funciones \fBswprintf\fP() y \fBvswprintf\fP(). Las funciones devuelven \-1 en caso de error. .SH ATRIBUTOS Para obtener una explicación de los términos usados en esta sección, véase \fBattributes\fP(7). .ad l .nh .TS allbox; lbx lb lb l l l. Interfaz Atributo Valor T{ \fBwprintf\fP(), \fBfwprintf\fP(), \fBswprintf\fP(), \fBvwprintf\fP(), \fBvfwprintf\fP(), \fBvswprintf\fP() T} Seguridad del hilo Configuración regional de multi\-hilo seguro .TE .hy .ad .sp 1 .SH ESTÁNDARES POSIX.1\-2001, POSIX.1\-2008, C99. .SH NOTAS El comportamiento de \fBwprintf\fP() y compañía depende de la categoría \fBLC_CTYPE\fP de la localización actual. .PP Si la cadena \fIformat\fP contiene caracteres anchos que no son ASCII, el programa sólo funcionará correctamente si la categoría \fBLC_CTYPE\fP de la localización actual en tiempo de ejecución es la misma que la categoría \fBLC_CTYPE\fP de la localización actual en tiempo de compilación. Esto es así porque la representación \fIwchar_t\fP es dependiente de la plataforma y de la localización. (La glibc representa los caracteres anchos usando sus puntos de código Unicode (ISO\-10646) pero otras plataformas no hacen esto. Tampoco el uso de nombres universales de caractares, según la norma C99, de la forma \eunnnn soluciona este problema.) Por tanto, en programas internacionalizados, la cadena \fIformat\fP debería estar formada sólo por caracteres anchos ASCII, o debería construirse en tiempo de ejecución de una forma internacionalizada (por ejemplo, usando \fBgettext\fP(3) o \fBiconv\fP(3), seguida de \fBmbstowcs\fP(3)). .SH "VÉASE TAMBIÉN" \fBfprintf\fP(3), \fBfputwc\fP(3), \fBfwide\fP(3), \fBprintf\fP(3), \fBsnprintf\fP(3) .\" .BR wscanf (3) .PP .SH TRADUCCIÓN La traducción al español de esta página del manual fue creada por Juan Piernas . .PP 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. .PP 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 .