aboutsummaryrefslogtreecommitdiffhomepage
path: root/util.h
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2011-12-26 21:50:23 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2011-12-26 21:50:23 -0800
commit28ecc68841b233188754dd2603566ddf04c288c3 (patch)
treee6107bbcdc36815d362b029f2e84de93ad172547 /util.h
parent7c7aba1202a2c205facd64ab728dcb9472a0b6e1 (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.h92
1 files changed, 0 insertions, 92 deletions
diff --git a/util.h b/util.h
index 948cccdb..ad90bb68 100644
--- a/util.h
+++ b/util.h
@@ -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.