Devhelp.Completion.complete

### Method

# Devhelp Completioncomplete

#### Declaration [src]

    gchar*
    dh_completion_complete (
      DhCompletion* completion,
      const gchar* prefix
    )

#### Description [src]

This function does the equivalent of: 1. Searches the data structure of `completion` to find all strings that have `prefix` as prefix. 2. From the list found at step 1, find the longest prefix that still matches all the strings in the list.

This function assumes that `prefix` and the strings contained in `completion` are in UTF-8. If all the strings are valid UTF-8, then the return value will also be valid UTF-8 (it won’t return a partial multi-byte character).

Available since: | 3.28

#### Parameters

`prefix` | `const gchar*`
| The string to complete.
| The data is owned by the caller of the function.
| The value is a NUL terminated UTF-8 string.

#### Return value

Returns: | `gchar*`
| The completed prefix, or `NULL` if a longer prefix has not been found. Free with `g_free()` when no longer needed.
| The caller of the method takes ownership of the data, and is responsible for freeing it.
| The return value can be `NULL`.
| The value is a NUL terminated UTF-8 string.