Back to index

im-sdk  12.3.91
phonetic_im.h
Go to the documentation of this file.
00001 #ifndef _PHONETIC_IM_H_
00002 #define _PHONETIC_IM_H_
00003 
00004 /* Limit Constant Defination */
00005 #define MAX_CHNAME_LEN             256 
00006 #define MAX_USEDCODES_NUM   126 
00007 
00008 #define PHONETIC_ENGINE_NAME   "phonetic"
00009 #define PHONETIC_CONFIG_NAME   "phonetic.cfg"
00010 #define DESCRIPTION_STR   "Description"
00011 #define LOCALE_STR  "Locale Name:"
00012 #define NAME_STR    "Layout Name:"
00013 #define ENCODE_STR    "Encode:"
00014 #define USEDCODES_STR   "UsedCodes:"
00015 #define FUNCTION_STR   "Function:"
00016 
00017 #define IME_Status  ime_buffer->return_status
00018 #define Input_Buf  ime_buffer->inputkey_buf
00019 #define Input_Len  ime_buffer->inputkey_len
00020 #define Preedit_Buf  ime_buffer->preedit_buf
00021 #define prev_Preedit_Buf  ime_buffer->prev_preedit_buf
00022 #define Preedit_Len  ime_buffer->preedit_len
00023 #define Preedit_CaretPos ime_buffer->preedit_caretpos
00024 #define Commit_Buf  ime_buffer->commit_buf
00025 #define Commit_Len  ime_buffer->commit_len
00026 #define Status_Buf  ime_buffer->status_buf
00027 #define Status_Len  ime_buffer->status_len
00028 #define Lookup_Buf  ime_buffer->lookup_buf
00029 #define Lookup_Num  ime_buffer->lookup_num
00030 #define Lookup_Pos  ime_buffer->cur_lookup_pos
00031 #define Candidates_Buf  ime_buffer->candidates_buf
00032 #define Additions_Buf  ime_buffer->additions_buf
00033 
00034 /* Section Constant */
00035 enum _Section_List {
00036        DEFAULT_SECTION = 0,
00037        DESCRIPTION_SECTION,
00038        MAX_SECTION_NUM
00039 };
00040 
00041 /* Bit Operations */
00042 #define BITMASK(i)          (1 << (i))
00043 #define BITSET(a, i)               ((a) |= BITMASK(i))
00044 #define BITCLEAR(a, i)             ((a) &= ~BITMASK(i))
00045 #define GETBIT(a, i)               ((a) & BITMASK(i))
00046 
00047 typedef int (*parse_token) (int *,unsigned char **, int *, int, int);
00048 parse_token fArray[127];
00049 int fNum;
00050 
00051 typedef struct {
00052        char          Encode;                            /* UTF-8 or native: encoding of table */  
00053   unsigned char   Lname[MAX_CHNAME_LEN];
00054        unsigned char        Cname[MAX_CHNAME_LEN];      /* IM Name */
00055        char   Fname[MAX_CHNAME_LEN];      /* Parse Routine Name */
00056        char  UsedCodes[MAX_USEDCODES_NUM]; /* Characters for valid input */
00057        char   Output_Encode;                     /* encode of output */
00058   int   EngineId;
00059   char *ptr;
00060 } TableStruct;
00061 
00062 TableStruct *phtable_Info[127];
00063 int table_Num;
00064 
00065 int word_start_flag;
00066 int word_separator_flag;
00067 int word_end_flag;
00068 
00069 #endif    /*  _PHONETIC_IM_H_  */
00070