GsOsRelease: GNOME Software Reference Manual

## GsOsRelease GsOsRelease — Data from os-release |

## Stability Level

Unstable, unless otherwise indicated

## Functions

GsOsRelease * | gs_os_release_new ()
const gchar * | gs_os_release_get_name ()
const gchar * | gs_os_release_get_version ()
const gchar * | gs_os_release_get_id ()
const gchar * const * | gs_os_release_get_id_like ()
const gchar * | gs_os_release_get_version_id ()
const gchar * | gs_os_release_get_pretty_name ()
const gchar * | gs_os_release_get_cpe_name ()
const gchar * | gs_os_release_get_distro_codename ()
const gchar * | gs_os_release_get_home_url ()
const gchar * | gs_os_release_get_logo ()
const gchar * | gs_os_release_get_vendor_name ()

## Types and Values

#define | GS_TYPE_OS_RELEASE
| GsOsRelease

## Includes

    #include <gnome-software.h>

## Description

This object allows plugins to parse /etc/os-release for distribution metadata information.

## Functions

### gs_os_release_new ()

    GsOsRelease *
    gs_os_release_new (GError **error);

Returns a new reference to a GsOsRelease. The information may be cached.

#### Parameters

error | a GError, or `NULL` |

#### Returns

A new reference to a GsOsRelease, or `NULL` for error.

[transfer full]

Since: 3.22

### gs_os_release_get_name ()

    const gchar *
    gs_os_release_get_name (GsOsRelease *os_release);

Gets the name from the os-release parser.

#### Parameters

os_release | A GsOsRelease |

#### Returns

a string, or `NULL`

Since: 3.22

### gs_os_release_get_version ()

    const gchar *
    gs_os_release_get_version (GsOsRelease *os_release);

Gets the version from the os-release parser.

#### Parameters

os_release | A GsOsRelease |

#### Returns

a string, or `NULL`

Since: 3.22

### gs_os_release_get_id ()

    const gchar *
    gs_os_release_get_id (GsOsRelease *os_release);

Gets the ID from the os-release parser.

#### Parameters

os_release | A GsOsRelease |

#### Returns

a string, or `NULL`

Since: 3.22

### gs_os_release_get_id_like ()

    const gchar *	  const *
    gs_os_release_get_id_like (GsOsRelease *os_release);

Gets the ID_LIKE from the os-release parser. This is a list of operating systems that are "closely related" to the local operating system, possibly by being a derivative distribution.

#### Parameters

os_release | A GsOsRelease |

#### Returns

a `NULL` terminated list

Since: 3.26.2

### gs_os_release_get_version_id ()

    const gchar *
    gs_os_release_get_version_id (GsOsRelease *os_release);

Gets the version ID from the os-release parser.

#### Parameters

os_release | A GsOsRelease |

#### Returns

a string, or `NULL`

Since: 3.22

### gs_os_release_get_pretty_name ()

    const gchar *
    gs_os_release_get_pretty_name (GsOsRelease *os_release);

Gets the pretty name from the os-release parser.

#### Parameters

os_release | A GsOsRelease |

#### Returns

a string, or `NULL`

Since: 3.22

### gs_os_release_get_cpe_name ()

    const gchar *
    gs_os_release_get_cpe_name (GsOsRelease *os_release);

Gets the pretty name from the os-release parser.

#### Parameters

os_release | A GsOsRelease |

#### Returns

a string, or `NULL`

Since: 3.22

### gs_os_release_get_distro_codename ()

    const gchar *
    gs_os_release_get_distro_codename (GsOsRelease *os_release);

Gets the distro codename from the os-release parser.

#### Parameters

os_release | A GsOsRelease |

#### Returns

a string, or `NULL`

Since: 3.22

### gs_os_release_get_home_url ()

    const gchar *
    gs_os_release_get_home_url (GsOsRelease *os_release);

Gets the home URL from the os-release parser.

#### Parameters

os_release | A GsOsRelease |

#### Returns

a string, or `NULL`

Since: 3.22

### gs_os_release_get_logo ()

    const gchar *
    gs_os_release_get_logo (GsOsRelease *os_release);

Gets the logo icon name from the os-release parser.

#### Parameters

os_release | A GsOsRelease |

#### Returns

a string, or `NULL`

Since: 44

### gs_os_release_get_vendor_name ()

    const gchar *
    gs_os_release_get_vendor_name (GsOsRelease *os_release);

Gets the vendor name from the os-release parser.

#### Parameters

os_release | A GsOsRelease |

#### Returns

a string, or `NULL`.

[nullable]

Since: 47

## Types and Values

### GS_TYPE_OS_RELEASE

    #define GS_TYPE_OS_RELEASE (gs_os_release_get_type ())

### GsOsRelease

    typedef struct _GsOsRelease GsOsRelease;