Tizen RT Libs&Environment  v1.0 D5

Provides APIs for Queue. More...

Collaboration diagram for QUEUE:

Files

file  queue.h
 Queue APIs.
 

Data Structures

struct  sq_entry_s
 structure for singly-linked queue More...
 
struct  dq_entry_s
 structure for double-linked queue More...
 
struct  sq_queue_s
 structure for header queue More...
 
struct  dq_queue_s
 structure for header queue More...
 

Macros

#define sq_init(q)   do { (q)->head = NULL; (q)->tail = NULL; } while (0)
 
#define dq_init(q)   do { (q)->head = NULL; (q)->tail = NULL; } while (0)
 
#define sq_next(p)   ((p)->flink)
 
#define dq_next(p)   ((p)->flink)
 
#define dq_prev(p)   ((p)->blink)
 
#define sq_empty(q)   ((q)->head == NULL)
 
#define dq_empty(q)   ((q)->head == NULL)
 
#define sq_peek(q)   ((q)->head)
 
#define dq_peek(q)   ((q)->head)
 
#define EXTERN   extern
 

Typedefs

typedef struct sq_entry_s sq_entry_t
 
typedef struct dq_entry_s dq_entry_t
 
typedef struct sq_queue_s sq_queue_t
 
typedef struct dq_queue_s dq_queue_t
 

Functions

void sq_addfirst (FAR sq_entry_t *node, FAR sq_queue_t *queue)
 places the 'node' at the head of the 'queue' More...
 
void dq_addfirst (FAR dq_entry_t *node, FAR dq_queue_t *queue)
 adds 'node' at the beginning of 'queue' More...
 
void sq_addlast (FAR sq_entry_t *node, FAR sq_queue_t *queue)
 places the 'node' at the tail of the 'queue' More...
 
void dq_addlast (FAR dq_entry_t *node, FAR dq_queue_t *queue)
 adds 'node' to the end of 'queue' More...
 
void sq_addafter (FAR sq_entry_t *prev, FAR sq_entry_t *node, FAR sq_queue_t *queue)
 adds 'node' after 'prev' in the 'queue.' More...
 
void dq_addafter (FAR dq_entry_t *prev, FAR dq_entry_t *node, FAR dq_queue_t *queue)
 adds 'node' after 'prev' in the 'queue.' More...
 
void dq_addbefore (FAR dq_entry_t *next, FAR dq_entry_t *node, FAR dq_queue_t *queue)
 adds 'node' before 'next' in 'queue' More...
 
FAR sq_entry_tsq_remafter (FAR sq_entry_t *node, FAR sq_queue_t *queue)
 removes the entry following 'node More...
 
void sq_rem (FAR sq_entry_t *node, FAR sq_queue_t *queue)
 removes a 'node' for 'queue.' More...
 
void dq_rem (FAR dq_entry_t *node, FAR dq_queue_t *queue)
 removes 'node' from 'queue' More...
 
FAR sq_entry_tsq_remlast (FAR sq_queue_t *queue)
 Removes the last entry in a singly-linked queue. More...
 
FAR dq_entry_tdq_remlast (FAR dq_queue_t *queue)
 removes the last entry from 'queue' More...
 
FAR sq_entry_tsq_remfirst (FAR sq_queue_t *queue)
 removes the first entry from 'queue' More...
 
FAR dq_entry_tdq_remfirst (FAR dq_queue_t *queue)
 removes 'node' from the head of 'queue' More...
 

Detailed Description

Provides APIs for Queue.

Macro Definition Documentation

#define dq_empty (   q)    ((q)->head == NULL)

Definition at line 84 of file queue.h.

#define dq_init (   q)    do { (q)->head = NULL; (q)->tail = NULL; } while (0)

Definition at line 77 of file queue.h.

#define dq_next (   p)    ((p)->flink)

Definition at line 80 of file queue.h.

#define dq_peek (   q)    ((q)->head)

Definition at line 87 of file queue.h.

#define dq_prev (   p)    ((p)->blink)

Definition at line 81 of file queue.h.

#define EXTERN   extern

Definition at line 136 of file queue.h.

#define sq_empty (   q)    ((q)->head == NULL)

Definition at line 83 of file queue.h.

