CXFile.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. /*===-- clang-c/CXFile.h - C Index File ---------------------------*- 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 files. *|
  16. |* *|
  17. \*===----------------------------------------------------------------------===*/
  18. #ifndef LLVM_CLANG_C_CXFILE_H
  19. #define LLVM_CLANG_C_CXFILE_H
  20. #include <time.h>
  21. #include "clang-c/CXString.h"
  22. #include "clang-c/ExternC.h"
  23. #include "clang-c/Platform.h"
  24. LLVM_CLANG_C_EXTERN_C_BEGIN
  25. /**
  26. * \defgroup CINDEX_FILES File manipulation routines
  27. *
  28. * @{
  29. */
  30. /**
  31. * A particular source file that is part of a translation unit.
  32. */
  33. typedef void *CXFile;
  34. /**
  35. * Retrieve the complete file and path name of the given file.
  36. */
  37. CINDEX_LINKAGE CXString clang_getFileName(CXFile SFile);
  38. /**
  39. * Retrieve the last modification time of the given file.
  40. */
  41. CINDEX_LINKAGE time_t clang_getFileTime(CXFile SFile);
  42. /**
  43. * Uniquely identifies a CXFile, that refers to the same underlying file,
  44. * across an indexing session.
  45. */
  46. typedef struct {
  47. unsigned long long data[3];
  48. } CXFileUniqueID;
  49. /**
  50. * Retrieve the unique ID for the given \c file.
  51. *
  52. * \param file the file to get the ID for.
  53. * \param outID stores the returned CXFileUniqueID.
  54. * \returns If there was a failure getting the unique ID, returns non-zero,
  55. * otherwise returns 0.
  56. */
  57. CINDEX_LINKAGE int clang_getFileUniqueID(CXFile file, CXFileUniqueID *outID);
  58. /**
  59. * Returns non-zero if the \c file1 and \c file2 point to the same file,
  60. * or they are both NULL.
  61. */
  62. CINDEX_LINKAGE int clang_File_isEqual(CXFile file1, CXFile file2);
  63. /**
  64. * Returns the real path name of \c file.
  65. *
  66. * An empty string may be returned. Use \c clang_getFileName() in that case.
  67. */
  68. CINDEX_LINKAGE CXString clang_File_tryGetRealPathName(CXFile file);
  69. /**
  70. * @}
  71. */
  72. LLVM_CLANG_C_EXTERN_C_END
  73. #endif
  74. #ifdef __GNUC__
  75. #pragma GCC diagnostic pop
  76. #endif