fred-mod-eppd-2.14.1
Data Structures | Defines | Typedefs | Functions
Queue structure and utilities

Data Structures

struct  queue_item_t
 Definition of queue item type. More...
struct  qhead
 Queue structure used on countless places throughout the program. More...

Defines

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

Typedefs

typedef struct queue_item_t 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).

Define Documentation

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

Iterate through items in a list.

cl advances each round to next item in list, until the sentinel is encountered. Caller must be sure that the list pointer is at the beginning when using this macro - use cl_reset for that.

Referenced by epp_call_check(), epp_call_create_contact(), epp_call_create_domain(), epp_call_create_keyset(), epp_call_create_nsset(), epp_call_dummy(), epp_call_renew_domain(), epp_call_test_nsset(), epp_call_update_contact(), epp_call_update_domain(), epp_call_update_keyset(), epp_call_update_nsset(), epp_gen_response(), gen_info_contact(), gen_info_domain(), gen_info_keyset(), gen_info_nsset(), gen_poll_message(), and gen_response().

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

Shift to next item in a queue.

Referenced by epp_gen_response().

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

Reset current item to the first one.

Referenced by epp_gen_response().


Function Documentation

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, queue_item_t::content, qhead::count, epp_malloc(), and queue_item_t::next.

Referenced by epilog_failure(), epp_call_check(), epp_call_creditinfo(), epp_call_getInfoResults(), epp_call_info_contact(), epp_call_list(), epp_call_poll_req(), info_domain_data_copy(), info_keyset_data_copy(), info_nsset_data_copy(), new_error_item(), parse_create_keyset(), parse_create_nsset(), parse_ext_enumval_create(), parse_ext_enumval_renew(), parse_ext_enumval_update(), parse_update_keyset(), parse_update_nsset(), and xpath_getn().