diff options
Diffstat (limited to 'tools/buildgen')
-rwxr-xr-x | tools/buildgen/plugins/list_api.py (renamed from tools/buildgen/plugins/c_api.py) | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/buildgen/plugins/c_api.py b/tools/buildgen/plugins/list_api.py index bb7bf37600..3a8eec113c 100755 --- a/tools/buildgen/plugins/c_api.py +++ b/tools/buildgen/plugins/list_api.py @@ -53,12 +53,14 @@ def list_c_apis(filenames): type_end = max(last_space, last_star) return_type = type_and_name[0:type_end+1].strip() name = type_and_name[type_end+1:].strip() - yield {'return_type': return_type, 'name': name, 'arguments': args} + yield {'return_type': return_type, 'name': name, 'arguments': args, 'header': filename} def mako_plugin(dictionary): apis = [] - # TODO(ctiller): find grpc library, iterate headers, append apis to dictionary + for lib in dictionary['libs']: + if lib['name'] == 'grpc': + apis.extend(list_c_apis(lib['public_headers'])) dictionary['c_apis'] = apis @@ -70,7 +72,5 @@ def headers_under(directory): if __name__ == '__main__': - apis = [{'name': api.name, 'return_type': api.return_type, 'args': api.arguments} - for api in list_c_apis(headers_under('include/grpc'))] - print yaml.dump(apis) + print yaml.dump([api for api in list_c_apis(headers_under('include/grpc'))]) |