| T X T _ S T R B O T H ( )
| | | | | SOURCE: qdev_autodocs.txt 1.163 (12/09/2014) English PORTA - TXT_#?
----------------------------------------------------------------------------
NAME
txt_strboth() - Compares two strings using cascaded
comparison.
SYNOPSIS
res = txt_strboth(str1, str2);
LONG txt_strboth(const UBYTE *, const UBYTE *);
FUNCTION
This function allows to compare the string using standard
comparison function and if that doesnt result in equality,
tries AmigaOS patterns on it(provided 'str2' contains
them).
INPUTS
str1 - NULL terminated string against which comparing will
be done.
str2 - NULL terminated string, that will be compared. AOS
patterns allowed(more on patterns can be found in
Commodore-Amiga 'RKM').
RETURNS
Returns positive value if strings are equal or pattern
matching was successful.
BASES
(SysBase), (DOSBase)
NOTES
There is also case insensitive variant of this function,
called: 'txt_striboth()'. Please note that by def. there
is no UTF-8 support in case insensitive version, but it
may do support it when compiled to use 'utility.library'
(-D___QDEV_UTILITYCHAREQ)! Plus both of these have ptr
checking wrappers called:
'txt_pstrboth()' and 'txt_pstriboth()' respectively.
This function was made so special pattern characters as
used in AmigaOS pattern parser can be compared too.
SEE ALSO
EXAMPLE
...
/*
* AmigaOS pattern parser discards brackets from the text
* so effectively you cant compare bracketed strings, this
* function allows that and even more.
*/
UBYTE *data = "(Bracketed)";
if ((txt_strboth(data, "(Bracketed)")))
{
if ((txt_strboth(data, "#?Bracketed#?")))
{
...
}
}
BUGS
None known.
----------------------------------------------------------------------------
| |
| |