Main Page Class Hierarchy Compound List File List Compound Members File Members

# priority_queue.h File Reference

`#include <transport.h>`

Go to the source code of this file.

## Compounds
struct | PRI_QUEUE
struct | PRI_QUEUE_ENTRY
## Defines
#define | EW_PRI_NOITEM 3
#define | EW_PRI_RETREJECT 2
#define | EW_PRI_RETDROP 1
#define | EW_PRI_RETNORMAL 0
#define | EW_PRI_RETNOTREADY -1
#define | EW_PRI_RETMSGSIZE -2
#define | EW_PRI_RETQNULL -3
#define | EW_PRI_RETMALLOC -4
#define | EW_PRI_RETBADPRI -5
#define | EW_PRI_RETPARAM -6
#define | EW_PRIORITY_NONE 0
#define | EW_PRIORITY_MIN 1
#define | EW_PRIORITY_MAX 9
#define | EW_PRIORITY_COUNT 10
#define | EW_PRIORITY_DEF 9
## Typedefs
typedef short | EW_PRIORITY
typedef char * | PRI_DATA
## Functions
int | init_pri_queue (PRI_QUEUE *p_queue, unsigned long p_max_items, unsigned long p_max_item_size)
void | release_pri_queue (PRI_QUEUE *p_queue)
int | getNumOfElementsInQueue (PRI_QUEUE *p_queue)
int | add_item (PRI_QUEUE *p_queue, EW_PRIORITY p_priority, MSG_LOGO p_logo, long p_size, PRI_DATA p_data)
int | peek_next_item (PRI_QUEUE *p_queue, MSG_LOGO *p_logoptr, EW_PRIORITY *p_priptr)
int | pop_next_item (PRI_QUEUE *p_queue, MSG_LOGO *p_logoptr, long *p_sizeptr, PRI_DATA p_data)

## Define Documentation

#define EW_PRI_NOITEM 3

| Definition at line 23 of file priority_queue.h. Referenced by peek_next_item(), and pop_next_item().

#define EW_PRI_RETBADPRI -5

| Definition at line 31 of file priority_queue.h. Referenced by add_item().

#define EW_PRI_RETDROP 1

| Definition at line 25 of file priority_queue.h. Referenced by add_item().

#define EW_PRI_RETMALLOC -4

| Definition at line 30 of file priority_queue.h. Referenced by init_pri_queue().

#define EW_PRI_RETMSGSIZE -2

| Definition at line 28 of file priority_queue.h.

#define EW_PRI_RETNORMAL 0

| Definition at line 26 of file priority_queue.h. Referenced by add_item(), init_pri_queue(), peek_next_item(), and pop_next_item().

#define EW_PRI_RETNOTREADY -1

| Definition at line 27 of file priority_queue.h.

#define EW_PRI_RETPARAM -6

| Definition at line 32 of file priority_queue.h. Referenced by init_pri_queue().

#define EW_PRI_RETQNULL -3

| Definition at line 29 of file priority_queue.h. Referenced by init_pri_queue().

#define EW_PRI_RETREJECT 2

| Definition at line 24 of file priority_queue.h. Referenced by add_item().

#define EW_PRIORITY_COUNT 10

| Definition at line 45 of file priority_queue.h. Referenced by add_item(), init_pri_queue(), and pop_next_item().

#define EW_PRIORITY_DEF 9

| Definition at line 47 of file priority_queue.h. Referenced by add_item().

#define EW_PRIORITY_MAX 9

| Definition at line 44 of file priority_queue.h. Referenced by add_item().

#define EW_PRIORITY_MIN 1

| Definition at line 43 of file priority_queue.h. Referenced by add_item().

#define EW_PRIORITY_NONE 0

| Definition at line 42 of file priority_queue.h. Referenced by init_pri_queue(), peek_next_item(), and pop_next_item().

## Typedef Documentation

typedef short EW_PRIORITY

| Definition at line 50 of file priority_queue.h. Referenced by add_item().

typedef char* PRI_DATA

| Definition at line 53 of file priority_queue.h.

## Function Documentation

int add_item | ( | PRI_QUEUE * | p_queue,
|  | EW_PRIORITY | p_priority,
|  | MSG_LOGO | p_logo,
|  | long | p_size,
|  | PRI_DATA | p_data
| ) |

