## InfProtocol InfProtocol — Infinote protocol parameters |

## Stability Level

Unstable, unless otherwise indicated

## Synopsis

    #include <libinfinity/common/inf-protocol.h>

    const gchar *       inf_protocol_get_version            (void);
    gboolean            inf_protocol_parse_version          (const gchar *version,
                                                             guint *major,
                                                             guint *minor,
                                                             GError **error);
    guint               inf_protocol_get_default_port       (void);

## Description

This section defines common protocol parameters used by libinfinity.

## Details

### inf_protocol_get_version ()

    const gchar *       inf_protocol_get_version            (void);

Returns the version of the Infinote protocol implemented by this version of libinfinity.

Returns : | The supported infinote version.

### inf_protocol_parse_version ()

    gboolean            inf_protocol_parse_version          (const gchar *version,
                                                             guint *major,
                                                             guint *minor,
                                                             GError **error);

Splits the given version string into it's major and minor version number. If the string is badly formatted then the function returns `FALSE`, `error` is set and `major` and `minor` are left untouched.

It is guaranteed that, if `version` is `inf_protocol_get_version()`, the function does not fail.

`version` : | A version string, such as "1.0"
`major` : | A location to store the major version number to.
`minor` : | A location to store the minor version number to
`error` : | Location to store error information, if any.
Returns : | `TRUE` on success, or `FALSE` on error.

### inf_protocol_get_default_port ()

    guint               inf_protocol_get_default_port       (void);

Returns the default port on which the infinote daemon listens for new connections.

Returns : | The default port.

## See Also

InfError