fred-mod-eppd-2.20.1
Data Structures | Macros | Typedefs | Functions
Queue structure and utilities

Data Structures

struct  qitem
 Queue item type. More...
 
struct  qhead
 Queue structure used on countless places throughout the program. More...
 

Macros

#define q_length(_qhead)   ((_qhead).count)
 Get length of a queue. More...
 
#define q_next(_qhead)   ((_qhead)->cur = ((_qhead)->cur) ? (_qhead)->cur->next : NULL)
 Shift to next item in a queue. More...
 
#define q_content(_qhead)   ((_qhead)->cur->content)
 Get content of current item. More...
 
#define q_reset(_qhead)   ((_qhead)->cur = (_qhead)->body)
 Reset current item to the first one. More...
 
#define q_foreach(_qhead)   for ((_qhead)->cur = (_qhead)->body; (_qhead)->cur != NULL; (_qhead)->cur = (_qhead)->cur->next)
 Iterate through items in a list. More...
 

Typedefs

typedef struct qitem qitem
 Queue item type.
 

Functions

int q_add (void *pool, qhead *head, void *data)
 Add new item to a queue (the item will be enqueued at the end of queue). More...
 

Detailed Description

Macro Definition Documentation

◆ q_content

#define q_content (   _qhead)    ((_qhead)->cur->content)

◆ q_foreach

#define q_foreach (   _qhead)    for ((_qhead)->cur = (_qhead)->body; (_qhead)->cur != NULL; (_qhead)->cur = (_qhead)->cur->next)

Iterate through items in a list.

At first, internal pointer is set to the list begining then it advances each round to the next item in a list, until the sentinel is encountered.

Referenced by epp_call_create_keyset(), epp_call_create_nsset(), epp_call_dummy(), epp_call_update_contact(), epp_call_update_domain(), epp_call_update_keyset(), epp_call_update_nsset(), gen_info_contact(), gen_info_domain(), gen_info_keyset(), gen_info_nsset(), gen_poll_message(), and gen_response().

◆ q_length

#define q_length (   _qhead)    ((_qhead).count)

◆ q_next

#define q_next (   _qhead)    ((_qhead)->cur = ((_qhead)->cur) ? (_qhead)->cur->next : NULL)

Shift to next item in a queue.

◆ q_reset

#define q_reset (   _qhead)    ((_qhead)->cur = (_qhead)->body)

Reset current item to the first one.

Function Documentation

◆ q_add()

int q_add ( void *  pool,
qhead head,
void *  data 
)

Add new item to a queue (the item will be enqueued at the end of queue).

Parameters
poolPool from which the new item will be allocated.
headThe queue.
dataPointer to data which shoud be enqueued.
Returns
0 if successfull, otherwise 1.

References qhead::body, qitem::content, qhead::count, epp_malloc(), and qitem::next.

Referenced by epilog_failure(), info_contact_data_copy(), info_domain_data_copy(), info_keyset_data_copy(), info_nsset_data_copy(), new_error_item(), parse_create_keyset(), parse_create_nsset(), parse_update_keyset(), parse_update_nsset(), and xpath_getn().