ljclang

FORK: A LuaJIT-based interface to libclang
git clone https://git.neptards.moe/neptards/ljclang.git
Log | Files | Refs

ljclang_Index_h.lua (62984B)


      1 require('ffi').cdef[==========[
      2 	/*===-- clang-c/CXString.h - C Index strings  --------------------*- C -*-===*\
      3 |*                                                                            *|
      4 |*                     The LLVM Compiler Infrastructure                       *|
      5 |*                                                                            *|
      6 |* This file is distributed under the University of Illinois Open Source      *|
      7 |* License. See LICENSE.TXT for details.                                      *|
      8 |*                                                                            *|
      9 |*===----------------------------------------------------------------------===*|
     10 |*                                                                            *|
     11 |* This header provides the interface to C Index strings.                     *|
     12 |*                                                                            *|
     13 \*===----------------------------------------------------------------------===*/
     14 typedef struct {
     15   const void *data;
     16   unsigned private_flags;
     17 } CXString;
     18 typedef struct {
     19   CXString *Strings;
     20   unsigned Count;
     21 } CXStringSet;
     22  const char *clang_getCString(CXString string);
     23  void clang_disposeString(CXString string);
     24  void clang_disposeStringSet(CXStringSet *set);
     25 	/*===-- clang-c/CXCompilationDatabase.h - Compilation database  ---*- C -*-===*\
     26 |*                                                                            *|
     27 |*                     The LLVM Compiler Infrastructure                       *|
     28 |*                                                                            *|
     29 |* This file is distributed under the University of Illinois Open Source      *|
     30 |* License. See LICENSE.TXT for details.                                      *|
     31 |*                                                                            *|
     32 |*===----------------------------------------------------------------------===*|
     33 |*                                                                            *|
     34 |* This header provides a public inferface to use CompilationDatabase without *|
     35 |* the full Clang C++ API.                                                    *|
     36 |*                                                                            *|
     37 \*===----------------------------------------------------------------------===*/
     38 typedef void * CXCompilationDatabase;
     39 typedef void * CXCompileCommands;
     40 typedef void * CXCompileCommand;
     41 typedef enum  {
     42   /*
     43    * \brief No error occurred
     44    */
     45   CXCompilationDatabase_NoError = 0,
     46   /*
     47    * \brief Database can not be loaded
     48    */
     49   CXCompilationDatabase_CanNotLoadDatabase = 1
     50 } CXCompilationDatabase_Error;
     51  CXCompilationDatabase
     52 clang_CompilationDatabase_fromDirectory(const char *BuildDir,
     53                                         CXCompilationDatabase_Error *ErrorCode);
     54  void
     55 clang_CompilationDatabase_dispose(CXCompilationDatabase);
     56  CXCompileCommands
     57 clang_CompilationDatabase_getCompileCommands(CXCompilationDatabase,
     58                                              const char *CompleteFileName);
     59  CXCompileCommands
     60 clang_CompilationDatabase_getAllCompileCommands(CXCompilationDatabase);
     61  void clang_CompileCommands_dispose(CXCompileCommands);
     62  unsigned
     63 clang_CompileCommands_getSize(CXCompileCommands);
     64  CXCompileCommand
     65 clang_CompileCommands_getCommand(CXCompileCommands, unsigned I);
     66  CXString
     67 clang_CompileCommand_getDirectory(CXCompileCommand);
     68  CXString
     69 clang_CompileCommand_getFilename(CXCompileCommand);
     70  unsigned
     71 clang_CompileCommand_getNumArgs(CXCompileCommand);
     72  CXString
     73 clang_CompileCommand_getArg(CXCompileCommand, unsigned I);
     74  unsigned
     75 clang_CompileCommand_getNumMappedSources(CXCompileCommand);
     76  CXString
     77 clang_CompileCommand_getMappedSourcePath(CXCompileCommand, unsigned I);
     78  CXString
     79 clang_CompileCommand_getMappedSourceContent(CXCompileCommand, unsigned I);
     80 	/*===-- clang-c/Index.h - Indexing Public C Interface -------------*- C -*-===*\
     81 |*                                                                            *|
     82 |*                     The LLVM Compiler Infrastructure                       *|
     83 |*                                                                            *|
     84 |* This file is distributed under the University of Illinois Open Source      *|
     85 |* License. See LICENSE.TXT for details.                                      *|
     86 |*                                                                            *|
     87 |*===----------------------------------------------------------------------===*|
     88 |*                                                                            *|
     89 |* This header provides a public inferface to a Clang library for extracting  *|
     90 |* high-level symbol information from source files without exposing the full  *|
     91 |* Clang C++ API.                                                             *|
     92 |*                                                                            *|
     93 \*===----------------------------------------------------------------------===*/
     94 typedef void *CXIndex;
     95 typedef struct CXTranslationUnitImpl *CXTranslationUnit;
     96 typedef void *CXClientData;
     97 struct CXUnsavedFile {
     98 
     99   const char *Filename;
    100 
    101   const char *Contents;
    102 
    103   unsigned long Length;
    104 };
    105 enum CXAvailabilityKind {
    106 
    107   CXAvailability_Available,
    108 
    109   CXAvailability_Deprecated,
    110 
    111   CXAvailability_NotAvailable,
    112 
    113   CXAvailability_NotAccessible
    114 };
    115 typedef struct CXVersion {
    116 
    117   int Major;
    118 
    119   int Minor;
    120 
    121   int Subminor;
    122 } CXVersion;
    123 
    124  CXIndex clang_createIndex(int excludeDeclarationsFromPCH,
    125                                          int displayDiagnostics);
    126  void clang_disposeIndex(CXIndex index);
    127 typedef enum {
    128 
    129   CXGlobalOpt_None = 0x0,
    130 
    131   CXGlobalOpt_ThreadBackgroundPriorityForIndexing = 0x1,
    132 
    133   CXGlobalOpt_ThreadBackgroundPriorityForEditing = 0x2,
    134 
    135   CXGlobalOpt_ThreadBackgroundPriorityForAll =
    136       CXGlobalOpt_ThreadBackgroundPriorityForIndexing |
    137       CXGlobalOpt_ThreadBackgroundPriorityForEditing
    138 } CXGlobalOptFlags;
    139  void clang_CXIndex_setGlobalOptions(CXIndex, unsigned options);
    140  unsigned clang_CXIndex_getGlobalOptions(CXIndex);
    141 typedef void *CXFile;
    142  CXString clang_getFileName(CXFile SFile);
    143  // time_t clang_getFileTime(CXFile SFile);
    144 typedef struct {
    145   unsigned long long data[3];
    146 } CXFileUniqueID;
    147  int clang_getFileUniqueID(CXFile file, CXFileUniqueID *outID);
    148  unsigned
    149 clang_isFileMultipleIncludeGuarded(CXTranslationUnit tu, CXFile file);
    150  CXFile clang_getFile(CXTranslationUnit tu,
    151                                     const char *file_name);
    152  int clang_File_isEqual(CXFile file1, CXFile file2);
    153 typedef struct {
    154   const void *ptr_data[2];
    155   unsigned int_data;
    156 } CXSourceLocation;
    157 typedef struct {
    158   const void *ptr_data[2];
    159   unsigned begin_int_data;
    160   unsigned end_int_data;
    161 } CXSourceRange;
    162  CXSourceLocation clang_getNullLocation(void);
    163  unsigned clang_equalLocations(CXSourceLocation loc1,
    164                                              CXSourceLocation loc2);
    165  CXSourceLocation clang_getLocation(CXTranslationUnit tu,
    166                                                   CXFile file,
    167                                                   unsigned line,
    168                                                   unsigned column);
    169  CXSourceLocation clang_getLocationForOffset(CXTranslationUnit tu,
    170                                                            CXFile file,
    171                                                            unsigned offset);
    172  int clang_Location_isInSystemHeader(CXSourceLocation location);
    173  int clang_Location_isFromMainFile(CXSourceLocation location);
    174  CXSourceRange clang_getNullRange(void);
    175  CXSourceRange clang_getRange(CXSourceLocation begin,
    176                                             CXSourceLocation end);
    177  unsigned clang_equalRanges(CXSourceRange range1,
    178                                           CXSourceRange range2);
    179  int clang_Range_isNull(CXSourceRange range);
    180  void clang_getExpansionLocation(CXSourceLocation location,
    181                                                CXFile *file,
    182                                                unsigned *line,
    183                                                unsigned *column,
    184                                                unsigned *offset);
    185  void clang_getPresumedLocation(CXSourceLocation location,
    186                                               CXString *filename,
    187                                               unsigned *line,
    188                                               unsigned *column);
    189  void clang_getInstantiationLocation(CXSourceLocation location,
    190                                                    CXFile *file,
    191                                                    unsigned *line,
    192                                                    unsigned *column,
    193                                                    unsigned *offset);
    194  void clang_getSpellingLocation(CXSourceLocation location,
    195                                               CXFile *file,
    196                                               unsigned *line,
    197                                               unsigned *column,
    198                                               unsigned *offset);
    199  void clang_getFileLocation(CXSourceLocation location,
    200                                           CXFile *file,
    201                                           unsigned *line,
    202                                           unsigned *column,
    203                                           unsigned *offset);
    204  CXSourceLocation clang_getRangeStart(CXSourceRange range);
    205  CXSourceLocation clang_getRangeEnd(CXSourceRange range);
    206 typedef struct {
    207 
    208   unsigned count;
    209 
    210   CXSourceRange *ranges;
    211 } CXSourceRangeList;
    212  CXSourceRangeList *clang_getSkippedRanges(CXTranslationUnit tu,
    213                                                          CXFile file);
    214  CXSourceRangeList *clang_getAllSkippedRanges(CXTranslationUnit tu);
    215  void clang_disposeSourceRangeList(CXSourceRangeList *ranges);
    216 enum CXDiagnosticSeverity {
    217 
    218   CXDiagnostic_Ignored = 0,
    219 
    220   CXDiagnostic_Note    = 1,
    221 
    222   CXDiagnostic_Warning = 2,
    223 
    224   CXDiagnostic_Error   = 3,
    225 
    226   CXDiagnostic_Fatal   = 4
    227 };
    228 typedef void *CXDiagnostic;
    229 typedef void *CXDiagnosticSet;
    230 
    231  unsigned clang_getNumDiagnosticsInSet(CXDiagnosticSet Diags);
    232  CXDiagnostic clang_getDiagnosticInSet(CXDiagnosticSet Diags,
    233                                                      unsigned Index);
    234 enum CXLoadDiag_Error {
    235 
    236   CXLoadDiag_None = 0,
    237 
    238 
    239   CXLoadDiag_Unknown = 1,
    240 
    241 
    242   CXLoadDiag_CannotLoad = 2,
    243 
    244 
    245   CXLoadDiag_InvalidFile = 3
    246 };
    247 
    248  CXDiagnosticSet clang_loadDiagnostics(const char *file,
    249                                                   enum CXLoadDiag_Error *error,
    250                                                   CXString *errorString);
    251  void clang_disposeDiagnosticSet(CXDiagnosticSet Diags);
    252  CXDiagnosticSet clang_getChildDiagnostics(CXDiagnostic D);
    253  unsigned clang_getNumDiagnostics(CXTranslationUnit Unit);
    254  CXDiagnostic clang_getDiagnostic(CXTranslationUnit Unit,
    255                                                 unsigned Index);
    256  CXDiagnosticSet
    257   clang_getDiagnosticSetFromTU(CXTranslationUnit Unit);
    258  void clang_disposeDiagnostic(CXDiagnostic Diagnostic);
    259 enum CXDiagnosticDisplayOptions {
    260 
    261   CXDiagnostic_DisplaySourceLocation = 0x01,
    262 
    263   CXDiagnostic_DisplayColumn = 0x02,
    264 
    265   CXDiagnostic_DisplaySourceRanges = 0x04,
    266 
    267 
    268   CXDiagnostic_DisplayOption = 0x08,
    269 
    270 
    271   CXDiagnostic_DisplayCategoryId = 0x10,
    272 
    273   CXDiagnostic_DisplayCategoryName = 0x20
    274 };
    275  CXString clang_formatDiagnostic(CXDiagnostic Diagnostic,
    276                                                unsigned Options);
    277  unsigned clang_defaultDiagnosticDisplayOptions(void);
    278  enum CXDiagnosticSeverity
    279 clang_getDiagnosticSeverity(CXDiagnostic);
    280  CXSourceLocation clang_getDiagnosticLocation(CXDiagnostic);
    281  CXString clang_getDiagnosticSpelling(CXDiagnostic);
    282  CXString clang_getDiagnosticOption(CXDiagnostic Diag,
    283                                                   CXString *Disable);
    284  unsigned clang_getDiagnosticCategory(CXDiagnostic);
    285 
    286 CXString clang_getDiagnosticCategoryName(unsigned Category);
    287  CXString clang_getDiagnosticCategoryText(CXDiagnostic);
    288 
    289  unsigned clang_getDiagnosticNumRanges(CXDiagnostic);
    290  CXSourceRange clang_getDiagnosticRange(CXDiagnostic Diagnostic,
    291                                                       unsigned Range);
    292  unsigned clang_getDiagnosticNumFixIts(CXDiagnostic Diagnostic);
    293  CXString clang_getDiagnosticFixIt(CXDiagnostic Diagnostic,
    294                                                  unsigned FixIt,
    295                                                CXSourceRange *ReplacementRange);
    296  CXString
    297 clang_getTranslationUnitSpelling(CXTranslationUnit CTUnit);
    298  CXTranslationUnit clang_createTranslationUnitFromSourceFile(
    299                                          CXIndex CIdx,
    300                                          const char *source_filename,
    301                                          int num_clang_command_line_args,
    302                                    const char * const *clang_command_line_args,
    303                                          unsigned num_unsaved_files,
    304                                          struct CXUnsavedFile *unsaved_files);
    305  CXTranslationUnit clang_createTranslationUnit(
    306     CXIndex CIdx,
    307     const char *ast_filename);
    308  enum CXErrorCode clang_createTranslationUnit2(
    309     CXIndex CIdx,
    310     const char *ast_filename,
    311     CXTranslationUnit *out_TU);
    312 enum CXTranslationUnit_Flags {
    313 
    314   CXTranslationUnit_None = 0x0,
    315 
    316   CXTranslationUnit_DetailedPreprocessingRecord = 0x01,
    317 
    318   CXTranslationUnit_Incomplete = 0x02,
    319 
    320 
    321   CXTranslationUnit_PrecompiledPreamble = 0x04,
    322 
    323 
    324   CXTranslationUnit_CacheCompletionResults = 0x08,
    325 
    326   CXTranslationUnit_ForSerialization = 0x10,
    327 
    328   CXTranslationUnit_CXXChainedPCH = 0x20,
    329 
    330   CXTranslationUnit_SkipFunctionBodies = 0x40,
    331 
    332   CXTranslationUnit_IncludeBriefCommentsInCodeCompletion = 0x80,
    333 
    334   CXTranslationUnit_CreatePreambleOnFirstParse = 0x100,
    335 
    336   CXTranslationUnit_KeepGoing = 0x200
    337 };
    338  unsigned clang_defaultEditingTranslationUnitOptions(void);
    339  CXTranslationUnit
    340 clang_parseTranslationUnit(CXIndex CIdx,
    341                            const char *source_filename,
    342                            const char *const *command_line_args,
    343                            int num_command_line_args,
    344                            struct CXUnsavedFile *unsaved_files,
    345                            unsigned num_unsaved_files,
    346                            unsigned options);
    347  enum CXErrorCode
    348 clang_parseTranslationUnit2(CXIndex CIdx,
    349                             const char *source_filename,
    350                             const char *const *command_line_args,
    351                             int num_command_line_args,
    352                             struct CXUnsavedFile *unsaved_files,
    353                             unsigned num_unsaved_files,
    354                             unsigned options,
    355                             CXTranslationUnit *out_TU);
    356  enum CXErrorCode clang_parseTranslationUnit2FullArgv(
    357     CXIndex CIdx, const char *source_filename,
    358     const char *const *command_line_args, int num_command_line_args,
    359     struct CXUnsavedFile *unsaved_files, unsigned num_unsaved_files,
    360     unsigned options, CXTranslationUnit *out_TU);
    361 enum CXSaveTranslationUnit_Flags {
    362 
    363   CXSaveTranslationUnit_None = 0x0
    364 };
    365  unsigned clang_defaultSaveOptions(CXTranslationUnit TU);
    366 enum CXSaveError {
    367 
    368   CXSaveError_None = 0,
    369 
    370 
    371   CXSaveError_Unknown = 1,
    372 
    373 
    374   CXSaveError_TranslationErrors = 2,
    375 
    376 
    377   CXSaveError_InvalidTU = 3
    378 };
    379 
    380  int clang_saveTranslationUnit(CXTranslationUnit TU,
    381                                              const char *FileName,
    382                                              unsigned options);
    383  void clang_disposeTranslationUnit(CXTranslationUnit);
    384 enum CXReparse_Flags {
    385 
    386   CXReparse_None = 0x0
    387 };
    388 
    389  unsigned clang_defaultReparseOptions(CXTranslationUnit TU);
    390  int clang_reparseTranslationUnit(CXTranslationUnit TU,
    391                                                 unsigned num_unsaved_files,
    392                                           struct CXUnsavedFile *unsaved_files,
    393                                                 unsigned options);
    394 enum CXTUResourceUsageKind {
    395   CXTUResourceUsage_AST = 1,
    396   CXTUResourceUsage_Identifiers = 2,
    397   CXTUResourceUsage_Selectors = 3,
    398   CXTUResourceUsage_GlobalCompletionResults = 4,
    399   CXTUResourceUsage_SourceManagerContentCache = 5,
    400   CXTUResourceUsage_AST_SideTables = 6,
    401   CXTUResourceUsage_SourceManager_Membuffer_Malloc = 7,
    402   CXTUResourceUsage_SourceManager_Membuffer_MMap = 8,
    403   CXTUResourceUsage_ExternalASTSource_Membuffer_Malloc = 9,
    404   CXTUResourceUsage_ExternalASTSource_Membuffer_MMap = 10,
    405   CXTUResourceUsage_Preprocessor = 11,
    406   CXTUResourceUsage_PreprocessingRecord = 12,
    407   CXTUResourceUsage_SourceManager_DataStructures = 13,
    408   CXTUResourceUsage_Preprocessor_HeaderSearch = 14,
    409   CXTUResourceUsage_MEMORY_IN_BYTES_BEGIN = CXTUResourceUsage_AST,
    410   CXTUResourceUsage_MEMORY_IN_BYTES_END =
    411     CXTUResourceUsage_Preprocessor_HeaderSearch,
    412   CXTUResourceUsage_First = CXTUResourceUsage_AST,
    413   CXTUResourceUsage_Last = CXTUResourceUsage_Preprocessor_HeaderSearch
    414 };
    415 const char *clang_getTUResourceUsageName(enum CXTUResourceUsageKind kind);
    416 typedef struct CXTUResourceUsageEntry {
    417   /* \brief The memory usage category. */
    418   enum CXTUResourceUsageKind kind;
    419   /* \brief Amount of resources used.
    420       The units will depend on the resource kind. */
    421   unsigned long amount;
    422 } CXTUResourceUsageEntry;
    423 typedef struct CXTUResourceUsage {
    424   /* \brief Private data member, used for queries. */
    425   void *data;
    426   /* \brief The number of entries in the 'entries' array. */
    427   unsigned numEntries;
    428   /* \brief An array of key-value pairs, representing the breakdown of memory
    429             usage. */
    430   CXTUResourceUsageEntry *entries;
    431 } CXTUResourceUsage;
    432  CXTUResourceUsage clang_getCXTUResourceUsage(CXTranslationUnit TU);
    433  void clang_disposeCXTUResourceUsage(CXTUResourceUsage usage);
    434 enum CXCursorKind {
    435   /* Declarations */
    436 
    437   CXCursor_UnexposedDecl                 = 1,
    438 
    439   CXCursor_StructDecl                    = 2,
    440 
    441   CXCursor_UnionDecl                     = 3,
    442 
    443   CXCursor_ClassDecl                     = 4,
    444 
    445   CXCursor_EnumDecl                      = 5,
    446 
    447   CXCursor_FieldDecl                     = 6,
    448 
    449   CXCursor_EnumConstantDecl              = 7,
    450 
    451   CXCursor_FunctionDecl                  = 8,
    452 
    453   CXCursor_VarDecl                       = 9,
    454 
    455   CXCursor_ParmDecl                      = 10,
    456 
    457   CXCursor_ObjCInterfaceDecl             = 11,
    458 
    459   CXCursor_ObjCCategoryDecl              = 12,
    460 
    461   CXCursor_ObjCProtocolDecl              = 13,
    462 
    463   CXCursor_ObjCPropertyDecl              = 14,
    464 
    465   CXCursor_ObjCIvarDecl                  = 15,
    466 
    467   CXCursor_ObjCInstanceMethodDecl        = 16,
    468 
    469   CXCursor_ObjCClassMethodDecl           = 17,
    470 
    471   CXCursor_ObjCImplementationDecl        = 18,
    472 
    473   CXCursor_ObjCCategoryImplDecl          = 19,
    474 
    475   CXCursor_TypedefDecl                   = 20,
    476 
    477   CXCursor_CXXMethod                     = 21,
    478 
    479   CXCursor_Namespace                     = 22,
    480 
    481   CXCursor_LinkageSpec                   = 23,
    482 
    483   CXCursor_Constructor                   = 24,
    484 
    485   CXCursor_Destructor                    = 25,
    486 
    487   CXCursor_ConversionFunction            = 26,
    488 
    489   CXCursor_TemplateTypeParameter         = 27,
    490 
    491   CXCursor_NonTypeTemplateParameter      = 28,
    492 
    493   CXCursor_TemplateTemplateParameter     = 29,
    494 
    495   CXCursor_FunctionTemplate              = 30,
    496 
    497   CXCursor_ClassTemplate                 = 31,
    498 
    499   CXCursor_ClassTemplatePartialSpecialization = 32,
    500 
    501   CXCursor_NamespaceAlias                = 33,
    502 
    503   CXCursor_UsingDirective                = 34,
    504 
    505   CXCursor_UsingDeclaration              = 35,
    506 
    507   CXCursor_TypeAliasDecl                 = 36,
    508 
    509   CXCursor_ObjCSynthesizeDecl            = 37,
    510 
    511   CXCursor_ObjCDynamicDecl               = 38,
    512 
    513   CXCursor_CXXAccessSpecifier            = 39,
    514   CXCursor_FirstDecl                     = CXCursor_UnexposedDecl,
    515   CXCursor_LastDecl                      = CXCursor_CXXAccessSpecifier,
    516   /* References */
    517   CXCursor_FirstRef                      = 40, /* Decl references */
    518   CXCursor_ObjCSuperClassRef             = 40,
    519   CXCursor_ObjCProtocolRef               = 41,
    520   CXCursor_ObjCClassRef                  = 42,
    521 
    522   CXCursor_TypeRef                       = 43,
    523   CXCursor_CXXBaseSpecifier              = 44,
    524 
    525   CXCursor_TemplateRef                   = 45,
    526 
    527   CXCursor_NamespaceRef                  = 46,
    528 
    529   CXCursor_MemberRef                     = 47,
    530 
    531   CXCursor_LabelRef                      = 48,
    532 
    533 
    534   CXCursor_OverloadedDeclRef             = 49,
    535 
    536 
    537   CXCursor_VariableRef                   = 50,
    538 
    539   CXCursor_LastRef                       = CXCursor_VariableRef,
    540   /* Error conditions */
    541   CXCursor_FirstInvalid                  = 70,
    542   CXCursor_InvalidFile                   = 70,
    543   CXCursor_NoDeclFound                   = 71,
    544   CXCursor_NotImplemented                = 72,
    545   CXCursor_InvalidCode                   = 73,
    546   CXCursor_LastInvalid                   = CXCursor_InvalidCode,
    547   /* Expressions */
    548   CXCursor_FirstExpr                     = 100,
    549 
    550   CXCursor_UnexposedExpr                 = 100,
    551 
    552   CXCursor_DeclRefExpr                   = 101,
    553 
    554   CXCursor_MemberRefExpr                 = 102,
    555 
    556   CXCursor_CallExpr                      = 103,
    557 
    558   CXCursor_ObjCMessageExpr               = 104,
    559 
    560   CXCursor_BlockExpr                     = 105,
    561 
    562   CXCursor_IntegerLiteral                = 106,
    563 
    564   CXCursor_FloatingLiteral               = 107,
    565 
    566   CXCursor_ImaginaryLiteral              = 108,
    567 
    568   CXCursor_StringLiteral                 = 109,
    569 
    570   CXCursor_CharacterLiteral              = 110,
    571 
    572   CXCursor_ParenExpr                     = 111,
    573 
    574   CXCursor_UnaryOperator                 = 112,
    575 
    576   CXCursor_ArraySubscriptExpr            = 113,
    577 
    578   CXCursor_BinaryOperator                = 114,
    579 
    580   CXCursor_CompoundAssignOperator        = 115,
    581 
    582   CXCursor_ConditionalOperator           = 116,
    583 
    584   CXCursor_CStyleCastExpr                = 117,
    585 
    586   CXCursor_CompoundLiteralExpr           = 118,
    587 
    588   CXCursor_InitListExpr                  = 119,
    589 
    590   CXCursor_AddrLabelExpr                 = 120,
    591 
    592   CXCursor_StmtExpr                      = 121,
    593 
    594   CXCursor_GenericSelectionExpr          = 122,
    595 
    596   CXCursor_GNUNullExpr                   = 123,
    597 
    598   CXCursor_CXXStaticCastExpr             = 124,
    599 
    600   CXCursor_CXXDynamicCastExpr            = 125,
    601 
    602   CXCursor_CXXReinterpretCastExpr        = 126,
    603 
    604   CXCursor_CXXConstCastExpr              = 127,
    605 
    606   CXCursor_CXXFunctionalCastExpr         = 128,
    607 
    608   CXCursor_CXXTypeidExpr                 = 129,
    609 
    610   CXCursor_CXXBoolLiteralExpr            = 130,
    611 
    612   CXCursor_CXXNullPtrLiteralExpr         = 131,
    613 
    614   CXCursor_CXXThisExpr                   = 132,
    615 
    616   CXCursor_CXXThrowExpr                  = 133,
    617 
    618   CXCursor_CXXNewExpr                    = 134,
    619 
    620   CXCursor_CXXDeleteExpr                 = 135,
    621 
    622   CXCursor_UnaryExpr                     = 136,
    623 
    624   CXCursor_ObjCStringLiteral             = 137,
    625 
    626   CXCursor_ObjCEncodeExpr                = 138,
    627 
    628   CXCursor_ObjCSelectorExpr              = 139,
    629 
    630   CXCursor_ObjCProtocolExpr              = 140,
    631 
    632   CXCursor_ObjCBridgedCastExpr           = 141,
    633 
    634   CXCursor_PackExpansionExpr             = 142,
    635 
    636   CXCursor_SizeOfPackExpr                = 143,
    637   /* \brief Represents a C++ lambda expression that produces a local function
    638    * object.
    639    *
    640    * \code
    641    * void abssort(float *x, unsigned N) {
    642    *   std::sort(x, x + N,
    643    *             [](float a, float b) {
    644    *               return std::abs(a) < std::abs(b);
    645    *             });
    646    * }
    647    * \endcode
    648    */
    649   CXCursor_LambdaExpr                    = 144,
    650 
    651 
    652   CXCursor_ObjCBoolLiteralExpr           = 145,
    653 
    654   CXCursor_ObjCSelfExpr                  = 146,
    655 
    656   CXCursor_OMPArraySectionExpr           = 147,
    657 
    658   CXCursor_ObjCAvailabilityCheckExpr     = 148,
    659   CXCursor_LastExpr                      = CXCursor_ObjCAvailabilityCheckExpr,
    660   /* Statements */
    661   CXCursor_FirstStmt                     = 200,
    662 
    663   CXCursor_UnexposedStmt                 = 200,
    664 
    665 
    666   CXCursor_LabelStmt                     = 201,
    667 
    668   CXCursor_CompoundStmt                  = 202,
    669 
    670   CXCursor_CaseStmt                      = 203,
    671 
    672   CXCursor_DefaultStmt                   = 204,
    673 
    674   CXCursor_IfStmt                        = 205,
    675 
    676   CXCursor_SwitchStmt                    = 206,
    677 
    678   CXCursor_WhileStmt                     = 207,
    679 
    680   CXCursor_DoStmt                        = 208,
    681 
    682   CXCursor_ForStmt                       = 209,
    683 
    684   CXCursor_GotoStmt                      = 210,
    685 
    686   CXCursor_IndirectGotoStmt              = 211,
    687 
    688   CXCursor_ContinueStmt                  = 212,
    689 
    690   CXCursor_BreakStmt                     = 213,
    691 
    692   CXCursor_ReturnStmt                    = 214,
    693 
    694   CXCursor_GCCAsmStmt                    = 215,
    695   CXCursor_AsmStmt                       = CXCursor_GCCAsmStmt,
    696 
    697   CXCursor_ObjCAtTryStmt                 = 216,
    698 
    699   CXCursor_ObjCAtCatchStmt               = 217,
    700 
    701   CXCursor_ObjCAtFinallyStmt             = 218,
    702 
    703   CXCursor_ObjCAtThrowStmt               = 219,
    704 
    705   CXCursor_ObjCAtSynchronizedStmt        = 220,
    706 
    707   CXCursor_ObjCAutoreleasePoolStmt       = 221,
    708 
    709   CXCursor_ObjCForCollectionStmt         = 222,
    710 
    711   CXCursor_CXXCatchStmt                  = 223,
    712 
    713   CXCursor_CXXTryStmt                    = 224,
    714 
    715   CXCursor_CXXForRangeStmt               = 225,
    716 
    717   CXCursor_SEHTryStmt                    = 226,
    718 
    719   CXCursor_SEHExceptStmt                 = 227,
    720 
    721   CXCursor_SEHFinallyStmt                = 228,
    722 
    723   CXCursor_MSAsmStmt                     = 229,
    724 
    725   CXCursor_NullStmt                      = 230,
    726 
    727   CXCursor_DeclStmt                      = 231,
    728 
    729   CXCursor_OMPParallelDirective          = 232,
    730 
    731   CXCursor_OMPSimdDirective              = 233,
    732 
    733   CXCursor_OMPForDirective               = 234,
    734 
    735   CXCursor_OMPSectionsDirective          = 235,
    736 
    737   CXCursor_OMPSectionDirective           = 236,
    738 
    739   CXCursor_OMPSingleDirective            = 237,
    740 
    741   CXCursor_OMPParallelForDirective       = 238,
    742 
    743   CXCursor_OMPParallelSectionsDirective  = 239,
    744 
    745   CXCursor_OMPTaskDirective              = 240,
    746 
    747   CXCursor_OMPMasterDirective            = 241,
    748 
    749   CXCursor_OMPCriticalDirective          = 242,
    750 
    751   CXCursor_OMPTaskyieldDirective         = 243,
    752 
    753   CXCursor_OMPBarrierDirective           = 244,
    754 
    755   CXCursor_OMPTaskwaitDirective          = 245,
    756 
    757   CXCursor_OMPFlushDirective             = 246,
    758 
    759   CXCursor_SEHLeaveStmt                  = 247,
    760 
    761   CXCursor_OMPOrderedDirective           = 248,
    762 
    763   CXCursor_OMPAtomicDirective            = 249,
    764 
    765   CXCursor_OMPForSimdDirective           = 250,
    766 
    767   CXCursor_OMPParallelForSimdDirective   = 251,
    768 
    769   CXCursor_OMPTargetDirective            = 252,
    770 
    771   CXCursor_OMPTeamsDirective             = 253,
    772 
    773   CXCursor_OMPTaskgroupDirective         = 254,
    774 
    775   CXCursor_OMPCancellationPointDirective = 255,
    776 
    777   CXCursor_OMPCancelDirective            = 256,
    778 
    779   CXCursor_OMPTargetDataDirective        = 257,
    780 
    781   CXCursor_OMPTaskLoopDirective          = 258,
    782 
    783   CXCursor_OMPTaskLoopSimdDirective      = 259,
    784 
    785   CXCursor_OMPDistributeDirective        = 260,
    786 
    787   CXCursor_OMPTargetEnterDataDirective   = 261,
    788 
    789   CXCursor_OMPTargetExitDataDirective    = 262,
    790 
    791   CXCursor_OMPTargetParallelDirective    = 263,
    792 
    793   CXCursor_OMPTargetParallelForDirective = 264,
    794 
    795   CXCursor_OMPTargetUpdateDirective      = 265,
    796 
    797   CXCursor_OMPDistributeParallelForDirective = 266,
    798 
    799   CXCursor_OMPDistributeParallelForSimdDirective = 267,
    800 
    801   CXCursor_OMPDistributeSimdDirective = 268,
    802 
    803   CXCursor_OMPTargetParallelForSimdDirective = 269,
    804 
    805   CXCursor_OMPTargetSimdDirective = 270,
    806 
    807   CXCursor_OMPTeamsDistributeDirective = 271,
    808 
    809   CXCursor_OMPTeamsDistributeSimdDirective = 272,
    810 
    811   CXCursor_OMPTeamsDistributeParallelForSimdDirective = 273,
    812 
    813   CXCursor_OMPTeamsDistributeParallelForDirective = 274,
    814 
    815   CXCursor_OMPTargetTeamsDirective = 275,
    816 
    817   CXCursor_OMPTargetTeamsDistributeDirective = 276,
    818 
    819   CXCursor_OMPTargetTeamsDistributeParallelForDirective = 277,
    820 
    821   CXCursor_OMPTargetTeamsDistributeParallelForSimdDirective = 278,
    822 
    823   CXCursor_OMPTargetTeamsDistributeSimdDirective = 279,
    824   CXCursor_LastStmt = CXCursor_OMPTargetTeamsDistributeSimdDirective,
    825 
    826   CXCursor_TranslationUnit               = 300,
    827   /* Attributes */
    828   CXCursor_FirstAttr                     = 400,
    829 
    830   CXCursor_UnexposedAttr                 = 400,
    831   CXCursor_IBActionAttr                  = 401,
    832   CXCursor_IBOutletAttr                  = 402,
    833   CXCursor_IBOutletCollectionAttr        = 403,
    834   CXCursor_CXXFinalAttr                  = 404,
    835   CXCursor_CXXOverrideAttr               = 405,
    836   CXCursor_AnnotateAttr                  = 406,
    837   CXCursor_AsmLabelAttr                  = 407,
    838   CXCursor_PackedAttr                    = 408,
    839   CXCursor_PureAttr                      = 409,
    840   CXCursor_ConstAttr                     = 410,
    841   CXCursor_NoDuplicateAttr               = 411,
    842   CXCursor_CUDAConstantAttr              = 412,
    843   CXCursor_CUDADeviceAttr                = 413,
    844   CXCursor_CUDAGlobalAttr                = 414,
    845   CXCursor_CUDAHostAttr                  = 415,
    846   CXCursor_CUDASharedAttr                = 416,
    847   CXCursor_VisibilityAttr                = 417,
    848   CXCursor_DLLExport                     = 418,
    849   CXCursor_DLLImport                     = 419,
    850   CXCursor_LastAttr                      = CXCursor_DLLImport,
    851   /* Preprocessing */
    852   CXCursor_PreprocessingDirective        = 500,
    853   CXCursor_MacroDefinition               = 501,
    854   CXCursor_MacroExpansion                = 502,
    855   CXCursor_MacroInstantiation            = CXCursor_MacroExpansion,
    856   CXCursor_InclusionDirective            = 503,
    857   CXCursor_FirstPreprocessing            = CXCursor_PreprocessingDirective,
    858   CXCursor_LastPreprocessing             = CXCursor_InclusionDirective,
    859   /* Extra Declarations */
    860 
    861   CXCursor_ModuleImportDecl              = 600,
    862   CXCursor_TypeAliasTemplateDecl         = 601,
    863 
    864   CXCursor_StaticAssert                  = 602,
    865 
    866   CXCursor_FriendDecl                    = 603,
    867   CXCursor_FirstExtraDecl                = CXCursor_ModuleImportDecl,
    868   CXCursor_LastExtraDecl                 = CXCursor_FriendDecl,
    869 
    870   CXCursor_OverloadCandidate             = 700
    871 };
    872 typedef struct {
    873   enum CXCursorKind kind;
    874   int xdata;
    875   const void *data[3];
    876 } CXCursor;
    877  CXCursor clang_getNullCursor(void);
    878  CXCursor clang_getTranslationUnitCursor(CXTranslationUnit);
    879  unsigned clang_equalCursors(CXCursor, CXCursor);
    880  int clang_Cursor_isNull(CXCursor cursor);
    881  unsigned clang_hashCursor(CXCursor);
    882 
    883  enum CXCursorKind clang_getCursorKind(CXCursor);
    884  unsigned clang_isDeclaration(enum CXCursorKind);
    885  unsigned clang_isReference(enum CXCursorKind);
    886  unsigned clang_isExpression(enum CXCursorKind);
    887  unsigned clang_isStatement(enum CXCursorKind);
    888  unsigned clang_isAttribute(enum CXCursorKind);
    889  unsigned clang_Cursor_hasAttrs(CXCursor C);
    890  unsigned clang_isInvalid(enum CXCursorKind);
    891  unsigned clang_isTranslationUnit(enum CXCursorKind);
    892  unsigned clang_isPreprocessing(enum CXCursorKind);
    893 
    894  unsigned clang_isUnexposed(enum CXCursorKind);
    895 enum CXLinkageKind {
    896 
    897   CXLinkage_Invalid,
    898 
    899   CXLinkage_NoLinkage,
    900 
    901   CXLinkage_Internal,
    902 
    903   CXLinkage_UniqueExternal,
    904 
    905   CXLinkage_External
    906 };
    907  enum CXLinkageKind clang_getCursorLinkage(CXCursor cursor);
    908 enum CXVisibilityKind {
    909 
    910   CXVisibility_Invalid,
    911 
    912   CXVisibility_Hidden,
    913 
    914   CXVisibility_Protected,
    915 
    916   CXVisibility_Default
    917 };
    918  enum CXVisibilityKind clang_getCursorVisibility(CXCursor cursor);
    919  enum CXAvailabilityKind
    920 clang_getCursorAvailability(CXCursor cursor);
    921 typedef struct CXPlatformAvailability {
    922 
    923   CXString Platform;
    924 
    925   CXVersion Introduced;
    926 
    927   CXVersion Deprecated;
    928 
    929   CXVersion Obsoleted;
    930 
    931   int Unavailable;
    932 
    933   CXString Message;
    934 } CXPlatformAvailability;
    935  int
    936 clang_getCursorPlatformAvailability(CXCursor cursor,
    937                                     int *always_deprecated,
    938                                     CXString *deprecated_message,
    939                                     int *always_unavailable,
    940                                     CXString *unavailable_message,
    941                                     CXPlatformAvailability *availability,
    942                                     int availability_size);
    943  void
    944 clang_disposeCXPlatformAvailability(CXPlatformAvailability *availability);
    945 
    946 enum CXLanguageKind {
    947   CXLanguage_Invalid = 0,
    948   CXLanguage_C,
    949   CXLanguage_ObjC,
    950   CXLanguage_CPlusPlus
    951 };
    952  enum CXLanguageKind clang_getCursorLanguage(CXCursor cursor);
    953  CXTranslationUnit clang_Cursor_getTranslationUnit(CXCursor);
    954 typedef struct CXCursorSetImpl *CXCursorSet;
    955  CXCursorSet clang_createCXCursorSet(void);
    956  void clang_disposeCXCursorSet(CXCursorSet cset);
    957  unsigned clang_CXCursorSet_contains(CXCursorSet cset,
    958                                                    CXCursor cursor);
    959  unsigned clang_CXCursorSet_insert(CXCursorSet cset,
    960                                                  CXCursor cursor);
    961  CXCursor clang_getCursorSemanticParent(CXCursor cursor);
    962  CXCursor clang_getCursorLexicalParent(CXCursor cursor);
    963  void clang_getOverriddenCursors(CXCursor cursor,
    964                                                CXCursor **overridden,
    965                                                unsigned *num_overridden);
    966  void clang_disposeOverriddenCursors(CXCursor *overridden);
    967  CXFile clang_getIncludedFile(CXCursor cursor);
    968 
    969  CXCursor clang_getCursor(CXTranslationUnit, CXSourceLocation);
    970  CXSourceLocation clang_getCursorLocation(CXCursor);
    971  CXSourceRange clang_getCursorExtent(CXCursor);
    972 
    973 enum CXTypeKind {
    974 
    975   CXType_Invalid = 0,
    976 
    977   CXType_Unexposed = 1,
    978   /* Builtin types */
    979   CXType_Void = 2,
    980   CXType_Bool = 3,
    981   CXType_Char_U = 4,
    982   CXType_UChar = 5,
    983   CXType_Char16 = 6,
    984   CXType_Char32 = 7,
    985   CXType_UShort = 8,
    986   CXType_UInt = 9,
    987   CXType_ULong = 10,
    988   CXType_ULongLong = 11,
    989   CXType_UInt128 = 12,
    990   CXType_Char_S = 13,
    991   CXType_SChar = 14,
    992   CXType_WChar = 15,
    993   CXType_Short = 16,
    994   CXType_Int = 17,
    995   CXType_Long = 18,
    996   CXType_LongLong = 19,
    997   CXType_Int128 = 20,
    998   CXType_Float = 21,
    999   CXType_Double = 22,
   1000   CXType_LongDouble = 23,
   1001   CXType_NullPtr = 24,
   1002   CXType_Overload = 25,
   1003   CXType_Dependent = 26,
   1004   CXType_ObjCId = 27,
   1005   CXType_ObjCClass = 28,
   1006   CXType_ObjCSel = 29,
   1007   CXType_Float128 = 30,
   1008   CXType_FirstBuiltin = CXType_Void,
   1009   CXType_LastBuiltin  = CXType_ObjCSel,
   1010   CXType_Complex = 100,
   1011   CXType_Pointer = 101,
   1012   CXType_BlockPointer = 102,
   1013   CXType_LValueReference = 103,
   1014   CXType_RValueReference = 104,
   1015   CXType_Record = 105,
   1016   CXType_Enum = 106,
   1017   CXType_Typedef = 107,
   1018   CXType_ObjCInterface = 108,
   1019   CXType_ObjCObjectPointer = 109,
   1020   CXType_FunctionNoProto = 110,
   1021   CXType_FunctionProto = 111,
   1022   CXType_ConstantArray = 112,
   1023   CXType_Vector = 113,
   1024   CXType_IncompleteArray = 114,
   1025   CXType_VariableArray = 115,
   1026   CXType_DependentSizedArray = 116,
   1027   CXType_MemberPointer = 117,
   1028   CXType_Auto = 118,
   1029 
   1030   CXType_Elaborated = 119
   1031 };
   1032 enum CXCallingConv {
   1033   CXCallingConv_Default = 0,
   1034   CXCallingConv_C = 1,
   1035   CXCallingConv_X86StdCall = 2,
   1036   CXCallingConv_X86FastCall = 3,
   1037   CXCallingConv_X86ThisCall = 4,
   1038   CXCallingConv_X86Pascal = 5,
   1039   CXCallingConv_AAPCS = 6,
   1040   CXCallingConv_AAPCS_VFP = 7,
   1041   CXCallingConv_X86RegCall = 8,
   1042   CXCallingConv_IntelOclBicc = 9,
   1043   CXCallingConv_X86_64Win64 = 10,
   1044   CXCallingConv_X86_64SysV = 11,
   1045   CXCallingConv_X86VectorCall = 12,
   1046   CXCallingConv_Swift = 13,
   1047   CXCallingConv_PreserveMost = 14,
   1048   CXCallingConv_PreserveAll = 15,
   1049   CXCallingConv_Invalid = 100,
   1050   CXCallingConv_Unexposed = 200
   1051 };
   1052 typedef struct {
   1053   enum CXTypeKind kind;
   1054   void *data[2];
   1055 } CXType;
   1056  CXType clang_getCursorType(CXCursor C);
   1057  CXString clang_getTypeSpelling(CXType CT);
   1058  CXType clang_getTypedefDeclUnderlyingType(CXCursor C);
   1059  CXType clang_getEnumDeclIntegerType(CXCursor C);
   1060  long long clang_getEnumConstantDeclValue(CXCursor C);
   1061  unsigned long long clang_getEnumConstantDeclUnsignedValue(CXCursor C);
   1062  int clang_getFieldDeclBitWidth(CXCursor C);
   1063  int clang_Cursor_getNumArguments(CXCursor C);
   1064  CXCursor clang_Cursor_getArgument(CXCursor C, unsigned i);
   1065 enum CXTemplateArgumentKind {
   1066   CXTemplateArgumentKind_Null,
   1067   CXTemplateArgumentKind_Type,
   1068   CXTemplateArgumentKind_Declaration,
   1069   CXTemplateArgumentKind_NullPtr,
   1070   CXTemplateArgumentKind_Integral,
   1071   CXTemplateArgumentKind_Template,
   1072   CXTemplateArgumentKind_TemplateExpansion,
   1073   CXTemplateArgumentKind_Expression,
   1074   CXTemplateArgumentKind_Pack,
   1075   /* Indicates an error case, preventing the kind from being deduced. */
   1076   CXTemplateArgumentKind_Invalid
   1077 };
   1078  int clang_Cursor_getNumTemplateArguments(CXCursor C);
   1079  enum CXTemplateArgumentKind clang_Cursor_getTemplateArgumentKind(
   1080     CXCursor C, unsigned I);
   1081  CXType clang_Cursor_getTemplateArgumentType(CXCursor C,
   1082                                                            unsigned I);
   1083  long long clang_Cursor_getTemplateArgumentValue(CXCursor C,
   1084                                                                unsigned I);
   1085  unsigned long long clang_Cursor_getTemplateArgumentUnsignedValue(
   1086     CXCursor C, unsigned I);
   1087  unsigned clang_equalTypes(CXType A, CXType B);
   1088  CXType clang_getCanonicalType(CXType T);
   1089  unsigned clang_isConstQualifiedType(CXType T);
   1090  unsigned clang_Cursor_isMacroFunctionLike(CXCursor C);
   1091  unsigned clang_Cursor_isMacroBuiltin(CXCursor C);
   1092  unsigned clang_Cursor_isFunctionInlined(CXCursor C);
   1093  unsigned clang_isVolatileQualifiedType(CXType T);
   1094  unsigned clang_isRestrictQualifiedType(CXType T);
   1095  CXType clang_getPointeeType(CXType T);
   1096  CXCursor clang_getTypeDeclaration(CXType T);
   1097  CXString clang_getDeclObjCTypeEncoding(CXCursor C);
   1098  CXString clang_Type_getObjCEncoding(CXType type);
   1099  CXString clang_getTypeKindSpelling(enum CXTypeKind K);
   1100  enum CXCallingConv clang_getFunctionTypeCallingConv(CXType T);
   1101  CXType clang_getResultType(CXType T);
   1102  int clang_getNumArgTypes(CXType T);
   1103  CXType clang_getArgType(CXType T, unsigned i);
   1104  unsigned clang_isFunctionTypeVariadic(CXType T);
   1105  CXType clang_getCursorResultType(CXCursor C);
   1106  unsigned clang_isPODType(CXType T);
   1107  unsigned clang_isFinalType(CXType T);
   1108  unsigned clang_isAbstractType(CXType T);
   1109  unsigned clang_isNoexcept(CXType C);
   1110  CXType clang_getElementType(CXType T);
   1111  long long clang_getNumElements(CXType T);
   1112  CXType clang_getArrayElementType(CXType T);
   1113  long long clang_getArraySize(CXType T);
   1114  CXType clang_Type_getNamedType(CXType T);
   1115 enum CXTypeLayoutError {
   1116 
   1117   CXTypeLayoutError_Invalid = -1,
   1118 
   1119   CXTypeLayoutError_Incomplete = -2,
   1120 
   1121   CXTypeLayoutError_Dependent = -3,
   1122 
   1123   CXTypeLayoutError_NotConstantSize = -4,
   1124 
   1125   CXTypeLayoutError_InvalidFieldName = -5
   1126 };
   1127  long long clang_Type_getAlignOf(CXType T);
   1128  CXType clang_Type_getClassType(CXType T);
   1129  long long clang_Type_getSizeOf(CXType T);
   1130  long long clang_Type_getOffsetOf(CXType T, const char *S);
   1131  long long clang_Cursor_getOffsetOfField(CXCursor C);
   1132  unsigned clang_Cursor_isAnonymous(CXCursor C);
   1133 enum CXRefQualifierKind {
   1134 
   1135   CXRefQualifier_None = 0,
   1136 
   1137   CXRefQualifier_LValue,
   1138 
   1139   CXRefQualifier_RValue
   1140 };
   1141  int clang_Type_getNumTemplateArguments(CXType T);
   1142  CXType clang_Type_getTemplateArgumentAsType(CXType T, unsigned i);
   1143  enum CXRefQualifierKind clang_Type_getCXXRefQualifier(CXType T);
   1144  unsigned clang_Cursor_isBitField(CXCursor C);
   1145  unsigned clang_isVirtualBase(CXCursor);
   1146 
   1147 enum CX_CXXAccessSpecifier {
   1148   CX_CXXInvalidAccessSpecifier,
   1149   CX_CXXPublic,
   1150   CX_CXXProtected,
   1151   CX_CXXPrivate
   1152 };
   1153  enum CX_CXXAccessSpecifier clang_getCXXAccessSpecifier(CXCursor);
   1154 enum CX_StorageClass {
   1155   CX_SC_Invalid,
   1156   CX_SC_None,
   1157   CX_SC_Extern,
   1158   CX_SC_Static,
   1159   CX_SC_PrivateExtern,
   1160   CX_SC_OpenCLWorkGroupLocal,
   1161   CX_SC_Auto,
   1162   CX_SC_Register
   1163 };
   1164  enum CX_StorageClass clang_Cursor_getStorageClass(CXCursor);
   1165  unsigned clang_getNumOverloadedDecls(CXCursor cursor);
   1166  CXCursor clang_getOverloadedDecl(CXCursor cursor,
   1167                                                 unsigned index);
   1168 
   1169 
   1170  CXType clang_getIBOutletCollectionType(CXCursor);
   1171 enum CXChildVisitResult {
   1172 
   1173   CXChildVisit_Break,
   1174 
   1175   CXChildVisit_Continue,
   1176 
   1177   CXChildVisit_Recurse
   1178 };
   1179 typedef enum CXChildVisitResult (*CXCursorVisitor)(CXCursor cursor,
   1180                                                    CXCursor parent,
   1181                                                    CXClientData client_data);
   1182  unsigned clang_visitChildren(CXCursor parent,
   1183                                             CXCursorVisitor visitor,
   1184                                             CXClientData client_data);
   1185  CXString clang_getCursorUSR(CXCursor);
   1186  CXString clang_constructUSR_ObjCClass(const char *class_name);
   1187  CXString
   1188   clang_constructUSR_ObjCCategory(const char *class_name,
   1189                                  const char *category_name);
   1190  CXString
   1191   clang_constructUSR_ObjCProtocol(const char *protocol_name);
   1192  CXString clang_constructUSR_ObjCIvar(const char *name,
   1193                                                     CXString classUSR);
   1194  CXString clang_constructUSR_ObjCMethod(const char *name,
   1195                                                       unsigned isInstanceMethod,
   1196                                                       CXString classUSR);
   1197  CXString clang_constructUSR_ObjCProperty(const char *property,
   1198                                                         CXString classUSR);
   1199  CXString clang_getCursorSpelling(CXCursor);
   1200  CXSourceRange clang_Cursor_getSpellingNameRange(CXCursor,
   1201                                                           unsigned pieceIndex,
   1202                                                           unsigned options);
   1203  CXString clang_getCursorDisplayName(CXCursor);
   1204 
   1205  CXCursor clang_getCursorReferenced(CXCursor);
   1206  CXCursor clang_getCursorDefinition(CXCursor);
   1207  unsigned clang_isCursorDefinition(CXCursor);
   1208  CXCursor clang_getCanonicalCursor(CXCursor);
   1209  int clang_Cursor_getObjCSelectorIndex(CXCursor);
   1210  int clang_Cursor_isDynamicCall(CXCursor C);
   1211  CXType clang_Cursor_getReceiverType(CXCursor C);
   1212 typedef enum {
   1213   CXObjCPropertyAttr_noattr    = 0x00,
   1214   CXObjCPropertyAttr_readonly  = 0x01,
   1215   CXObjCPropertyAttr_getter    = 0x02,
   1216   CXObjCPropertyAttr_assign    = 0x04,
   1217   CXObjCPropertyAttr_readwrite = 0x08,
   1218   CXObjCPropertyAttr_retain    = 0x10,
   1219   CXObjCPropertyAttr_copy      = 0x20,
   1220   CXObjCPropertyAttr_nonatomic = 0x40,
   1221   CXObjCPropertyAttr_setter    = 0x80,
   1222   CXObjCPropertyAttr_atomic    = 0x100,
   1223   CXObjCPropertyAttr_weak      = 0x200,
   1224   CXObjCPropertyAttr_strong    = 0x400,
   1225   CXObjCPropertyAttr_unsafe_unretained = 0x800,
   1226   CXObjCPropertyAttr_class = 0x1000
   1227 } CXObjCPropertyAttrKind;
   1228  unsigned clang_Cursor_getObjCPropertyAttributes(CXCursor C,
   1229                                                              unsigned reserved);
   1230 typedef enum {
   1231   CXObjCDeclQualifier_None = 0x0,
   1232   CXObjCDeclQualifier_In = 0x1,
   1233   CXObjCDeclQualifier_Inout = 0x2,
   1234   CXObjCDeclQualifier_Out = 0x4,
   1235   CXObjCDeclQualifier_Bycopy = 0x8,
   1236   CXObjCDeclQualifier_Byref = 0x10,
   1237   CXObjCDeclQualifier_Oneway = 0x20
   1238 } CXObjCDeclQualifierKind;
   1239  unsigned clang_Cursor_getObjCDeclQualifiers(CXCursor C);
   1240  unsigned clang_Cursor_isObjCOptional(CXCursor C);
   1241  unsigned clang_Cursor_isVariadic(CXCursor C);
   1242  CXSourceRange clang_Cursor_getCommentRange(CXCursor C);
   1243  CXString clang_Cursor_getRawCommentText(CXCursor C);
   1244  CXString clang_Cursor_getBriefCommentText(CXCursor C);
   1245  CXString clang_Cursor_getMangling(CXCursor);
   1246  CXStringSet *clang_Cursor_getCXXManglings(CXCursor);
   1247 typedef void *CXModule;
   1248  CXModule clang_Cursor_getModule(CXCursor C);
   1249  CXModule clang_getModuleForFile(CXTranslationUnit, CXFile);
   1250  CXFile clang_Module_getASTFile(CXModule Module);
   1251  CXModule clang_Module_getParent(CXModule Module);
   1252  CXString clang_Module_getName(CXModule Module);
   1253  CXString clang_Module_getFullName(CXModule Module);
   1254  int clang_Module_isSystem(CXModule Module);
   1255  unsigned clang_Module_getNumTopLevelHeaders(CXTranslationUnit,
   1256                                                            CXModule Module);
   1257 CXFile clang_Module_getTopLevelHeader(CXTranslationUnit,
   1258                                       CXModule Module, unsigned Index);
   1259  unsigned clang_CXX_isDeleted(CXCursor C);
   1260  unsigned clang_CXXConstructor_isConvertingConstructor(CXCursor C);
   1261  unsigned clang_CXXConstructor_isCopyConstructor(CXCursor C);
   1262  unsigned clang_CXXConstructor_isDefaultConstructor(CXCursor C);
   1263  unsigned clang_CXXConstructor_isMoveConstructor(CXCursor C);
   1264  unsigned clang_CXXField_isMutable(CXCursor C);
   1265  unsigned clang_CXXMethod_isDefaulted(CXCursor C);
   1266  unsigned clang_CXXMethod_isPureVirtual(CXCursor C);
   1267  unsigned clang_CXXMethod_isStatic(CXCursor C);
   1268  unsigned clang_CXXMethod_isVirtual(CXCursor C);
   1269  unsigned clang_CXXMethod_isOverride(CXCursor C);
   1270  unsigned clang_CXXMethod_isConst(CXCursor C);
   1271  enum CXCursorKind clang_getTemplateCursorKind(CXCursor C);
   1272 
   1273  CXCursor clang_getSpecializedCursorTemplate(CXCursor C);
   1274  CXSourceRange clang_getCursorReferenceNameRange(CXCursor C,
   1275                                                 unsigned NameFlags,
   1276                                                 unsigned PieceIndex);
   1277 enum CXNameRefFlags {
   1278 
   1279   CXNameRange_WantQualifier = 0x1,
   1280 
   1281 
   1282   CXNameRange_WantTemplateArgs = 0x2,
   1283 
   1284   CXNameRange_WantSinglePiece = 0x4
   1285 };
   1286 
   1287 typedef enum CXTokenKind {
   1288 
   1289   CXToken_Punctuation,
   1290 
   1291   CXToken_Keyword,
   1292 
   1293   CXToken_Identifier,
   1294 
   1295   CXToken_Literal,
   1296 
   1297   CXToken_Comment
   1298 } CXTokenKind;
   1299 typedef struct {
   1300   unsigned int_data[4];
   1301   void *ptr_data;
   1302 } CXToken;
   1303  CXTokenKind clang_getTokenKind(CXToken);
   1304  CXString clang_getTokenSpelling(CXTranslationUnit, CXToken);
   1305  CXSourceLocation clang_getTokenLocation(CXTranslationUnit,
   1306                                                        CXToken);
   1307  CXSourceRange clang_getTokenExtent(CXTranslationUnit, CXToken);
   1308  void clang_tokenize(CXTranslationUnit TU, CXSourceRange Range,
   1309                                    CXToken **Tokens, unsigned *NumTokens);
   1310  void clang_annotateTokens(CXTranslationUnit TU,
   1311                                          CXToken *Tokens, unsigned NumTokens,
   1312                                          CXCursor *Cursors);
   1313  void clang_disposeTokens(CXTranslationUnit TU,
   1314                                         CXToken *Tokens, unsigned NumTokens);
   1315 /* for debug/testing */
   1316  CXString clang_getCursorKindSpelling(enum CXCursorKind Kind);
   1317  void clang_getDefinitionSpellingAndExtent(CXCursor,
   1318                                           const char **startBuf,
   1319                                           const char **endBuf,
   1320                                           unsigned *startLine,
   1321                                           unsigned *startColumn,
   1322                                           unsigned *endLine,
   1323                                           unsigned *endColumn);
   1324  void clang_enableStackTraces(void);
   1325  void clang_executeOnThread(void (*fn)(void*), void *user_data,
   1326                                           unsigned stack_size);
   1327 typedef void *CXCompletionString;
   1328 typedef struct {
   1329 
   1330   enum CXCursorKind CursorKind;
   1331 
   1332   CXCompletionString CompletionString;
   1333 } CXCompletionResult;
   1334 enum CXCompletionChunkKind {
   1335 
   1336   CXCompletionChunk_Optional,
   1337 
   1338   CXCompletionChunk_TypedText,
   1339 
   1340   CXCompletionChunk_Text,
   1341 
   1342   CXCompletionChunk_Placeholder,
   1343 
   1344   CXCompletionChunk_Informative,
   1345 
   1346   CXCompletionChunk_CurrentParameter,
   1347 
   1348   CXCompletionChunk_LeftParen,
   1349 
   1350   CXCompletionChunk_RightParen,
   1351 
   1352   CXCompletionChunk_LeftBracket,
   1353 
   1354   CXCompletionChunk_RightBracket,
   1355 
   1356   CXCompletionChunk_LeftBrace,
   1357 
   1358   CXCompletionChunk_RightBrace,
   1359 
   1360   CXCompletionChunk_LeftAngle,
   1361 
   1362   CXCompletionChunk_RightAngle,
   1363 
   1364   CXCompletionChunk_Comma,
   1365 
   1366   CXCompletionChunk_ResultType,
   1367 
   1368   CXCompletionChunk_Colon,
   1369 
   1370   CXCompletionChunk_SemiColon,
   1371 
   1372   CXCompletionChunk_Equal,
   1373 
   1374   CXCompletionChunk_HorizontalSpace,
   1375 
   1376   CXCompletionChunk_VerticalSpace
   1377 };
   1378  enum CXCompletionChunkKind
   1379 clang_getCompletionChunkKind(CXCompletionString completion_string,
   1380                              unsigned chunk_number);
   1381  CXString
   1382 clang_getCompletionChunkText(CXCompletionString completion_string,
   1383                              unsigned chunk_number);
   1384  CXCompletionString
   1385 clang_getCompletionChunkCompletionString(CXCompletionString completion_string,
   1386                                          unsigned chunk_number);
   1387  unsigned
   1388 clang_getNumCompletionChunks(CXCompletionString completion_string);
   1389  unsigned
   1390 clang_getCompletionPriority(CXCompletionString completion_string);
   1391 
   1392  enum CXAvailabilityKind
   1393 clang_getCompletionAvailability(CXCompletionString completion_string);
   1394  unsigned
   1395 clang_getCompletionNumAnnotations(CXCompletionString completion_string);
   1396  CXString
   1397 clang_getCompletionAnnotation(CXCompletionString completion_string,
   1398                               unsigned annotation_number);
   1399  CXString
   1400 clang_getCompletionParent(CXCompletionString completion_string,
   1401                           enum CXCursorKind *kind);
   1402  CXString
   1403 clang_getCompletionBriefComment(CXCompletionString completion_string);
   1404  CXCompletionString
   1405 clang_getCursorCompletionString(CXCursor cursor);
   1406 
   1407 typedef struct {
   1408 
   1409   CXCompletionResult *Results;
   1410 
   1411   unsigned NumResults;
   1412 } CXCodeCompleteResults;
   1413 enum CXCodeComplete_Flags {
   1414 
   1415   CXCodeComplete_IncludeMacros = 0x01,
   1416 
   1417   CXCodeComplete_IncludeCodePatterns = 0x02,
   1418 
   1419   CXCodeComplete_IncludeBriefComments = 0x04
   1420 };
   1421 enum CXCompletionContext {
   1422 
   1423   CXCompletionContext_Unexposed = 0,
   1424 
   1425 
   1426   CXCompletionContext_AnyType = 1 << 0,
   1427 
   1428 
   1429   CXCompletionContext_AnyValue = 1 << 1,
   1430 
   1431   CXCompletionContext_ObjCObjectValue = 1 << 2,
   1432 
   1433   CXCompletionContext_ObjCSelectorValue = 1 << 3,
   1434 
   1435   CXCompletionContext_CXXClassTypeValue = 1 << 4,
   1436 
   1437 
   1438   CXCompletionContext_DotMemberAccess = 1 << 5,
   1439 
   1440   CXCompletionContext_ArrowMemberAccess = 1 << 6,
   1441 
   1442   CXCompletionContext_ObjCPropertyAccess = 1 << 7,
   1443 
   1444 
   1445   CXCompletionContext_EnumTag = 1 << 8,
   1446 
   1447   CXCompletionContext_UnionTag = 1 << 9,
   1448 
   1449   CXCompletionContext_StructTag = 1 << 10,
   1450 
   1451 
   1452   CXCompletionContext_ClassTag = 1 << 11,
   1453 
   1454   CXCompletionContext_Namespace = 1 << 12,
   1455 
   1456   CXCompletionContext_NestedNameSpecifier = 1 << 13,
   1457 
   1458 
   1459   CXCompletionContext_ObjCInterface = 1 << 14,
   1460 
   1461   CXCompletionContext_ObjCProtocol = 1 << 15,
   1462 
   1463   CXCompletionContext_ObjCCategory = 1 << 16,
   1464 
   1465   CXCompletionContext_ObjCInstanceMessage = 1 << 17,
   1466 
   1467   CXCompletionContext_ObjCClassMessage = 1 << 18,
   1468 
   1469   CXCompletionContext_ObjCSelectorName = 1 << 19,
   1470 
   1471 
   1472   CXCompletionContext_MacroName = 1 << 20,
   1473 
   1474 
   1475   CXCompletionContext_NaturalLanguage = 1 << 21,
   1476 
   1477 
   1478   CXCompletionContext_Unknown = ((1 << 22) - 1)
   1479 };
   1480 
   1481  unsigned clang_defaultCodeCompleteOptions(void);
   1482 CXCodeCompleteResults *clang_codeCompleteAt(CXTranslationUnit TU,
   1483                                             const char *complete_filename,
   1484                                             unsigned complete_line,
   1485                                             unsigned complete_column,
   1486                                             struct CXUnsavedFile *unsaved_files,
   1487                                             unsigned num_unsaved_files,
   1488                                             unsigned options);
   1489 void clang_sortCodeCompletionResults(CXCompletionResult *Results,
   1490                                      unsigned NumResults);
   1491 
   1492 void clang_disposeCodeCompleteResults(CXCodeCompleteResults *Results);
   1493 
   1494 unsigned clang_codeCompleteGetNumDiagnostics(CXCodeCompleteResults *Results);
   1495 CXDiagnostic clang_codeCompleteGetDiagnostic(CXCodeCompleteResults *Results,
   1496                                              unsigned Index);
   1497 unsigned long long clang_codeCompleteGetContexts(
   1498                                                 CXCodeCompleteResults *Results);
   1499 enum CXCursorKind clang_codeCompleteGetContainerKind(
   1500                                                  CXCodeCompleteResults *Results,
   1501                                                      unsigned *IsIncomplete);
   1502 CXString clang_codeCompleteGetContainerUSR(CXCodeCompleteResults *Results);
   1503 CXString clang_codeCompleteGetObjCSelector(CXCodeCompleteResults *Results);
   1504 
   1505  CXString clang_getClangVersion(void);
   1506  void clang_toggleCrashRecovery(unsigned isEnabled);
   1507 
   1508 
   1509 typedef void (*CXInclusionVisitor)(CXFile included_file,
   1510                                    CXSourceLocation* inclusion_stack,
   1511                                    unsigned include_len,
   1512                                    CXClientData client_data);
   1513  void clang_getInclusions(CXTranslationUnit tu,
   1514                                         CXInclusionVisitor visitor,
   1515                                         CXClientData client_data);
   1516 typedef enum {
   1517   CXEval_Int = 1 ,
   1518   CXEval_Float = 2,
   1519   CXEval_ObjCStrLiteral = 3,
   1520   CXEval_StrLiteral = 4,
   1521   CXEval_CFStr = 5,
   1522   CXEval_Other = 6,
   1523   CXEval_UnExposed = 0
   1524 } CXEvalResultKind ;
   1525 typedef void * CXEvalResult;
   1526  CXEvalResult clang_Cursor_Evaluate(CXCursor C);
   1527  CXEvalResultKind clang_EvalResult_getKind(CXEvalResult E);
   1528  int clang_EvalResult_getAsInt(CXEvalResult E);
   1529  long long clang_EvalResult_getAsLongLong(CXEvalResult E);
   1530  unsigned clang_EvalResult_isUnsignedInt(CXEvalResult E);
   1531  unsigned long long clang_EvalResult_getAsUnsigned(CXEvalResult E);
   1532  double clang_EvalResult_getAsDouble(CXEvalResult E);
   1533  const char* clang_EvalResult_getAsStr(CXEvalResult E);
   1534  void clang_EvalResult_dispose(CXEvalResult E);
   1535 typedef void *CXRemapping;
   1536  CXRemapping clang_getRemappings(const char *path);
   1537 CXRemapping clang_getRemappingsFromFileList(const char **filePaths,
   1538                                             unsigned numFiles);
   1539  unsigned clang_remap_getNumFiles(CXRemapping);
   1540  void clang_remap_getFilenames(CXRemapping, unsigned index,
   1541                                      CXString *original, CXString *transformed);
   1542  void clang_remap_dispose(CXRemapping);
   1543 enum CXVisitorResult {
   1544   CXVisit_Break,
   1545   CXVisit_Continue
   1546 };
   1547 typedef struct CXCursorAndRangeVisitor {
   1548   void *context;
   1549   enum CXVisitorResult (*visit)(void *context, CXCursor, CXSourceRange);
   1550 } CXCursorAndRangeVisitor;
   1551 typedef enum {
   1552 
   1553   CXResult_Success = 0,
   1554 
   1555   CXResult_Invalid = 1,
   1556 
   1557   CXResult_VisitBreak = 2
   1558 } CXResult;
   1559  CXResult clang_findReferencesInFile(CXCursor cursor, CXFile file,
   1560                                                CXCursorAndRangeVisitor visitor);
   1561  CXResult clang_findIncludesInFile(CXTranslationUnit TU,
   1562                                                  CXFile file,
   1563                                               CXCursorAndRangeVisitor visitor);
   1564 typedef void *CXIdxClientFile;
   1565 typedef void *CXIdxClientEntity;
   1566 typedef void *CXIdxClientContainer;
   1567 typedef void *CXIdxClientASTFile;
   1568 typedef struct {
   1569   void *ptr_data[2];
   1570   unsigned int_data;
   1571 } CXIdxLoc;
   1572 typedef struct {
   1573 
   1574   CXIdxLoc hashLoc;
   1575 
   1576   const char *filename;
   1577 
   1578   CXFile file;
   1579   int isImport;
   1580   int isAngled;
   1581 
   1582   int isModuleImport;
   1583 } CXIdxIncludedFileInfo;
   1584 typedef struct {
   1585 
   1586   CXFile file;
   1587 
   1588   CXModule module;
   1589 
   1590   CXIdxLoc loc;
   1591 
   1592   int isImplicit;
   1593 } CXIdxImportedASTFileInfo;
   1594 typedef enum {
   1595   CXIdxEntity_Unexposed     = 0,
   1596   CXIdxEntity_Typedef       = 1,
   1597   CXIdxEntity_Function      = 2,
   1598   CXIdxEntity_Variable      = 3,
   1599   CXIdxEntity_Field         = 4,
   1600   CXIdxEntity_EnumConstant  = 5,
   1601   CXIdxEntity_ObjCClass     = 6,
   1602   CXIdxEntity_ObjCProtocol  = 7,
   1603   CXIdxEntity_ObjCCategory  = 8,
   1604   CXIdxEntity_ObjCInstanceMethod = 9,
   1605   CXIdxEntity_ObjCClassMethod    = 10,
   1606   CXIdxEntity_ObjCProperty  = 11,
   1607   CXIdxEntity_ObjCIvar      = 12,
   1608   CXIdxEntity_Enum          = 13,
   1609   CXIdxEntity_Struct        = 14,
   1610   CXIdxEntity_Union         = 15,
   1611   CXIdxEntity_CXXClass              = 16,
   1612   CXIdxEntity_CXXNamespace          = 17,
   1613   CXIdxEntity_CXXNamespaceAlias     = 18,
   1614   CXIdxEntity_CXXStaticVariable     = 19,
   1615   CXIdxEntity_CXXStaticMethod       = 20,
   1616   CXIdxEntity_CXXInstanceMethod     = 21,
   1617   CXIdxEntity_CXXConstructor        = 22,
   1618   CXIdxEntity_CXXDestructor         = 23,
   1619   CXIdxEntity_CXXConversionFunction = 24,
   1620   CXIdxEntity_CXXTypeAlias          = 25,
   1621   CXIdxEntity_CXXInterface          = 26
   1622 } CXIdxEntityKind;
   1623 typedef enum {
   1624   CXIdxEntityLang_None = 0,
   1625   CXIdxEntityLang_C    = 1,
   1626   CXIdxEntityLang_ObjC = 2,
   1627   CXIdxEntityLang_CXX  = 3
   1628 } CXIdxEntityLanguage;
   1629 typedef enum {
   1630   CXIdxEntity_NonTemplate   = 0,
   1631   CXIdxEntity_Template      = 1,
   1632   CXIdxEntity_TemplatePartialSpecialization = 2,
   1633   CXIdxEntity_TemplateSpecialization = 3
   1634 } CXIdxEntityCXXTemplateKind;
   1635 typedef enum {
   1636   CXIdxAttr_Unexposed     = 0,
   1637   CXIdxAttr_IBAction      = 1,
   1638   CXIdxAttr_IBOutlet      = 2,
   1639   CXIdxAttr_IBOutletCollection = 3
   1640 } CXIdxAttrKind;
   1641 typedef struct {
   1642   CXIdxAttrKind kind;
   1643   CXCursor cursor;
   1644   CXIdxLoc loc;
   1645 } CXIdxAttrInfo;
   1646 typedef struct {
   1647   CXIdxEntityKind kind;
   1648   CXIdxEntityCXXTemplateKind templateKind;
   1649   CXIdxEntityLanguage lang;
   1650   const char *name;
   1651   const char *USR;
   1652   CXCursor cursor;
   1653   const CXIdxAttrInfo *const *attributes;
   1654   unsigned numAttributes;
   1655 } CXIdxEntityInfo;
   1656 typedef struct {
   1657   CXCursor cursor;
   1658 } CXIdxContainerInfo;
   1659 typedef struct {
   1660   const CXIdxAttrInfo *attrInfo;
   1661   const CXIdxEntityInfo *objcClass;
   1662   CXCursor classCursor;
   1663   CXIdxLoc classLoc;
   1664 } CXIdxIBOutletCollectionAttrInfo;
   1665 typedef enum {
   1666   CXIdxDeclFlag_Skipped = 0x1
   1667 } CXIdxDeclInfoFlags;
   1668 typedef struct {
   1669   const CXIdxEntityInfo *entityInfo;
   1670   CXCursor cursor;
   1671   CXIdxLoc loc;
   1672   const CXIdxContainerInfo *semanticContainer;
   1673 
   1674   const CXIdxContainerInfo *lexicalContainer;
   1675   int isRedeclaration;
   1676   int isDefinition;
   1677   int isContainer;
   1678   const CXIdxContainerInfo *declAsContainer;
   1679 
   1680   int isImplicit;
   1681   const CXIdxAttrInfo *const *attributes;
   1682   unsigned numAttributes;
   1683   unsigned flags;
   1684 } CXIdxDeclInfo;
   1685 typedef enum {
   1686   CXIdxObjCContainer_ForwardRef = 0,
   1687   CXIdxObjCContainer_Interface = 1,
   1688   CXIdxObjCContainer_Implementation = 2
   1689 } CXIdxObjCContainerKind;
   1690 typedef struct {
   1691   const CXIdxDeclInfo *declInfo;
   1692   CXIdxObjCContainerKind kind;
   1693 } CXIdxObjCContainerDeclInfo;
   1694 typedef struct {
   1695   const CXIdxEntityInfo *base;
   1696   CXCursor cursor;
   1697   CXIdxLoc loc;
   1698 } CXIdxBaseClassInfo;
   1699 typedef struct {
   1700   const CXIdxEntityInfo *protocol;
   1701   CXCursor cursor;
   1702   CXIdxLoc loc;
   1703 } CXIdxObjCProtocolRefInfo;
   1704 typedef struct {
   1705   const CXIdxObjCProtocolRefInfo *const *protocols;
   1706   unsigned numProtocols;
   1707 } CXIdxObjCProtocolRefListInfo;
   1708 typedef struct {
   1709   const CXIdxObjCContainerDeclInfo *containerInfo;
   1710   const CXIdxBaseClassInfo *superInfo;
   1711   const CXIdxObjCProtocolRefListInfo *protocols;
   1712 } CXIdxObjCInterfaceDeclInfo;
   1713 typedef struct {
   1714   const CXIdxObjCContainerDeclInfo *containerInfo;
   1715   const CXIdxEntityInfo *objcClass;
   1716   CXCursor classCursor;
   1717   CXIdxLoc classLoc;
   1718   const CXIdxObjCProtocolRefListInfo *protocols;
   1719 } CXIdxObjCCategoryDeclInfo;
   1720 typedef struct {
   1721   const CXIdxDeclInfo *declInfo;
   1722   const CXIdxEntityInfo *getter;
   1723   const CXIdxEntityInfo *setter;
   1724 } CXIdxObjCPropertyDeclInfo;
   1725 typedef struct {
   1726   const CXIdxDeclInfo *declInfo;
   1727   const CXIdxBaseClassInfo *const *bases;
   1728   unsigned numBases;
   1729 } CXIdxCXXClassDeclInfo;
   1730 typedef enum {
   1731 
   1732   CXIdxEntityRef_Direct = 1,
   1733 
   1734   CXIdxEntityRef_Implicit = 2
   1735 } CXIdxEntityRefKind;
   1736 typedef struct {
   1737   CXIdxEntityRefKind kind;
   1738 
   1739   CXCursor cursor;
   1740   CXIdxLoc loc;
   1741 
   1742   const CXIdxEntityInfo *referencedEntity;
   1743 
   1744   const CXIdxEntityInfo *parentEntity;
   1745 
   1746   const CXIdxContainerInfo *container;
   1747 } CXIdxEntityRefInfo;
   1748 typedef struct {
   1749 
   1750   int (*abortQuery)(CXClientData client_data, void *reserved);
   1751 
   1752   void (*diagnostic)(CXClientData client_data,
   1753                      CXDiagnosticSet, void *reserved);
   1754   CXIdxClientFile (*enteredMainFile)(CXClientData client_data,
   1755                                      CXFile mainFile, void *reserved);
   1756 
   1757 
   1758   CXIdxClientFile (*ppIncludedFile)(CXClientData client_data,
   1759                                     const CXIdxIncludedFileInfo *);
   1760 
   1761 
   1762   CXIdxClientASTFile (*importedASTFile)(CXClientData client_data,
   1763                                         const CXIdxImportedASTFileInfo *);
   1764 
   1765   CXIdxClientContainer (*startedTranslationUnit)(CXClientData client_data,
   1766                                                  void *reserved);
   1767   void (*indexDeclaration)(CXClientData client_data,
   1768                            const CXIdxDeclInfo *);
   1769 
   1770   void (*indexEntityReference)(CXClientData client_data,
   1771                                const CXIdxEntityRefInfo *);
   1772 } IndexerCallbacks;
   1773  int clang_index_isEntityObjCContainerKind(CXIdxEntityKind);
   1774  const CXIdxObjCContainerDeclInfo *
   1775 clang_index_getObjCContainerDeclInfo(const CXIdxDeclInfo *);
   1776  const CXIdxObjCInterfaceDeclInfo *
   1777 clang_index_getObjCInterfaceDeclInfo(const CXIdxDeclInfo *);
   1778 const CXIdxObjCCategoryDeclInfo *
   1779 clang_index_getObjCCategoryDeclInfo(const CXIdxDeclInfo *);
   1780  const CXIdxObjCProtocolRefListInfo *
   1781 clang_index_getObjCProtocolRefListInfo(const CXIdxDeclInfo *);
   1782  const CXIdxObjCPropertyDeclInfo *
   1783 clang_index_getObjCPropertyDeclInfo(const CXIdxDeclInfo *);
   1784  const CXIdxIBOutletCollectionAttrInfo *
   1785 clang_index_getIBOutletCollectionAttrInfo(const CXIdxAttrInfo *);
   1786  const CXIdxCXXClassDeclInfo *
   1787 clang_index_getCXXClassDeclInfo(const CXIdxDeclInfo *);
   1788  CXIdxClientContainer
   1789 clang_index_getClientContainer(const CXIdxContainerInfo *);
   1790  void
   1791 clang_index_setClientContainer(const CXIdxContainerInfo *,CXIdxClientContainer);
   1792  CXIdxClientEntity
   1793 clang_index_getClientEntity(const CXIdxEntityInfo *);
   1794  void
   1795 clang_index_setClientEntity(const CXIdxEntityInfo *, CXIdxClientEntity);
   1796 typedef void *CXIndexAction;
   1797  CXIndexAction clang_IndexAction_create(CXIndex CIdx);
   1798  void clang_IndexAction_dispose(CXIndexAction);
   1799 typedef enum {
   1800 
   1801   CXIndexOpt_None = 0x0,
   1802 
   1803 
   1804   CXIndexOpt_SuppressRedundantRefs = 0x1,
   1805 
   1806   CXIndexOpt_IndexFunctionLocalSymbols = 0x2,
   1807 
   1808   CXIndexOpt_IndexImplicitTemplateInstantiations = 0x4,
   1809 
   1810   CXIndexOpt_SuppressWarnings = 0x8,
   1811 
   1812   CXIndexOpt_SkipParsedBodiesInSession = 0x10
   1813 } CXIndexOptFlags;
   1814  int clang_indexSourceFile(CXIndexAction,
   1815                                          CXClientData client_data,
   1816                                          IndexerCallbacks *index_callbacks,
   1817                                          unsigned index_callbacks_size,
   1818                                          unsigned index_options,
   1819                                          const char *source_filename,
   1820                                          const char * const *command_line_args,
   1821                                          int num_command_line_args,
   1822                                          struct CXUnsavedFile *unsaved_files,
   1823                                          unsigned num_unsaved_files,
   1824                                          CXTranslationUnit *out_TU,
   1825                                          unsigned TU_options);
   1826  int clang_indexSourceFileFullArgv(
   1827     CXIndexAction, CXClientData client_data, IndexerCallbacks *index_callbacks,
   1828     unsigned index_callbacks_size, unsigned index_options,
   1829     const char *source_filename, const char *const *command_line_args,
   1830     int num_command_line_args, struct CXUnsavedFile *unsaved_files,
   1831     unsigned num_unsaved_files, CXTranslationUnit *out_TU, unsigned TU_options);
   1832  int clang_indexTranslationUnit(CXIndexAction,
   1833                                               CXClientData client_data,
   1834                                               IndexerCallbacks *index_callbacks,
   1835                                               unsigned index_callbacks_size,
   1836                                               unsigned index_options,
   1837                                               CXTranslationUnit);
   1838  void clang_indexLoc_getFileLocation(CXIdxLoc loc,
   1839                                                    CXIdxClientFile *indexFile,
   1840                                                    CXFile *file,
   1841                                                    unsigned *line,
   1842                                                    unsigned *column,
   1843                                                    unsigned *offset);
   1844 CXSourceLocation clang_indexLoc_getCXSourceLocation(CXIdxLoc loc);
   1845 typedef enum CXVisitorResult (*CXFieldVisitor)(CXCursor C,
   1846                                                CXClientData client_data);
   1847  unsigned clang_Type_visitFields(CXType T,
   1848                                                CXFieldVisitor visitor,
   1849                                                CXClientData client_data);
   1850 	]==========]