CXString.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. /*===-- clang-c/CXString.h - C Index strings --------------------*- C -*-===*\
  7. |* *|
  8. |* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
  9. |* Exceptions. *|
  10. |* See https://llvm.org/LICENSE.txt for license information. *|
  11. |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
  12. |* *|
  13. |*===----------------------------------------------------------------------===*|
  14. |* *|
  15. |* This header provides the interface to C Index strings. *|
  16. |* *|
  17. \*===----------------------------------------------------------------------===*/
  18. #ifndef LLVM_CLANG_C_CXSTRING_H
  19. #define LLVM_CLANG_C_CXSTRING_H
  20. #include "clang-c/ExternC.h"
  21. #include "clang-c/Platform.h"
  22. LLVM_CLANG_C_EXTERN_C_BEGIN
  23. /**
  24. * \defgroup CINDEX_STRING String manipulation routines
  25. * \ingroup CINDEX
  26. *
  27. * @{
  28. */
  29. /**
  30. * A character string.
  31. *
  32. * The \c CXString type is used to return strings from the interface when
  33. * 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 finished
  35. * with the string data, call \c clang_disposeString() to free the string.
  36. */
  37. typedef struct {
  38. const void *data;
  39. unsigned private_flags;
  40. } CXString;
  41. typedef struct {
  42. CXString *Strings;
  43. unsigned Count;
  44. } CXStringSet;
  45. /**
  46. * Retrieve the character data associated with the given string.
  47. */
  48. CINDEX_LINKAGE const char *clang_getCString(CXString string);
  49. /**
  50. * Free the given string.
  51. */
  52. CINDEX_LINKAGE void clang_disposeString(CXString string);
  53. /**
  54. * Free the given string set.
  55. */
  56. CINDEX_LINKAGE void clang_disposeStringSet(CXStringSet *set);
  57. /**
  58. * @}
  59. */
  60. LLVM_CLANG_C_EXTERN_C_END
  61. #endif
  62. #ifdef __GNUC__
  63. #pragma GCC diagnostic pop
  64. #endif