diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2011-12-26 21:50:23 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2011-12-26 21:50:23 -0800 |
commit | 28ecc68841b233188754dd2603566ddf04c288c3 (patch) | |
tree | e6107bbcdc36815d362b029f2e84de93ad172547 /util.h | |
parent | 7c7aba1202a2c205facd64ab728dcb9472a0b6e1 (diff) |
Migrated some more data structures to the STL. Removed some ad-hoc data structure implementations.
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 92 |
1 files changed, 0 insertions, 92 deletions
@@ -42,23 +42,6 @@ typedef union } anything_t; - -/** - Data structure for an automatically resizing dynamically allocated queue, -*/ -typedef struct dyn_queue -{ - /** Start of the array */ - void **start; - /** End of the array*/ - void **stop; - /** Where to insert elements */ - void **put_pos; - /** Where to remove elements */ - void **get_pos; -} - dyn_queue_t; - /** Internal struct used by hash_table_t. */ @@ -210,38 +193,6 @@ int mini( int a, int b ); to never be less than 50% full. */ -/** - Initialize the queue. A queue is a FIFO buffer, i.e. the first - element to be inserted into the buffer is the first element to be - returned. -*/ -void q_init( dyn_queue_t *q ); - -/** - Destroy the queue -*/ -void q_destroy( dyn_queue_t *q ); - -/** - Insert element into queue -*/ -int q_put( dyn_queue_t *q, void *e ); - -/** - Remove and return next element from queue -*/ -void *q_get( dyn_queue_t *q); - -/** - Return next element from queue without removing it -*/ -void *q_peek( dyn_queue_t *q); - -/** - Returns 1 if the queue is empty, 0 otherwise -*/ -int q_empty( dyn_queue_t *q ); - /** Initialize a hash table. The hash function must never return the value 0. */ @@ -364,49 +315,6 @@ int hash_ptr_cmp( void *a, void *b ); - -/** - Initialize the priority queue - - \param q the queue to initialize - \param compare a comparison function that can compare two entries in the queue -*/ -void pq_init( priority_queue_t *q, - int (*compare)(void *e1, void *e2) ); -/** - Add element to the queue - - \param q the queue - \param e the new element - -*/ -int pq_put( priority_queue_t *q, - void *e ); -/** - Removes and returns the last entry in the priority queue -*/ -void *pq_get( priority_queue_t *q ); - -/** - Returns the last entry in the priority queue witout removing it. -*/ -void *pq_peek( priority_queue_t *q ); - -/** - Returns 1 if the priority queue is empty, 0 otherwise. -*/ -int pq_empty( priority_queue_t *q ); - -/** - Returns the number of elements in the priority queue. -*/ -int pq_get_count( priority_queue_t *q ); - -/** - Destroy the priority queue and free memory used by it. -*/ -void pq_destroy( priority_queue_t *q ); - /** Allocate heap memory for creating a new list and initialize it. Equivalent to calling malloc and al_init. |