Next: , Previous: , Up: Elementary string functions   [Contents][Index]


4.3.3 Copying Unicode strings

The following functions copy Unicode strings in memory.

Function: uint8_t * u8_cpy (uint8_t *dest, const uint8_t *src, size_t n)
Function: uint16_t * u16_cpy (uint16_t *dest, const uint16_t *src, size_t n)
Function: uint32_t * u32_cpy (uint32_t *dest, const uint32_t *src, size_t n)

Copies n units from src to dest.

This function is similar to memcpy, except that it operates on Unicode strings.

Function: uint8_t * u8_move (uint8_t *dest, const uint8_t *src, size_t n)
Function: uint16_t * u16_move (uint16_t *dest, const uint16_t *src, size_t n)
Function: uint32_t * u32_move (uint32_t *dest, const uint32_t *src, size_t n)

Copies n units from src to dest, guaranteeing correct behavior for overlapping memory areas.

This function is similar to memmove, except that it operates on Unicode strings.

The following function fills a Unicode string.

Function: uint8_t * u8_set (uint8_t *s, ucs4_t uc, size_t n)
Function: uint16_t * u16_set (uint16_t *s, ucs4_t uc, size_t n)
Function: uint32_t * u32_set (uint32_t *s, ucs4_t uc, size_t n)

Sets the first n characters of s to uc. uc should be a character that occupies only 1 unit.

This function is similar to memset, except that it operates on Unicode strings.