#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "pq.h"
Go to the source code of this file.
Functions | |
void | InitPQ (PQ *q, int ne, int(*c)(void **, void **)) |
int | Insert (PQ *q, void *item) |
int | Delete (PQ *q, void **target) |
int | Replace (PQ *q, void **target, void *item) |
int | Remove (PQ *q, void **target, int(*cmp)(void **, void **), void *item) |
void | swap (void **s1, void **s2) |
void | ReheapUp (PQ *q) |
void | ReheapDown (PQ *q) |
void * | Get (PQ *q) |
int | NumElem (PQ *q) |
void * | GetI (PQ *q, int i) |
Variables | |
int | ReplaceCount |
int | ReplaceCountReheap |
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 ** | s1, | |
void ** | s2 | |||
) |
int ReplaceCount |