📄 ltf_inner.h
字号:
/* *---------------------------------------------------------------------- * 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. * *---------------------------------------------------------------------- *//* * ltf_inner.h (seio) * * Standard input/output * Local tf library *//* ------------------------------------------------------------ */#ifndef __TFCODER_H__#define __TFCODER_H__/* ID type */#define TF_ID_TYPE_MASK 0x1f000000struct xssrc{ UB *pubCurSrc; /* Pointer to characters to be converted */ W wSrcLen; /* Size of characters to be converted */ UB pubBuf[4]; /* Buffer for remaining previous characters */ W wStoredLen; /* Size of remaining previous characters */ W wWantLen; /* Shortage of remaining previous characters */ W wSrcP; /* Position for starting conversion */ TC ptcBuf[ 8]; /* Converted TC character buffer */ W wStoredTCLen; /* Recorded size of converted TC character buffer */ W wStoredTCP; /* Start position for copying converted TC character buffer */};struct tcsrc{ const TC *ptcCurSrc; /* Start of character string to be converted */ W wSrcEnd; /* End of character string to be converted */ W wSrcP; /* Position for starting conversion */ W wSegSize; /* Segment size */ W wRCnt; /* Counter for loading character scale-up/down specification tags */ W wTCState; /* State of current position */ TC tcEsc; /* TRON escape code */};union srcs{ struct xssrc xs; struct tcsrc tcs;};#define TF_NOTRUN 0#define TF_RUN 1#define TF_ZEN 0#define TF_HAN 2#define TF_IGNORE 4#define TF_CONTINUE 8#define TF_SUPPR 0x10#define IS_TF_RUN(x) (((x)->wState) & (TF_RUN))#define SET_TF_RUN(x) (((x)->wState) |= (TF_RUN))#define SET_TF_NOTRUN(x) (((x)->wState) &= ~(UW)(TF_RUN))#define IS_TFZEN(x) (((x) & (TF_HAN)) == 0)#define IS_TFHAN(x) ((x) & (TF_HAN))#define IS_TFIGNO(x) ((x) & (TF_IGNORE))#define IS_TFCONT(x) ((x) & (TF_CONTINUE))#define IS_TFSUPPR(x) ((x) & (TF_SUPPR))#define SET_TFZEN(x) ((x) &= ~(TF_HAN))#define SET_TFHAN(x) ((x) |= (TF_HAN))#define SET_TFNIGNO(x) ((x) &= ~(TF_IGNORE))#define SET_TFIGNO(x) ((x) |= (TF_IGNORE))#define SET_TFNCONT(x) ((x) &= ~(TF_CONTINUE))#define SET_TFCONT(x) ((x) |= (TF_CONTINUE))#define SET_TFNSUPPR(x) ((x) &= ~(TF_SUPPR))#define SET_TFSUPPR(x) ((x) |= (TF_SUPPR))#define TF_TC_TC 0#define TF_TC_NO_OR_LAR 1#define TF_TC_LAR0 2#define TF_TC_LAR1 3#define TF_TC_SKIP 4#define TF_TC_NORM 5#define TF_TC_SUBID 6#define TF_TC_RATIO 7#define SET_TF_TC_TC(a) ((a)->srcs.tcs.wTCState = (TF_TC_TC))#define SET_TF_TC_NO_OR_LAR(a) ((a)->srcs.tcs.wTCState = (TF_TC_NO_OR_LAR))#define SET_TF_TC_LAR0(a) ((a)->srcs.tcs.wTCState = (TF_TC_LAR0))#define SET_TF_TC_LAR1(a) ((a)->srcs.tcs.wTCState = (TF_TC_LAR1))#define SET_TF_TC_SKIP(a) ((a)->srcs.tcs.wTCState = (TF_TC_SKIP))#define SET_TF_TC_NORM(a) ((a)->srcs.tcs.wTCState = (TF_TC_NORM))#define SET_TF_TC_SUBID(a) ((a)->srcs.tcs.wTCState = (TF_TC_SUBID))#define SET_TF_TC_RATIO(a) ((a)->srcs.tcs.wTCState = (TF_TC_RATIO))struct tf_ctx { union srcs srcs; W wState; TLANG uhLang; /* Language specification code */ W (*chgfunc)(); /* Conversion function */ W (*isEnd)(); /* End: TRUE */ /* Subsequent options are based on UB. */ UB ubX2TUndefChar; /* Support for X2T undefined characters */ UB ubT2XUnsupChar; /* Support for character set that cannot be converted into T2X */};#endif /* !__TFCODER_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -