asc-globals: AppStream Compose Library Reference Manual

## asc-globals

asc-globals — Set and read a bunch of global settings used across appstream-compose

## Functions

GQuark | asc_compose_error_quark ()
void | asc_globals_clear ()
const gchar * | asc_globals_get_tmp_dir ()
const gchar * | asc_globals_get_tmp_dir_create ()
void | asc_globals_set_tmp_dir ()
gboolean | asc_globals_get_use_optipng ()
void | asc_globals_set_use_optipng ()
const gchar * | asc_globals_get_optipng_binary ()
void | asc_globals_set_optipng_binary ()
const gchar * | asc_globals_get_ffprobe_binary ()
void | asc_globals_set_ffprobe_binary ()
gboolean | asc_globals_add_hint_tag ()
gchar ** | asc_globals_get_hint_tags ()
AsIssueSeverity | asc_globals_hint_tag_severity ()
const gchar * | asc_globals_hint_tag_explanation ()

## Types and Values

enum | AscComposeError
#define | ASC_COMPOSE_ERROR

## Includes

    #include <appstream-compose.h>

## Description

## Functions

### asc_compose_error_quark ()

    GQuark
    asc_compose_error_quark (void);

#### Returns

An error quark.

### asc_globals_clear ()

    void
    asc_globals_clear (void);

Clear all global state and restore defaults.

### asc_globals_get_tmp_dir ()

    const gchar *
    asc_globals_get_tmp_dir (void);

Get temporary directory used by appstream-compose.

### asc_globals_get_tmp_dir_create ()

    const gchar *
    asc_globals_get_tmp_dir_create (void);

Get temporary directory used by appstream-compose and try to create it if it does not exist.

### asc_globals_set_tmp_dir ()

    void
    asc_globals_set_tmp_dir (const gchar *path);

Set temporary directory used by appstream-compose.

### asc_globals_get_use_optipng ()

    gboolean
    asc_globals_get_use_optipng (void);

Get whether images should be optimized using optipng.

### asc_globals_set_use_optipng ()

    void
    asc_globals_set_use_optipng (gboolean enabled);

Set whether images should be optimized using optipng.

### asc_globals_get_optipng_binary ()

    const gchar *
    asc_globals_get_optipng_binary (void);

Get path to the "optipng" binary we should use.

### asc_globals_set_optipng_binary ()

    void
    asc_globals_set_optipng_binary (const gchar *path);

Set path to the "optipng" binary we should use.

### asc_globals_get_ffprobe_binary ()

    const gchar *
    asc_globals_get_ffprobe_binary (void);

Get path to the "ffprobe" binary we should use.

### asc_globals_set_ffprobe_binary ()

    void
    asc_globals_set_ffprobe_binary (const gchar *path);

Set path to the "ffprobe" binary we should use.

### asc_globals_add_hint_tag ()

    gboolean
    asc_globals_add_hint_tag (const gchar *tag,
                              AsIssueSeverity severity,
                              const gchar *explanation,
                              gboolean overrideExisting);

Register a new hint tag. If a previous tag with the given name already existed, the existing tag will not be replaced unless `overrideExisting` is set to `TRUE`. Please be careful when overriding tags! Tag severities can not be lowered by overriding a tag.

#### Parameters

tag | the tag-ID to add |
severity | the tag severity as AsIssueSeverity |
explanation | the tag explanatory message |
overrideExisting | whether an existing tag should be replaced |

#### Returns

`TRUE` if the tag was registered and did not exist previously.

### asc_globals_get_hint_tags ()

    gchar **
    asc_globals_get_hint_tags (void);

Retrieve all hint tags that we know.

#### Returns

A list of valid hint tags. Free with `g_strfreev`.

[transfer full]

### asc_globals_hint_tag_severity ()

    AsIssueSeverity
    asc_globals_hint_tag_severity (const gchar *tag);

Retrieve the severity of the given hint tag.

#### Returns

An AsIssueSeverity or `AS_ISSUE_SEVERITY_UNKNOWN` if the tag did not exist or has an unknown severity.

### asc_globals_hint_tag_explanation ()

    const gchar *
    asc_globals_hint_tag_explanation (const gchar *tag);

Retrieve the explanation template of the given hint tag.

#### Returns

An explanation template, or `NULL` if the tag was not found.

## Types and Values

### enum AscComposeError

A metadata composition error.

#### Members

ASC_COMPOSE_ERROR_FAILED | Generic failure. |

### ASC_COMPOSE_ERROR

    #define ASC_COMPOSE_ERROR asc_compose_error_quark ()