| T X T _ N O A N S I ( )
| | | | | SOURCE: qdev_autodocs.txt 1.163 (12/09/2014) English INDEP - TXT_#?
----------------------------------------------------------------------------
NAME
txt_noansi() - Checks if character might be a part of
ANSI sequence.
SYNOPSIS
res = txt_noansi(chr, ptr);
LONG txt_noansi(ULONG, ULONG *);
FUNCTION
This function checks if character passed in might possibly
be a part of ANSI sequence. It does that by caching flags.
INPUTS
chr - Character to examine.
ptr - Character/flags cache.
RETURNS
Returns 1 if character does not belong to the ANSI sequence
or 0 if it does.
BASES
None.
NOTES
To correctly determine whether certain character belongs to
ANSI sequence you must start at the sequence initiator(ESC
and/or CSI)!
Historically this function was caching previous character
and was able to only work on ESC prefixed sequences.
SEE ALSO
txt_stripansi()
EXAMPLE
...
UBYTE *text = "\x1B[32mColored text comming up.\x1B[0m";
UBYTE *ptr = text;
UBYTE hold[] = {NULL, NULL};
ULONG store = QDEV_TXT_NA_ALL;
while (*ptr)
{
if (txt_noansi(ptr, &store))
{
hold[0] = *ptr
FPrintf(Output(), "%s", (LONG)hold);
}
ptr++;
}
BUGS
None known.
----------------------------------------------------------------------------
| |
| |