.\" -*- 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 fevereiro 2023" "Linux man\-pages 6.03" .SH NOME wprintf, fwprintf, swprintf, vwprintf, vfwprintf, vswprintf \- conversão de saída formatada de caracteres largos .SH BIBLIOTECA Biblioteca C Padrão (\fIlibc\fP, \fI\-lc\fP) .SH SINOPSE .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 macro de teste de recursos para o glibc (consulte \fBfeature_test_macros\fP(7)): .RE .PP .\" .BR wprintf (), .\" .BR fwprintf (), .\" .BR swprintf (), .\" .BR vwprintf (), .\" .BR vfwprintf (), .\" .BR vswprintf (): Todas as funções mostradas acima: .nf _XOPEN_SOURCE >= 500 || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L .fi .SH DESCRIÇÃO A família de funções \fBwprintf\fP() é a equivalente para caracteres largos à família de funções \fBprintf\fP(3). Ela realiza a saída formatada de caracteres largos. .PP As funções \fBwprintf\fP() e \fBvwprintf\fP() realizam saída de caracteres largos para \fIstdout\fP. \fIstdout\fP não deve ser orientado a byte; veja \fBfwide\fP(3) para maiores informações. .PP As funções \fBfwprintf\fP() e \fBvfwprintf\fP() realizam saída de caracteres largos para \fIfluxo\fP. \fIfluxo\fP não deve ser orientado a byte; veja \fBfwide\fP(3) para maiores informações. .PP As funções \fBswprintf\fP() e \fBvswprintf\fP() realizam saída de caracteres largos para um array de caracteres largos. O programador deve garantir que há espaço suficiente para no mínimo \fImaxlen\fP caracteres largos em \fIwcs\fP. .PP Estas funções são como as funções \fBprintf\fP(3), \fBvprintf\fP(3), \fBfprintf\fP(3), \fBvfprintf\fP(3), \fBsprintf\fP(3), \fBvsprintf\fP(3) exceto pelas seguintes diferenças: .TP \fB\[bu]\fP A \fIformato\fP é uma string de caracteres largos. .TP \fB\[bu]\fP A saída consiste de caracteres largos, não bytes. .TP \fB\[bu]\fP \fBswprintf\fP() e \fBvswprintf\fP() recebem um argumento \fImaxcomp\fP, \fBsprintf\fP(3) e \fBvsprintf\fP(3) não recebem. (\fBsnprintf\fP(3) e \fBvsnprintf\fP(3) recebem um argumento \fImaxcomp\fP, mas estas funções não retornam \-1 quando ocorre um estouro de buffer no GNU/Linux.) .PP O tratamento de caracteres de conversão \fBc\fP e \fBs\fP é diferente: .TP \fBc\fP Se nenhum modificador \fBl\fP está presente, o argumento \fIint\fP é convertido para um caractere largo por uma chamada a para a função \fBbtowc\fP(3), e o caractere largo resultante é escrito. Se um modificador \fBl\fP está presente, o argumento \fIwint_t\fP (caractere largo) é escrito. .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 DE RETORNO" As funções retornam o número de caracteres largos escritos, excluindo\-se o caractere largo nulo de terminação no caso das funções \fBswprintf\fP() e \fBvswprintf\fP(). Elas retornam \-1 quando ocorre um erro. .SH ATRIBUTOS Para uma explicação dos termos usados nesta seção, consulte \fBattributes\fP(7). .ad l .nh .TS allbox; lbx lb lb l l l. Interface Atributo Valor T{ \fBwprintf\fP(), \fBfwprintf\fP(), \fBswprintf\fP(), \fBvwprintf\fP(), \fBvfwprintf\fP(), \fBvswprintf\fP() T} Thread safety MT\-Safe locale .TE .hy .ad .sp 1 .SH PADRÕES POSIX.1\-2001, POSIX.1\-2008, C99. .SH NOTAS O comportamento de \fBwprintf\fP() etc. depende da categoria \fBLC_CTYPE\fP da localização atual. .PP Se a string \fIformato\fP contiver caracteres largos não\-ASCII, o programa funcionará corretamente apenas se a categoria \fBLC_CTYPE\fP da localização atual em tempo de execução for a mesma que a categoria \fBLC_CTYPE\fP da localização atual em tempo de compilação. Isto é porque a representação \fIwchar_t\fP é dependente de plataforma e da localização. (A glibc representa caracteres largos usando seu ponto de código Unicode (ISO\-10646), mas outras plataformas não o fazem. Ademais, o uso de nomes de caracteres universais C99 da forma \eunnnn não resolve este problema.) Portanto, em programas internacionalizados, a string \fIformato\fP deve consistir apenas de caracteres largos ASCII, ou deve ser compilado em tempo de execução de forma internacionalizada (ou seja, usando \fBgettext\fP(3) ou \fBiconv\fP(3), seguido de \fBmbstowcs\fP(3)). .SH "VEJA TAMBÉM" \fBfprintf\fP(3), \fBfputwc\fP(3), \fBfwide\fP(3), \fBprintf\fP(3), \fBsnprintf\fP(3) .\" .BR wscanf (3) .PP .SH TRADUÇÃO A tradução para português brasileiro desta página man foi criada por Felipe M Pereira , Ricardo C.O.Freitas e Rafael Fontenelle . . .PP Esta tradução é uma documentação livre; leia a .UR https://www.gnu.org/licenses/gpl-3.0.html Licença Pública Geral GNU Versão 3 .UE ou posterior para as condições de direitos autorais. Nenhuma responsabilidade é aceita. .PP Se você encontrar algum erro na tradução desta página de manual, envie um e-mail para .MT debian-l10n-portuguese@lists.debian.org a lista de discussão de tradutores .ME .