Output with Unicode strings <unistdio.h>
****************************************

This include file declares functions for doing formatted output with Unicode strings.  It defines a set of functions similar to fprintf and sprintf, which are declared in <stdio.h>.

These functions work like the printf function family. In the format string:

  * The format directive U takes an UTF-8 string (const uint8_t *).

  * The format directive lU takes an UTF-16 string (const uint16_t *).

  * The format directive llU takes an UTF-32 string (const uint32_t *).

  * The format directive n is not supported, for security reasons.

A function name with an infix v indicates that a va_list is passed instead of multiple arguments.

The functions *sprintf have a BUF argument that is assumed to be large enough. (DANGEROUS!  Overflowing the buffer will crash the program.)

The functions *snprintf have a BUF argument that is assumed to be SIZE units large.  (DANGEROUS!  The resulting string might be truncated in the middle of a multibyte character.)

The functions *asprintf have a RESULTP argument.  The result will be freshly allocated and stored in *resultp.

The functions *asnprintf have a (RESULTBUF, LENGTHP) argument pair.  If RESULTBUF is not NULL and the result fits into *LENGTHP units, it is put in RESULTBUF, and RESULTBUF is returned.  Otherwise, a freshly allocated string is returned.  In both cases, *LENGTHP is set to the length (number of units) of the returned string.  In case of error, NULL is returned and errno is set.

The following functions take an ASCII format string and return a result that is a char * string in locale encoding.

 -- Function: int ulc_sprintf (char *BUF, const char *FORMAT, ...)

 -- Function: int ulc_snprintf (char *BUF, size_t size, const char *FORMAT, ...)

 -- Function: int ulc_asprintf (char **RESULTP, const char *FORMAT, ...)

 -- Function: char * ulc_asnprintf (char *RESULTBUF, size_t *LENGTHP, const char *FORMAT, ...)

 -- Function: int ulc_vsprintf (char *BUF, const char *FORMAT, va_list AP)

 -- Function: int ulc_vsnprintf (char *BUF, size_t size, const char *FORMAT, va_list AP)

 -- Function: int ulc_vasprintf (char **RESULTP, const char *FORMAT, va_list AP)

 -- Function: char * ulc_vasnprintf (char *RESULTBUF, size_t *LENGTHP, const char *FORMAT, va_list AP)

The following functions take an ASCII format string and return a result in UTF-8 format.

 -- Function: int u8_sprintf (uint8_t *BUF, const char *FORMAT, ...)

 -- Function: int u8_snprintf (uint8_t *BUF, size_t SIZE, const char *FORMAT, ...)

 -- Function: int u8_asprintf (uint8_t **RESULTP, const char *FORMAT, ...)

 -- Function: uint8_t * u8_asnprintf (uint8_t *RESULTBUF, size_t *LENGTHP, const char *FORMAT, ...)

 -- Function: int u8_vsprintf (uint8_t *BUF, const char *FORMAT, va_list ap)

 -- Function: int u8_vsnprintf (uint8_t *BUF, size_t SIZE, const char *FORMAT, va_list AP)

 -- Function: int u8_vasprintf (uint8_t **RESULTP, const char *FORMAT, va_list AP)

 -- Function: uint8_t * u8_vasnprintf (uint8_t *resultbuf, size_t *LENGTHP, const char *FORMAT, va_list AP)

The following functions take an UTF-8 format string and return a result in UTF-8 format.

 -- Function: int u8_u8_sprintf (uint8_t *BUF, const uint8_t *FORMAT, ...)

 -- Function: int u8_u8_snprintf (uint8_t *BUF, size_t SIZE, const uint8_t *FORMAT, ...)

 -- Function: int u8_u8_asprintf (uint8_t **RESULTP, const uint8_t *FORMAT, ...)

 -- Function: uint8_t * u8_u8_asnprintf (uint8_t *resultbuf, size_t *LENGTHP, const uint8_t *FORMAT, ...)

 -- Function: int u8_u8_vsprintf (uint8_t *BUF, const uint8_t *FORMAT, va_list AP)

 -- Function: int u8_u8_vsnprintf (uint8_t *BUF, size_t SIZE, const uint8_t *FORMAT, va_list AP)

 -- Function: int u8_u8_vasprintf (uint8_t **RESULTP, const uint8_t *FORMAT, va_list AP)

 -- Function: uint8_t * u8_u8_vasnprintf (uint8_t *resultbuf, size_t *LENGTHP, const uint8_t *FORMAT, va_list AP)

