gmime-stream-buffer

## gmime-stream-buffer gmime-stream-buffer — |

## Synopsis

    enum        GMimeStreamBufferMode;
                GMimeStreamBuffer;
    GMimeStream* g_mime_stream_buffer_new       (GMimeStream *source,
                                                 GMimeStreamBufferMode mode);
    ssize_t     g_mime_stream_buffer_gets       (GMimeStream *stream,
                                                 char *buf,
                                                 size_t max);
    void        g_mime_stream_buffer_readln     (GMimeStream *stream,
                                                 GByteArray *buffer);

## Object Hierarchy

      GObject
       +----GMimeStream
             +----GMimeStreamBuffer

## Description

## Details

### enum GMimeStreamBufferMode

    typedef enum {
    	GMIME_STREAM_BUFFER_CACHE_READ,
    	GMIME_STREAM_BUFFER_BLOCK_READ,
    	GMIME_STREAM_BUFFER_BLOCK_WRITE
    } GMimeStreamBufferMode;

### GMimeStreamBuffer

    typedef struct _GMimeStreamBuffer GMimeStreamBuffer;

### g_mime_stream_buffer_new ()

    GMimeStream* g_mime_stream_buffer_new       (GMimeStream *source,
                                                 GMimeStreamBufferMode mode);

Creates a new GMimeStreamBuffer object.

`source` : | source stream
`mode` : | buffering mode
Returns : | a new buffer stream with source `source` and mode `mode`.

### g_mime_stream_buffer_gets ()

    ssize_t     g_mime_stream_buffer_gets       (GMimeStream *stream,
                                                 char *buf,
                                                 size_t max);

Reads in at most one less than `max` characters from `stream` and stores them into the buffer pointed to by `buf`. Reading stops after an EOS or newline (#'\n'). If a newline is read, it is stored into the buffer. A #'\0' is stored after the last character in the buffer.

`stream` : | stream
`buf` : | line buffer
`max` : | max length of a line
Returns : | the number of characters read into `buf` on success and -1 on fail.

### g_mime_stream_buffer_readln ()

    void        g_mime_stream_buffer_readln     (GMimeStream *stream,
                                                 GByteArray *buffer);

Reads a single line into `buffer`.

`stream` : | stream
`buffer` : | output buffer