| 192 | /* generic arrays */ |
| 193 | |
| 194 | int md_array_remove_at(struct apr_array_header_t *a, int idx) |
| 195 | { |
| 196 | char *ps, *pe; |
| 197 | |
| 198 | if (idx < 0 || idx >= a->nelts) return 0; |
| 199 | if (idx+1 == a->nelts) { |
| 200 | --a->nelts; |
| 201 | } |
| 202 | else { |
| 203 | ps = (a->elts + (idx * a->elt_size)); |
| 204 | pe = ps + a->elt_size; |
| 205 | memmove(ps, pe, (size_t)((a->nelts - (idx+1)) * a->elt_size)); |
| 206 | --a->nelts; |
| 207 | } |
| 208 | return 1; |
| 209 | } |
| 210 | |
| 211 | int md_array_remove(struct apr_array_header_t *a, void *elem) |
| 212 | { |