CamelIMAPPStream
3
CAMEL Library

# CamelIMAPPStream

## Synopsis

                        CamelIMAPPStream;
    enum                camel_imapp_token_t;
    CamelStream*        camel_imapp_stream_new              (CamelStream *source);
    camel_imapp_token_t camel_imapp_stream_token            (CamelIMAPPStream *is,
                                                             unsigned char **start,
                                                             unsigned int *len);
    void                camel_imapp_stream_ungettoken       (CamelIMAPPStream *is,
                                                             camel_imapp_token_t tok,
                                                             unsigned char *token,
                                                             unsigned int len);
    void                camel_imapp_stream_set_literal      (CamelIMAPPStream *is,
                                                             unsigned int literal);
    int                 camel_imapp_stream_gets             (CamelIMAPPStream *is,
                                                             unsigned char **start,
                                                             unsigned int *len);
    int                 camel_imapp_stream_getl             (CamelIMAPPStream *is,
                                                             unsigned char **start,
                                                             unsigned int *len);
    int                 camel_imapp_stream_atom             (CamelIMAPPStream *is,
                                                             unsigned char **start,
                                                             unsigned int *len);
    int                 camel_imapp_stream_astring          (CamelIMAPPStream *is,
                                                             unsigned char **start);
    int                 camel_imapp_stream_nstring          (CamelIMAPPStream *is,
                                                             unsigned char **start);
    int                 camel_imapp_stream_nstring_stream   (CamelIMAPPStream *is,
                                                             CamelStream **stream);
    int                 camel_imapp_stream_text             (CamelIMAPPStream *is,
                                                             unsigned char **text);
    guint32             camel_imapp_stream_number           (CamelIMAPPStream *is);

## Description

## Details

### CamelIMAPPStream

    typedef struct {
    	CamelStream parent;

    	CamelStream *source;

    	/*int state;*/
    	unsigned char *buf, *ptr, *end;
    	unsigned int literal;

    	unsigned int unget;
    	camel_imapp_token_t unget_tok;
    	unsigned char *unget_token;
    	unsigned int unget_len;

    	unsigned char *tokenbuf, *tokenptr, *tokenend;
    } CamelIMAPPStream;

### enum camel_imapp_token_t

    typedef enum {
    	IMAP_TOK_PROTOCOL = -2,
    	IMAP_TOK_ERROR = -1,
    	IMAP_TOK_TOKEN = 256,
    	IMAP_TOK_STRING,
    	IMAP_TOK_INT,
    	IMAP_TOK_LITERAL,
    } camel_imapp_token_t;

### camel_imapp_stream_new ()

    CamelStream*        camel_imapp_stream_new              (CamelStream *source);

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

`source` :

Returns :

  the stream

### camel_imapp_stream_token ()

    camel_imapp_token_t camel_imapp_stream_token            (CamelIMAPPStream *is,
                                                             unsigned char **start,
                                                             unsigned int *len);

`is` :

`start` :

`len` :

Returns :

### camel_imapp_stream_ungettoken ()

    void                camel_imapp_stream_ungettoken       (CamelIMAPPStream *is,
                                                             camel_imapp_token_t tok,
                                                             unsigned char *token,
                                                             unsigned int len);

`is` :

`tok` :

`token` :

`len` :

### camel_imapp_stream_set_literal ()

    void                camel_imapp_stream_set_literal      (CamelIMAPPStream *is,
                                                             unsigned int literal);

`is` :

`literal` :

### camel_imapp_stream_gets ()

    int                 camel_imapp_stream_gets             (CamelIMAPPStream *is,
                                                             unsigned char **start,
                                                             unsigned int *len);

`is` :

`start` :

`len` :

Returns :

### camel_imapp_stream_getl ()

    int                 camel_imapp_stream_getl             (CamelIMAPPStream *is,
                                                             unsigned char **start,
                                                             unsigned int *len);

`is` :

`start` :

`len` :

Returns :

### camel_imapp_stream_atom ()

    int                 camel_imapp_stream_atom             (CamelIMAPPStream *is,
                                                             unsigned char **start,
                                                             unsigned int *len);

`is` :

`start` :

`len` :

Returns :

### camel_imapp_stream_astring ()

    int                 camel_imapp_stream_astring          (CamelIMAPPStream *is,
                                                             unsigned char **start);

`is` :

`start` :

Returns :

### camel_imapp_stream_nstring ()

    int                 camel_imapp_stream_nstring          (CamelIMAPPStream *is,
                                                             unsigned char **start);

`is` :

`start` :

Returns :

### camel_imapp_stream_nstring_stream ()

    int                 camel_imapp_stream_nstring_stream   (CamelIMAPPStream *is,
                                                             CamelStream **stream);

`is` :

`stream` :

Returns :

### camel_imapp_stream_text ()

    int                 camel_imapp_stream_text             (CamelIMAPPStream *is,
                                                             unsigned char **text);

`is` :

`text` :

Returns :

### camel_imapp_stream_number ()

    guint32             camel_imapp_stream_number           (CamelIMAPPStream *is);

`is` :

Returns :