Go to the source code of this file.
Data Structures | |
struct | pq |
typedef struct pq | PQ |
Class for priority queue. | |
void | swap (void **, void **) |
void | ReheapUp (PQ *q) |
void | ReheapDown (PQ *q) |
void | InitPQ (PQ *q, int ne, int(*c)(void **, void **)) |
int | Insert (PQ *q, void *item) |
int | Delete (PQ *q, void **target) |
void * | Get (PQ *q) |
int | NumElem (PQ *q) |
int | Replace (PQ *q, void **target, void *item) |
int | Remove (PQ *q, void **target, int(*cmp)(void **, void **), void *item) |
void * | GetI (PQ *q, int i) |
Definition in file pq.h.
int Delete | ( | PQ * | q, | |
void ** | target | |||
) |
Definition at line 77 of file pq.c.
References pq::bottom, pq::heap, pq::nitems, and ReheapDown().
Referenced by BQget(), PendSemaphore(), and StartOS().
void InitPQ | ( | PQ * | q, | |
int | ne, | |||
int(*)(void **, void **) | c | |||
) |
Definition at line 34 of file pq.c.
References pq::bottom, pq::cmp, pq::heap, malloc, pq::maxitems, and pq::nitems.
Referenced by OSInit().
int Insert | ( | PQ * | q, | |
void * | item | |||
) |
Definition at line 53 of file pq.c.
References pq::bottom, pq::maxitems, pq::nitems, and ReheapUp().
Referenced by BQPut(), DeleteSemaphore(), InitTimerServices(), mmcInit(), PostSemaphore(), PostSemaphoreIrq(), PostSemaphoreWithData(), and TimerTicker().
int NumElem | ( | PQ * | q | ) |
void ReheapDown | ( | PQ * | q | ) |
void ReheapUp | ( | PQ * | q | ) |
int Remove | ( | PQ * | q, | |
void ** | target, | |||
int(*)(void **, void **) | cmp, | |||
void * | item | |||
) |
Definition at line 136 of file pq.c.
References pq::bottom, pq::heap, memcpy(), pq::nitems, and ReheapDown().
int Replace | ( | PQ * | q, | |
void ** | target, | |||
void * | item | |||
) |
Definition at line 102 of file pq.c.
References pq::cmp, pq::heap, pq::nitems, ReheapDown(), ReplaceCount, and ReplaceCountReheap.
Referenced by ExitInterrupt(), and Yeild().
void swap | ( | void ** | , | |
void ** | ||||
) |