Function

GioAppInfocreate_from_commandline

Declaration

GAppInfo*
g_app_info_create_from_commandline (
  const char* commandline,
  const char* application_name,
  GAppInfoCreateFlags flags,
  GError** error
)

Description

Creates a new GAppInfo from the given information.

Note that for commandline, the quoting rules of the Exec key of the freedesktop.org Desktop Entry Specification are applied. For example, if the commandline contains percent-encoded URIs, the percent-character must be doubled in order to prevent it from being swallowed by Exec key unquoting. See the specification for exact quoting rules.

Parameters

commandline

Type: const char*

The commandline to use.

The data is owned by the caller of the function.
The value is a file system path, using the OS encoding.
application_name

Type: const char*

The application name, or NULL to use commandline.

The argument can be NULL.
The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
flags

Type: GAppInfoCreateFlags

Flags that can specify details of the created GAppInfo.

error

Type: GError **

The return location for an error.

The argument can be NULL.
The argument will be set to NULL by the function if there are no errors.
In case of error, the argument will be set and the caller will take ownership of the data, and be responsible for freeing it.

Return value

Type: GAppInfo

New GAppInfo for given command.

The caller of the function takes ownership of the data, and is responsible for freeing it.