blob: 68ab7bc5244c5ac02f0cf2f081ce377428681a79 [file] [log] [blame]
Arnaud A. de Grandmaison0271b322012-06-28 22:01:06 +00001/*===-- 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 Kramer2f5db8b2014-08-13 16:25:19 +000014#ifndef LLVM_CLANG_C_CXSTRING_H
15#define LLVM_CLANG_C_CXSTRING_H
Arnaud A. de Grandmaison0271b322012-06-28 22:01:06 +000016
17#include "clang-c/Platform.h"
18
19#ifdef __cplusplus
20extern "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 Weber82098cb2014-04-24 04:14:12 +000034 * the ownership of that string might differ from one call to the next.
Arnaud A. de Grandmaison0271b322012-06-28 22:01:06 +000035 * 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 */
38typedef struct {
Dmitri Gribenkoec3a16f2013-01-11 23:08:18 +000039 const void *data;
Arnaud A. de Grandmaison0271b322012-06-28 22:01:06 +000040 unsigned private_flags;
41} CXString;
42
Saleem Abdulrasool5d92eae2015-11-12 03:57:16 +000043typedef struct {
44 CXString *Strings;
45 unsigned Count;
46} CXStringSet;
47
Arnaud A. de Grandmaison0271b322012-06-28 22:01:06 +000048/**
49 * \brief Retrieve the character data associated with the given string.
50 */
51CINDEX_LINKAGE const char *clang_getCString(CXString string);
52
53/**
Adrian Prantl58ebbcd2013-05-24 18:38:08 +000054 * \brief Free the given string.
Arnaud A. de Grandmaison0271b322012-06-28 22:01:06 +000055 */
56CINDEX_LINKAGE void clang_disposeString(CXString string);
57
58/**
Saleem Abdulrasool5d92eae2015-11-12 03:57:16 +000059 * \brief Free the given string set.
60 */
61CINDEX_LINKAGE void clang_disposeStringSet(CXStringSet *set);
62
63/**
Arnaud A. de Grandmaison0271b322012-06-28 22:01:06 +000064 * @}
65 */
66
67#ifdef __cplusplus
68}
69#endif
70#endif
71