* Remove the specified method from a method list. */
| 1632 | * Remove the specified method from a method list. |
| 1633 | */ |
| 1634 | AP_DECLARE(void) ap_method_list_remove(ap_method_list_t *l, |
| 1635 | const char *method) |
| 1636 | { |
| 1637 | int methnum; |
| 1638 | char **methods; |
| 1639 | |
| 1640 | /* |
| 1641 | * If it's a known methods, either builtin or registered |
| 1642 | * by a module, use the bitmask. |
| 1643 | */ |
| 1644 | methnum = ap_method_number_of(method); |
| 1645 | if (methnum != M_INVALID) { |
| 1646 | l->method_mask &= ~(AP_METHOD_BIT << methnum); |
| 1647 | return; |
| 1648 | } |
| 1649 | /* |
| 1650 | * Otherwise, see if the method name is in the array of string names. |
| 1651 | */ |
| 1652 | if (l->method_list->nelts != 0) { |
| 1653 | int i, j, k; |
| 1654 | methods = (char **)l->method_list->elts; |
| 1655 | for (i = 0; i < l->method_list->nelts; ) { |
| 1656 | if (strcmp(method, methods[i]) == 0) { |
| 1657 | for (j = i, k = i + 1; k < l->method_list->nelts; ++j, ++k) { |
| 1658 | methods[j] = methods[k]; |
| 1659 | } |
| 1660 | --l->method_list->nelts; |
| 1661 | } |
| 1662 | else { |
| 1663 | ++i; |
| 1664 | } |
| 1665 | } |
| 1666 | } |
| 1667 | } |
| 1668 | |
| 1669 | /* |
| 1670 | * Reset a method list to be completely empty. |
nothing calls this directly
no test coverage detected