### Method

# GLib BookmarkFile add_application

since: 2.12

#### Declaration [src]

    void
    g_bookmark_file_add_application (
      GBookmarkFile* bookmark,
      const gchar* uri,
      const gchar* name,
      const gchar* exec
    )

#### Description [src]

Adds the application with `name` and `exec` to the list of applications that have registered a bookmark for `uri` into `bookmark`.

Every bookmark inside a `GBookmarkFile` must have at least an application registered. Each application must provide a name, a command line useful for launching the bookmark, the number of times the bookmark has been registered by the application and the last time the application registered this bookmark.

If `name` is `NULL`, the name of the application will be the same returned by g_get_application_name(); if `exec` is `NULL`, the command line will be a composition of the program name as returned by `g_get_prgname()` and the “\%u” modifier, which will be expanded to the bookmark’s URI.

This function will automatically take care of updating the registrations count and timestamping in case an application with the same `name` had already registered a bookmark for `uri` inside `bookmark`.

If no bookmark for `uri` is found, one is created.

Available since: 2.12

#### Parameters

`uri`

  Type: `const gchar*`

  A valid URI.

  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`name`

  Type: `const gchar*`

  The name of the application registering the bookmark or `NULL`.

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

`exec`

  Type: `const gchar*`

  Command line to be used to launch the bookmark or `NULL`.

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