⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uifind_py.c

📁 嵌入工linux开发的源码
💻 C
字号:
#include "uiFind_py.h"
#include "uiWnd.h"
#include "uiFind_py.res"

//******************************************************
// codeStr:	汉字
// pyStr:	多音字每个读音的第一个字母组成的字符串
// return:	pyStr中的字母数
//******************************************************
DLL_EXP(int) guiGet_py(char *codeStr, char *pyStr)
{
	//char codeQm,codeWm;
	unsigned short codeQm,codeWm, temp;
	int codeID;
	int pyNum;
	int iLeft,iMid,iRight; 
	
	char numStr[32];
                                         

//	codeQm=codeStr[0]-0xb0;
//	codeWm=codeStr[1]-0xa1;
	temp = (unsigned char)codeStr[0];   
	codeQm=temp-0xb0;
	temp = (unsigned char)codeStr[1]; 
	codeWm=temp-0xa1;    

	//if(codeQm < 0 || codeQm > 71 || codeWm < 0 || codeWm > 93)      
	if(codeQm > 71 || codeWm > 93)            // by zhangxp     2003/06/17      
	{ 
		return 0;
	}                                                                   


	codeID=codeQm*94+codeWm;
	pyStr[0]=MPY_TABLE1[codeID];
	pyNum=1;
	                
	iLeft = 0;  iRight = MAX_MPY-1;
	while(iLeft <= iRight)
	{
		iMid = (iRight+iLeft)/2;

		if(codeID == MPY_TABLE2[iMid].codeID)
			break;
		else if(codeID < MPY_TABLE2[iMid].codeID)
			iRight = iMid-1;
		else
			iLeft = iMid+1;
	}
	if(codeID == MPY_TABLE2[iMid].codeID)
	{
		pyStr[1] = MPY_TABLE2[iMid].py1;
		pyNum++;
		if(MPY_TABLE2[iMid].py2 != ' ')
		{
			pyStr[2] = MPY_TABLE2[iMid].py2;
			pyNum++;
		}
		if(MPY_TABLE2[iMid].py3 != ' ')
		{
			pyStr[3] = MPY_TABLE2[iMid].py3;
			pyNum++;
		}
	}
	pyStr[pyNum]='\0';
	return pyNum;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -