camel-imap4-command
3
CAMEL Library

# camel-imap4-command

## Synopsis

                        CamelIMAP4Command;
                        CamelIMAP4Literal;
    int                 (*CamelIMAP4PlusCallback)           (struct _CamelIMAP4Engine *engine,
                                                             CamelIMAP4Command *ic,
                                                             unsigned char *linebuf,
                                                             size_t linelen,
                                                             CamelException *ex);
    int                 (*CamelIMAP4UntaggedCallback)       (struct _CamelIMAP4Engine *engine,
                                                             CamelIMAP4Command *ic,
                                                             guint32 index,
                                                             struct _camel_imap4_token_t *token,
                                                             CamelException *ex);
                        CamelIMAP4CommandPart;
    CamelIMAP4Command*  camel_imap4_command_new             (struct _CamelIMAP4Engine *engine,
                                                             struct _CamelIMAP4Folder *folder,
                                                             const char *format,
                                                             ...);
    CamelIMAP4Command*  camel_imap4_command_newv            (struct _CamelIMAP4Engine *engine,
                                                             struct _CamelIMAP4Folder *folder,
                                                             const char *format,
                                                             va_list args);
    void                camel_imap4_command_register_untagged
                                                            (CamelIMAP4Command *ic,
                                                             const char *atom,
                                                             CamelIMAP4UntaggedCallback untagged);
    void                camel_imap4_command_ref             (CamelIMAP4Command *ic);
    void                camel_imap4_command_unref           (CamelIMAP4Command *ic);
    int                 camel_imap4_command_step            (CamelIMAP4Command *ic);
    void                camel_imap4_command_reset           (CamelIMAP4Command *ic);

## Description

## Details

### CamelIMAP4Command

    typedef struct {
    	EDListNode node;

    	struct _CamelIMAP4Engine *engine;

    	unsigned int ref_count:26;
    	unsigned int status:3;
    	unsigned int result:3;
    	int id;

    	char *tag;

    	GPtrArray *resp_codes;

    	struct _CamelIMAP4Folder *folder;
    	CamelException ex;

    	/* command parts - logical breaks in the overall command based on literals */
    	CamelIMAP4CommandPart *parts;

    	/* current part */
    	CamelIMAP4CommandPart *part;

    	/* untagged handlers */
    	GHashTable *untagged;

    	/* '+' callback/data */
    	CamelIMAP4PlusCallback plus;
    	void *user_data;
    } CamelIMAP4Command;

### CamelIMAP4Literal

    typedef struct {
    	int type;
    	union {
    		char *string;
    		CamelStream *stream;
    		CamelDataWrapper *wrapper;
    	} literal;
    } CamelIMAP4Literal;

### CamelIMAP4PlusCallback ()

    int                 (*CamelIMAP4PlusCallback)           (struct _CamelIMAP4Engine *engine,
                                                             CamelIMAP4Command *ic,
                                                             unsigned char *linebuf,
                                                             size_t linelen,
                                                             CamelException *ex);

`engine` :

`ic` :

`linebuf` :

`linelen` :

`ex` :

Returns :

### CamelIMAP4UntaggedCallback ()

    int                 (*CamelIMAP4UntaggedCallback)       (struct _CamelIMAP4Engine *engine,
                                                             CamelIMAP4Command *ic,
                                                             guint32 index,
                                                             struct _camel_imap4_token_t *token,
                                                             CamelException *ex);

`engine` :

`ic` :

`index` :

`token` :

`ex` :

Returns :

### CamelIMAP4CommandPart

    typedef struct {
    	struct _CamelIMAP4CommandPart *next;
    	unsigned char *buffer;
    	size_t buflen;

    	CamelIMAP4Literal *literal;
    } CamelIMAP4CommandPart;

### camel_imap4_command_new ()

    CamelIMAP4Command*  camel_imap4_command_new             (struct _CamelIMAP4Engine *engine,
                                                             struct _CamelIMAP4Folder *folder,
                                                             const char *format,
                                                             ...);

`engine` :

`folder` :

`format` :

`...` :

Returns :

### camel_imap4_command_newv ()

    CamelIMAP4Command*  camel_imap4_command_newv            (struct _CamelIMAP4Engine *engine,
                                                             struct _CamelIMAP4Folder *folder,
                                                             const char *format,
                                                             va_list args);

`engine` :

`folder` :

`format` :

`args` :

Returns :

### camel_imap4_command_register_untagged ()

    void                camel_imap4_command_register_untagged
                                                            (CamelIMAP4Command *ic,
                                                             const char *atom,
                                                             CamelIMAP4UntaggedCallback untagged);

`ic` :

`atom` :

`untagged` :

### camel_imap4_command_ref ()

    void                camel_imap4_command_ref             (CamelIMAP4Command *ic);

`ic` :

### camel_imap4_command_unref ()

    void                camel_imap4_command_unref           (CamelIMAP4Command *ic);

`ic` :

### camel_imap4_command_step ()

    int                 camel_imap4_command_step            (CamelIMAP4Command *ic);

`ic` :

Returns :

### camel_imap4_command_reset ()

    void                camel_imap4_command_reset           (CamelIMAP4Command *ic);

`ic` :