* xmlListSize: * @l: a list * * Get the number of elements in the list * * Returns the number of elements in the list or -1 in case of error */
| 480 | * Returns the number of elements in the list or -1 in case of error |
| 481 | */ |
| 482 | int |
| 483 | xmlListSize(xmlListPtr l) |
| 484 | { |
| 485 | xmlLinkPtr lk; |
| 486 | int count=0; |
| 487 | |
| 488 | if (l == NULL) |
| 489 | return(-1); |
| 490 | /* TODO: keep a counter in xmlList instead */ |
| 491 | for(lk = l->sentinel->next; lk != l->sentinel; lk = lk->next, count++); |
| 492 | return count; |
| 493 | } |
| 494 | |
| 495 | /** |
| 496 | * xmlListPopFront: |
no outgoing calls
no test coverage detected