## OobsGroupsConfig

OobsGroupsConfig — Object that represents groups configuration

## Synopsis

                        OobsGroupsConfig;
    OobsObject*         oobs_groups_config_get              (void);
    OobsList*           oobs_groups_config_get_groups       (OobsGroupsConfig *config);
    OobsResult          oobs_groups_config_add_group        (OobsGroupsConfig *config,
                                                             OobsGroup *group);
    OobsResult          oobs_groups_config_delete_group     (OobsGroupsConfig *config,
                                                             OobsGroup *group);
    OobsGroup*          oobs_groups_config_get_from_name    (OobsGroupsConfig *config,
                                                             const gchar *name);
    OobsGroup*          oobs_groups_config_get_from_gid     (OobsGroupsConfig *config,
                                                             gid_t gid);
    gboolean            oobs_groups_config_is_name_used     (OobsGroupsConfig *config,
                                                             const gchar *name);
    gboolean            oobs_groups_config_is_gid_used      (OobsGroupsConfig *config,
                                                             gid_t gid);
    gid_t               oobs_groups_config_find_free_gid    (OobsGroupsConfig *config,
                                                             gid_t gid_min,
                                                             gid_t gid_max);

## Object Hierarchy

      GObject
       +----OobsObject
             +----OobsGroupsConfig

## Properties

      "maximum-gid"              gint                  : Read / Write
      "minimum-gid"              gint                  : Read / Write

## Description

## Details

### OobsGroupsConfig

    typedef struct _OobsGroupsConfig OobsGroupsConfig;

### oobs_groups_config_get ()

    OobsObject*         oobs_groups_config_get              (void);

Returns the OobsGroupsConfig singleton, which represents the groups configuration.

Returns : | the singleton OobsGoupsConfig

### oobs_groups_config_get_groups ()

    OobsList*           oobs_groups_config_get_groups       (OobsGroupsConfig *config);

Returns an OobsList containing objects of type OobsGroup.

`config` : | An OobsGroupsConfig.
Returns : | An OobsList containing the groups configuration.

### oobs_groups_config_add_group ()

    OobsResult          oobs_groups_config_add_group        (OobsGroupsConfig *config,
                                                             OobsGroup *group);

Add a group to the configuration, immediately committing changes to the system. On success, `group` will be appended to the groups list.

`config` : | An OobsGroupsConfig.
`group` : | An Oobsgroup.
Returns : | an OobsResult enum with the error code.

### oobs_groups_config_delete_group ()

    OobsResult          oobs_groups_config_delete_group     (OobsGroupsConfig *config,
                                                             OobsGroup *group);

Delete an group from the configuration, immediately committing changes to the system. On success, `group` will be removed from the groups list.

`config` : | An OobsGroupsConfig.
`group` : | An OobsGroup.
Returns : | an OobsResult enum with the error code.

### oobs_groups_config_get_from_name ()

    OobsGroup*          oobs_groups_config_get_from_name    (OobsGroupsConfig *config,
                                                             const gchar *name);

Gets the (first) group called `name`. This is a convenience function to avoid walking manually over the groups list.

`config` : | An OobsGroupsConfig.
`name` : | the name of the wanted group.
Returns : | an OobsGroup corresponding to the passed named, or `NULL` if no such group exists. Don't forget to unref group when you're done.

### oobs_groups_config_get_from_gid ()

    OobsGroup*          oobs_groups_config_get_from_gid     (OobsGroupsConfig *config,
                                                             gid_t gid);

`config` : |
`gid` : |
Returns : |

### oobs_groups_config_is_name_used ()

    gboolean            oobs_groups_config_is_name_used     (OobsGroupsConfig *config,
                                                             const gchar *name);

Check whether `name` is already used by an existing group or not. This is a convenience function to avoid walking manually over the groups list.

`config` : | An OobsGroupsConfig.
`name` : | the name to check.
Returns : | `TRUE` if a group called `name` already exists, `FALSE` otherwise.

### oobs_groups_config_is_gid_used ()

    gboolean            oobs_groups_config_is_gid_used      (OobsGroupsConfig *config,
                                                             gid_t gid);

Check whether `gid` is already used by an existing group or not. This is a convenience function to avoid walking manually over the groups list.

`config` : | An OobsGroupsConfig.
`gid` : | the gid to check.
Returns : | `TRUE` if an group with such an gid already exists, `FALSE` otherwise.

### oobs_groups_config_find_free_gid ()

    gid_t               oobs_groups_config_find_free_gid    (OobsGroupsConfig *config,
                                                             gid_t gid_min,
                                                             gid_t gid_max);

`config` : |
`gid_min` : |
`gid_max` : |
Returns : |

## Property Details

### The `"maximum-gid"` property

      "maximum-gid"              gint                  : Read / Write

Maximum GID for non-system groups.

Allowed values: >= 0

Default value: 2147483647

### The `"minimum-gid"` property

      "minimum-gid"              gint                  : Read / Write

Minimum GID for non-system groups.

Allowed values: >= 0

Default value: 2147483647

## See Also

OobsGroup