You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
1.0 KiB

  1. /*****************************************************************************
  2. * Definitions, visible to others, of Priority Queue module: *
  3. *****************************************************************************/
  4. #ifndef PRIOR_Q_GH
  5. #define PRIOR_Q_GH
  6. typedef struct PriorQue
  7. {
  8. struct PriorQue *Right, *Left; /* Pointers to two sons of this node. */
  9. void * Data; /* Pointers to the data itself. */
  10. } PriorQue;
  11. typedef int (*PQCompFuncType)( void *, void *); /* Comparison function. */
  12. /* And global function prototypes: */
  13. void PQInit(PriorQue **PQ);
  14. int PQEmpty(PriorQue *PQ);
  15. void PQCompFunc(PQCompFuncType NewCompFunc);
  16. void * PQFirst(PriorQue **PQ, int Delete);
  17. void * PQInsert(PriorQue **PQ, void * NewItem);
  18. void * PQDelete(PriorQue **PQ, void * NewItem);
  19. void * PQFind(PriorQue *PQ, void * OldItem);
  20. void * PQNext(PriorQue *PQ, void * CmpItem, void * BiggerThan);
  21. void PQPrint(PriorQue *PQ, void (*PrintFunc)());
  22. void PQFree(PriorQue *PQ, int FreeItems);
  23. void PQFreeFunc(PriorQue *PQ, void (*FreeFunc)(void *));
  24. #endif /* PRIOR_Q_GH */