Ted Kremenek | d2fa566 | 2009-08-26 22:36:44 +0000 | [diff] [blame] | 1 | //===- CIndex.cpp - Clang-C Source Indexing Library -----------------------===// |
| 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 file implements the Clang-C Source Indexing library. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "clang-c/Index.h" |
| 15 | |
Steve Naroff | 600866c | 2009-08-27 19:51:58 +0000 | [diff] [blame^] | 16 | extern "C" { |
Ted Kremenek | d2fa566 | 2009-08-26 22:36:44 +0000 | [diff] [blame] | 17 | |
Steve Naroff | 600866c | 2009-08-27 19:51:58 +0000 | [diff] [blame^] | 18 | // Some notes on CXEntity: |
| 19 | // |
| 20 | // - Since the 'ordinary' namespace includes functions, data, typedefs, ObjC interfaces, the |
| 21 | // current algorithm is a bit naive (resulting in one entity for 2 different types). For example: |
| 22 | // |
| 23 | // module1.m: @interface Foo @end Foo *x; |
| 24 | // module2.m: void Foo(int); |
| 25 | // |
| 26 | // - Since the unique name spans translation units, static data/functions within a CXTranslationUnit |
| 27 | // are *not* currently represented by entities. As a result, there will be no entity for the following: |
| 28 | // |
| 29 | // module.m: static void Foo() { } |
| 30 | // |
| 31 | |
| 32 | CXIndex clang_createIndex() |
| 33 | { |
| 34 | return 0; |
| 35 | } |
| 36 | |
| 37 | CXTranslationUnit clang_loadTranslationUnitFromASTFile( |
| 38 | CXIndex, const char *ast_filename) |
| 39 | { |
| 40 | return 0; |
| 41 | } |
| 42 | |
| 43 | void clang_loadTranslationUnit( |
| 44 | CXTranslationUnit, void (*callback)(CXTranslationUnit, CXCursor) |
| 45 | ) |
| 46 | { |
| 47 | } |
| 48 | |
| 49 | void clang_loadDeclaration(CXDecl, void (*callback)(CXDecl, CXCursor)) |
| 50 | { |
| 51 | } |
| 52 | |
| 53 | const char *clang_getDeclarationName(CXEntity) |
| 54 | { |
| 55 | return ""; |
| 56 | } |
| 57 | const char *clang_getURI(CXEntity) |
| 58 | { |
| 59 | return ""; |
| 60 | } |
| 61 | |
| 62 | CXEntity clang_getEntity(const char *URI) |
| 63 | { |
| 64 | return 0; |
| 65 | } |
| 66 | |
| 67 | // |
| 68 | // CXDecl Operations. |
| 69 | // |
| 70 | CXCursor clang_getCursorFromDecl(CXDecl) |
| 71 | { |
| 72 | return 0; |
| 73 | } |
| 74 | CXEntity clang_getEntityFromDecl(CXDecl) |
| 75 | { |
| 76 | return 0; |
| 77 | } |
| 78 | enum CXDeclKind clang_getDeclKind(CXDecl) |
| 79 | { |
| 80 | return CXDecl_any; |
| 81 | } |
| 82 | const char *clang_getDeclSpelling(CXDecl) |
| 83 | { |
| 84 | return ""; |
| 85 | } |
| 86 | // |
| 87 | // CXCursor Operations. |
| 88 | // |
| 89 | CXCursor clang_getCursor(CXTranslationUnit, const char *source_name, |
| 90 | unsigned line, unsigned column) |
| 91 | { |
| 92 | return 0; |
| 93 | } |
| 94 | |
| 95 | CXCursorKind clang_getCursorKind(CXCursor) |
| 96 | { |
| 97 | return Cursor_Declaration; |
| 98 | } |
| 99 | |
| 100 | unsigned clang_getCursorLine(CXCursor) |
| 101 | { |
| 102 | return 0; |
| 103 | } |
| 104 | unsigned clang_getCursorColumn(CXCursor) |
| 105 | { |
| 106 | return 0; |
| 107 | } |
| 108 | const char *clang_getCursorSource(CXCursor) |
| 109 | { |
| 110 | return ""; |
| 111 | } |
| 112 | |
| 113 | // If CXCursorKind == Cursor_Reference, then this will return the referenced declaration. |
| 114 | // If CXCursorKind == Cursor_Declaration, then this will return the declaration. |
| 115 | CXDecl clang_getCursorDecl(CXCursor) |
| 116 | { |
| 117 | return 0; |
| 118 | } |
| 119 | |
| 120 | } // end extern "C" |