thcoll.h File Reference

Thai string collation. More...

## Functions

int | th_strcoll (const thchar_t *s1, const thchar_t *s2)
| Compare two Thai strings for collation.
size_t | th_strxfrm (thchar_t dest[], const thchar_t *src, size_t n)
| Transform string into collatable form.

## Detailed Description

Thai string collation.

## Function Documentation

## th_strcoll()

int th_strcoll | ( | const thchar_t * | s1,
|  | const thchar_t * | s2 )

extern

Compare two Thai strings for collation.

Parameters

  s1 | : first string (null-terminated)
  s2 | : second string (null-terminated)

Returns
  < 0 if s1 precedes s2; 0 if s1 equals s2; > 0 if s1 succeeds s2

## th_strxfrm()

size_t th_strxfrm | ( | thchar_t | dest[],
|  | const thchar_t * | src,
|  | size_t | n )

extern

Transform string into collatable form.

Parameters

  dest | : the destination string buffer
  src | : the string to transform
  n | : the size of dest buffer

Returns
  the number of bytes required to store the result in dest, excluding the terminating '\0'. If the return value >= n, dest is undefined.

Transforms src into a form from which comparison using strcmp() yields the same result as that from th_strcoll(). At most n characters are put in dest.