Esempio n. 1
0
unsigned char *WoreWaanRtn( register unsigned char *TempIndx ) {
	register unsigned char *plus1 = TempIndx + 1, *minus3 = TempIndx - 3;

	if ( istcon( *( TempIndx - 1 ) ) ) {
		if ( istlvwl( *( TempIndx - 2 ) ) ) {
			return( minus3 );
		} else if ( istcon( *( TempIndx - 2 ) ) && istcon( *plus1 ) ) {
			switch ( *( TempIndx + 1 ) ) {
			case OrAng:
				return( FAIL );
			case RoreReo:
				if ( *( TempIndx + 2 ) == RoreReo ) {
					return( FAIL );
				}
			default:
				if ( plus1 <= RightMargin ) {
					if ( *( TempIndx + 3 ) == Karan ) {
						return( FAIL );
					} else {
						return( !istrvwl( *( TempIndx + 2 ) ) ? plus1 : FAIL );
					}
				} else {
					return( FAIL );
				}
			}
		} else if ( isttnl( *( TempIndx - 1 ) ) && istcon( *( TempIndx - 2 ) ) && istcon( *minus3 ) ) {

			if ( plus1 <= RightMargin ) {
				return( plus1 );
			} else if ( !nstrcmp( "¡Ã", minus3 ) || !nstrcmp( "¡Å", minus3 ) || !nstrcmp( "˹", minus3 ) || !nstrcmp( "ËÂ", minus3 ) ) {
				return( TempIndx - 4 );
			} else {
				return( minus3 );
			}
		}
	}
	return( FAIL );
}
Esempio n. 2
0
File: SARAR.C Progetto: kytulendu/TW
unsigned char *SaraRRtn( register unsigned char *TempIndx ) {
	register unsigned char *TempIndxm3 = TempIndx - 3; /* for return point before A-2 */
	/* register unsigned char *charPtr; */
	unsigned char chbufm1 = *( TempIndx - 1 );
	unsigned char chbufm3 = *TempIndxm3;

	if ( istcon( chbufm1 ) ) {
		if ( *( TempIndx - 2 ) == SaraA ) {
			/* After this comment is   à_Ò */
			switch ( *( TempIndx + 1 ) ) {
			case SaraAh:		/* à_ÒÐ */
				if ( ( TempIndx + 1 ) <= RightMargin ) {
					if ( *( TempIndx - 1 ) == ToreMontoe ) {	/* à±ÒÐ */
						return( TempIndxm3 );		/* cut before a - 2 */
					} else {
						return ( TempIndx + 1 );	/*cut after a + 1 */
					}
				} else {
					return( TempIndxm3 );			/* cut before a - 2 */
				}
			case RoreReo:
				if ( chbufm1 == SoreSeo || chbufm1 == KoreKwai ) {	/* àÊÒÃì, à¤Òþ */
					return( TempIndxm3 );			/* cut before a - 2  (/à_Ò) */
				} else {
					return( TempIndx );				/* cut after a */
				}
			case NoreNoo:
				if ( chbufm1 == KoreKwai || chbufm1 == PorePla ) {	/* à¤Ò¹ì,à»Ò¹ì*/
					return( TempIndxm3 );			/* cut before a-2 */
				} else {
					return( TempIndx );				/* cut after a */
				}
			case WoreWaan:
				if ( chbufm1 == SoreSeo || chbufm1 == ShoreChang || chbufm1 == YoreYak ) {
					return( TempIndxm3 );			/* cut before a-2 */
				} else {
					return( TempIndx );				/* cut after a */
				}
			default:
				return( TempIndx );					/* cut after a (à_Ò/) */

			}
		} else {									/* isn't SaraA */
			if ( chbufm3 == SaraA ) {
				Indx = TempIndxm3;
				return( ( *FuncPtr[*Indx] )( Indx ) );
			} else {								/* Jmp to SaraARtn */
				return( SaraRWithoutTnl( TempIndx ) );
			}
		}

	} else {										/* Sara ArRtn without tonal mark section */
		switch ( chbufm1 ) {
		case MaiTri:
			if ( *( TempIndx - 3 ) == SaraA ) {
				if ( *( TempIndx + 1 ) == SaraAh && TempIndx + 1 <= RightMargin ) {
					return( TempIndx + 1 );			/* cut after a + 1 */
				} else {
					return( TempIndx - 4 );
				}
			} else {
				return( SaraRWithMaiTri( TempIndx ) );
			}
		case MaiEk:
		case MaiToe:
		case MaiJattawa:
			if ( *( TempIndx - 3 ) == SaraA ) {
				return( TempIndx );					/* cut after a */
			} else {
				if ( *( TempIndx - 4 ) == SaraA ) {
					Indx = TempIndx - 4;
					return( ( *FuncPtr[*Indx] )( Indx ) );
				} else {							/* Jmp to Sara A Rtn */
					return( SaraRWithTonal( TempIndx ) );
				}
			}
		default:
			return( NULL );
		}
	}
}