diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2009-05-16 16:18:19 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2009-05-16 16:18:19 +0000 |
commit | 8d932f6fd7df8a622f3cb998dab1529247158706 (patch) | |
tree | 0b9e0c09f30a0e3dccbd5c6c2314e56ee87b63da /crypto/pqueue | |
parent | 48fd490c6d3c0e5dcfb2f2464ce84adb6bc3ec7e (diff) | |
download | openssl-8d932f6fd7df8a622f3cb998dab1529247158706.tar.gz |
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 c20bc6fc96..99a6fb874d 100644 --- a/crypto/pqueue/pqueue.c +++ b/crypto/pqueue/pqueue.c @@ -237,3 +237,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 7a293c8584..87fc9037c8 100644 --- a/crypto/pqueue/pqueue.h +++ b/crypto/pqueue/pqueue.h @@ -89,5 +89,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 */ |