Export pqueue functions.

04dbb7f1d1 added tests for the pqueue
functions. However, when building as a shared library, the test binary
needs access to the raw pqueue functions which require them to be
exported.

Change-Id: Iffb22fec491082ff43f06a7119560610425cf20e
Reviewed-on: https://boringssl-review.googlesource.com/1711
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
Adam Langley 2014-09-03 13:59:23 -07:00 committed by Adam Langley
parent c92c2d7a07
commit 7bdec13c03

View File

@ -84,11 +84,11 @@ typedef struct _pitem *piterator;
/* pqueue_new allocates a fresh, empty priority queue object and returns it, or /* pqueue_new allocates a fresh, empty priority queue object and returns it, or
* NULL on error. */ * NULL on error. */
pqueue pqueue_new(void); OPENSSL_EXPORT pqueue pqueue_new(void);
/* pqueue_free frees |pq| but not any of the items it points to. Thus |pq| must /* pqueue_free frees |pq| but not any of the items it points to. Thus |pq| must
* be empty or a memory leak will occur. */ * be empty or a memory leak will occur. */
void pqueue_free(pqueue pq); OPENSSL_EXPORT void pqueue_free(pqueue pq);
/* Creating and freeing items. */ /* Creating and freeing items. */
@ -97,47 +97,46 @@ void pqueue_free(pqueue pq);
* has a priority given by |prio64be|, which is a 64-bit, unsigned number * has a priority given by |prio64be|, which is a 64-bit, unsigned number
* expressed in big-endian form. It returns the fresh item, or NULL on * expressed in big-endian form. It returns the fresh item, or NULL on
* error. */ * error. */
pitem *pitem_new(uint8_t prio64be[8], void *data); OPENSSL_EXPORT pitem *pitem_new(uint8_t prio64be[8], void *data);
/* pitem_free frees |item|, but not any data that it points to. */ /* pitem_free frees |item|, but not any data that it points to. */
void pitem_free(pitem *item); OPENSSL_EXPORT void pitem_free(pitem *item);
/* Queue accessor functions */ /* Queue accessor functions */
/* pqueue_peek returns the item with the smallest priority from |pq|, or NULL /* pqueue_peek returns the item with the smallest priority from |pq|, or NULL
* if empty. */ * if empty. */
pitem *pqueue_peek(pqueue pq); OPENSSL_EXPORT pitem *pqueue_peek(pqueue pq);
/* pqueue_find returns the item whose priority matches |prio64be| or NULL if no /* pqueue_find returns the item whose priority matches |prio64be| or NULL if no
* such item exists. */ * such item exists. */
pitem *pqueue_find(pqueue pq, uint8_t *prio64be); OPENSSL_EXPORT pitem *pqueue_find(pqueue pq, uint8_t *prio64be);
/* Queue mutation functions */ /* Queue mutation functions */
/* pqueue_insert inserts |item| into |pq| and returns item. */ /* pqueue_insert inserts |item| into |pq| and returns item. */
pitem *pqueue_insert(pqueue pq, pitem *item); OPENSSL_EXPORT pitem *pqueue_insert(pqueue pq, pitem *item);
/* pqueue_pop takes the item with the least priority from |pq| and returns it, /* pqueue_pop takes the item with the least priority from |pq| and returns it,
* or NULL if |pq| is empty. */ * or NULL if |pq| is empty. */
pitem *pqueue_pop(pqueue pq); OPENSSL_EXPORT pitem *pqueue_pop(pqueue pq);
/* pqueue_size returns the number of items in |pq|. */ /* pqueue_size returns the number of items in |pq|. */
size_t pqueue_size(pqueue pq); OPENSSL_EXPORT size_t pqueue_size(pqueue pq);
/* Iterating */ /* Iterating */
/* pqueue_iterator returns an iterator that can be used to iterate over the /* pqueue_iterator returns an iterator that can be used to iterate over the
* contents of the queue. */ * contents of the queue. */
piterator pqueue_iterator(pqueue pq); OPENSSL_EXPORT piterator pqueue_iterator(pqueue pq);
/* pqueue_next returns the current value of |iter| and advances it to the next /* pqueue_next returns the current value of |iter| and advances it to the next
* position. If the iterator has advanced over all the elements, it returns * position. If the iterator has advanced over all the elements, it returns
* NULL. */ * NULL. */
pitem *pqueue_next(piterator *iter); OPENSSL_EXPORT pitem *pqueue_next(piterator *iter);
#if defined(__cplusplus) #if defined(__cplusplus)