1*0a6a1f1dSLionel Sambuc /*==-- clang-c/BuildSystem.h - Utilities for use by build systems -*- C -*-===*\ 2*0a6a1f1dSLionel Sambuc |* *| 3*0a6a1f1dSLionel Sambuc |* The LLVM Compiler Infrastructure *| 4*0a6a1f1dSLionel Sambuc |* *| 5*0a6a1f1dSLionel Sambuc |* This file is distributed under the University of Illinois Open Source *| 6*0a6a1f1dSLionel Sambuc |* License. See LICENSE.TXT for details. *| 7*0a6a1f1dSLionel Sambuc |* *| 8*0a6a1f1dSLionel Sambuc |*===----------------------------------------------------------------------===*| 9*0a6a1f1dSLionel Sambuc |* *| 10*0a6a1f1dSLionel Sambuc |* This header provides various utilities for use by build systems. *| 11*0a6a1f1dSLionel Sambuc |* *| 12*0a6a1f1dSLionel Sambuc \*===----------------------------------------------------------------------===*/ 13*0a6a1f1dSLionel Sambuc 14*0a6a1f1dSLionel Sambuc #ifndef LLVM_CLANG_C_BUILDSYSTEM_H 15*0a6a1f1dSLionel Sambuc #define LLVM_CLANG_C_BUILDSYSTEM_H 16*0a6a1f1dSLionel Sambuc 17*0a6a1f1dSLionel Sambuc #include "clang-c/Platform.h" 18*0a6a1f1dSLionel Sambuc #include "clang-c/CXErrorCode.h" 19*0a6a1f1dSLionel Sambuc #include "clang-c/CXString.h" 20*0a6a1f1dSLionel Sambuc 21*0a6a1f1dSLionel Sambuc #ifdef __cplusplus 22*0a6a1f1dSLionel Sambuc extern "C" { 23*0a6a1f1dSLionel Sambuc #endif 24*0a6a1f1dSLionel Sambuc 25*0a6a1f1dSLionel Sambuc /** 26*0a6a1f1dSLionel Sambuc * \defgroup BUILD_SYSTEM Build system utilities 27*0a6a1f1dSLionel Sambuc * @{ 28*0a6a1f1dSLionel Sambuc */ 29*0a6a1f1dSLionel Sambuc 30*0a6a1f1dSLionel Sambuc /** 31*0a6a1f1dSLionel Sambuc * \brief Return the timestamp for use with Clang's 32*0a6a1f1dSLionel Sambuc * \c -fbuild-session-timestamp= option. 33*0a6a1f1dSLionel Sambuc */ 34*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE unsigned long long clang_getBuildSessionTimestamp(void); 35*0a6a1f1dSLionel Sambuc 36*0a6a1f1dSLionel Sambuc /** 37*0a6a1f1dSLionel Sambuc * \brief Object encapsulating information about overlaying virtual 38*0a6a1f1dSLionel Sambuc * file/directories over the real file system. 39*0a6a1f1dSLionel Sambuc */ 40*0a6a1f1dSLionel Sambuc typedef struct CXVirtualFileOverlayImpl *CXVirtualFileOverlay; 41*0a6a1f1dSLionel Sambuc 42*0a6a1f1dSLionel Sambuc /** 43*0a6a1f1dSLionel Sambuc * \brief Create a \c CXVirtualFileOverlay object. 44*0a6a1f1dSLionel Sambuc * Must be disposed with \c clang_VirtualFileOverlay_dispose(). 45*0a6a1f1dSLionel Sambuc * 46*0a6a1f1dSLionel Sambuc * \param options is reserved, always pass 0. 47*0a6a1f1dSLionel Sambuc */ 48*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE CXVirtualFileOverlay 49*0a6a1f1dSLionel Sambuc clang_VirtualFileOverlay_create(unsigned options); 50*0a6a1f1dSLionel Sambuc 51*0a6a1f1dSLionel Sambuc /** 52*0a6a1f1dSLionel Sambuc * \brief Map an absolute virtual file path to an absolute real one. 53*0a6a1f1dSLionel Sambuc * The virtual path must be canonicalized (not contain "."/".."). 54*0a6a1f1dSLionel Sambuc * \returns 0 for success, non-zero to indicate an error. 55*0a6a1f1dSLionel Sambuc */ 56*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE enum CXErrorCode 57*0a6a1f1dSLionel Sambuc clang_VirtualFileOverlay_addFileMapping(CXVirtualFileOverlay, 58*0a6a1f1dSLionel Sambuc const char *virtualPath, 59*0a6a1f1dSLionel Sambuc const char *realPath); 60*0a6a1f1dSLionel Sambuc 61*0a6a1f1dSLionel Sambuc /** 62*0a6a1f1dSLionel Sambuc * \brief Set the case sensitivity for the \c CXVirtualFileOverlay object. 63*0a6a1f1dSLionel Sambuc * The \c CXVirtualFileOverlay object is case-sensitive by default, this 64*0a6a1f1dSLionel Sambuc * option can be used to override the default. 65*0a6a1f1dSLionel Sambuc * \returns 0 for success, non-zero to indicate an error. 66*0a6a1f1dSLionel Sambuc */ 67*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE enum CXErrorCode 68*0a6a1f1dSLionel Sambuc clang_VirtualFileOverlay_setCaseSensitivity(CXVirtualFileOverlay, 69*0a6a1f1dSLionel Sambuc int caseSensitive); 70*0a6a1f1dSLionel Sambuc 71*0a6a1f1dSLionel Sambuc /** 72*0a6a1f1dSLionel Sambuc * \brief Write out the \c CXVirtualFileOverlay object to a char buffer. 73*0a6a1f1dSLionel Sambuc * 74*0a6a1f1dSLionel Sambuc * \param options is reserved, always pass 0. 75*0a6a1f1dSLionel Sambuc * \param out_buffer_ptr pointer to receive the buffer pointer, which should be 76*0a6a1f1dSLionel Sambuc * disposed using \c free(). 77*0a6a1f1dSLionel Sambuc * \param out_buffer_size pointer to receive the buffer size. 78*0a6a1f1dSLionel Sambuc * \returns 0 for success, non-zero to indicate an error. 79*0a6a1f1dSLionel Sambuc */ 80*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE enum CXErrorCode 81*0a6a1f1dSLionel Sambuc clang_VirtualFileOverlay_writeToBuffer(CXVirtualFileOverlay, unsigned options, 82*0a6a1f1dSLionel Sambuc char **out_buffer_ptr, 83*0a6a1f1dSLionel Sambuc unsigned *out_buffer_size); 84*0a6a1f1dSLionel Sambuc 85*0a6a1f1dSLionel Sambuc /** 86*0a6a1f1dSLionel Sambuc * \brief Dispose a \c CXVirtualFileOverlay object. 87*0a6a1f1dSLionel Sambuc */ 88*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE void clang_VirtualFileOverlay_dispose(CXVirtualFileOverlay); 89*0a6a1f1dSLionel Sambuc 90*0a6a1f1dSLionel Sambuc /** 91*0a6a1f1dSLionel Sambuc * \brief Object encapsulating information about a module.map file. 92*0a6a1f1dSLionel Sambuc */ 93*0a6a1f1dSLionel Sambuc typedef struct CXModuleMapDescriptorImpl *CXModuleMapDescriptor; 94*0a6a1f1dSLionel Sambuc 95*0a6a1f1dSLionel Sambuc /** 96*0a6a1f1dSLionel Sambuc * \brief Create a \c CXModuleMapDescriptor object. 97*0a6a1f1dSLionel Sambuc * Must be disposed with \c clang_ModuleMapDescriptor_dispose(). 98*0a6a1f1dSLionel Sambuc * 99*0a6a1f1dSLionel Sambuc * \param options is reserved, always pass 0. 100*0a6a1f1dSLionel Sambuc */ 101*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE CXModuleMapDescriptor 102*0a6a1f1dSLionel Sambuc clang_ModuleMapDescriptor_create(unsigned options); 103*0a6a1f1dSLionel Sambuc 104*0a6a1f1dSLionel Sambuc /** 105*0a6a1f1dSLionel Sambuc * \brief Sets the framework module name that the module.map describes. 106*0a6a1f1dSLionel Sambuc * \returns 0 for success, non-zero to indicate an error. 107*0a6a1f1dSLionel Sambuc */ 108*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE enum CXErrorCode 109*0a6a1f1dSLionel Sambuc clang_ModuleMapDescriptor_setFrameworkModuleName(CXModuleMapDescriptor, 110*0a6a1f1dSLionel Sambuc const char *name); 111*0a6a1f1dSLionel Sambuc 112*0a6a1f1dSLionel Sambuc /** 113*0a6a1f1dSLionel Sambuc * \brief Sets the umbrealla header name that the module.map describes. 114*0a6a1f1dSLionel Sambuc * \returns 0 for success, non-zero to indicate an error. 115*0a6a1f1dSLionel Sambuc */ 116*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE enum CXErrorCode 117*0a6a1f1dSLionel Sambuc clang_ModuleMapDescriptor_setUmbrellaHeader(CXModuleMapDescriptor, 118*0a6a1f1dSLionel Sambuc const char *name); 119*0a6a1f1dSLionel Sambuc 120*0a6a1f1dSLionel Sambuc /** 121*0a6a1f1dSLionel Sambuc * \brief Write out the \c CXModuleMapDescriptor object to a char buffer. 122*0a6a1f1dSLionel Sambuc * 123*0a6a1f1dSLionel Sambuc * \param options is reserved, always pass 0. 124*0a6a1f1dSLionel Sambuc * \param out_buffer_ptr pointer to receive the buffer pointer, which should be 125*0a6a1f1dSLionel Sambuc * disposed using \c free(). 126*0a6a1f1dSLionel Sambuc * \param out_buffer_size pointer to receive the buffer size. 127*0a6a1f1dSLionel Sambuc * \returns 0 for success, non-zero to indicate an error. 128*0a6a1f1dSLionel Sambuc */ 129*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE enum CXErrorCode 130*0a6a1f1dSLionel Sambuc clang_ModuleMapDescriptor_writeToBuffer(CXModuleMapDescriptor, unsigned options, 131*0a6a1f1dSLionel Sambuc char **out_buffer_ptr, 132*0a6a1f1dSLionel Sambuc unsigned *out_buffer_size); 133*0a6a1f1dSLionel Sambuc 134*0a6a1f1dSLionel Sambuc /** 135*0a6a1f1dSLionel Sambuc * \brief Dispose a \c CXModuleMapDescriptor object. 136*0a6a1f1dSLionel Sambuc */ 137*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE void clang_ModuleMapDescriptor_dispose(CXModuleMapDescriptor); 138*0a6a1f1dSLionel Sambuc 139*0a6a1f1dSLionel Sambuc /** 140*0a6a1f1dSLionel Sambuc * @} 141*0a6a1f1dSLionel Sambuc */ 142*0a6a1f1dSLionel Sambuc 143*0a6a1f1dSLionel Sambuc #ifdef __cplusplus 144*0a6a1f1dSLionel Sambuc } 145*0a6a1f1dSLionel Sambuc #endif 146*0a6a1f1dSLionel Sambuc 147*0a6a1f1dSLionel Sambuc #endif /* CLANG_C_BUILD_SYSTEM_H */ 148*0a6a1f1dSLionel Sambuc 149