Back to index

im-sdk  12.3.91
Typedefs | Functions
utfchar.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef unsigned short UTFCHAR

Functions

int _utfchar_concat (UTFCHAR *dest, UTFCHAR *str1, UTFCHAR *str2)
int _utfchar_copy (UTFCHAR *dest, UTFCHAR *original)
int _utfchar_length (UTFCHAR *p)
int _utfchar_comp (UTFCHAR *s1, UTFCHAR *s2)

Typedef Documentation

typedef unsigned short UTFCHAR

Definition at line 3 of file utfchar.h.


Function Documentation

int _utfchar_comp ( UTFCHAR s1,
UTFCHAR s2 
)

Definition at line 61 of file utfchar.c.

{
  UTFCHAR *p1, *p2;
  
  p1 = s1, p2 = s2;
  
  while (*p1 && *p2){
    if (*p1 > *p2)
      return 1;
    else if (*p1 < *p2)
      return -1;
    p1++, p2++;
  }
  if (!*p1 && *p2)
    return -1;
  if (!*p2 && *p1)
    return 1;
  return 0;
}
int _utfchar_concat ( UTFCHAR dest,
UTFCHAR str1,
UTFCHAR str2 
)

Definition at line 9 of file utfchar.c.

{
      int i;
      for (i = 0; *str1; i++) {
         *dest++ = *str1++;
      }
      for (i = 0; *str2; i++) {
         *dest++ = *str2++;
      }
      *dest = 0;
      return i;
}
int _utfchar_copy ( UTFCHAR dest,
UTFCHAR original 
)

Definition at line 36 of file utfchar.c.

{
       int i;
       if (dest == NULL || original == NULL)
              return -1;
       for (i = 0; *original; i++) {
              *dest++ = *original++;
       }
       *dest = 0;
       return i;
}
int _utfchar_length ( UTFCHAR p)

Definition at line 49 of file utfchar.c.

{
      int i;
              assert (p != NULL);
              if (p == NULL)
                     return 0;
      for (i = 0; *p; i++)
         p++;
      return i;
}