MilterDecoder 3 MILTER-MANAGER Library
MilterDecoder

## Functions

GQuark | milter_decoder_error_quark ()
gboolean | milter_decoder_decode ()
gboolean | milter_decoder_end_decode ()
const gchar * | milter_decoder_get_buffer ()
gint32 | milter_decoder_get_command_length ()
gboolean | milter_decoder_check_command_length ()
gint | milter_decoder_decode_null_terminated_value ()
gboolean | milter_decoder_decode_header_content ()
MilterOption * | milter_decoder_decode_negotiate ()
guint | milter_decoder_get_tag ()
void | milter_decoder_set_tag ()

## Properties

guint | tag | Read

## Signals

gboolean | decode | Run Last

## Types and Values

#define | MILTER_DECODER_ERROR
enum | MilterDecoderError
enum | MilterDecoderCompareType

## Object Hierarchy

        GObject
        ╰── MilterDecoder
            ├── MilterCommandDecoder
            ├── MilterManagerControlCommandDecoder
            ├── MilterManagerReplyDecoder
            ├── MilterManagerLaunchCommandDecoder
            ╰── MilterReplyDecoder

## Description

## Functions

### milter_decoder_error_quark ()

    GQuark
    milter_decoder_error_quark (void);

milter_decoder_error_quark

### milter_decoder_decode ()

    gboolean
    milter_decoder_decode (MilterDecoder *decoder,
                           const gchar *chunk,
                           gsize size,
                           GError **error);

Decodes a chunk. You can get decoded data by MilterDecoder::decode signals.

#### Parameters

decoder | A MilterDecoder. |
chunk | The string to be decoded. | [array length=size][element-type guint8]
size | The size of chunk in bytes. |
error | Return location for an error, or `NULL`. | [nullable]

#### Returns

`TRUE` on success, `FALSE` otherwise.

milter_decoder_decode

### milter_decoder_end_decode ()

    gboolean
    milter_decoder_end_decode (MilterDecoder *decoder,
                               GError **error);

milter_decoder_end_decode

### milter_decoder_get_buffer ()

    const gchar *
    milter_decoder_get_buffer (MilterDecoder *decoder);

milter_decoder_get_buffer

### milter_decoder_get_command_length ()

    gint32
    milter_decoder_get_command_length (MilterDecoder *decoder);

milter_decoder_get_command_length

### milter_decoder_check_command_length ()

    gboolean
    milter_decoder_check_command_length (const gchar *buffer,
                                         gint length,
                                         gint expected_length,
                                         MilterDecoderCompareType compare_type,
                                         GError **error,
                                         const gchar *target);

milter_decoder_check_command_length

### milter_decoder_decode_null_terminated_value ()

    gint
    milter_decoder_decode_null_terminated_value
                                   (const gchar *buffer,
                                    gint length,
                                    GError **error,
                                    const gchar *message);

milter_decoder_decode_null_terminated_value

### milter_decoder_decode_header_content ()

    gboolean
    milter_decoder_decode_header_content (const gchar *buffer,
                                          gint length,
                                          const gchar **name,
                                          const gchar **value,
                                          GError **error);

milter_decoder_decode_header_content

### milter_decoder_decode_negotiate ()

    MilterOption *
    milter_decoder_decode_negotiate (const gchar *buffer,
                                     gint length,
                                     gint *processed_length,
                                     GError **error);

#### Parameters

buffer | A buffer that has the target data. |
length | The number of bytes of buffer . |
processed_length | The number of bytes that are processed. | [out]
error | Return location for a GError or `NULL`. | [nullable]

#### Returns

The decoded MilterOption on success, `NULL` on error.

[transfer full][nullable]

milter_decoder_decode_negotiate

### milter_decoder_get_tag ()

    guint
    milter_decoder_get_tag (MilterDecoder *decoder);

milter_decoder_get_tag

### milter_decoder_set_tag ()

    void
    milter_decoder_set_tag (MilterDecoder *decoder,
                            guint tag);

milter_decoder_set_tag

## Types and Values

### MILTER_DECODER_ERROR

    #define MILTER_DECODER_ERROR           (milter_decoder_error_quark())

MILTER_DECODER_ERROR

### enum MilterDecoderError

#### Members

MILTER_DECODER_ERROR_SHORT_COMMAND_LENGTH |  |
MILTER_DECODER_ERROR_LONG_COMMAND_LENGTH |  |
MILTER_DECODER_ERROR_UNEXPECTED_END |  |
MILTER_DECODER_ERROR_UNEXPECTED_COMMAND |  |
MILTER_DECODER_ERROR_MISSING_NULL |  |

MilterDecoderError

### enum MilterDecoderCompareType

#### Members

MILTER_DECODER_COMPARE_AT_LEAST |  |
MILTER_DECODER_COMPARE_EXACT |  |

MilterDecoderCompareType

## Property Details

### The `“tag”` property

      “tag”                      guint

The tag of the decoder.

Owner: MilterDecoder

Flags: Read

Default value: 0

MilterDecoder:tag

## Signal Details

### The `“decode”` signal

    gboolean
    user_function (MilterDecoder *milterdecoder,
                   gpointer       arg1,
                   gpointer       user_data)

Flags: Run Last

MilterDecoder::decode