CamelPOP3Engine
3
CAMEL Library

# CamelPOP3Engine

## Synopsis

                        CamelPOP3Engine;
                        CamelPOP3Command;
    enum                camel_pop3_engine_t;
    enum                camel_pop3_command_t;
    void                (*CamelPOP3CommandFunc)             (CamelPOP3Engine *pe,
                                                             CamelPOP3Stream *stream,
                                                             void *data);
    CamelPOP3Engine*    camel_pop3_engine_new               (CamelStream *source,
                                                             guint32 flags);
    void                camel_pop3_engine_reget_capabilities
                                                            (CamelPOP3Engine *engine);
    void                camel_pop3_engine_command_free      (CamelPOP3Engine *pe,
                                                             CamelPOP3Command *pc);
    int                 camel_pop3_engine_iterate           (CamelPOP3Engine *pe,
                                                             CamelPOP3Command *pc);
    CamelPOP3Command*   camel_pop3_engine_command_new       (CamelPOP3Engine *pe,
                                                             guint32 flags,
                                                             CamelPOP3CommandFunc func,
                                                             void *data,
                                                             const char *fmt,
                                                             ...);

## Description

## Details

### CamelPOP3Engine

    typedef struct {
    	CamelObject parent;

    	guint32 flags;

    	camel_pop3_engine_t state;

    	GList *auth;		/* authtypes supported */

    	guint32 capa;		/* capabilities */
    	char *apop;		/* apop time string */

    	unsigned char *line;	/* current line buffer */
    	unsigned int linelen;

    	struct _CamelPOP3Stream *stream;

    	unsigned int sentlen;	/* data sent (so we dont overflow network buffer) */

    	EDList active;		/* active commands */
    	EDList queue;		/* queue of waiting commands */
    	EDList done;		/* list of done commands, awaiting free */

    	CamelPOP3Command *current; /* currently busy (downloading) response */
    } CamelPOP3Engine;

### CamelPOP3Command

    typedef struct {
    	struct _CamelPOP3Command *next;
    	struct _CamelPOP3Command *prev;

    	guint32 flags;
    	camel_pop3_command_t state;

    	CamelPOP3CommandFunc func;
    	void *func_data;

    	int data_size;
    	char *data;
    } CamelPOP3Command;

### enum camel_pop3_engine_t

    typedef enum {
    	CAMEL_POP3_ENGINE_DISCONNECT = 0,
    	CAMEL_POP3_ENGINE_AUTH,
    	CAMEL_POP3_ENGINE_TRANSACTION,
    	CAMEL_POP3_ENGINE_UPDATE
    } camel_pop3_engine_t;

### 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;

### CamelPOP3CommandFunc ()

    void                (*CamelPOP3CommandFunc)             (CamelPOP3Engine *pe,
                                                             CamelPOP3Stream *stream,
                                                             void *data);

`pe` :

`stream` :

`data` :

### camel_pop3_engine_new ()

    CamelPOP3Engine*    camel_pop3_engine_new               (CamelStream *source,
                                                             guint32 flags);

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

Returns :

  the stream

### camel_pop3_engine_reget_capabilities ()

    void                camel_pop3_engine_reget_capabilities
                                                            (CamelPOP3Engine *engine);

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

`engine` :

  pop3 engine

### camel_pop3_engine_command_free ()

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

`pe` :

`pc` :

### camel_pop3_engine_iterate ()

    int                 camel_pop3_engine_iterate           (CamelPOP3Engine *pe,
                                                             CamelPOP3Command *pc);

`pe` :

`pc` :

Returns :

### camel_pop3_engine_command_new ()

    CamelPOP3Command*   camel_pop3_engine_command_new       (CamelPOP3Engine *pe,
                                                             guint32 flags,
                                                             CamelPOP3CommandFunc func,
                                                             void *data,
                                                             const char *fmt,
                                                             ...);

`pe` :

`flags` :

`func` :

`data` :

`fmt` :

`...` :

Returns :