diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2009-05-16 16:18:45 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2009-05-16 16:18:45 +0000 |
commit | 6bf4ca08404708bd83a56b1982aa6823d2f605f1 (patch) | |
tree | a3466ffef3728f47675c2578d45cbef29a0d8b50 /crypto/pqueue | |
parent | efa59b8d5957a4e632482280355a92766c4f0f77 (diff) |
Update from 1.0.0-stable.
Diffstat (limited to 'crypto/pqueue')
-rw-r--r-- | crypto/pqueue/pqueue.c | 14 | ||||
-rw-r--r-- | crypto/pqueue/pqueue.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/crypto/pqueue/pqueue.c b/crypto/pqueue/pqueue.c index 5cc18527f8..6c89f06fb1 100644 --- a/crypto/pqueue/pqueue.c +++ b/crypto/pqueue/pqueue.c @@ -234,3 +234,17 @@ pqueue_next(pitem **item) return ret; } + +int +pqueue_size(pqueue_s *pq) +{ + pitem *item = pq->items; + int count = 0; + + while(item != NULL) + { + count++; + item = item->next; + } + return count; +} diff --git a/crypto/pqueue/pqueue.h b/crypto/pqueue/pqueue.h index 02386d130e..16c4072681 100644 --- a/crypto/pqueue/pqueue.h +++ b/crypto/pqueue/pqueue.h @@ -91,5 +91,6 @@ pitem *pqueue_iterator(pqueue pq); pitem *pqueue_next(piterator *iter); void pqueue_print(pqueue pq); +int pqueue_size(pqueue pq); #endif /* ! HEADER_PQUEUE_H */ |