## CamelPOP3Engine CamelPOP3Engine |

## Synopsis

    struct              CamelPOP3Engine;
    CamelPOP3Engine *   camel_pop3_engine_new               (CamelStream *source,
                                                             guint32 flags,
                                                             GCancellable *cancellable,
                                                             GError **error);
    gboolean            camel_pop3_engine_reget_capabilities
                                                            (CamelPOP3Engine *engine,
                                                             GCancellable *cancellable,
                                                             GError **error);
    gint                camel_pop3_engine_iterate           (CamelPOP3Engine *pe,
                                                             CamelPOP3Command *pc,
                                                             GCancellable *cancellable,
                                                             GError **error);
    enum                camel_pop3_command_t;
    struct              CamelPOP3Command;
    void                (*CamelPOP3CommandFunc)             (CamelPOP3Engine *pe,
                                                             CamelPOP3Stream *stream,
                                                             GCancellable *cancellable,
                                                             GError **error,
                                                             gpointer data);
    CamelPOP3Command *  camel_pop3_engine_command_new       (CamelPOP3Engine *pe,
                                                             guint32 flags,
                                                             CamelPOP3CommandFunc func,
                                                             gpointer data,
                                                             GCancellable *cancellable,
                                                             GError **error,
                                                             const gchar *fmt,
                                                             ...);
    void                camel_pop3_engine_command_free      (CamelPOP3Engine *pe,
                                                             CamelPOP3Command *pc);

## Object Hierarchy

      GObject
       +----CamelPOP3Engine

## Description

## Details

### struct CamelPOP3Engine

    struct CamelPOP3Engine;

### camel_pop3_engine_new ()

    CamelPOP3Engine *   camel_pop3_engine_new               (CamelStream *source,
                                                             guint32 flags,
                                                             GCancellable *cancellable,
                                                             GError **error);

Returns a NULL stream. A null stream is always at eof, and always returns success for all reads and writes.

`source` : | source stream
`flags` : | engine flags
`cancellable` : | optional GCancellable object, or `NULL`
`error` : | optional GError, or `NULL`
Returns : | the stream

### camel_pop3_engine_reget_capabilities ()

    gboolean            camel_pop3_engine_reget_capabilities
                                                            (CamelPOP3Engine *engine,
                                                             GCancellable *cancellable,
                                                             GError **error);

Regets server capabilities (needed after a STLS command is issued for example).

`engine` : | pop3 engine
`cancellable` : | optional GCancellable object, or `NULL`
`error` : | optional GError, or `NULL`

### camel_pop3_engine_iterate ()

    gint                camel_pop3_engine_iterate           (CamelPOP3Engine *pe,
                                                             CamelPOP3Command *pc,
                                                             GCancellable *cancellable,
                                                             GError **error);

### enum camel_pop3_command_t

    typedef enum {
    	CAMEL_POP3_COMMAND_IDLE = 0, /* command created or queued, not yet sent (e.g. non pipelined server) */
    	CAMEL_POP3_COMMAND_DISPATCHED, /* command sent to server */

    	/* completion codes */
    	CAMEL_POP3_COMMAND_OK, /* plain ok response */
    	CAMEL_POP3_COMMAND_DATA, /* processing command response */
    	CAMEL_POP3_COMMAND_ERR /* error response */
    } camel_pop3_command_t;

`CAMEL_POP3_COMMAND_IDLE` |
`CAMEL_POP3_COMMAND_DISPATCHED` |
`CAMEL_POP3_COMMAND_OK` |
`CAMEL_POP3_COMMAND_DATA` |
`CAMEL_POP3_COMMAND_ERR` |

### struct CamelPOP3Command

    struct CamelPOP3Command {
    	guint32 flags;
    	camel_pop3_command_t state;
    	gchar *error_str;

    	CamelPOP3CommandFunc func;
    	gpointer func_data;

    	gint data_size;
    	gchar *data;
    };

### CamelPOP3CommandFunc ()

    void                (*CamelPOP3CommandFunc)             (CamelPOP3Engine *pe,
                                                             CamelPOP3Stream *stream,
                                                             GCancellable *cancellable,
                                                             GError **error,
                                                             gpointer data);

### camel_pop3_engine_command_new ()

    CamelPOP3Command *  camel_pop3_engine_command_new       (CamelPOP3Engine *pe,
                                                             guint32 flags,
                                                             CamelPOP3CommandFunc func,
                                                             gpointer data,
                                                             GCancellable *cancellable,
                                                             GError **error,
                                                             const gchar *fmt,
                                                             ...);

### camel_pop3_engine_command_free ()

    void                camel_pop3_engine_command_free      (CamelPOP3Engine *pe,
                                                             CamelPOP3Command *pc);