Newer
Older
#include <priority-q.h>
int ASCII2NUM(char ch){
if(ch >= '0' && ch<= '9') return ch-'0';
if(ch >= 'a' && ch<= 'f') return ch-'a'+10;
if(ch>= 'A' && ch<= 'F') return ch-'A'+10;
return -1;
}
int TDPQReady(TDPQ* PQ)
{
return ready;
}
int PushToTDPQ(TDPQ *PQ, TD* Task)
{
if(PQ->Head == NULL){
PQ->Head = Task;
PQ->Tail = Task;
}else{
PQ->Tail->NextInPQ = Task;
PQ->Tail = Task;
}
PQ->Length = PQ->Length + 1;
//bwprintf(COM2,"PQ->Len %d, PQ->head %d\n\r",PQ->Length, PQ->Head);
}else return -1;
}
TD* TDPQGetStart(TDPQ* PQ)
{
}
int TDPQPopStart(TDPQ* PQ)
{
if(TDPQReady(PQ)||PQ->Length == 0){
PQ->Head = PQ->Head->NextInPQ;
PQ->Length = PQ->Length - 1;
}else return -1;
}