The following functions take an ASCII format string and return a result in UTF-16 format.

 -- Function: int u16_sprintf (uint16_t *BUF, const char *FORMAT, ...)

 -- Function: int u16_snprintf (uint16_t *BUF, size_t SIZE, const char *FORMAT, ...)

 -- Function: int u16_asprintf (uint16_t **RESULTP, const char *FORMAT, ...)

 -- Function: uint16_t * u16_asnprintf (uint16_t *RESULTBUF, size_t *LENGTHP, const char *FORMAT, ...)

 -- Function: int u16_vsprintf (uint16_t *BUF, const char *FORMAT, va_list ap)

 -- Function: int u16_vsnprintf (uint16_t *BUF, size_t SIZE, const char *FORMAT, va_list AP)

 -- Function: int u16_vasprintf (uint16_t **RESULTP, const char *FORMAT, va_list AP)

 -- Function: uint16_t * u16_vasnprintf (uint16_t *resultbuf, size_t *LENGTHP, const char *FORMAT, va_list AP)

The following functions take an UTF-16 format string and return a result in UTF-16 format.

 -- Function: int u16_u16_sprintf (uint16_t *BUF, const uint16_t *FORMAT, ...)

 -- Function: int u16_u16_snprintf (uint16_t *BUF, size_t SIZE, const uint16_t *FORMAT, ...)

 -- Function: int u16_u16_asprintf (uint16_t **RESULTP, const uint16_t *FORMAT, ...)

 -- Function: uint16_t * u16_u16_asnprintf (uint16_t *resultbuf, size_t *LENGTHP, const uint16_t *FORMAT, ...)

 -- Function: int u16_u16_vsprintf (uint16_t *BUF, const uint16_t *FORMAT, va_list AP)

 -- Function: int u16_u16_vsnprintf (uint16_t *BUF, size_t SIZE, const uint16_t *FORMAT, va_list AP)

 -- Function: int u16_u16_vasprintf (uint16_t **RESULTP, const uint16_t *FORMAT, va_list AP)

 -- Function: uint16_t * u16_u16_vasnprintf (uint16_t *resultbuf, size_t *LENGTHP, const uint16_t *FORMAT, va_list AP)

The following functions take an ASCII format string and return a result in UTF-32 format.

 -- Function: int u32_sprintf (uint32_t *BUF, const char *FORMAT, ...)

 -- Function: int u32_snprintf (uint32_t *BUF, size_t SIZE, const char *FORMAT, ...)

 -- Function: int u32_asprintf (uint32_t **RESULTP, const char *FORMAT, ...)

 -- Function: uint32_t * u32_asnprintf (uint32_t *RESULTBUF, size_t *LENGTHP, const char *FORMAT, ...)

 -- Function: int u32_vsprintf (uint32_t *BUF, const char *FORMAT, va_list ap)

 -- Function: int u32_vsnprintf (uint32_t *BUF, size_t SIZE, const char *FORMAT, va_list AP)

 -- Function: int u32_vasprintf (uint32_t **RESULTP, const char *FORMAT, va_list AP)

 -- Function: uint32_t * u32_vasnprintf (uint32_t *resultbuf, size_t *LENGTHP, const char *FORMAT, va_list AP)

The following functions take an UTF-32 format string and return a result in UTF-32 format.

 -- Function: int u32_u32_sprintf (uint32_t *BUF, const uint32_t *FORMAT, ...)

 -- Function: int u32_u32_snprintf (uint32_t *BUF, size_t SIZE, const uint32_t *FORMAT, ...)

 -- Function: int u32_u32_asprintf (uint32_t **RESULTP, const uint32_t *FORMAT, ...)

 -- Function: uint32_t * u32_u32_asnprintf (uint32_t *resultbuf, size_t *LENGTHP, const uint32_t *FORMAT, ...)

 -- Function: int u32_u32_vsprintf (uint32_t *BUF, const uint32_t *FORMAT, va_list AP)

 -- Function: int u32_u32_vsnprintf (uint32_t *BUF, size_t SIZE, const uint32_t *FORMAT, va_list AP)

 -- Function: int u32_u32_vasprintf (uint32_t **RESULTP, const uint32_t *FORMAT, va_list AP)

 -- Function: uint32_t * u32_u32_vasnprintf (uint32_t *resultbuf, size_t *LENGTHP, const uint32_t *FORMAT, va_list AP)

The following functions take an ASCII format string and produce output in locale encoding to a FILE stream.

 -- Function: int ulc_fprintf (FILE *STREAM, const char *FORMAT, ...)

 -- Function: int ulc_vfprintf (FILE *STREAM, const char *FORMAT, va_list AP)