1 /*==-- clang-c/BuildSysetm.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 CLANG_C_BUILD_SYSTEM_H
15 #define CLANG_C_BUILD_SYSTEM_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 * \brief Return the timestamp for use with Clang's
32 * \c -fbuild-session-timestamp= option.
34 CINDEX_LINKAGE unsigned long long clang_getBuildSessionTimestamp(void);
37 * \brief Object encapsulating information about overlaying virtual
38 * file/directories over the real file system.
40 typedef struct CXVirtualFileOverlayImpl *CXVirtualFileOverlay;
43 * \brief 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 * \brief 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 * \brief Write out the \c CXVirtualFileOverlay object to a char buffer.
64 * \param options is reserved, always pass 0.
65 * \param out_buffer_ptr pointer to receive the buffer pointer, which should be
66 * disposed using \c free().
67 * \param out_buffer_size pointer to receive the buffer size.
68 * \returns 0 for success, non-zero to indicate an error.
70 CINDEX_LINKAGE enum CXErrorCode
71 clang_VirtualFileOverlay_writeToBuffer(CXVirtualFileOverlay, unsigned options,
72 char **out_buffer_ptr,
73 unsigned *out_buffer_size);
76 * \brief Dispose a \c CXVirtualFileOverlay object.
78 CINDEX_LINKAGE void clang_VirtualFileOverlay_dispose(CXVirtualFileOverlay);
81 * \brief Object encapsulating information about a module.map file.
83 typedef struct CXModuleMapDescriptorImpl *CXModuleMapDescriptor;
86 * \brief Create a \c CXModuleMapDescriptor object.
87 * Must be disposed with \c clang_ModuleMapDescriptor_dispose().
89 * \param options is reserved, always pass 0.
91 CINDEX_LINKAGE CXModuleMapDescriptor
92 clang_ModuleMapDescriptor_create(unsigned options);
95 * \brief Sets the framework module name that the module.map describes.
96 * \returns 0 for success, non-zero to indicate an error.
98 CINDEX_LINKAGE enum CXErrorCode
99 clang_ModuleMapDescriptor_setFrameworkModuleName(CXModuleMapDescriptor,
103 * \brief Sets the umbrealla header name that the module.map describes.
104 * \returns 0 for success, non-zero to indicate an error.
106 CINDEX_LINKAGE enum CXErrorCode
107 clang_ModuleMapDescriptor_setUmbrellaHeader(CXModuleMapDescriptor,
111 * \brief Write out the \c CXModuleMapDescriptor object to a char buffer.
113 * \param options is reserved, always pass 0.
114 * \param out_buffer_ptr pointer to receive the buffer pointer, which should be
115 * disposed using \c free().
116 * \param out_buffer_size pointer to receive the buffer size.
117 * \returns 0 for success, non-zero to indicate an error.
119 CINDEX_LINKAGE enum CXErrorCode
120 clang_ModuleMapDescriptor_writeToBuffer(CXModuleMapDescriptor, unsigned options,
121 char **out_buffer_ptr,
122 unsigned *out_buffer_size);
125 * \brief Dispose a \c CXModuleMapDescriptor object.
127 CINDEX_LINKAGE void clang_ModuleMapDescriptor_dispose(CXModuleMapDescriptor);
137 #endif /* CLANG_C_BUILD_SYSTEM_H */