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