Method

HaslContextadd_mechanism

since: 0.1

Declaration [src]

gboolean
hasl_context_add_mechanism (
  HaslContext* ctx,
  const char* name,
  GType type
)

Description [src]

Registers type in ctx with the given name. name should follow the convention from RFC4422ยง3.1.

type is the GType of the HaslMechanism subclass.

See the following example:

hasl_context_add_mechanism(ctx, "PLAIN", HASL_TYPE_MECHANISM_PLAIN);

This only needs to be called for custom mechanisms, all of the built in mechanism are already added to all contexts by default. However, you may replace them by name if you need to adapt to a server that isn’t RFC compliant.

Available since: 0.1

Parameters

name

Type: const char*

The name of the mechanism.

The data is owned by the caller of the method.
The value is a NUL terminated UTF-8 string.
type

Type: GType

The type of the mechanism.

Return value

Type: gboolean

TRUE if the mechanism was added, otherwise FALSE.