X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=include%2Flibfirm%2Fadt%2Fpqueue.h;h=8ff60406228add434087d576e1e89de27fe77579;hb=0df5e0ea5d4d6a566339ac4b93a73719858e81e1;hp=7ee987338a9bd10ba23eb2284c49c111c075b7e8;hpb=1ce363f80e6a204d4011f85813362d9bd1d0e7e4;p=libfirm diff --git a/include/libfirm/adt/pqueue.h b/include/libfirm/adt/pqueue.h index 7ee987338..8ff604062 100644 --- a/include/libfirm/adt/pqueue.h +++ b/include/libfirm/adt/pqueue.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -21,54 +21,58 @@ * @file * @date 18.04.2007 * @author Christian Wuerdig - * @brief Implementation of a priority queue. This is the ported version of the - * original Java implementation by Matthias Braun. + * @brief Implementation of a priority queue. This is the ported version of + the original Java implementation by Matthias Braun. * @version $Id$ */ #ifndef FIRM_ADT_PQUEUE_H #define FIRM_ADT_PQUEUE_H -typedef struct _pqueue_t pqueue; +#include "../begin.h" + +typedef struct pqueue_t pqueue_t; /** * Creates a new priority queue. * @return A priority queue of initial length 0. */ -pqueue *new_pqueue(void); +FIRM_API pqueue_t *new_pqueue(void); /** * Frees all memory allocated by the priority queue. * @param q The priority queue to destroy. */ -void del_pqueue(pqueue *q); +FIRM_API void del_pqueue(pqueue_t *q); /** * Inserts a new element into a priority queue. - * @param q The priority queue the element should be inserted to. - * @param data The actual data which should be stored in the queue. - * @param key The priority for the data. + * @param q The priority queue the element should be inserted to. + * @param data The actual data which should be stored in the queue. + * @param priority The priority for the data. */ -void pqueue_put(pqueue *q, void *data, int key); +FIRM_API void pqueue_put(pqueue_t *q, void *data, int priority); /** * Returns and removes the first element, ie. that one with the highest priority, from the queue. * @param q The priority queue. * @return The first element of the queue. Asserts if queue is empty. */ -void *pqueue_get(pqueue *q); +FIRM_API void *pqueue_pop_front(pqueue_t *q); /** * Get the length of the priority queue. * @param q The priority queue. * @return The length of the queue. */ -int pqueue_length(pqueue *q); +FIRM_API size_t pqueue_length(const pqueue_t *q); /** * Returns true if queue is empty. * @param q The priority queue. * @return 1 if the queue is empty, 0 otherwise. */ -int pqueue_empty(pqueue *q); +FIRM_API int pqueue_empty(const pqueue_t *q); + +#include "../end.h" #endif