blob: 86e63607b473cc99af675f967bc873d321622d6f [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 +000018// 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
32CXIndex clang_createIndex()
33{
34 return 0;
35}
36
37CXTranslationUnit clang_loadTranslationUnitFromASTFile(
38 CXIndex, const char *ast_filename)
39{
40 return 0;
41}
42
43void clang_loadTranslationUnit(
44 CXTranslationUnit, void (*callback)(CXTranslationUnit, CXCursor)
45)
46{
47}
48
49void clang_loadDeclaration(CXDecl, void (*callback)(CXDecl, CXCursor))
50{
51}
52
53const char *clang_getDeclarationName(CXEntity)
54{
55 return "";
56}
57const char *clang_getURI(CXEntity)
58{
59 return "";
60}
61
62CXEntity clang_getEntity(const char *URI)
63{
64 return 0;
65}
66
67//
68// CXDecl Operations.
69//
70CXCursor clang_getCursorFromDecl(CXDecl)
71{
72 return 0;
73}
74CXEntity clang_getEntityFromDecl(CXDecl)
75{
76 return 0;
77}
78enum CXDeclKind clang_getDeclKind(CXDecl)
79{
80 return CXDecl_any;
81}
82const char *clang_getDeclSpelling(CXDecl)
83{
84 return "";
85}
86//
87// CXCursor Operations.
88//
89CXCursor clang_getCursor(CXTranslationUnit, const char *source_name,
90 unsigned line, unsigned column)
91{
92 return 0;
93}
94
95CXCursorKind clang_getCursorKind(CXCursor)
96{
97 return Cursor_Declaration;
98}
99
100unsigned clang_getCursorLine(CXCursor)
101{
102 return 0;
103}
104unsigned clang_getCursorColumn(CXCursor)
105{
106 return 0;
107}
108const 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.
115CXDecl clang_getCursorDecl(CXCursor)
116{
117 return 0;
118}
119
120} // end extern "C"