* ap_strcmp_match (const char *str, const char *expected) * Determine if a string matches a pattern containing the wildcards '?' or '*' * @param str The string to check * @param expected The pattern to match against * @param ignoreCase Whether to ignore case when matching * @return 1 if the two strings match, 0 otherwise */
| 1705 | * @return 1 if the two strings match, 0 otherwise |
| 1706 | */ |
| 1707 | static int lua_ap_strcmp_match(lua_State *L) |
| 1708 | { |
| 1709 | int returnValue; |
| 1710 | const char *str; |
| 1711 | const char *expected; |
| 1712 | int ignoreCase = 0; |
| 1713 | luaL_checktype(L, 1, LUA_TSTRING); |
| 1714 | str = lua_tostring(L, 1); |
| 1715 | luaL_checktype(L, 2, LUA_TSTRING); |
| 1716 | expected = lua_tostring(L, 2); |
| 1717 | if (lua_isboolean(L, 3)) |
| 1718 | ignoreCase = lua_toboolean(L, 3); |
| 1719 | if (!ignoreCase) |
| 1720 | returnValue = ap_strcmp_match(str, expected); |
| 1721 | else |
| 1722 | returnValue = ap_strcasecmp_match(str, expected); |
| 1723 | lua_pushboolean(L, (!returnValue)); |
| 1724 | return 1; |
| 1725 | } |
| 1726 | |
| 1727 | |
| 1728 | /** |
nothing calls this directly
no test coverage detected