xref: /minix3/external/bsd/llvm/dist/clang/include/clang-c/Documentation.h (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc /*==-- clang-c/Documentation.h - Utilities for comment processing -*- C -*-===*\
2*0a6a1f1dSLionel Sambuc |*                                                                            *|
3*0a6a1f1dSLionel Sambuc |*                     The LLVM Compiler Infrastructure                       *|
4*0a6a1f1dSLionel Sambuc |*                                                                            *|
5*0a6a1f1dSLionel Sambuc |* This file is distributed under the University of Illinois Open Source      *|
6*0a6a1f1dSLionel Sambuc |* License. See LICENSE.TXT for details.                                      *|
7*0a6a1f1dSLionel Sambuc |*                                                                            *|
8*0a6a1f1dSLionel Sambuc |*===----------------------------------------------------------------------===*|
9*0a6a1f1dSLionel Sambuc |*                                                                            *|
10*0a6a1f1dSLionel Sambuc |* This header provides a supplementary interface for inspecting              *|
11*0a6a1f1dSLionel Sambuc |* documentation comments.                                                    *|
12*0a6a1f1dSLionel Sambuc |*                                                                            *|
13*0a6a1f1dSLionel Sambuc \*===----------------------------------------------------------------------===*/
14*0a6a1f1dSLionel Sambuc 
15*0a6a1f1dSLionel Sambuc #ifndef LLVM_CLANG_C_DOCUMENTATION_H
16*0a6a1f1dSLionel Sambuc #define LLVM_CLANG_C_DOCUMENTATION_H
17*0a6a1f1dSLionel Sambuc 
18*0a6a1f1dSLionel Sambuc #include "clang-c/Index.h"
19*0a6a1f1dSLionel Sambuc 
20*0a6a1f1dSLionel Sambuc #ifdef __cplusplus
21*0a6a1f1dSLionel Sambuc extern "C" {
22*0a6a1f1dSLionel Sambuc #endif
23*0a6a1f1dSLionel Sambuc 
24*0a6a1f1dSLionel Sambuc /**
25*0a6a1f1dSLionel Sambuc  * \defgroup CINDEX_COMMENT Comment introspection
26*0a6a1f1dSLionel Sambuc  *
27*0a6a1f1dSLionel Sambuc  * The routines in this group provide access to information in documentation
28*0a6a1f1dSLionel Sambuc  * comments. These facilities are distinct from the core and may be subject to
29*0a6a1f1dSLionel Sambuc  * their own schedule of stability and deprecation.
30*0a6a1f1dSLionel Sambuc  *
31*0a6a1f1dSLionel Sambuc  * @{
32*0a6a1f1dSLionel Sambuc  */
33*0a6a1f1dSLionel Sambuc 
34*0a6a1f1dSLionel Sambuc /**
35*0a6a1f1dSLionel Sambuc  * \brief A parsed comment.
36*0a6a1f1dSLionel Sambuc  */
37*0a6a1f1dSLionel Sambuc typedef struct {
38*0a6a1f1dSLionel Sambuc   const void *ASTNode;
39*0a6a1f1dSLionel Sambuc   CXTranslationUnit TranslationUnit;
40*0a6a1f1dSLionel Sambuc } CXComment;
41*0a6a1f1dSLionel Sambuc 
42*0a6a1f1dSLionel Sambuc /**
43*0a6a1f1dSLionel Sambuc  * \brief Given a cursor that represents a documentable entity (e.g.,
44*0a6a1f1dSLionel Sambuc  * declaration), return the associated parsed comment as a
45*0a6a1f1dSLionel Sambuc  * \c CXComment_FullComment AST node.
46*0a6a1f1dSLionel Sambuc  */
47*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE CXComment clang_Cursor_getParsedComment(CXCursor C);
48*0a6a1f1dSLionel Sambuc 
49*0a6a1f1dSLionel Sambuc /**
50*0a6a1f1dSLionel Sambuc  * \brief Describes the type of the comment AST node (\c CXComment).  A comment
51*0a6a1f1dSLionel Sambuc  * node can be considered block content (e. g., paragraph), inline content
52*0a6a1f1dSLionel Sambuc  * (plain text) or neither (the root AST node).
53*0a6a1f1dSLionel Sambuc  */
54*0a6a1f1dSLionel Sambuc enum CXCommentKind {
55*0a6a1f1dSLionel Sambuc   /**
56*0a6a1f1dSLionel Sambuc    * \brief Null comment.  No AST node is constructed at the requested location
57*0a6a1f1dSLionel Sambuc    * because there is no text or a syntax error.
58*0a6a1f1dSLionel Sambuc    */
59*0a6a1f1dSLionel Sambuc   CXComment_Null = 0,
60*0a6a1f1dSLionel Sambuc 
61*0a6a1f1dSLionel Sambuc   /**
62*0a6a1f1dSLionel Sambuc    * \brief Plain text.  Inline content.
63*0a6a1f1dSLionel Sambuc    */
64*0a6a1f1dSLionel Sambuc   CXComment_Text = 1,
65*0a6a1f1dSLionel Sambuc 
66*0a6a1f1dSLionel Sambuc   /**
67*0a6a1f1dSLionel Sambuc    * \brief A command with word-like arguments that is considered inline content.
68*0a6a1f1dSLionel Sambuc    *
69*0a6a1f1dSLionel Sambuc    * For example: \\c command.
70*0a6a1f1dSLionel Sambuc    */
71*0a6a1f1dSLionel Sambuc   CXComment_InlineCommand = 2,
72*0a6a1f1dSLionel Sambuc 
73*0a6a1f1dSLionel Sambuc   /**
74*0a6a1f1dSLionel Sambuc    * \brief HTML start tag with attributes (name-value pairs).  Considered
75*0a6a1f1dSLionel Sambuc    * inline content.
76*0a6a1f1dSLionel Sambuc    *
77*0a6a1f1dSLionel Sambuc    * For example:
78*0a6a1f1dSLionel Sambuc    * \verbatim
79*0a6a1f1dSLionel Sambuc    * <br> <br /> <a href="http://example.org/">
80*0a6a1f1dSLionel Sambuc    * \endverbatim
81*0a6a1f1dSLionel Sambuc    */
82*0a6a1f1dSLionel Sambuc   CXComment_HTMLStartTag = 3,
83*0a6a1f1dSLionel Sambuc 
84*0a6a1f1dSLionel Sambuc   /**
85*0a6a1f1dSLionel Sambuc    * \brief HTML end tag.  Considered inline content.
86*0a6a1f1dSLionel Sambuc    *
87*0a6a1f1dSLionel Sambuc    * For example:
88*0a6a1f1dSLionel Sambuc    * \verbatim
89*0a6a1f1dSLionel Sambuc    * </a>
90*0a6a1f1dSLionel Sambuc    * \endverbatim
91*0a6a1f1dSLionel Sambuc    */
92*0a6a1f1dSLionel Sambuc   CXComment_HTMLEndTag = 4,
93*0a6a1f1dSLionel Sambuc 
94*0a6a1f1dSLionel Sambuc   /**
95*0a6a1f1dSLionel Sambuc    * \brief A paragraph, contains inline comment.  The paragraph itself is
96*0a6a1f1dSLionel Sambuc    * block content.
97*0a6a1f1dSLionel Sambuc    */
98*0a6a1f1dSLionel Sambuc   CXComment_Paragraph = 5,
99*0a6a1f1dSLionel Sambuc 
100*0a6a1f1dSLionel Sambuc   /**
101*0a6a1f1dSLionel Sambuc    * \brief A command that has zero or more word-like arguments (number of
102*0a6a1f1dSLionel Sambuc    * word-like arguments depends on command name) and a paragraph as an
103*0a6a1f1dSLionel Sambuc    * argument.  Block command is block content.
104*0a6a1f1dSLionel Sambuc    *
105*0a6a1f1dSLionel Sambuc    * Paragraph argument is also a child of the block command.
106*0a6a1f1dSLionel Sambuc    *
107*0a6a1f1dSLionel Sambuc    * For example: \\brief has 0 word-like arguments and a paragraph argument.
108*0a6a1f1dSLionel Sambuc    *
109*0a6a1f1dSLionel Sambuc    * AST nodes of special kinds that parser knows about (e. g., \\param
110*0a6a1f1dSLionel Sambuc    * command) have their own node kinds.
111*0a6a1f1dSLionel Sambuc    */
112*0a6a1f1dSLionel Sambuc   CXComment_BlockCommand = 6,
113*0a6a1f1dSLionel Sambuc 
114*0a6a1f1dSLionel Sambuc   /**
115*0a6a1f1dSLionel Sambuc    * \brief A \\param or \\arg command that describes the function parameter
116*0a6a1f1dSLionel Sambuc    * (name, passing direction, description).
117*0a6a1f1dSLionel Sambuc    *
118*0a6a1f1dSLionel Sambuc    * For example: \\param [in] ParamName description.
119*0a6a1f1dSLionel Sambuc    */
120*0a6a1f1dSLionel Sambuc   CXComment_ParamCommand = 7,
121*0a6a1f1dSLionel Sambuc 
122*0a6a1f1dSLionel Sambuc   /**
123*0a6a1f1dSLionel Sambuc    * \brief A \\tparam command that describes a template parameter (name and
124*0a6a1f1dSLionel Sambuc    * description).
125*0a6a1f1dSLionel Sambuc    *
126*0a6a1f1dSLionel Sambuc    * For example: \\tparam T description.
127*0a6a1f1dSLionel Sambuc    */
128*0a6a1f1dSLionel Sambuc   CXComment_TParamCommand = 8,
129*0a6a1f1dSLionel Sambuc 
130*0a6a1f1dSLionel Sambuc   /**
131*0a6a1f1dSLionel Sambuc    * \brief A verbatim block command (e. g., preformatted code).  Verbatim
132*0a6a1f1dSLionel Sambuc    * block has an opening and a closing command and contains multiple lines of
133*0a6a1f1dSLionel Sambuc    * text (\c CXComment_VerbatimBlockLine child nodes).
134*0a6a1f1dSLionel Sambuc    *
135*0a6a1f1dSLionel Sambuc    * For example:
136*0a6a1f1dSLionel Sambuc    * \\verbatim
137*0a6a1f1dSLionel Sambuc    * aaa
138*0a6a1f1dSLionel Sambuc    * \\endverbatim
139*0a6a1f1dSLionel Sambuc    */
140*0a6a1f1dSLionel Sambuc   CXComment_VerbatimBlockCommand = 9,
141*0a6a1f1dSLionel Sambuc 
142*0a6a1f1dSLionel Sambuc   /**
143*0a6a1f1dSLionel Sambuc    * \brief A line of text that is contained within a
144*0a6a1f1dSLionel Sambuc    * CXComment_VerbatimBlockCommand node.
145*0a6a1f1dSLionel Sambuc    */
146*0a6a1f1dSLionel Sambuc   CXComment_VerbatimBlockLine = 10,
147*0a6a1f1dSLionel Sambuc 
148*0a6a1f1dSLionel Sambuc   /**
149*0a6a1f1dSLionel Sambuc    * \brief A verbatim line command.  Verbatim line has an opening command,
150*0a6a1f1dSLionel Sambuc    * a single line of text (up to the newline after the opening command) and
151*0a6a1f1dSLionel Sambuc    * has no closing command.
152*0a6a1f1dSLionel Sambuc    */
153*0a6a1f1dSLionel Sambuc   CXComment_VerbatimLine = 11,
154*0a6a1f1dSLionel Sambuc 
155*0a6a1f1dSLionel Sambuc   /**
156*0a6a1f1dSLionel Sambuc    * \brief A full comment attached to a declaration, contains block content.
157*0a6a1f1dSLionel Sambuc    */
158*0a6a1f1dSLionel Sambuc   CXComment_FullComment = 12
159*0a6a1f1dSLionel Sambuc };
160*0a6a1f1dSLionel Sambuc 
161*0a6a1f1dSLionel Sambuc /**
162*0a6a1f1dSLionel Sambuc  * \brief The most appropriate rendering mode for an inline command, chosen on
163*0a6a1f1dSLionel Sambuc  * command semantics in Doxygen.
164*0a6a1f1dSLionel Sambuc  */
165*0a6a1f1dSLionel Sambuc enum CXCommentInlineCommandRenderKind {
166*0a6a1f1dSLionel Sambuc   /**
167*0a6a1f1dSLionel Sambuc    * \brief Command argument should be rendered in a normal font.
168*0a6a1f1dSLionel Sambuc    */
169*0a6a1f1dSLionel Sambuc   CXCommentInlineCommandRenderKind_Normal,
170*0a6a1f1dSLionel Sambuc 
171*0a6a1f1dSLionel Sambuc   /**
172*0a6a1f1dSLionel Sambuc    * \brief Command argument should be rendered in a bold font.
173*0a6a1f1dSLionel Sambuc    */
174*0a6a1f1dSLionel Sambuc   CXCommentInlineCommandRenderKind_Bold,
175*0a6a1f1dSLionel Sambuc 
176*0a6a1f1dSLionel Sambuc   /**
177*0a6a1f1dSLionel Sambuc    * \brief Command argument should be rendered in a monospaced font.
178*0a6a1f1dSLionel Sambuc    */
179*0a6a1f1dSLionel Sambuc   CXCommentInlineCommandRenderKind_Monospaced,
180*0a6a1f1dSLionel Sambuc 
181*0a6a1f1dSLionel Sambuc   /**
182*0a6a1f1dSLionel Sambuc    * \brief Command argument should be rendered emphasized (typically italic
183*0a6a1f1dSLionel Sambuc    * font).
184*0a6a1f1dSLionel Sambuc    */
185*0a6a1f1dSLionel Sambuc   CXCommentInlineCommandRenderKind_Emphasized
186*0a6a1f1dSLionel Sambuc };
187*0a6a1f1dSLionel Sambuc 
188*0a6a1f1dSLionel Sambuc /**
189*0a6a1f1dSLionel Sambuc  * \brief Describes parameter passing direction for \\param or \\arg command.
190*0a6a1f1dSLionel Sambuc  */
191*0a6a1f1dSLionel Sambuc enum CXCommentParamPassDirection {
192*0a6a1f1dSLionel Sambuc   /**
193*0a6a1f1dSLionel Sambuc    * \brief The parameter is an input parameter.
194*0a6a1f1dSLionel Sambuc    */
195*0a6a1f1dSLionel Sambuc   CXCommentParamPassDirection_In,
196*0a6a1f1dSLionel Sambuc 
197*0a6a1f1dSLionel Sambuc   /**
198*0a6a1f1dSLionel Sambuc    * \brief The parameter is an output parameter.
199*0a6a1f1dSLionel Sambuc    */
200*0a6a1f1dSLionel Sambuc   CXCommentParamPassDirection_Out,
201*0a6a1f1dSLionel Sambuc 
202*0a6a1f1dSLionel Sambuc   /**
203*0a6a1f1dSLionel Sambuc    * \brief The parameter is an input and output parameter.
204*0a6a1f1dSLionel Sambuc    */
205*0a6a1f1dSLionel Sambuc   CXCommentParamPassDirection_InOut
206*0a6a1f1dSLionel Sambuc };
207*0a6a1f1dSLionel Sambuc 
208*0a6a1f1dSLionel Sambuc /**
209*0a6a1f1dSLionel Sambuc  * \param Comment AST node of any kind.
210*0a6a1f1dSLionel Sambuc  *
211*0a6a1f1dSLionel Sambuc  * \returns the type of the AST node.
212*0a6a1f1dSLionel Sambuc  */
213*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE enum CXCommentKind clang_Comment_getKind(CXComment Comment);
214*0a6a1f1dSLionel Sambuc 
215*0a6a1f1dSLionel Sambuc /**
216*0a6a1f1dSLionel Sambuc  * \param Comment AST node of any kind.
217*0a6a1f1dSLionel Sambuc  *
218*0a6a1f1dSLionel Sambuc  * \returns number of children of the AST node.
219*0a6a1f1dSLionel Sambuc  */
220*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE unsigned clang_Comment_getNumChildren(CXComment Comment);
221*0a6a1f1dSLionel Sambuc 
222*0a6a1f1dSLionel Sambuc /**
223*0a6a1f1dSLionel Sambuc  * \param Comment AST node of any kind.
224*0a6a1f1dSLionel Sambuc  *
225*0a6a1f1dSLionel Sambuc  * \param ChildIdx child index (zero-based).
226*0a6a1f1dSLionel Sambuc  *
227*0a6a1f1dSLionel Sambuc  * \returns the specified child of the AST node.
228*0a6a1f1dSLionel Sambuc  */
229*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE
230*0a6a1f1dSLionel Sambuc CXComment clang_Comment_getChild(CXComment Comment, unsigned ChildIdx);
231*0a6a1f1dSLionel Sambuc 
232*0a6a1f1dSLionel Sambuc /**
233*0a6a1f1dSLionel Sambuc  * \brief A \c CXComment_Paragraph node is considered whitespace if it contains
234*0a6a1f1dSLionel Sambuc  * only \c CXComment_Text nodes that are empty or whitespace.
235*0a6a1f1dSLionel Sambuc  *
236*0a6a1f1dSLionel Sambuc  * Other AST nodes (except \c CXComment_Paragraph and \c CXComment_Text) are
237*0a6a1f1dSLionel Sambuc  * never considered whitespace.
238*0a6a1f1dSLionel Sambuc  *
239*0a6a1f1dSLionel Sambuc  * \returns non-zero if \c Comment is whitespace.
240*0a6a1f1dSLionel Sambuc  */
241*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE unsigned clang_Comment_isWhitespace(CXComment Comment);
242*0a6a1f1dSLionel Sambuc 
243*0a6a1f1dSLionel Sambuc /**
244*0a6a1f1dSLionel Sambuc  * \returns non-zero if \c Comment is inline content and has a newline
245*0a6a1f1dSLionel Sambuc  * immediately following it in the comment text.  Newlines between paragraphs
246*0a6a1f1dSLionel Sambuc  * do not count.
247*0a6a1f1dSLionel Sambuc  */
248*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE
249*0a6a1f1dSLionel Sambuc unsigned clang_InlineContentComment_hasTrailingNewline(CXComment Comment);
250*0a6a1f1dSLionel Sambuc 
251*0a6a1f1dSLionel Sambuc /**
252*0a6a1f1dSLionel Sambuc  * \param Comment a \c CXComment_Text AST node.
253*0a6a1f1dSLionel Sambuc  *
254*0a6a1f1dSLionel Sambuc  * \returns text contained in the AST node.
255*0a6a1f1dSLionel Sambuc  */
256*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE CXString clang_TextComment_getText(CXComment Comment);
257*0a6a1f1dSLionel Sambuc 
258*0a6a1f1dSLionel Sambuc /**
259*0a6a1f1dSLionel Sambuc  * \param Comment a \c CXComment_InlineCommand AST node.
260*0a6a1f1dSLionel Sambuc  *
261*0a6a1f1dSLionel Sambuc  * \returns name of the inline command.
262*0a6a1f1dSLionel Sambuc  */
263*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE
264*0a6a1f1dSLionel Sambuc CXString clang_InlineCommandComment_getCommandName(CXComment Comment);
265*0a6a1f1dSLionel Sambuc 
266*0a6a1f1dSLionel Sambuc /**
267*0a6a1f1dSLionel Sambuc  * \param Comment a \c CXComment_InlineCommand AST node.
268*0a6a1f1dSLionel Sambuc  *
269*0a6a1f1dSLionel Sambuc  * \returns the most appropriate rendering mode, chosen on command
270*0a6a1f1dSLionel Sambuc  * semantics in Doxygen.
271*0a6a1f1dSLionel Sambuc  */
272*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE enum CXCommentInlineCommandRenderKind
273*0a6a1f1dSLionel Sambuc clang_InlineCommandComment_getRenderKind(CXComment Comment);
274*0a6a1f1dSLionel Sambuc 
275*0a6a1f1dSLionel Sambuc /**
276*0a6a1f1dSLionel Sambuc  * \param Comment a \c CXComment_InlineCommand AST node.
277*0a6a1f1dSLionel Sambuc  *
278*0a6a1f1dSLionel Sambuc  * \returns number of command arguments.
279*0a6a1f1dSLionel Sambuc  */
280*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE
281*0a6a1f1dSLionel Sambuc unsigned clang_InlineCommandComment_getNumArgs(CXComment Comment);
282*0a6a1f1dSLionel Sambuc 
283*0a6a1f1dSLionel Sambuc /**
284*0a6a1f1dSLionel Sambuc  * \param Comment a \c CXComment_InlineCommand AST node.
285*0a6a1f1dSLionel Sambuc  *
286*0a6a1f1dSLionel Sambuc  * \param ArgIdx argument index (zero-based).
287*0a6a1f1dSLionel Sambuc  *
288*0a6a1f1dSLionel Sambuc  * \returns text of the specified argument.
289*0a6a1f1dSLionel Sambuc  */
290*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE
291*0a6a1f1dSLionel Sambuc CXString clang_InlineCommandComment_getArgText(CXComment Comment,
292*0a6a1f1dSLionel Sambuc                                                unsigned ArgIdx);
293*0a6a1f1dSLionel Sambuc 
294*0a6a1f1dSLionel Sambuc /**
295*0a6a1f1dSLionel Sambuc  * \param Comment a \c CXComment_HTMLStartTag or \c CXComment_HTMLEndTag AST
296*0a6a1f1dSLionel Sambuc  * node.
297*0a6a1f1dSLionel Sambuc  *
298*0a6a1f1dSLionel Sambuc  * \returns HTML tag name.
299*0a6a1f1dSLionel Sambuc  */
300*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE CXString clang_HTMLTagComment_getTagName(CXComment Comment);
301*0a6a1f1dSLionel Sambuc 
302*0a6a1f1dSLionel Sambuc /**
303*0a6a1f1dSLionel Sambuc  * \param Comment a \c CXComment_HTMLStartTag AST node.
304*0a6a1f1dSLionel Sambuc  *
305*0a6a1f1dSLionel Sambuc  * \returns non-zero if tag is self-closing (for example, &lt;br /&gt;).
306*0a6a1f1dSLionel Sambuc  */
307*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE
308*0a6a1f1dSLionel Sambuc unsigned clang_HTMLStartTagComment_isSelfClosing(CXComment Comment);
309*0a6a1f1dSLionel Sambuc 
310*0a6a1f1dSLionel Sambuc /**
311*0a6a1f1dSLionel Sambuc  * \param Comment a \c CXComment_HTMLStartTag AST node.
312*0a6a1f1dSLionel Sambuc  *
313*0a6a1f1dSLionel Sambuc  * \returns number of attributes (name-value pairs) attached to the start tag.
314*0a6a1f1dSLionel Sambuc  */
315*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE unsigned clang_HTMLStartTag_getNumAttrs(CXComment Comment);
316*0a6a1f1dSLionel Sambuc 
317*0a6a1f1dSLionel Sambuc /**
318*0a6a1f1dSLionel Sambuc  * \param Comment a \c CXComment_HTMLStartTag AST node.
319*0a6a1f1dSLionel Sambuc  *
320*0a6a1f1dSLionel Sambuc  * \param AttrIdx attribute index (zero-based).
321*0a6a1f1dSLionel Sambuc  *
322*0a6a1f1dSLionel Sambuc  * \returns name of the specified attribute.
323*0a6a1f1dSLionel Sambuc  */
324*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE
325*0a6a1f1dSLionel Sambuc CXString clang_HTMLStartTag_getAttrName(CXComment Comment, unsigned AttrIdx);
326*0a6a1f1dSLionel Sambuc 
327*0a6a1f1dSLionel Sambuc /**
328*0a6a1f1dSLionel Sambuc  * \param Comment a \c CXComment_HTMLStartTag AST node.
329*0a6a1f1dSLionel Sambuc  *
330*0a6a1f1dSLionel Sambuc  * \param AttrIdx attribute index (zero-based).
331*0a6a1f1dSLionel Sambuc  *
332*0a6a1f1dSLionel Sambuc  * \returns value of the specified attribute.
333*0a6a1f1dSLionel Sambuc  */
334*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE
335*0a6a1f1dSLionel Sambuc CXString clang_HTMLStartTag_getAttrValue(CXComment Comment, unsigned AttrIdx);
336*0a6a1f1dSLionel Sambuc 
337*0a6a1f1dSLionel Sambuc /**
338*0a6a1f1dSLionel Sambuc  * \param Comment a \c CXComment_BlockCommand AST node.
339*0a6a1f1dSLionel Sambuc  *
340*0a6a1f1dSLionel Sambuc  * \returns name of the block command.
341*0a6a1f1dSLionel Sambuc  */
342*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE
343*0a6a1f1dSLionel Sambuc CXString clang_BlockCommandComment_getCommandName(CXComment Comment);
344*0a6a1f1dSLionel Sambuc 
345*0a6a1f1dSLionel Sambuc /**
346*0a6a1f1dSLionel Sambuc  * \param Comment a \c CXComment_BlockCommand AST node.
347*0a6a1f1dSLionel Sambuc  *
348*0a6a1f1dSLionel Sambuc  * \returns number of word-like arguments.
349*0a6a1f1dSLionel Sambuc  */
350*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE
351*0a6a1f1dSLionel Sambuc unsigned clang_BlockCommandComment_getNumArgs(CXComment Comment);
352*0a6a1f1dSLionel Sambuc 
353*0a6a1f1dSLionel Sambuc /**
354*0a6a1f1dSLionel Sambuc  * \param Comment a \c CXComment_BlockCommand AST node.
355*0a6a1f1dSLionel Sambuc  *
356*0a6a1f1dSLionel Sambuc  * \param ArgIdx argument index (zero-based).
357*0a6a1f1dSLionel Sambuc  *
358*0a6a1f1dSLionel Sambuc  * \returns text of the specified word-like argument.
359*0a6a1f1dSLionel Sambuc  */
360*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE
361*0a6a1f1dSLionel Sambuc CXString clang_BlockCommandComment_getArgText(CXComment Comment,
362*0a6a1f1dSLionel Sambuc                                               unsigned ArgIdx);
363*0a6a1f1dSLionel Sambuc 
364*0a6a1f1dSLionel Sambuc /**
365*0a6a1f1dSLionel Sambuc  * \param Comment a \c CXComment_BlockCommand or
366*0a6a1f1dSLionel Sambuc  * \c CXComment_VerbatimBlockCommand AST node.
367*0a6a1f1dSLionel Sambuc  *
368*0a6a1f1dSLionel Sambuc  * \returns paragraph argument of the block command.
369*0a6a1f1dSLionel Sambuc  */
370*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE
371*0a6a1f1dSLionel Sambuc CXComment clang_BlockCommandComment_getParagraph(CXComment Comment);
372*0a6a1f1dSLionel Sambuc 
373*0a6a1f1dSLionel Sambuc /**
374*0a6a1f1dSLionel Sambuc  * \param Comment a \c CXComment_ParamCommand AST node.
375*0a6a1f1dSLionel Sambuc  *
376*0a6a1f1dSLionel Sambuc  * \returns parameter name.
377*0a6a1f1dSLionel Sambuc  */
378*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE
379*0a6a1f1dSLionel Sambuc CXString clang_ParamCommandComment_getParamName(CXComment Comment);
380*0a6a1f1dSLionel Sambuc 
381*0a6a1f1dSLionel Sambuc /**
382*0a6a1f1dSLionel Sambuc  * \param Comment a \c CXComment_ParamCommand AST node.
383*0a6a1f1dSLionel Sambuc  *
384*0a6a1f1dSLionel Sambuc  * \returns non-zero if the parameter that this AST node represents was found
385*0a6a1f1dSLionel Sambuc  * in the function prototype and \c clang_ParamCommandComment_getParamIndex
386*0a6a1f1dSLionel Sambuc  * function will return a meaningful value.
387*0a6a1f1dSLionel Sambuc  */
388*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE
389*0a6a1f1dSLionel Sambuc unsigned clang_ParamCommandComment_isParamIndexValid(CXComment Comment);
390*0a6a1f1dSLionel Sambuc 
391*0a6a1f1dSLionel Sambuc /**
392*0a6a1f1dSLionel Sambuc  * \param Comment a \c CXComment_ParamCommand AST node.
393*0a6a1f1dSLionel Sambuc  *
394*0a6a1f1dSLionel Sambuc  * \returns zero-based parameter index in function prototype.
395*0a6a1f1dSLionel Sambuc  */
396*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE
397*0a6a1f1dSLionel Sambuc unsigned clang_ParamCommandComment_getParamIndex(CXComment Comment);
398*0a6a1f1dSLionel Sambuc 
399*0a6a1f1dSLionel Sambuc /**
400*0a6a1f1dSLionel Sambuc  * \param Comment a \c CXComment_ParamCommand AST node.
401*0a6a1f1dSLionel Sambuc  *
402*0a6a1f1dSLionel Sambuc  * \returns non-zero if parameter passing direction was specified explicitly in
403*0a6a1f1dSLionel Sambuc  * the comment.
404*0a6a1f1dSLionel Sambuc  */
405*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE
406*0a6a1f1dSLionel Sambuc unsigned clang_ParamCommandComment_isDirectionExplicit(CXComment Comment);
407*0a6a1f1dSLionel Sambuc 
408*0a6a1f1dSLionel Sambuc /**
409*0a6a1f1dSLionel Sambuc  * \param Comment a \c CXComment_ParamCommand AST node.
410*0a6a1f1dSLionel Sambuc  *
411*0a6a1f1dSLionel Sambuc  * \returns parameter passing direction.
412*0a6a1f1dSLionel Sambuc  */
413*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE
414*0a6a1f1dSLionel Sambuc enum CXCommentParamPassDirection clang_ParamCommandComment_getDirection(
415*0a6a1f1dSLionel Sambuc                                                             CXComment Comment);
416*0a6a1f1dSLionel Sambuc 
417*0a6a1f1dSLionel Sambuc /**
418*0a6a1f1dSLionel Sambuc  * \param Comment a \c CXComment_TParamCommand AST node.
419*0a6a1f1dSLionel Sambuc  *
420*0a6a1f1dSLionel Sambuc  * \returns template parameter name.
421*0a6a1f1dSLionel Sambuc  */
422*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE
423*0a6a1f1dSLionel Sambuc CXString clang_TParamCommandComment_getParamName(CXComment Comment);
424*0a6a1f1dSLionel Sambuc 
425*0a6a1f1dSLionel Sambuc /**
426*0a6a1f1dSLionel Sambuc  * \param Comment a \c CXComment_TParamCommand AST node.
427*0a6a1f1dSLionel Sambuc  *
428*0a6a1f1dSLionel Sambuc  * \returns non-zero if the parameter that this AST node represents was found
429*0a6a1f1dSLionel Sambuc  * in the template parameter list and
430*0a6a1f1dSLionel Sambuc  * \c clang_TParamCommandComment_getDepth and
431*0a6a1f1dSLionel Sambuc  * \c clang_TParamCommandComment_getIndex functions will return a meaningful
432*0a6a1f1dSLionel Sambuc  * value.
433*0a6a1f1dSLionel Sambuc  */
434*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE
435*0a6a1f1dSLionel Sambuc unsigned clang_TParamCommandComment_isParamPositionValid(CXComment Comment);
436*0a6a1f1dSLionel Sambuc 
437*0a6a1f1dSLionel Sambuc /**
438*0a6a1f1dSLionel Sambuc  * \param Comment a \c CXComment_TParamCommand AST node.
439*0a6a1f1dSLionel Sambuc  *
440*0a6a1f1dSLionel Sambuc  * \returns zero-based nesting depth of this parameter in the template parameter list.
441*0a6a1f1dSLionel Sambuc  *
442*0a6a1f1dSLionel Sambuc  * For example,
443*0a6a1f1dSLionel Sambuc  * \verbatim
444*0a6a1f1dSLionel Sambuc  *     template<typename C, template<typename T> class TT>
445*0a6a1f1dSLionel Sambuc  *     void test(TT<int> aaa);
446*0a6a1f1dSLionel Sambuc  * \endverbatim
447*0a6a1f1dSLionel Sambuc  * for C and TT nesting depth is 0,
448*0a6a1f1dSLionel Sambuc  * for T nesting depth is 1.
449*0a6a1f1dSLionel Sambuc  */
450*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE
451*0a6a1f1dSLionel Sambuc unsigned clang_TParamCommandComment_getDepth(CXComment Comment);
452*0a6a1f1dSLionel Sambuc 
453*0a6a1f1dSLionel Sambuc /**
454*0a6a1f1dSLionel Sambuc  * \param Comment a \c CXComment_TParamCommand AST node.
455*0a6a1f1dSLionel Sambuc  *
456*0a6a1f1dSLionel Sambuc  * \returns zero-based parameter index in the template parameter list at a
457*0a6a1f1dSLionel Sambuc  * given nesting depth.
458*0a6a1f1dSLionel Sambuc  *
459*0a6a1f1dSLionel Sambuc  * For example,
460*0a6a1f1dSLionel Sambuc  * \verbatim
461*0a6a1f1dSLionel Sambuc  *     template<typename C, template<typename T> class TT>
462*0a6a1f1dSLionel Sambuc  *     void test(TT<int> aaa);
463*0a6a1f1dSLionel Sambuc  * \endverbatim
464*0a6a1f1dSLionel Sambuc  * for C and TT nesting depth is 0, so we can ask for index at depth 0:
465*0a6a1f1dSLionel Sambuc  * at depth 0 C's index is 0, TT's index is 1.
466*0a6a1f1dSLionel Sambuc  *
467*0a6a1f1dSLionel Sambuc  * For T nesting depth is 1, so we can ask for index at depth 0 and 1:
468*0a6a1f1dSLionel Sambuc  * at depth 0 T's index is 1 (same as TT's),
469*0a6a1f1dSLionel Sambuc  * at depth 1 T's index is 0.
470*0a6a1f1dSLionel Sambuc  */
471*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE
472*0a6a1f1dSLionel Sambuc unsigned clang_TParamCommandComment_getIndex(CXComment Comment, unsigned Depth);
473*0a6a1f1dSLionel Sambuc 
474*0a6a1f1dSLionel Sambuc /**
475*0a6a1f1dSLionel Sambuc  * \param Comment a \c CXComment_VerbatimBlockLine AST node.
476*0a6a1f1dSLionel Sambuc  *
477*0a6a1f1dSLionel Sambuc  * \returns text contained in the AST node.
478*0a6a1f1dSLionel Sambuc  */
479*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE
480*0a6a1f1dSLionel Sambuc CXString clang_VerbatimBlockLineComment_getText(CXComment Comment);
481*0a6a1f1dSLionel Sambuc 
482*0a6a1f1dSLionel Sambuc /**
483*0a6a1f1dSLionel Sambuc  * \param Comment a \c CXComment_VerbatimLine AST node.
484*0a6a1f1dSLionel Sambuc  *
485*0a6a1f1dSLionel Sambuc  * \returns text contained in the AST node.
486*0a6a1f1dSLionel Sambuc  */
487*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE CXString clang_VerbatimLineComment_getText(CXComment Comment);
488*0a6a1f1dSLionel Sambuc 
489*0a6a1f1dSLionel Sambuc /**
490*0a6a1f1dSLionel Sambuc  * \brief Convert an HTML tag AST node to string.
491*0a6a1f1dSLionel Sambuc  *
492*0a6a1f1dSLionel Sambuc  * \param Comment a \c CXComment_HTMLStartTag or \c CXComment_HTMLEndTag AST
493*0a6a1f1dSLionel Sambuc  * node.
494*0a6a1f1dSLionel Sambuc  *
495*0a6a1f1dSLionel Sambuc  * \returns string containing an HTML tag.
496*0a6a1f1dSLionel Sambuc  */
497*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE CXString clang_HTMLTagComment_getAsString(CXComment Comment);
498*0a6a1f1dSLionel Sambuc 
499*0a6a1f1dSLionel Sambuc /**
500*0a6a1f1dSLionel Sambuc  * \brief Convert a given full parsed comment to an HTML fragment.
501*0a6a1f1dSLionel Sambuc  *
502*0a6a1f1dSLionel Sambuc  * Specific details of HTML layout are subject to change.  Don't try to parse
503*0a6a1f1dSLionel Sambuc  * this HTML back into an AST, use other APIs instead.
504*0a6a1f1dSLionel Sambuc  *
505*0a6a1f1dSLionel Sambuc  * Currently the following CSS classes are used:
506*0a6a1f1dSLionel Sambuc  * \li "para-brief" for \\brief paragraph and equivalent commands;
507*0a6a1f1dSLionel Sambuc  * \li "para-returns" for \\returns paragraph and equivalent commands;
508*0a6a1f1dSLionel Sambuc  * \li "word-returns" for the "Returns" word in \\returns paragraph.
509*0a6a1f1dSLionel Sambuc  *
510*0a6a1f1dSLionel Sambuc  * Function argument documentation is rendered as a \<dl\> list with arguments
511*0a6a1f1dSLionel Sambuc  * sorted in function prototype order.  CSS classes used:
512*0a6a1f1dSLionel Sambuc  * \li "param-name-index-NUMBER" for parameter name (\<dt\>);
513*0a6a1f1dSLionel Sambuc  * \li "param-descr-index-NUMBER" for parameter description (\<dd\>);
514*0a6a1f1dSLionel Sambuc  * \li "param-name-index-invalid" and "param-descr-index-invalid" are used if
515*0a6a1f1dSLionel Sambuc  * parameter index is invalid.
516*0a6a1f1dSLionel Sambuc  *
517*0a6a1f1dSLionel Sambuc  * Template parameter documentation is rendered as a \<dl\> list with
518*0a6a1f1dSLionel Sambuc  * parameters sorted in template parameter list order.  CSS classes used:
519*0a6a1f1dSLionel Sambuc  * \li "tparam-name-index-NUMBER" for parameter name (\<dt\>);
520*0a6a1f1dSLionel Sambuc  * \li "tparam-descr-index-NUMBER" for parameter description (\<dd\>);
521*0a6a1f1dSLionel Sambuc  * \li "tparam-name-index-other" and "tparam-descr-index-other" are used for
522*0a6a1f1dSLionel Sambuc  * names inside template template parameters;
523*0a6a1f1dSLionel Sambuc  * \li "tparam-name-index-invalid" and "tparam-descr-index-invalid" are used if
524*0a6a1f1dSLionel Sambuc  * parameter position is invalid.
525*0a6a1f1dSLionel Sambuc  *
526*0a6a1f1dSLionel Sambuc  * \param Comment a \c CXComment_FullComment AST node.
527*0a6a1f1dSLionel Sambuc  *
528*0a6a1f1dSLionel Sambuc  * \returns string containing an HTML fragment.
529*0a6a1f1dSLionel Sambuc  */
530*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE CXString clang_FullComment_getAsHTML(CXComment Comment);
531*0a6a1f1dSLionel Sambuc 
532*0a6a1f1dSLionel Sambuc /**
533*0a6a1f1dSLionel Sambuc  * \brief Convert a given full parsed comment to an XML document.
534*0a6a1f1dSLionel Sambuc  *
535*0a6a1f1dSLionel Sambuc  * A Relax NG schema for the XML can be found in comment-xml-schema.rng file
536*0a6a1f1dSLionel Sambuc  * inside clang source tree.
537*0a6a1f1dSLionel Sambuc  *
538*0a6a1f1dSLionel Sambuc  * \param Comment a \c CXComment_FullComment AST node.
539*0a6a1f1dSLionel Sambuc  *
540*0a6a1f1dSLionel Sambuc  * \returns string containing an XML document.
541*0a6a1f1dSLionel Sambuc  */
542*0a6a1f1dSLionel Sambuc CINDEX_LINKAGE CXString clang_FullComment_getAsXML(CXComment Comment);
543*0a6a1f1dSLionel Sambuc 
544*0a6a1f1dSLionel Sambuc /**
545*0a6a1f1dSLionel Sambuc  * @}
546*0a6a1f1dSLionel Sambuc  */
547*0a6a1f1dSLionel Sambuc 
548*0a6a1f1dSLionel Sambuc 
549*0a6a1f1dSLionel Sambuc #ifdef __cplusplus
550*0a6a1f1dSLionel Sambuc }
551*0a6a1f1dSLionel Sambuc #endif
552*0a6a1f1dSLionel Sambuc 
553*0a6a1f1dSLionel Sambuc #endif /* CLANG_C_DOCUMENTATION_H */
554*0a6a1f1dSLionel Sambuc 
555