BuildSystem.odin (5331B)
1 /*==-- clang-c/BuildSystem.h - Utilities for use by build systems -*- C -*-===*\ 2 |* *| 3 |* Part of the LLVM Project, under the Apache License v2.0 with LLVM *| 4 |* Exceptions. *| 5 |* See https://llvm.org/LICENSE.txt for license information. *| 6 |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *| 7 |* *| 8 |*===----------------------------------------------------------------------===*| 9 |* *| 10 |* This header provides various utilities for use by build systems. *| 11 |* *| 12 \*===----------------------------------------------------------------------===*/ 13 package libclang 14 15 import "core:c" 16 17 _ :: c 18 19 when ODIN_OS == .Windows { 20 @(extra_linker_flags="/NODEFAULTLIB:libcmt") 21 foreign import lib { 22 "system:ntdll.lib", 23 "system:ucrt.lib", 24 "system:msvcrt.lib", 25 "system:legacy_stdio_definitions.lib", 26 "system:kernel32.lib", 27 "system:user32.lib", 28 "system:advapi32.lib", 29 "system:shell32.lib", 30 "system:ole32.lib", 31 "system:oleaut32.lib", 32 "system:uuid.lib", 33 "system:ws2_32.lib", 34 "system:version.lib", 35 "system:oldnames.lib", 36 "libclang.lib", 37 } 38 } else { 39 foreign import lib "system:clang" 40 } 41 42 // LLVM_CLANG_C_BUILDSYSTEM_H :: 43 44 /** 45 * Object encapsulating information about overlaying virtual 46 * file/directories over the real file system. 47 */ 48 Virtual_File_Overlay :: struct {} 49 50 /** 51 * Object encapsulating information about a module.modulemap file. 52 */ 53 Module_Map_Descriptor :: struct {} 54 55 @(default_calling_convention="c", link_prefix="clang_") 56 foreign lib { 57 /** 58 * Return the timestamp for use with Clang's 59 * \c -fbuild-session-timestamp= option. 60 */ 61 getBuildSessionTimestamp :: proc() -> c.ulonglong --- 62 63 /** 64 * Create a \c CXVirtualFileOverlay object. 65 * Must be disposed with \c clang_VirtualFileOverlay_dispose(). 66 * 67 * \param options is reserved, always pass 0. 68 */ 69 VirtualFileOverlay_create :: proc(options: c.uint) -> Virtual_File_Overlay --- 70 71 /** 72 * Map an absolute virtual file path to an absolute real one. 73 * The virtual path must be canonicalized (not contain "."/".."). 74 * \returns 0 for success, non-zero to indicate an error. 75 */ 76 VirtualFileOverlay_addFileMapping :: proc(_: Virtual_File_Overlay, virtualPath: cstring, realPath: cstring) -> Error_Code --- 77 78 /** 79 * Set the case sensitivity for the \c CXVirtualFileOverlay object. 80 * The \c CXVirtualFileOverlay object is case-sensitive by default, this 81 * option can be used to override the default. 82 * \returns 0 for success, non-zero to indicate an error. 83 */ 84 VirtualFileOverlay_setCaseSensitivity :: proc(_: Virtual_File_Overlay, caseSensitive: c.int) -> Error_Code --- 85 86 /** 87 * Write out the \c CXVirtualFileOverlay object to a char buffer. 88 * 89 * \param options is reserved, always pass 0. 90 * \param out_buffer_ptr pointer to receive the buffer pointer, which should be 91 * disposed using \c clang_free(). 92 * \param out_buffer_size pointer to receive the buffer size. 93 * \returns 0 for success, non-zero to indicate an error. 94 */ 95 VirtualFileOverlay_writeToBuffer :: proc(_: Virtual_File_Overlay, options: c.uint, out_buffer_ptr: [^]cstring, out_buffer_size: ^c.uint) -> Error_Code --- 96 97 /** 98 * free memory allocated by libclang, such as the buffer returned by 99 * \c CXVirtualFileOverlay() or \c clang_ModuleMapDescriptor_writeToBuffer(). 100 * 101 * \param buffer memory pointer to free. 102 */ 103 free :: proc(buffer: rawptr) --- 104 105 /** 106 * Dispose a \c CXVirtualFileOverlay object. 107 */ 108 VirtualFileOverlay_dispose :: proc(_: Virtual_File_Overlay) --- 109 110 /** 111 * Create a \c CXModuleMapDescriptor object. 112 * Must be disposed with \c clang_ModuleMapDescriptor_dispose(). 113 * 114 * \param options is reserved, always pass 0. 115 */ 116 ModuleMapDescriptor_create :: proc(options: c.uint) -> Module_Map_Descriptor --- 117 118 /** 119 * Sets the framework module name that the module.modulemap describes. 120 * \returns 0 for success, non-zero to indicate an error. 121 */ 122 ModuleMapDescriptor_setFrameworkModuleName :: proc(_: Module_Map_Descriptor, name: cstring) -> Error_Code --- 123 124 /** 125 * Sets the umbrella header name that the module.modulemap describes. 126 * \returns 0 for success, non-zero to indicate an error. 127 */ 128 ModuleMapDescriptor_setUmbrellaHeader :: proc(_: Module_Map_Descriptor, name: cstring) -> Error_Code --- 129 130 /** 131 * Write out the \c CXModuleMapDescriptor object to a char buffer. 132 * 133 * \param options is reserved, always pass 0. 134 * \param out_buffer_ptr pointer to receive the buffer pointer, which should be 135 * disposed using \c clang_free(). 136 * \param out_buffer_size pointer to receive the buffer size. 137 * \returns 0 for success, non-zero to indicate an error. 138 */ 139 ModuleMapDescriptor_writeToBuffer :: proc(_: Module_Map_Descriptor, options: c.uint, out_buffer_ptr: [^]cstring, out_buffer_size: ^c.uint) -> Error_Code --- 140 141 /** 142 * Dispose a \c CXModuleMapDescriptor object. 143 */ 144 ModuleMapDescriptor_dispose :: proc(_: Module_Map_Descriptor) --- 145 }