Opened 20 years ago
Closed 20 years ago
#685 closed defect (fixed)
should psArray/psVector have a 'length' accessor?
| Reported by: | jhoblitt | Owned by: | Paul Price |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | PSLib SDRS | Version: | unspecified |
| Severity: | normal | Keywords: | |
| Cc: |
Description
It seems logical to have a 'length' function for psArray, psVector, and perhaps
psList as we already have general purpose accessor/mutator functions for those
types. Accessing ->n directly is the only usage that is preventing these types
from being completely opaque to the user. I think that calling such a function
'size' would be too easy confused with 'size_of()' and 'NumElements'/etc. is a
little long winded.
So I'd like to propose the addtion of these functions to API:
psArrayLength()
psVectorLength()
psListLength() (???)
Note:
See TracTickets
for help on using tickets.

Added in the SDRS:
long psListLength(const psList *list);
long psArrayLength(const psArray *array);
long psVectorLength(const psVector *vector);
long psPixelsLength(const psPixels *pixels);