brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · 63dce4d Raw
74 lines · c
1/*===-- clang-c/CXString.h - C Index strings  --------------------*- 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 the interface to C Index strings.                     *|11|*                                                                            *|12\*===----------------------------------------------------------------------===*/13 14#ifndef LLVM_CLANG_C_CXSTRING_H15#define LLVM_CLANG_C_CXSTRING_H16 17#include "clang-c/ExternC.h"18#include "clang-c/Platform.h"19 20LLVM_CLANG_C_EXTERN_C_BEGIN21 22/**23 * \defgroup CINDEX_STRING String manipulation routines24 * \ingroup CINDEX25 *26 * @{27 */28 29/**30 * A character string.31 *32 * The \c CXString type is used to return strings from the interface when33 * the ownership of that string might differ from one call to the next.34 * Use \c clang_getCString() to retrieve the string data and, once finished35 * with the string data, call \c clang_disposeString() to free the string.36 */37typedef struct {38  const void *data;39  unsigned private_flags;40} CXString;41 42typedef struct {43  CXString *Strings;44  unsigned Count;45} CXStringSet;46 47/**48 * Retrieve the character data associated with the given string.49 *50 * The returned data is a reference and not owned by the user. This data51 * is only valid while the `CXString` is valid. This function is similar52 * to `std::string::c_str()`.53 */54CINDEX_LINKAGE const char *clang_getCString(CXString string);55 56/**57 * Free the given string.58 */59CINDEX_LINKAGE void clang_disposeString(CXString string);60 61/**62 * Free the given string set.63 */64CINDEX_LINKAGE void clang_disposeStringSet(CXStringSet *set);65 66/**67 * @}68 */69 70LLVM_CLANG_C_EXTERN_C_END71 72#endif73 74