Back to index

im-sdk  12.3.91
Functions | Variables
zhuyin_standard.c File Reference
#include <stdio.h>
#include "zhuyin_standard.h"

Go to the source code of this file.

Functions

unsigned char * ZhuyinIndexToZhuyinSymbol (int idx)
char ZhuyinIndexToStandardKey (int idx)
int ZhuyinIndexToZhuyinType (int idx)
int ZhuyinSymbolToZhuyinIndex (unsigned char *sym)
int ZhuyinSymbolToZhuyinType (unsigned char *sym)
char ZhuyinSymbolToStandardKey (unsigned char *sym)
int ZhuyinKeyToZhuyinIndex (char key)
unsigned char * ZhuyinKeyToZhuyinSymbol (char key)
int ZhuyinKeyToZhuyinType (char key)
int ZhuyinSymbolSequenceToStandardKeySequence (unsigned char *sym_sequence, char *key_sequence, int *sym_len)

Variables

static char * ZhuyinSymbol [NUM_OF_ZHUYIN_SYMBOL+1]
static char StandardKeyMap [NUM_OF_ZHUYIN_SYMBOL+1]

Function Documentation

char ZhuyinIndexToStandardKey ( int  idx)

Definition at line 80 of file zhuyin_standard.c.

{
       if (idx <= 0 || idx > NUM_OF_ZHUYIN_SYMBOL) {
              return(0);
       }
       return(StandardKeyMap[idx]);
}

Here is the caller graph for this function:

unsigned char* ZhuyinIndexToZhuyinSymbol ( int  idx)

Definition at line 69 of file zhuyin_standard.c.

{
       if (idx <= 0 || idx > NUM_OF_ZHUYIN_SYMBOL) {
              return(NULL);
       }
       return((unsigned char *)ZhuyinSymbol[idx]);
}

Here is the caller graph for this function:

int ZhuyinIndexToZhuyinType ( int  idx)

Definition at line 91 of file zhuyin_standard.c.

{
       if (idx <= 0 || idx > NUM_OF_ZHUYIN_SYMBOL) {
              return(ZHUYIN_TYPE_ERROR);
       }

       if (idx >= 1 && idx <= 21) {
              return(ZHUYIN_TYPE_CONSONANT);
       } else if (idx >= 22 && idx <= 24) {
              return(ZHUYIN_TYPE_VOWEL1);
       } else if (idx >= 25 && idx <= 37) {
              return(ZHUYIN_TYPE_VOWEL2);
       } else if (idx >= 38 && idx <= 42) {
              return(ZHUYIN_TYPE_TONE);
       }

       return(ZHUYIN_TYPE_ERROR);
}

Here is the caller graph for this function:

int ZhuyinKeyToZhuyinIndex ( char  key)

Definition at line 150 of file zhuyin_standard.c.

{
       int idx;

       for (idx = 1; idx <= NUM_OF_ZHUYIN_SYMBOL; idx++) {
              if (key == StandardKeyMap[idx]) {
                     return(idx);
              }
       }
       return(0);
}

Here is the caller graph for this function:

unsigned char* ZhuyinKeyToZhuyinSymbol ( char  key)

Definition at line 165 of file zhuyin_standard.c.

{
       int idx = ZhuyinKeyToZhuyinIndex(key);
       return((unsigned char *)ZhuyinSymbol[idx]);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int ZhuyinKeyToZhuyinType ( char  key)

Definition at line 174 of file zhuyin_standard.c.

{
       int idx = ZhuyinKeyToZhuyinIndex(key);
       return(ZhuyinIndexToZhuyinType(idx));
}

Here is the call graph for this function:

Here is the caller graph for this function:

int ZhuyinSymbolSequenceToStandardKeySequence ( unsigned char *  sym_sequence,
char *  key_sequence,
int *  sym_len 
)

Definition at line 180 of file zhuyin_standard.c.

{
       int i, idx;
       unsigned char *sym_ptr = sym_sequence;
       char *key_ptr = key_sequence;

       i = 0;
       while (i++ < 4) {
              idx = ZhuyinSymbolToZhuyinIndex(sym_ptr);
              if (idx == 0) break;

              *key_ptr++ = StandardKeyMap[idx];
              sym_ptr += strlen((char *)ZhuyinSymbol[idx]);
       }

       *key_ptr = '\0';
       *sym_len = (sym_ptr - sym_sequence);

       return(0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

char ZhuyinSymbolToStandardKey ( unsigned char *  sym)

Definition at line 140 of file zhuyin_standard.c.

Here is the call graph for this function:

int ZhuyinSymbolToZhuyinIndex ( unsigned char *  sym)

Definition at line 113 of file zhuyin_standard.c.

{
       int idx;

       if (sym == NULL) return(0);

       for (idx = 1; idx <= NUM_OF_ZHUYIN_SYMBOL; idx++) {
              if (!strncmp((char *)sym, (char *)ZhuyinSymbol[idx], strlen(ZhuyinSymbol[idx]))) {
                     return(idx);
              }
       }
       return(0);
}

Here is the caller graph for this function:

int ZhuyinSymbolToZhuyinType ( unsigned char *  sym)

Definition at line 130 of file zhuyin_standard.c.

Here is the call graph for this function:


Variable Documentation

Initial value:
 {
  0,
  '1', 'q', 'a', 'z', '2', 'w', 's', 'x', 'e', 'd',
  'c', 'r', 'f', 'v', '5', 't', 'g', 'b', 'y', 'h',
  'n', 'u', 'j', 'm', '8', 'i', 'k', ',', '9', 'o',
  'l', '.', '0', 'p', ';', '/', '-', ' ', '6', '3',
  '4', '7',
}

Definition at line 57 of file zhuyin_standard.c.

Initial value:
 {
  NULL, 
  "ㄅ", "ㄆ", "ㄇ", "ㄈ", "ㄉ", "ㄊ", "ㄋ", "ㄌ", "ㄍ", "ㄎ",
  "ㄏ", "ㄐ", "ㄑ", "ㄒ", "ㄓ", "ㄔ", "ㄕ", "ㄖ", "ㄗ", "ㄘ",
  "ㄙ",               
  "ㄧ", "ㄨ", "ㄩ",    
  "ㄚ", "ㄛ", "ㄜ", "ㄝ", "ㄞ", "ㄟ", "ㄠ", "ㄡ", "ㄢ", "ㄣ",
  "ㄤ", "ㄥ", "ㄦ",    
  "ˉ", "ˊ", "ˇ", "ˋ", "˙", 
}

Definition at line 46 of file zhuyin_standard.c.