型定義 | |
typedef cache_pqueue_t | cache_pqueue_t |
typedef long(*) | cache_pqueue_set_priority (long queue_clock, void *a) |
typedef long(*) | cache_pqueue_get_priority (void *a) |
typedef apr_ssize_t(*) | cache_pqueue_getpos (void *a) |
typedef void(*) | cache_pqueue_setpos (void *a, apr_ssize_t pos) |
typedef void(*) | cache_pqueue_print_entry (FILE *out, void *a) |
関数 | |
cache_pqueue_t * | cache_pq_init (apr_ssize_t n, cache_pqueue_get_priority pri, cache_pqueue_getpos get, cache_pqueue_setpos set) |
void | cache_pq_free (cache_pqueue_t *q) |
apr_ssize_t | cache_pq_size (cache_pqueue_t *q) |
apr_status_t | cache_pq_insert (cache_pqueue_t *q, void *d) |
void | cache_pq_change_priority (cache_pqueue_t *q, long old_priority, long new_priority, void *d) |
void * | cache_pq_pop (cache_pqueue_t *q) |
apr_status_t | cache_pq_remove (cache_pqueue_t *q, void *d) |
void * | cache_pq_peek (cache_pqueue_t *q) |
void | cache_pq_print (cache_pqueue_t *q, FILE *out, cache_pqueue_print_entry print) |
void | cache_pq_dump (cache_pqueue_t *q, FILE *out, cache_pqueue_print_entry print) |
int | cache_pq_is_valid (cache_pqueue_t *q) |
typedef apr_ssize_t(*) cache_pqueue_getpos(void *a) |
callback function to get a position of a element
typedef void(*) cache_pqueue_print_entry(FILE *out, void *a) |
debug callback function to print a entry
typedef long(*) cache_pqueue_set_priority(long queue_clock, void *a) |
callback function to assign a priority for a element
a | the element |
typedef void(*) cache_pqueue_setpos(void *a, apr_ssize_t pos) |
callback function to set a position of a element
a | the element | |
pos | the position to set it to |
typedef struct cache_pqueue_t cache_pqueue_t |
the cache priority queue handle
void cache_pq_dump | ( | cache_pqueue_t * | q, | |
FILE * | out, | |||
cache_pqueue_print_entry | ||||
) |
dump the queue and it's internal structure
void cache_pq_free | ( | cache_pqueue_t * | q | ) |
free all memory used by the queue
q | the queue |
cache_pqueue_t* cache_pq_init | ( | apr_ssize_t | n, | |
cache_pqueue_get_priority | pri, | |||
cache_pqueue_getpos | get, | |||
cache_pqueue_setpos | set | |||
) |
initialize the queue
n | the initial estimate of the number of queue items for which memory should be preallocated | |
pri | the callback function to run to assign a score to a element | |
get | the callback function to get the current element's position | |
set | the callback function to set the current element's position |
apr_status_t cache_pq_insert | ( | cache_pqueue_t * | q, | |
void * | d | |||
) |
insert an item into the queue.
q | the queue | |
d | the item |
int cache_pq_is_valid | ( | cache_pqueue_t * | q | ) |
checks that the pq is in the right order, etc
void* cache_pq_peek | ( | cache_pqueue_t * | q | ) |
access highest-ranking item without removing it.
q | the queue | |
d | the entry |
void* cache_pq_pop | ( | cache_pqueue_t * | q | ) |
pop the highest-ranking item from the queue.
p | the queue | |
d | where to copy the entry to |
void cache_pq_print | ( | cache_pqueue_t * | q, | |
FILE * | out, | |||
cache_pqueue_print_entry | ||||
) |
print the queue
apr_status_t cache_pq_remove | ( | cache_pqueue_t * | q, | |
void * | d | |||
) |
remove an item from the queue.
p | the queue | |
d | the entry |
apr_ssize_t cache_pq_size | ( | cache_pqueue_t * | q | ) |
return the size of the queue.
q | the queue |