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