1f4a2713aSLionel Sambuc /*===-- clang-c/CXString.h - C Index strings --------------------*- C -*-===*\ 2f4a2713aSLionel Sambuc |* *| 3f4a2713aSLionel Sambuc |* The LLVM Compiler Infrastructure *| 4f4a2713aSLionel Sambuc |* *| 5f4a2713aSLionel Sambuc |* This file is distributed under the University of Illinois Open Source *| 6f4a2713aSLionel Sambuc |* License. See LICENSE.TXT for details. *| 7f4a2713aSLionel Sambuc |* *| 8f4a2713aSLionel Sambuc |*===----------------------------------------------------------------------===*| 9f4a2713aSLionel Sambuc |* *| 10f4a2713aSLionel Sambuc |* This header provides the interface to C Index strings. *| 11f4a2713aSLionel Sambuc |* *| 12f4a2713aSLionel Sambuc \*===----------------------------------------------------------------------===*/ 13f4a2713aSLionel Sambuc 14*0a6a1f1dSLionel Sambuc #ifndef LLVM_CLANG_C_CXSTRING_H 15*0a6a1f1dSLionel Sambuc #define LLVM_CLANG_C_CXSTRING_H 16f4a2713aSLionel Sambuc 17f4a2713aSLionel Sambuc #include "clang-c/Platform.h" 18f4a2713aSLionel Sambuc 19f4a2713aSLionel Sambuc #ifdef __cplusplus 20f4a2713aSLionel Sambuc extern "C" { 21f4a2713aSLionel Sambuc #endif 22f4a2713aSLionel Sambuc 23f4a2713aSLionel Sambuc /** 24f4a2713aSLionel Sambuc * \defgroup CINDEX_STRING String manipulation routines 25f4a2713aSLionel Sambuc * \ingroup CINDEX 26f4a2713aSLionel Sambuc * 27f4a2713aSLionel Sambuc * @{ 28f4a2713aSLionel Sambuc */ 29f4a2713aSLionel Sambuc 30f4a2713aSLionel Sambuc /** 31f4a2713aSLionel Sambuc * \brief A character string. 32f4a2713aSLionel Sambuc * 33f4a2713aSLionel Sambuc * The \c CXString type is used to return strings from the interface when 34*0a6a1f1dSLionel Sambuc * the ownership of that string might differ from one call to the next. 35f4a2713aSLionel Sambuc * Use \c clang_getCString() to retrieve the string data and, once finished 36f4a2713aSLionel Sambuc * with the string data, call \c clang_disposeString() to free the string. 37f4a2713aSLionel Sambuc */ 38f4a2713aSLionel Sambuc typedef struct { 39f4a2713aSLionel Sambuc const void *data; 40f4a2713aSLionel Sambuc unsigned private_flags; 41f4a2713aSLionel Sambuc } CXString; 42f4a2713aSLionel Sambuc 43f4a2713aSLionel Sambuc /** 44f4a2713aSLionel Sambuc * \brief Retrieve the character data associated with the given string. 45f4a2713aSLionel Sambuc */ 46f4a2713aSLionel Sambuc CINDEX_LINKAGE const char *clang_getCString(CXString string); 47f4a2713aSLionel Sambuc 48f4a2713aSLionel Sambuc /** 49f4a2713aSLionel Sambuc * \brief Free the given string. 50f4a2713aSLionel Sambuc */ 51f4a2713aSLionel Sambuc CINDEX_LINKAGE void clang_disposeString(CXString string); 52f4a2713aSLionel Sambuc 53f4a2713aSLionel Sambuc /** 54f4a2713aSLionel Sambuc * @} 55f4a2713aSLionel Sambuc */ 56f4a2713aSLionel Sambuc 57f4a2713aSLionel Sambuc #ifdef __cplusplus 58f4a2713aSLionel Sambuc } 59f4a2713aSLionel Sambuc #endif 60f4a2713aSLionel Sambuc #endif 61f4a2713aSLionel Sambuc 62