#define sq_init (   q)    do { (q)->head = NULL; (q)->tail = NULL; } while (0)

Definition at line 76 of file queue.h.

#define sq_next (   p)    ((p)->flink)

Definition at line 79 of file queue.h.

#define sq_peek (   q)    ((q)->head)

Definition at line 86 of file queue.h.

Typedef Documentation

typedef struct dq_entry_s dq_entry_t

Definition at line 108 of file queue.h.

typedef struct dq_queue_s dq_queue_t

Definition at line 126 of file queue.h.

typedef struct sq_entry_s sq_entry_t

Definition at line 99 of file queue.h.

typedef struct sq_queue_s sq_queue_t

Definition at line 117 of file queue.h.

Function Documentation

void dq_addafter ( FAR dq_entry_t prev,
FAR dq_entry_t node,
FAR dq_queue_t queue 
)

adds 'node' after 'prev' in the 'queue.'

Parameters
[in]nodeto be added
[in]prevnode
[in]queue
Returns
none
Since
Tizen RT v1.0
void dq_addbefore ( FAR dq_entry_t next,
FAR dq_entry_t node,
FAR dq_queue_t queue 
)

adds 'node' before 'next' in 'queue'

Parameters
[in]nextnode
[in]nodeto be added
[in]queue
Returns
none
Since
Tizen RT v1.0
void dq_addfirst ( FAR dq_entry_t node,
FAR dq_queue_t queue 
)

adds 'node' at the beginning of 'queue'

Parameters
[in]nodeto be added
[in]queue
Returns
none
Since
Tizen RT v1.0
void dq_addlast ( FAR dq_entry_t node,
FAR dq_queue_t queue 
)

adds 'node' to the end of 'queue'

Parameters
[in]nodeto be added
[in]queue
Returns
none
Since
Tizen RT v1.0
void dq_rem ( FAR dq_entry_t node,
FAR dq_queue_t queue 
)

removes 'node' from 'queue'

Parameters
[in]nodeto be removed
[in]queue
Returns
void
Since
Tizen RT v1.0
FAR dq_entry_t* dq_remfirst ( FAR dq_queue_t queue)

removes 'node' from the head of 'queue'

Parameters
[in]singly-linkedqueue
Returns
node to be removed
Since
Tizen RT v1.0
FAR dq_entry_t* dq_remlast ( FAR dq_queue_t queue)

removes the last entry from 'queue'

Parameters
[in]singly-linkedqueue
Returns
node to be removed
Since
Tizen RT v1.0
void sq_addafter ( FAR sq_entry_t prev,
FAR sq_entry_t node,
FAR sq_queue_t queue 
)

adds 'node' after 'prev' in the 'queue.'

Parameters
[in]nodeto be added
[in]queue
Returns
none
Since
Tizen RT v1.0
void sq_addfirst ( FAR sq_entry_t node,
FAR sq_queue_t queue 
)

places the 'node' at the head of the 'queue'

Parameters
[in]nodeto be added
[in]queue
Returns
none
Since
Tizen RT v1.0
void sq_addlast ( FAR sq_entry_t node,
FAR sq_queue_t queue 
)

places the 'node' at the tail of the 'queue'

Parameters
[in]nodeto be added
[in]queue
Returns
none
Since
Tizen RT v1.0
void sq_rem ( FAR sq_entry_t node,
FAR sq_queue_t queue 
)

removes a 'node' for 'queue.'

Parameters
[in]nodeto be removed
[in]queue
Returns
void
Since
Tizen RT v1.0
FAR sq_entry_t* sq_remafter ( FAR sq_entry_t node,
FAR sq_queue_t queue 
)

removes the entry following 'node

Parameters
[in]nodeto be removed
[in]queue
Returns
a reference to the removed entry
Since
Tizen RT v1.0
FAR sq_entry_t* sq_remfirst ( FAR sq_queue_t queue)

removes the first entry from 'queue'

Parameters
[in]singly-linkedqueue
Returns
node to be removed
Since
Tizen RT v1.0
FAR sq_entry_t* sq_remlast ( FAR sq_queue_t queue)

Removes the last entry in a singly-linked queue.

Parameters
[in]singly-linkedqueue
Returns
node to be removed
Since
Tizen RT v1.0