| T X T _ S T R P A T ( )
| | | | | SOURCE: qdev_autodocs.txt 1.163 (12/09/2014) English PORTA - TXT_#?
----------------------------------------------------------------------------
NAME
txt_strpat() - Compares two strings using AmigaOS pattern
matching facility.
SYNOPSIS
res = txt_strpat(str1, str2);
LONG txt_strpat(const UBYTE *, const UBYTE *);
FUNCTION
This function is able to compare fully or partially two
strings using AmigaOS pattern syntax.
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_stripat()'. 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_pstrpat()' and 'txt_pstripat()' respectively.
Please note, case sensitive pattern matching is about
3 times slower than using ordinary string matching funcs.
such as 'txt_strstr()', 'txt_strcmp()' and up to 10 times
slower when using case insensitive variant!!!
This function cannot compare strings that contain special
pattern characters and are not related to patterns! If you
want standard comparison plus pattern comparison then use
'txt_strboth()'.
SEE ALSO
EXAMPLE
...
UBYTE *data = "Your CPU is: 68040\n";
if ((txt_strpat(data, "#?68040#?")))
{
...
}
BUGS
None known.
----------------------------------------------------------------------------
| |
| |