GObject.TypeModule.register_enum

### Method

# GObject TypeModuleregister_enum

since: 2.6

#### Declaration

    GType
    g_type_module_register_enum (
      GTypeModule* module,
      const gchar* name,
      const GEnumValue* const_static_values
    )

#### Description

Looks up or registers an enumeration that is implemented with a particular type plugin. If a type with name `type_name` was previously registered, the `GType` identifier for the type is returned, otherwise the type is newly registered, and the resulting `GType` identifier returned.

As long as any instances of the type exist, the type plugin will not be unloaded.

Since 2.56 if `module` is `NULL` this will call `g_type_register_static()` instead. This can be used when making a static build of the module.

Available since: 2.6

#### Parameters

`name`

  Type: `const gchar*`

  Name for the type.

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

`const_static_values`

  Type: `GEnumValue`

  An array of `GEnumValue` structs for the possible enumeration values. The array is terminated by a struct with all members being 0.

  The data is owned by the caller of the method.

#### Return value

Type: `GType`

The new or existing type ID.