/*===-- clang-c/CXCompilationDatabase.h - Compilation database ---*- C -*-===*\
|* *|
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
|* Exceptions. *|
|* See https://llvm.org/LICENSE.txt for license information. *|
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
|* *|
|*===----------------------------------------------------------------------===*|
|* *|
|* This header provides a public interface to use CompilationDatabase without *|
|* the full Clang C++ API. *|
|* *|
\*===----------------------------------------------------------------------===*/
/** \defgroup COMPILATIONDB CompilationDatabase functions
* \ingroup CINDEX
*
* @{
*/
/**
* A compilation database holds all information used to compile files in a
* project. For each file in the database, it can be queried for the working
* directory or the command line used for the compiler invocation.
*
* Must be freed by \c clang_CompilationDatabase_dispose
*/
typedef void * CXCompilationDatabase;
/**
* Contains the results of a search in the compilation database
*
* When searching for the compile command for a file, the compilation db can
* return several commands, as the file may have been compiled with
* different options in different places of the project. This choice of compile
* commands is wrapped in this opaque data structure. It must be freed by
* \c clang_CompileCommands_dispose.
*/
typedef void * CXCompileCommands;
/**
* Represents the command line invocation to compile a specific file.
*/
typedef void * CXCompileCommand;
/**
* Error codes for Compilation Database
*/
typedef enum CXCompilationDatabase_Error;
/**
* Creates a compilation database from the database found in directory
* buildDir. For example, CMake can output a compile_commands.json which can
* be used to build the database.
*
* It must be freed by \c clang_CompilationDatabase_dispose.
*/
CINDEX_LINKAGE ;
/**
* Free the given compilation database
*/
CINDEX_LINKAGE void
;
/**
* Find the compile commands used for a file. The compile commands
* must be freed by \c clang_CompileCommands_dispose.
*/
CINDEX_LINKAGE ;
/**
* Get all the compile commands in the given compilation database.
*/
CINDEX_LINKAGE ;
/**
* Free the given CompileCommands
*/
CINDEX_LINKAGE void ;
/**
* Get the number of CompileCommand we have for a file
*/
CINDEX_LINKAGE unsigned
;
/**
* Get the I'th CompileCommand for a file
*
* Note : 0 <= i < clang_CompileCommands_getSize(CXCompileCommands)
*/
CINDEX_LINKAGE ;
/**
* Get the working directory where the CompileCommand was executed from
*/
CINDEX_LINKAGE ;
/**
* Get the filename associated with the CompileCommand.
*/
CINDEX_LINKAGE ;
/**
* Get the number of arguments in the compiler invocation.
*
*/
CINDEX_LINKAGE unsigned
;
/**
* Get the I'th argument value in the compiler invocations
*
* Invariant :
* - argument 0 is the compiler executable
*/
CINDEX_LINKAGE ;
/**
* Get the number of source mappings for the compiler invocation.
*/
CINDEX_LINKAGE unsigned
;
/**
* Get the I'th mapped source path for the compiler invocation.
*/
CINDEX_LINKAGE ;
/**
* Get the I'th mapped source content for the compiler invocation.
*/
CINDEX_LINKAGE ;
/**
* @}
*/