### Method

# Foundry CompileCommands lookup

#### Declaration [src]

    char**
    foundry_compile_commands_lookup (
      FoundryCompileCommands* self,
      GFile* file,
      const char* const* system_includes,
      GFile** directory,
      GError** error
    )

#### Description [src]

Locates the commands to compile the `file` requested.

If `directory` is non-NULL, then the directory to run the command from is placed in `directory`.

#### Parameters

`file`

  Type: `GFile`

  A `GFile` representing the file to lookup.

  The data is owned by the caller of the method.

`system_includes`

  Type: `const char* const*`

  System include dirs if any.

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

`directory`

  Type: `GFile`

  A location for a `GFile`, or `NULL`.

  The argument will be set by the function.
  The argument can be `NULL`.
  The caller of the method takes ownership of the returned data, and is responsible for freeing it.

`error`

  Type: `GError **`

  The return location for a recoverable error.

  The argument can be `NULL`.
  If the return location is not `NULL`, then you must initialize it to a `NULL` `GError*`.
  The argument will be left initialized to `NULL` by the method if there are no errors.
  In case of error, the argument will be set to a newly allocated `GError`; the caller will take ownership of the data, and be responsible for freeing it.

#### Return value

Type: An array of `utf8`

A string array or `NULL` if there was a failure to locate or parse the command.

The array is `NULL`-terminated.
The caller of the method takes ownership of the returned data, and is responsible for freeing it.
The return value can be `NULL`.
Each element is a NUL terminated UTF-8 string.