wcsnrtombs(3) Library Functions Manual wcsnrtombs(3) NOMBRE wcsnrtombs - convierte una cadena de caracteres anchos a una cadena mulibyte BIBLIOTECA Biblioteca Estandar C (libc, -lc) SINOPSIS #include size_t wcsnrtombs(char dest[restrict .len], const wchar_t **restrict src, size_t nwc, size_t len, mbstate_t *restrict ps); Requisitos de Macros de Prueba de Caracteristicas para glibc (vease feature_test_macros(7)): wcsnrtombs(): Desde glibc 2.10: _POSIX_C_SOURCE >= 200809L Antes de glibc 2.10: _GNU_SOURCE DESCRIPCION La funcion wcsnrtombs() es como la funcion wcsrtombs(3), salvo que el numero de caracteres anchos a convertir, empezando en *src, esta limitado a nwc. If dest is not NULL, the wcsnrtombs() function converts at most nwc wide characters from the wide-character string *src to a multibyte string starting at dest. At most len bytes are written to dest. The shift state *ps is updated. The conversion is effectively performed by repeatedly calling wcrtomb(dest, *src, ps), as long as this call succeeds, and then incrementing dest by the number of bytes written and *src by one. The conversion can stop for three reasons: o Se ha encontrado un caracter ancho que no se puede representar como una secuencia multibyte (de acuerdo con la localizacion actual). En este caso, *src se deja apuntando al caracter ancho invalido, se devuelve (size_t) -1 y errno toma el valor EILSEQ. o nwc wide characters have been converted without encountering a null wide character (L'\0'), or the length limit forces a stop. In this case, *src is left pointing to the next wide character to be converted, and the number of bytes written to dest is returned. o The wide-character string has been completely converted, including the terminating null wide character (which has the side effect of bringing back *ps to the initial state). In this case, *src is set to NULL, and the number of bytes written to dest, excluding the terminating null byte ('\0'), is returned. Si dest es NULL, len se ignora, y la conversion procede como arriba, salvo que los bytes convertidos no se escriben en memoria, y no existe limite de longitud. In both of the above cases, if ps is NULL, a static anonymous state known only to the wcsnrtombs() function is used instead. El programador tiene que asegurarse de que hay espacio para al menos len bytes en dest. VALOR DEVUELTO La funcion wcsnrtombs() devuelve el numero de bytes que conforman la parte de la secuencia multibyte convertida, sin incluir el byte nulo terminador. Si encontro un caracter ancho que no pudo convertir, devuelve (size_t) -1 y errno toma el valor EILSEQ. ATRIBUTOS Para obtener una explicacion de los terminos usados en esta seccion, vease attributes(7). +-------------+--------------------+-----------------------------------+ |Interfaz | Atributo | Valor | +-------------+--------------------+-----------------------------------+ |wcsnrtombs() | Seguridad del hilo | MT-Unsafe race:wcsnrtombs/!ps | +-------------+--------------------+-----------------------------------+ ESTANDARES POSIX.1-2008. NOTAS El comportamiento de wcsnrtombs() depende de la categoria LC_CTYPE de la localizacion actual. Pasar NULL como valor de ps no es seguro en un entorno multihilos. VEASE TAMBIEN iconv(3), mbsinit(3), wcsrtombs(3) TRADUCCION La traduccion al espanol de esta pagina del manual fue creada por Pedro Pablo Fabrega y Juan Piernas Esta traduccion es documentacion libre; lea la GNU General Public License Version 3 o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD. Si encuentra algun error en la traduccion de esta pagina del manual, envie un correo electronico a . Paginas de manual de Linux 6.06 31 Octubre 2023 wcsnrtombs(3)