File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,23 @@ def write_api(api, out):
150150 writer .writeln (' void *user_data);' )
151151 writer .writeln ()
152152
153+ # add functions:
154+ for fun in type_ .iter_functions ():
155+ doc = fun .get_doc ()
156+ if doc :
157+ writer .write_doc_comment (doc )
158+ writer .writeln ('GCC_PUBLIC_API(%s)' % fun .get_c_return_type ())
159+ paramstrs = ['%s %s' % (type_ .get_c_name (),
160+ type_ .get_varname ())]
161+ for param in fun .iter_params ():
162+ paramstrs .append ('%s %s' % (param .get_c_type (),
163+ param .get_xml_name ()))
164+ writer .writeln ('%s_%s(%s);'
165+ % (type_ .get_c_prefix (),
166+ fun .get_c_name (),
167+ ', ' .join (paramstrs )))
168+ writer .writeln ()
169+
153170 # add upcasts
154171 for base in type_ .get_bases ():
155172 writer .writeln ('GCC_PUBLIC_API(%s)'
Original file line number Diff line number Diff line change @@ -136,6 +136,10 @@ def iter_iters(self):
136136 for node in self .node .iter ('iterator' ):
137137 yield Iterator (self .api , node )
138138
139+ def iter_functions (self ):
140+ for node in self .node .findall ('function' ):
141+ yield Function (self , node )
142+
139143class Attribute (XmlWrapper , HasDocsMixin ):
140144 def get_xml_name (self ):
141145 return self .node .get ('name' )
You can’t perform that action at this time.
0 commit comments