ucs2char.h File Reference

#include <stdio.h>

Go to the source code of this file.

Defines

#define UCS2API

Typedefs

typedef uint16_t ucs2char_t
 Type definition of a UCS-2 character.

Functions

UCS2API int ucs2init ()
 Initialize the UCS-2 Character/String library.
UCS2API int ucs2setenc (const char *encoding)
 Set the encoding for multi-byte characters (for iconv/libiconv).
UCS2API const char * ucs2getenc ()
 Get the encoding for multi-byte characters (for iconv/libiconv).
UCS2API void ucs2setcp (int cp)
 Set the code page for multi-byte characters (for Win32).
UCS2API int ucs2getcp ()
 Get the code page for multi-byte characters (for Win32).
UCS2API size_t ucs2tombs (char *mbstr, size_t mbs_size, const ucs2char_t *ucs2str, size_t ucs_size)
 Convert a UCS-2 string to multi-byte characters.
UCS2API size_t mbstoucs2 (ucs2char_t *ucs2str, size_t ucs_size, const char *mbstr, size_t mbs_size)
 Convert multi-byte characters to a UCS-2 string.
UCS2API size_t mbstoucs2_charset (ucs2char_t *ucs2str, size_t ucs_size, const char *mbstr, size_t mbs_size, const char *charset)
 Convert multi-byte characters in a specific encoding to a UCS-2 string.
UCS2API size_t ucs2toutf8 (char *mbstr, size_t mbs_size, const ucs2char_t *ucs2str, size_t ucs_size)
 Convert a UCS-2 string to a UTF-8 string.
UCS2API size_t utf8toucs2 (ucs2char_t *ucs2str, size_t ucs_size, const char *mbstr, size_t mbs_size)
 Convert a UTF-8 string to a UCS-2 string.
UCS2API char * ucs2dupmbs (const ucs2char_t *ucs2str)
 Convert and duplicate a UCS-2 string to multi-byte characters.
UCS2API ucs2char_tmbsdupucs2 (const char *mbstr)
 Convert and duplicate multi-byte characters to a UCS-2 string.
UCS2API ucs2char_tmbsdupucs2_charset (const char *mbstr, const char *charset)
 Convert and duplicate multi-byte characters in a specific encoding to a UCS-2 string.
UCS2API char * ucs2duputf8 (const ucs2char_t *ucs2str)
 Convert and duplicate a UCS-2 string to a UTF-8 string.
UCS2API ucs2char_tutf8dupucs2 (const char *utf8str)
 Convert and duplicate a UTF-8 string to a UCS-2 string.
UCS2API void * ucs2malloc (size_t size)
 Allocate a memory block.
UCS2API void * ucs2calloc (size_t size)
 Allocate a memory block with values initialized as zero.
UCS2API void * ucs2realloc (void *ptr, size_t size)
 Resize a memory block.
UCS2API void ucs2free (void *ptr)
 Free a memory block.
UCS2API int ucs2issurrogate (ucs2char_t c)
 Test whether a USC-2 character is a surrogate-pair character in UTF-16.
UCS2API int ucs2isspace (ucs2char_t c)
 Test whether a USC-2 character is a whitespace character.
UCS2API int ucs2isdigit (ucs2char_t c)
 Test whether a USC-2 character is a numeric character.
UCS2API ucs2char_t ucs2lower (ucs2char_t c)
 Convert a UCS-2 character to lower case.
UCS2API ucs2char_t ucs2upper (ucs2char_t c)
 Convert a UCS-2 character to upper case.
UCS2API ucs2char_tucs2cat (ucs2char_t *dst, const ucs2char_t *src)
 Concatenate two strings.
UCS2API ucs2char_tucs2chr (const ucs2char_t *str, ucs2char_t c)
 Search for the first occurrence of a character in a string.
UCS2API int ucs2cmp (const ucs2char_t *x, const ucs2char_t *y)
 Compare two strings.
UCS2API ucs2char_tucs2cpy (ucs2char_t *dst, const ucs2char_t *src)
 Copy a string.
UCS2API size_t ucs2cspn (const ucs2char_t *str, const ucs2char_t *charset)
 Count the number of characters not appearing in a character set.
UCS2API size_t ucs2len (const ucs2char_t *str)
 Count the length of a string.
UCS2API ucs2char_tucs2ncat (ucs2char_t *dst, const ucs2char_t *src, size_t n)
 Concatenate two strings (no more than the maximum length).
UCS2API int ucs2ncmp (const ucs2char_t *x, const ucs2char_t *y, size_t n)
 Compare two strings (no longer than the maximum length).
UCS2API ucs2char_tucs2ncpy (ucs2char_t *dst, const ucs2char_t *src, size_t n)
 Copy a string (no more than the maximum length).
UCS2API ucs2char_tucs2pbrk (const ucs2char_t *str, const ucs2char_t *charset)
 Find a character in a string that belongs to a character set.
UCS2API ucs2char_tucs2rchr (const ucs2char_t *str, ucs2char_t c)
 Search for the last occurrence of a character in a string.
UCS2API size_t ucs2spn (const ucs2char_t *str, const ucs2char_t *charset)
 Find a character in a string that does not belong to a character set.
UCS2API ucs2char_tucs2str (const ucs2char_t *str, const ucs2char_t *substr)
 Find a substring in a string.
UCS2API ucs2char_tucs2dup (const ucs2char_t *str)
 Duplicate a string.
UCS2API ucs2char_tucs2ndup (const ucs2char_t *str, size_t length)
 Duplicate a string no longer than the specified length.
UCS2API ucs2char_tucs2lwr (ucs2char_t *str)
 Convert a string to lowercase.
UCS2API ucs2char_tucs2upr (ucs2char_t *str)
 Convert a string to uppercase.
UCS2API int ucs2icmp (const ucs2char_t *x, const ucs2char_t *y)
 Compare two strings incasesensitively.
UCS2API int ucs2incmp (const ucs2char_t *x, const ucs2char_t *y, size_t n)
 Compare two strings incasesensitively (no longer than the maximum length).
UCS2API ucs2char_tucs2strip (ucs2char_t *str)
 Strip whitespace characters at the head and tail of a string.
UCS2API int ucs2toi (const ucs2char_t *str)
 Convert a UCS-2 string to integer value.
UCS2API ucs2char_titoucs2 (int value, ucs2char_t *string, int radix)
 Convert an integer value to UCS-2 string.
UCS2API FILE * ucs2fopen (const ucs2char_t *filename, const char *mode)
 Open a stream from a file.
UCS2API int fputucs2c (ucs2char_t c, FILE *fp)
 Write a UCS-2 character to a stream.


Define Documentation

#define UCS2API

Definition at line 32 of file ucs2char.h.