SbuildConfig

SbuildConfig — config object

Synopsis




enum        SbuildConfigFileError;
#define     SBUILD_CONFIG_FILE_ERROR
            SbuildConfig;
            SbuildConfigClass;
SbuildConfig* sbuild_config_new             (const char *file);
const GList* sbuild_config_get_chroots      (SbuildConfig *config);
SbuildChroot* sbuild_config_find_chroot     (SbuildConfig *config,
                                             const char *name);
SbuildChroot* sbuild_config_find_alias      (SbuildConfig *config,
                                             const char *name);
GList*      sbuild_config_get_chroot_list   (SbuildConfig *config);
void        sbuild_config_print_chroot_list (SbuildConfig *config,
                                             FILE *file);
gboolean    sbuild_config_validate_chroots  (SbuildConfig *config,
                                             char **chroots);

Object Hierarchy


  GObject
   +----SbuildConfig

Properties


  "config-file"          gchararray            : Read / Write / Construct Only

Description

This class holds the configuration details from the configuration file. Conceptually, it's an opaque container of SbuildChroot objects.

Methods are provided to query the available chroots and find specific chroots.

Details

enum SbuildConfigFileError

typedef enum
{
  SBUILD_CONFIG_FILE_ERROR_STAT_FAIL,
  SBUILD_CONFIG_FILE_ERROR_OWNERSHIP,
  SBUILD_CONFIG_FILE_ERROR_PERMISSIONS,
  SBUILD_CONFIG_FILE_ERROR_NOT_REGULAR
} SbuildConfigFileError;

The errors which can occur while loading a configuration file.

SBUILD_CONFIG_FILE_ERROR_STAT_FAIL The file could not be fstat()ed
SBUILD_CONFIG_FILE_ERROR_OWNERSHIP Ownership checks failed
SBUILD_CONFIG_FILE_ERROR_PERMISSIONS Permissions checks failed
SBUILD_CONFIG_FILE_ERROR_NOT_REGULAR Not a regular file

SBUILD_CONFIG_FILE_ERROR

#define SBUILD_CONFIG_FILE_ERROR sbuild_config_file_error_quark()

The error domain for sbuild configuration file errors.


SbuildConfig

typedef struct _SbuildConfig SbuildConfig;

SbuildConfig object.


SbuildConfigClass

typedef struct {
  GObjectClass		     parent;
} SbuildConfigClass;

SbuildConfig class.

GObjectClass parent; the parent class

sbuild_config_new ()

SbuildConfig* sbuild_config_new             (const char *file);

Creates a new SbuildConfig.

file : the filename to open.
Returns : the newly created SbuildConfig.

sbuild_config_get_chroots ()

const GList* sbuild_config_get_chroots      (SbuildConfig *config);

Get a list of available chroots.

config : a SbuildConfig
Returns : a list of available chroots, or NULL if no chroots are available.

sbuild_config_find_chroot ()

SbuildChroot* sbuild_config_find_chroot     (SbuildConfig *config,
                                             const char *name);

Find a chroot by its name.

config : an SbuildConfig
name : the chroot name
Returns : the chroot if found, otherwise NULL.

sbuild_config_find_alias ()

SbuildChroot* sbuild_config_find_alias      (SbuildConfig *config,
                                             const char *name);

Find a chroot by its name or an alias.

config : an SbuildConfig
name : the chroot name
Returns : the chroot if found, otherwise NULL.

sbuild_config_get_chroot_list ()

GList*      sbuild_config_get_chroot_list   (SbuildConfig *config);

Get the names (including aliases) of all the available chroots.

config : an SbuildConfig
Returns : the list, or NULL if no chroots are available.

sbuild_config_print_chroot_list ()

void        sbuild_config_print_chroot_list (SbuildConfig *config,
                                             FILE *file);

Print all the available chroots to the specified file.

config : an SbuildConfig
file : the file to print to

sbuild_config_validate_chroots ()

gboolean    sbuild_config_validate_chroots  (SbuildConfig *config,
                                             char **chroots);

Check that all the chroots specified by chroots exist in config.

config : an SbuildConfig
chroots : the chroots to validate
Returns : TRUE if the validation succeeds, otherwise FALSE.

Properties

The "config-file" property

  "config-file"          gchararray            : Read / Write / Construct Only

The file containing the chroot configuration.

Default value: ""