clang API Documentation

BuildSystem.h
Go to the documentation of this file.
00001 /*==-- clang-c/BuildSystem.h - Utilities for use by build systems -*- C -*-===*\
00002 |*                                                                            *|
00003 |*                     The LLVM Compiler Infrastructure                       *|
00004 |*                                                                            *|
00005 |* This file is distributed under the University of Illinois Open Source      *|
00006 |* License. See LICENSE.TXT for details.                                      *|
00007 |*                                                                            *|
00008 |*===----------------------------------------------------------------------===*|
00009 |*                                                                            *|
00010 |* This header provides various utilities for use by build systems.           *|
00011 |*                                                                            *|
00012 \*===----------------------------------------------------------------------===*/
00013 
00014 #ifndef LLVM_CLANG_C_BUILDSYSTEM_H
00015 #define LLVM_CLANG_C_BUILDSYSTEM_H
00016 
00017 #include "clang-c/Platform.h"
00018 #include "clang-c/CXErrorCode.h"
00019 #include "clang-c/CXString.h"
00020 
00021 #ifdef __cplusplus
00022 extern "C" {
00023 #endif
00024 
00025 /**
00026  * \defgroup BUILD_SYSTEM Build system utilities
00027  * @{
00028  */
00029 
00030 /**
00031  * \brief Return the timestamp for use with Clang's
00032  * \c -fbuild-session-timestamp= option.
00033  */
00034 CINDEX_LINKAGE unsigned long long clang_getBuildSessionTimestamp(void);
00035 
00036 /**
00037  * \brief Object encapsulating information about overlaying virtual
00038  * file/directories over the real file system.
00039  */
00040 typedef struct CXVirtualFileOverlayImpl *CXVirtualFileOverlay;
00041 
00042 /**
00043  * \brief Create a \c CXVirtualFileOverlay object.
00044  * Must be disposed with \c clang_VirtualFileOverlay_dispose().
00045  *
00046  * \param options is reserved, always pass 0.
00047  */
00048 CINDEX_LINKAGE CXVirtualFileOverlay
00049 clang_VirtualFileOverlay_create(unsigned options);
00050 
00051 /**
00052  * \brief Map an absolute virtual file path to an absolute real one.
00053  * The virtual path must be canonicalized (not contain "."/"..").
00054  * \returns 0 for success, non-zero to indicate an error.
00055  */
00056 CINDEX_LINKAGE enum CXErrorCode
00057 clang_VirtualFileOverlay_addFileMapping(CXVirtualFileOverlay,
00058                                         const char *virtualPath,
00059                                         const char *realPath);
00060 
00061 /**
00062  * \brief Set the case sensitivity for the \c CXVirtualFileOverlay object.
00063  * The \c CXVirtualFileOverlay object is case-sensitive by default, this
00064  * option can be used to override the default.
00065  * \returns 0 for success, non-zero to indicate an error.
00066  */
00067 CINDEX_LINKAGE enum CXErrorCode
00068 clang_VirtualFileOverlay_setCaseSensitivity(CXVirtualFileOverlay,
00069                       int caseSensitive);
00070 
00071 /**
00072  * \brief Write out the \c CXVirtualFileOverlay object to a char buffer.
00073  *
00074  * \param options is reserved, always pass 0.
00075  * \param out_buffer_ptr pointer to receive the buffer pointer, which should be
00076  * disposed using \c free().
00077  * \param out_buffer_size pointer to receive the buffer size.
00078  * \returns 0 for success, non-zero to indicate an error.
00079  */
00080 CINDEX_LINKAGE enum CXErrorCode
00081 clang_VirtualFileOverlay_writeToBuffer(CXVirtualFileOverlay, unsigned options,
00082                                        char **out_buffer_ptr,
00083                                        unsigned *out_buffer_size);
00084 
00085 /**
00086  * \brief Dispose a \c CXVirtualFileOverlay object.
00087  */
00088 CINDEX_LINKAGE void clang_VirtualFileOverlay_dispose(CXVirtualFileOverlay);
00089 
00090 /**
00091  * \brief Object encapsulating information about a module.map file.
00092  */
00093 typedef struct CXModuleMapDescriptorImpl *CXModuleMapDescriptor;
00094 
00095 /**
00096  * \brief Create a \c CXModuleMapDescriptor object.
00097  * Must be disposed with \c clang_ModuleMapDescriptor_dispose().
00098  *
00099  * \param options is reserved, always pass 0.
00100  */
00101 CINDEX_LINKAGE CXModuleMapDescriptor
00102 clang_ModuleMapDescriptor_create(unsigned options);
00103 
00104 /**
00105  * \brief Sets the framework module name that the module.map describes.
00106  * \returns 0 for success, non-zero to indicate an error.
00107  */
00108 CINDEX_LINKAGE enum CXErrorCode
00109 clang_ModuleMapDescriptor_setFrameworkModuleName(CXModuleMapDescriptor,
00110                                                  const char *name);
00111 
00112 /**
00113  * \brief Sets the umbrealla header name that the module.map describes.
00114  * \returns 0 for success, non-zero to indicate an error.
00115  */
00116 CINDEX_LINKAGE enum CXErrorCode
00117 clang_ModuleMapDescriptor_setUmbrellaHeader(CXModuleMapDescriptor,
00118                                             const char *name);
00119 
00120 /**
00121  * \brief Write out the \c CXModuleMapDescriptor object to a char buffer.
00122  *
00123  * \param options is reserved, always pass 0.
00124  * \param out_buffer_ptr pointer to receive the buffer pointer, which should be
00125  * disposed using \c free().
00126  * \param out_buffer_size pointer to receive the buffer size.
00127  * \returns 0 for success, non-zero to indicate an error.
00128  */
00129 CINDEX_LINKAGE enum CXErrorCode
00130 clang_ModuleMapDescriptor_writeToBuffer(CXModuleMapDescriptor, unsigned options,
00131                                        char **out_buffer_ptr,
00132                                        unsigned *out_buffer_size);
00133 
00134 /**
00135  * \brief Dispose a \c CXModuleMapDescriptor object.
00136  */
00137 CINDEX_LINKAGE void clang_ModuleMapDescriptor_dispose(CXModuleMapDescriptor);
00138 
00139 /**
00140  * @}
00141  */
00142 
00143 #ifdef __cplusplus
00144 }
00145 #endif
00146 
00147 #endif /* CLANG_C_BUILD_SYSTEM_H */
00148