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

📄 eucstotcs.c

📁 T-kernel 的extension源代码
💻 C
字号:
/* *---------------------------------------------------------------------- *    T-Kernel / Standard Extension * *    Copyright (C) 2006 by Ken Sakamura. All rights reserved. *    T-Kernel / Standard Extension is distributed  *      under the T-License for T-Kernel / Standard Extension. *---------------------------------------------------------------------- * *    Version:   1.00.00 *    Released by T-Engine Forum(http://www.t-engine.org) at 2006/8/11. * *---------------------------------------------------------------------- *//* *	eucstotcs.c (libtcstr) * *	W	eucstotcs(TC *tcstr, const UB* eucstr) * *	Convert an EUC character string into a TC character string. *	Return the length of converted TC character string (=tc_strlen(tcstr)). *	If tcstr == NULL, do not store the conversion result, but return a correct function value. *	If the character string cannot be converted, return the function value "-1". */#include <basic.h>#include <tstring.h>#define TSD_ETT_RTN_M1	(-1)EXPORT	W 	eucstotcs( TC *tcstr, const UB* eucstr ){	W	tlen, len;	for (tlen = 0;  ; tlen++) {		len = euctotc(tcstr, eucstr);		if (len <= 0) {			break;		}		eucstr += len;		if (tcstr != 0) {			tcstr++;		}	}	if (tcstr != 0) {		*tcstr = TNULL;	}	return 	(len < 0) ? TSD_ETT_RTN_M1 : tlen;}

⌨️ 快捷键说明

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