| Definition at line 219 of file priority_queue.c. References PRI_QUEUE_ENTRY::data, EW_PRI_RETBADPRI, EW_PRI_RETDROP, EW_PRI_RETNORMAL, EW_PRI_RETREJECT, EW_PRI_SHIFT_DOWN, EW_PRI_SHIFT_NONE, EW_PRI_SHIFT_UP, EW_PRIORITY, EW_PRIORITY_COUNT, EW_PRIORITY_DEF, EW_PRIORITY_MAX, EW_PRIORITY_MIN, PRI_QUEUE::insert_indices, MSG_LOGO::instid, PRI_QUEUE::itemmaxsize, PRI_QUEUE::itemsused, PRI_QUEUE_ENTRY::length, PRI_QUEUE::lock, logit(), PRI_QUEUE_ENTRY::logo, MSG_LOGO::mod, PRI_QUEUE_ENTRY::pri, PRI_QUEUE::queuesize, ReleaseSpecificMutex(), RequestSpecificMutex(), PRI_QUEUE::sorted, and MSG_LOGO::type.

int getNumOfElementsInQueue | ( | PRI_QUEUE * | p_queue | ) |

| Definition at line 207 of file priority_queue.c. References PRI_QUEUE::itemsused.

int init_pri_queue | ( | PRI_QUEUE * | p_queue,
|  | unsigned long | p_max_items,
|  | unsigned long | p_max_item_size
| ) |

| Definition at line 48 of file priority_queue.c. References CreateSpecificMutex(), PRI_QUEUE_ENTRY::data, PRI_QUEUE::data, PRI_QUEUE::entries, EW_PRI_RETMALLOC, EW_PRI_RETNORMAL, EW_PRI_RETPARAM, EW_PRI_RETQNULL, EW_PRIORITY_COUNT, EW_PRIORITY_NONE, PRI_QUEUE::insert_indices, PRI_QUEUE::itemmaxsize, PRI_QUEUE::itemsused, PRI_QUEUE_ENTRY::length, PRI_QUEUE::lock, logit(), PRI_QUEUE_ENTRY::pri, PRI_QUEUE::queuesize, release_pri_queue(), and PRI_QUEUE::sorted.

int peek_next_item | ( | PRI_QUEUE * | p_queue,
|  | MSG_LOGO * | p_logoptr,
|  | EW_PRIORITY * | p_priptr
| ) |

| Definition at line 489 of file priority_queue.c. References EW_PRI_NOITEM, EW_PRI_RETNORMAL, EW_PRIORITY_NONE, MSG_LOGO::instid, PRI_QUEUE::lock, PRI_QUEUE_ENTRY::logo, MSG_LOGO::mod, PRI_QUEUE_ENTRY::pri, PRI_QUEUE::queuesize, ReleaseSpecificMutex(), RequestSpecificMutex(), PRI_QUEUE::sorted, and MSG_LOGO::type.

int pop_next_item | ( | PRI_QUEUE * | p_queue,
|  | MSG_LOGO * | p_logoptr,
|  | long * | p_sizeptr,
|  | PRI_DATA | p_data
| ) |

| Definition at line 541 of file priority_queue.c. References PRI_QUEUE_ENTRY::data, EW_PRI_NOITEM, EW_PRI_RETNORMAL, EW_PRIORITY_COUNT, EW_PRIORITY_NONE, PRI_QUEUE::insert_indices, MSG_LOGO::instid, PRI_QUEUE::itemsused, PRI_QUEUE_ENTRY::length, PRI_QUEUE::lock, logit(), PRI_QUEUE_ENTRY::logo, MSG_LOGO::mod, PRI_QUEUE_ENTRY::pri, PRI_QUEUE::queuesize, ReleaseSpecificMutex(), RequestSpecificMutex(), PRI_QUEUE::sorted, and MSG_LOGO::type.

void release_pri_queue | ( | PRI_QUEUE * | p_queue | ) |

| Definition at line 178 of file priority_queue.c. References CloseSpecificMutex(), PRI_QUEUE::data, PRI_QUEUE::entries, PRI_QUEUE::itemsused, PRI_QUEUE::lock, PRI_QUEUE::queuesize, and PRI_QUEUE::sorted. Referenced by init_pri_queue().