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