| wprintf(3) | Library Functions Manual | wprintf(3) |
wprintf, fwprintf, swprintf, vwprintf, vfwprintf, vswprintf - conversão de saída formatada de caracteres largos
Biblioteca C Padrão (libc, -lc)
#include <stdio.h> #include <wchar.h>
int wprintf(const wchar_t *restrict format, ...);
int fwprintf(FILE *restrict stream,
const wchar_t *restrict format, ...);
int swprintf(wchar_t wcs[restrict .maxlen], size_t maxlen,
const wchar_t *restrict format, ...);
int vwprintf(const wchar_t *restrict format, va_list args);
int vfwprintf(FILE *restrict stream,
const wchar_t *restrict format, va_list args);
int vswprintf(wchar_t wcs[restrict .maxlen], size_t maxlen,
const wchar_t *restrict format, va_list args);
Todas as funções mostradas acima:
_XOPEN_SOURCE >= 500 || _ISOC99_SOURCE
|| _POSIX_C_SOURCE >= 200112L
A família de funções wprintf() é a equivalente para caracteres largos à família de funções printf(3). Ela realiza a saída formatada de caracteres largos.
As funções wprintf() e vwprintf() realizam saída de caracteres largos para stdout. stdout não deve ser orientado a byte; veja fwide(3) para maiores informações.
As funções fwprintf() e vfwprintf() realizam saída de caracteres largos para fluxo. fluxo não deve ser orientado a byte; veja fwide(3) para maiores informações.
As funções swprintf() e vswprintf() 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 maxlen caracteres largos em wcs.
Estas funções são como as funções printf(3), vprintf(3), fprintf(3), vfprintf(3), sprintf(3), vsprintf(3) exceto pelas seguintes diferenças:
O tratamento de caracteres de conversão c e s é diferente:
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 swprintf() e vswprintf(). Elas retornam -1 quando ocorre um erro.
Para uma explicação dos termos usados nesta seção, consulte attributes(7).
| Interface | Atributo | Valor |
| wprintf(), fwprintf(), swprintf(), vwprintf(), vfwprintf(), vswprintf() | Thread safety | MT-Safe locale |
C11, POSIX.1-2008.
POSIX.1-2001, C99.
O comportamento de wprintf() etc. depende da categoria LC_CTYPE da localização atual.
If the format string contains non-ASCII wide characters, the program will work correctly only if the LC_CTYPE category of the current locale at run time is the same as the LC_CTYPE category of the current locale at compile time. This is because the wchar_t representation is platform- and locale-dependent. (The glibc represents wide characters using their Unicode (ISO/IEC 10646) code point, but other platforms don't do this. Also, the use of C99 universal character names of the form \unnnn does not solve this problem.) Therefore, in internationalized programs, the format string should consist of ASCII wide characters only, or should be constructed at run time in an internationalized way (e.g., using gettext(3) or iconv(3), followed by mbstowcs(3)).
A tradução para português brasileiro desta página man foi criada por Felipe M Pereira <Felipe.Pereira@ic.unicamp.br>, Ricardo C.O.Freitas <english.quest@best-service.com> e Rafael Fontenelle <rafaelff@gnome.org>.
Esta tradução é uma documentação livre; leia a Licença Pública Geral GNU Versão 3 ou posterior para as condições de direitos autorais. Nenhuma responsabilidade é aceita.
Se você encontrar algum erro na tradução desta página de manual, envie um e-mail para a lista de discussão de tradutores.
| 15 junho 2024 | Linux man-pages 6.9.1 |