xref: /freebsd-src/contrib/llvm-project/clang/include/clang-c/CXString.h (revision 5b27928474e6a4103d65b347544705c40c9618fd)
10b57cec5SDimitry Andric /*===-- clang-c/CXString.h - C Index strings  --------------------*- C -*-===*\
20b57cec5SDimitry Andric |*                                                                            *|
30b57cec5SDimitry Andric |* Part of the LLVM Project, under the Apache License v2.0 with LLVM          *|
40b57cec5SDimitry Andric |* Exceptions.                                                                *|
50b57cec5SDimitry Andric |* See https://llvm.org/LICENSE.txt for license information.                  *|
60b57cec5SDimitry Andric |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception                    *|
70b57cec5SDimitry Andric |*                                                                            *|
80b57cec5SDimitry Andric |*===----------------------------------------------------------------------===*|
90b57cec5SDimitry Andric |*                                                                            *|
100b57cec5SDimitry Andric |* This header provides the interface to C Index strings.                     *|
110b57cec5SDimitry Andric |*                                                                            *|
120b57cec5SDimitry Andric \*===----------------------------------------------------------------------===*/
130b57cec5SDimitry Andric 
140b57cec5SDimitry Andric #ifndef LLVM_CLANG_C_CXSTRING_H
150b57cec5SDimitry Andric #define LLVM_CLANG_C_CXSTRING_H
160b57cec5SDimitry Andric 
17*480093f4SDimitry Andric #include "clang-c/ExternC.h"
180b57cec5SDimitry Andric #include "clang-c/Platform.h"
190b57cec5SDimitry Andric 
20*480093f4SDimitry Andric LLVM_CLANG_C_EXTERN_C_BEGIN
210b57cec5SDimitry Andric 
220b57cec5SDimitry Andric /**
230b57cec5SDimitry Andric  * \defgroup CINDEX_STRING String manipulation routines
240b57cec5SDimitry Andric  * \ingroup CINDEX
250b57cec5SDimitry Andric  *
260b57cec5SDimitry Andric  * @{
270b57cec5SDimitry Andric  */
280b57cec5SDimitry Andric 
290b57cec5SDimitry Andric /**
300b57cec5SDimitry Andric  * A character string.
310b57cec5SDimitry Andric  *
320b57cec5SDimitry Andric  * The \c CXString type is used to return strings from the interface when
330b57cec5SDimitry Andric  * the ownership of that string might differ from one call to the next.
340b57cec5SDimitry Andric  * Use \c clang_getCString() to retrieve the string data and, once finished
350b57cec5SDimitry Andric  * with the string data, call \c clang_disposeString() to free the string.
360b57cec5SDimitry Andric  */
370b57cec5SDimitry Andric typedef struct {
380b57cec5SDimitry Andric   const void *data;
390b57cec5SDimitry Andric   unsigned private_flags;
400b57cec5SDimitry Andric } CXString;
410b57cec5SDimitry Andric 
420b57cec5SDimitry Andric typedef struct {
430b57cec5SDimitry Andric   CXString *Strings;
440b57cec5SDimitry Andric   unsigned Count;
450b57cec5SDimitry Andric } CXStringSet;
460b57cec5SDimitry Andric 
470b57cec5SDimitry Andric /**
480b57cec5SDimitry Andric  * Retrieve the character data associated with the given string.
490b57cec5SDimitry Andric  */
500b57cec5SDimitry Andric CINDEX_LINKAGE const char *clang_getCString(CXString string);
510b57cec5SDimitry Andric 
520b57cec5SDimitry Andric /**
530b57cec5SDimitry Andric  * Free the given string.
540b57cec5SDimitry Andric  */
550b57cec5SDimitry Andric CINDEX_LINKAGE void clang_disposeString(CXString string);
560b57cec5SDimitry Andric 
570b57cec5SDimitry Andric /**
580b57cec5SDimitry Andric  * Free the given string set.
590b57cec5SDimitry Andric  */
600b57cec5SDimitry Andric CINDEX_LINKAGE void clang_disposeStringSet(CXStringSet *set);
610b57cec5SDimitry Andric 
620b57cec5SDimitry Andric /**
630b57cec5SDimitry Andric  * @}
640b57cec5SDimitry Andric  */
650b57cec5SDimitry Andric 
66*480093f4SDimitry Andric LLVM_CLANG_C_EXTERN_C_END
67*480093f4SDimitry Andric 
680b57cec5SDimitry Andric #endif
690b57cec5SDimitry Andric 
70