## soup-message-queue

soup-message-queue —

## Synopsis

    struct      SoupMessageQueueIter;
    SoupMessageQueue* soup_message_queue_new    (void);
    void        soup_message_queue_append       (SoupMessageQueue *queue,
                                                 SoupMessage *msg);
    SoupMessage* soup_message_queue_first       (SoupMessageQueue *queue,
                                                 SoupMessageQueueIter *iter);
    SoupMessage* soup_message_queue_next        (SoupMessageQueue *queue,
                                                 SoupMessageQueueIter *iter);
    SoupMessage* soup_message_queue_remove      (SoupMessageQueue *queue,
                                                 SoupMessageQueueIter *iter);
    void        soup_message_queue_free_iter    (SoupMessageQueue *queue,
                                                 SoupMessageQueueIter *iter);
    void        soup_message_queue_destroy      (SoupMessageQueue *queue);
    void        soup_message_queue_remove_message
                                                (SoupMessageQueue *queue,
                                                 SoupMessage *msg);

## Description

## Details

### struct SoupMessageQueueIter

    struct SoupMessageQueueIter {

    	GList *cur, *next;
    };

An opaque data structure used to iterate the elements of a SoupMessageQueue.

### soup_message_queue_new ()

    SoupMessageQueue* soup_message_queue_new    (void);

Creates a new SoupMessageQueue

Returns : | a new SoupMessageQueue object

### soup_message_queue_append ()

    void        soup_message_queue_append       (SoupMessageQueue *queue,
                                                 SoupMessage *msg);

Appends `msg` to the end of `queue`

`queue` : | a queue
`msg` : | a message

### soup_message_queue_first ()

    SoupMessage* soup_message_queue_first       (SoupMessageQueue *queue,
                                                 SoupMessageQueueIter *iter);

Initializes `iter` and returns the first element of `queue`. If you do not iterate all the way to the end of the list, you must call `soup_message_queue_free_iter()` to dispose the iterator when you are done.

`queue` : | a queue
`iter` : | pointer to a SoupMessageQueueIter
Returns : | the first element of `queue`, or `NULL` if it is empty.

### soup_message_queue_next ()

    SoupMessage* soup_message_queue_next        (SoupMessageQueue *queue,
                                                 SoupMessageQueueIter *iter);

Returns the next element of `queue`

`queue` : | a queue
`iter` : | pointer to an initialized SoupMessageQueueIter
Returns : | the next element, or `NULL` if there are no more.

### soup_message_queue_remove ()

    SoupMessage* soup_message_queue_remove      (SoupMessageQueue *queue,
                                                 SoupMessageQueueIter *iter);

Removes the queue element pointed to by `iter`; that is, the last message returned by `soup_message_queue_first()` or `soup_message_queue_next()`.

`queue` : | a queue
`iter` : | pointer to an initialized SoupMessageQueueIter
Returns : | the removed message, or `NULL` if the element pointed to by `iter` was already removed.

### soup_message_queue_free_iter ()

    void        soup_message_queue_free_iter    (SoupMessageQueue *queue,
                                                 SoupMessageQueueIter *iter);

Removes `iter` from the list of active iterators in `queue`.

`queue` : | a queue
`iter` : | pointer to an initialized SoupMessageQueueIter

### soup_message_queue_destroy ()

    void        soup_message_queue_destroy      (SoupMessageQueue *queue);

Frees memory associated with `queue`, which must be empty.

`queue` : | a message queue

### soup_message_queue_remove_message ()

    void        soup_message_queue_remove_message
                                                (SoupMessageQueue *queue,
                                                 SoupMessage *msg);

Removes the indicated message from `queue`.

`queue` : | a queue
`msg` : | a SoupMessage