--- /dev/null
+.. highlightlang:: c
+
+.. $composite.macro_reference($composite.name):
+
+
+
+#if $composite.short_description is not None and len($composite.short_description)
+ #set $title = $composite.name + ' - ' + $composite.short_description
+#else
+ #set $title = $composite.name
+#end if
+$title
+#echo ''.join(['=']*len($title)) #
+
+
+
+:krb5doxy:`Doxygen reference to $composite.name <$composite.name>`
+
+..
+.. data:: $composite.name
+..
+
+#echo ''.join(['=']*len($composite.name)) + '== ======================' #
+$composite.name $composite.initializer
+#echo ''.join(['=']*len($composite.name)) + '== ======================' #
+
+
+$composite.long_description
+
+
+#if $composite.Id is not None
+
+
+#end if
+
+
+Feedback
+----------
+
+#set $msg_subject = 'Documentation___' + $composite.name
+
+Please, provide your feedback on this document at krb5-bugs@mit.edu?subject=$msg_subject
+
self.definition = argkw.get('definition')
self.name = argkw.get('name')
self.Id = argkw.get('Id')
+ self.initializer = argkw.get('initializer')
self.active = argkw.get('active', False)
self.version = argkw.get('version')
self.return_type = argkw.get('return_type')
return result
+ def macro_reference(self, name):
+ result = re.sub(r'_', '-', name)
+ result = '_%s-data' % result
+
+ return result
+
class Parameter(object):
def __init__(self, **argkw):
self.seqno = argkw.get('seqno')
this software for any purpose. It is provided "as is" without express
or implied warranty.
'''
+
import sys
import os
import re
data = self._process_typedef_node(node)
elif kind == 'variable':
data = self._process_variable_node(node)
+ elif kind == 'define':
+ data = self._process_define_node(node)
result.append(data)
print "\nnumber of types processed ==> " , len(result)
return result
'definition': t_definition,
'name': t_name,
'Id': t_Id,
+ 'initializer': '',
'type': t_type[1],
'short_description': t_brief,
'long_description': t_detailed,
v_definition = re.sub('\*', '\\*', v_definition)
variable_descr = {'category': 'variable',
- 'definition': v_definition,
+ 'definition': v_definition,
'name': v_name,
'Id': v_Id,
+ 'initializer': '',
'type': v_type[1],
'short_description': v_brief,
- 'long_description': detailed_description
+ 'long_description': detailed_description,
+ 'attributes': list()
}
return variable_descr
+ def _process_define_node(self, node):
+ d_name = node.xpath('./name/text()')[0]
+ print d_name
+ d_initializer = ''
+ d_type = ''
+ if len(node.xpath('./initializer')) > 0:
+ len_ref = len(node.xpath('./initializer/ref'))
+ if len(node.xpath('./initializer/ref')) > 0:
+ d_type = self._process_type_node(node.xpath("./initializer/ref")[0])
+ if len(d_type) > 0:
+ len_text = len(node.xpath('./initializer/text()'))
+ if len(node.xpath('./initializer/text()')[0]) > 0:
+ d_initializer = node.xpath('./initializer/text()')[0] + d_type[1]
+ if len_text > 1:
+ if node.xpath('./initializer/text()')[1] is not None:
+ d_initializer = d_initializer + node.xpath('./initializer/text()')[1]
+ else:
+ d_initializer = node.xpath('./initializer/text()')[0]
+ d_Id = node.attrib['id']
+ brief_node = node.xpath('./briefdescription')[0]
+ d_brief = self._get_brief_description(brief_node)
+ details_node = node.xpath('./detaileddescription')[0]
+ detailed_description = self._get_detailed_description(details_node)
+
+ define_descr = {'category': 'composite',
+ 'definition': '',
+ 'name': d_name,
+ 'Id': d_Id,
+ 'initializer': d_initializer,
+ 'type': '',
+ 'short_description': d_brief,
+ 'long_description': detailed_description,
+ 'attributes': list()
+ }
+
+ return define_descr
+
def _get_brief_description(self, node):
result = list()
super(DoxyTypesTest,self).__init__(xmlpath)
def run_tests(self):
+ print "Process typedef's"
self.test_process_typedef_node()
+ print "Process define's"
+ self.test_process_define_node()
- # TESTS
-
def test_run(self):
filename = 'krb5_8hin.xml'
self.run(filename)
-
def test_process_variable_node(self):
filename = 'struct__krb5__octet__data.xml'
obj = DocModel(**t)
self.save(obj, self.templates, target_dir)
- def test_run_compound(self):
- filename = 'struct__krb5__context.xml'
- result = self.run_compound(filename)
-
+ def test_process_define_node(self):
+ # run parser for define's
+ filename = 'krb5_8hin.xml'
+ result = self.run(filename, include=['define'])
+ target_dir = '%s/macros' % (self.target_dir)
+ if not os.path.exists(target_dir):
+ os.makedirs(target_dir, 0755)
+ for t in result:
+ obj = DocModel(**t)
+ tmpl = {'composite': 'define_document.tmpl'}
+ self.save(obj, tmpl, target_dir)
+
if __name__ == '__main__':
tester = DoxyTypesTest( xml_inpath, rst_outpath)