1 /*==-- clang-c/BuildSystem.h - Utilities for use by build systems -*- C -*-===*\
3 |* The LLVM Compiler Infrastructure *|
5 |* This file is distributed under the University of Illinois Open Source *|
6 |* License. See LICENSE.TXT for details. *|
8 |*===----------------------------------------------------------------------===*|
10 |* This header provides various utilities for use by build systems. *|
12 \*===----------------------------------------------------------------------===*/
14 #ifndef LLVM_CLANG_C_BUILDSYSTEM_H
15 #define LLVM_CLANG_C_BUILDSYSTEM_H
17 #include "clang-c/Platform.h"
18 #include "clang-c/CXErrorCode.h"
19 #include "clang-c/CXString.h"
26 * \defgroup BUILD_SYSTEM Build system utilities
31 * Return the timestamp for use with Clang's
32 * \c -fbuild-session-timestamp= option.
34 CINDEX_LINKAGE unsigned long long clang_getBuildSessionTimestamp(void);
37 * Object encapsulating information about overlaying virtual
38 * file/directories over the real file system.
40 typedef struct CXVirtualFileOverlayImpl *CXVirtualFileOverlay;
43 * Create a \c CXVirtualFileOverlay object.
44 * Must be disposed with \c clang_VirtualFileOverlay_dispose().
46 * \param options is reserved, always pass 0.
48 CINDEX_LINKAGE CXVirtualFileOverlay
49 clang_VirtualFileOverlay_create(unsigned options);
52 * Map an absolute virtual file path to an absolute real one.
53 * The virtual path must be canonicalized (not contain "."/"..").
54 * \returns 0 for success, non-zero to indicate an error.
56 CINDEX_LINKAGE enum CXErrorCode
57 clang_VirtualFileOverlay_addFileMapping(CXVirtualFileOverlay,
58 const char *virtualPath,
59 const char *realPath);
62 * Set the case sensitivity for the \c CXVirtualFileOverlay object.
63 * The \c CXVirtualFileOverlay object is case-sensitive by default, this
64 * option can be used to override the default.
65 * \returns 0 for success, non-zero to indicate an error.
67 CINDEX_LINKAGE enum CXErrorCode
68 clang_VirtualFileOverlay_setCaseSensitivity(CXVirtualFileOverlay,
72 * Write out the \c CXVirtualFileOverlay object to a char buffer.
74 * \param options is reserved, always pass 0.
75 * \param out_buffer_ptr pointer to receive the buffer pointer, which should be
76 * disposed using \c clang_free().
77 * \param out_buffer_size pointer to receive the buffer size.
78 * \returns 0 for success, non-zero to indicate an error.
80 CINDEX_LINKAGE enum CXErrorCode
81 clang_VirtualFileOverlay_writeToBuffer(CXVirtualFileOverlay, unsigned options,
82 char **out_buffer_ptr,
83 unsigned *out_buffer_size);
86 * free memory allocated by libclang, such as the buffer returned by
87 * \c CXVirtualFileOverlay() or \c clang_ModuleMapDescriptor_writeToBuffer().
89 * \param buffer memory pointer to free.
91 CINDEX_LINKAGE void clang_free(void *buffer);
94 * Dispose a \c CXVirtualFileOverlay object.
96 CINDEX_LINKAGE void clang_VirtualFileOverlay_dispose(CXVirtualFileOverlay);
99 * Object encapsulating information about a module.map file.
101 typedef struct CXModuleMapDescriptorImpl *CXModuleMapDescriptor;
104 * Create a \c CXModuleMapDescriptor object.
105 * Must be disposed with \c clang_ModuleMapDescriptor_dispose().
107 * \param options is reserved, always pass 0.
109 CINDEX_LINKAGE CXModuleMapDescriptor
110 clang_ModuleMapDescriptor_create(unsigned options);
113 * Sets the framework module name that the module.map describes.
114 * \returns 0 for success, non-zero to indicate an error.
116 CINDEX_LINKAGE enum CXErrorCode
117 clang_ModuleMapDescriptor_setFrameworkModuleName(CXModuleMapDescriptor,
121 * Sets the umbrealla header name that the module.map describes.
122 * \returns 0 for success, non-zero to indicate an error.
124 CINDEX_LINKAGE enum CXErrorCode
125 clang_ModuleMapDescriptor_setUmbrellaHeader(CXModuleMapDescriptor,
129 * Write out the \c CXModuleMapDescriptor object to a char buffer.
131 * \param options is reserved, always pass 0.
132 * \param out_buffer_ptr pointer to receive the buffer pointer, which should be
133 * disposed using \c clang_free().
134 * \param out_buffer_size pointer to receive the buffer size.
135 * \returns 0 for success, non-zero to indicate an error.
137 CINDEX_LINKAGE enum CXErrorCode
138 clang_ModuleMapDescriptor_writeToBuffer(CXModuleMapDescriptor, unsigned options,
139 char **out_buffer_ptr,
140 unsigned *out_buffer_size);
143 * Dispose a \c CXModuleMapDescriptor object.
145 CINDEX_LINKAGE void clang_ModuleMapDescriptor_dispose(CXModuleMapDescriptor);
155 #endif /* CLANG_C_BUILD_SYSTEM_H */