summaryrefslogtreecommitdiff
path: root/giscanner/doctemplates/C/function.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'giscanner/doctemplates/C/function.tmpl')
-rw-r--r--giscanner/doctemplates/C/function.tmpl75
1 files changed, 75 insertions, 0 deletions
diff --git a/giscanner/doctemplates/C/function.tmpl b/giscanner/doctemplates/C/function.tmpl
new file mode 100644
index 00000000..01c653b9
--- /dev/null
+++ b/giscanner/doctemplates/C/function.tmpl
@@ -0,0 +1,75 @@
+<%inherit file="/base.tmpl"/>
+<%block name="info">
+% if node.parent is not None:
+ <link type="guide" xref="${namespace.name}.${node.parent.name}" group="${page_style}"/>
+% else:
+ <link type="guide" xref="index" group="${page_style}"/>
+% endif
+ <api:function>
+ <api:returns>
+ <api:type>${formatter.format_type(node.retval.type) | x}</api:type>
+ </api:returns>
+ <api:name>${node.symbol}</api:name>
+% if node.is_method:
+ <api:arg>
+ <api:type>${node.parent.ctype} *</api:type>
+ <api:name>self</api:name>
+ </api:arg>
+% endif
+% for arg in node.parameters:
+% if arg.type.ctype == '<varargs>':
+ <api:varargs/>
+% else:
+ <api:arg>
+ <api:type>${formatter.format_type(arg.type) | x}</api:type>
+ <api:name>${arg.argname}</api:name>
+ </api:arg>
+% endif
+% endfor
+ </api:function>
+</%block>
+<%block name="synopsis">
+<synopsis><code mime="text/x-csrc">
+${node.retval.type.ctype} ${node.symbol} (\
+% if node.is_method:
+${node.parent.ctype} *self\
+%endif
+% if len(node.parameters) == 0:
+% if not node.is_method:
+void\
+%endif
+);
+% elif node.is_method:
+,
+% endif
+% for arg, ix in zip(node.parameters, range(len(node.parameters))):
+% if ix != 0:
+${' ' * (len(formatter.format_type(node.retval.type)) + len(node.symbol) + 3)}\
+% endif
+% if arg.type.ctype == '<varargs>':
+...\
+% else:
+${formatter.format_type(arg.type) | x} ${arg.argname}\
+% endif
+% if ix == len(node.parameters) - 1:
+);
+% else:
+,
+%endif
+% endfor
+</code></synopsis>
+</%block>
+<%block name="details">
+% if node.parameters or node.retval:
+<dl>
+% for arg, ix in zip(node.parameters, range(len(node.parameters))):
+<dt><p>${arg.argname} :</p></dt>
+<dd>${formatter.format(node, arg.doc)}</dd>
+% endfor
+% if node.retval:
+<dt><p>Returns :</p></dt>
+<dd>${formatter.format(node, node.retval.doc)}</dd>
+% endif
+</dl>
+% endif
+</%block>