mbsinit(3) Library Functions Manual mbsinit(3) NOMBRE mbsinit - comprueba el estado inicial de cambios BIBLIOTECA Biblioteca Estandar C (libc, -lc) SINOPSIS #include int mbsinit(const mbstate_t *ps); DESCRIPCION Character conversion between the multibyte representation and the wide character representation uses conversion state, of type mbstate_t. Conversion of a string uses a finite-state machine; when it is interrupted after the complete conversion of a number of characters, it may need to save a state for processing the remaining characters. Such a conversion state is needed for the sake of encodings such as ISO/IEC 2022 and UTF-7. El estado inicial es el estado al principio de la conversion de la cadena. Existen dos clases de estado: el que usan las funciones de conversion de multibyte a caracter ancho, tal como mbsrtowcs(3), y el que usan las funciones de conversion de caracter ancho a multibyte, tal como wcsrtombs(3), aunque ambos encajan en un mbstate_t, y ambos poseen la misma representacion para un estado inicial. For 8-bit encodings, all states are equivalent to the initial state. For multibyte encodings like UTF-8, EUC-*, BIG5, or SJIS, the wide character to multibyte conversion functions never produce non-initial states, but the multibyte to wide-character conversion functions like mbrtowc(3) do produce non-initial states when interrupted in the middle of a character. Una forma posible de crear un mbstate_t en un estado inicial es asignarle un cero: mbstate_t state; memset(&state, 0, sizeof(state)); En Linux, lo siguiente tambien funciona, aunque podria producir advertencias del compilador: mbstate_t state = { 0 }; La funcion mbsinit() comprueba si *ps se corresponde con un estado inicial. VALOR DEVUELTO mbsinit() returns nonzero if *ps is an initial state, or if ps is NULL. Otherwise, it returns 0. ATRIBUTOS Para obtener una explicacion de los terminos usados en esta seccion, vease attributes(7). +-----------------------------+--------------------+-------------------+ |Interfaz | Atributo | Valor | +-----------------------------+--------------------+-------------------+ |mbsinit() | Seguridad del hilo | Multi-hilo seguro | +-----------------------------+--------------------+-------------------+ ESTANDARES C11, POSIX.1-2008. HISTORIAL POSIX.1-2001, C99. NOTAS El comportamiento de mbsinit() depende de la categoria LC_CTYPE de la localizacion actual. VEASE TAMBIEN mbrlen(3), mbrtowc(3), mbsrtowcs(3), wcrtomb(3), wcsrtombs(3) TRADUCCION La traduccion al espanol de esta pagina del manual fue creada por Juan Piernas y Miguel Perez Ibars 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 28 Enero 2024 mbsinit(3)