提取C / C ++函数原型 [英] Extracting C / C++ function prototypes

查看:83
本文介绍了提取C / C ++函数原型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想这样做:

extract_prototypes file1.c file2.cpp file3.c

和拥有的任何脚本/程序打印函数原型的一个很好的列表在给定的C / C ++文件中定义的所有功能。它必须很好地处理了多行的声明。

and have whatever script/program print a nice list of function prototypes for all functions defined in the given C / C++ files. It must handle multi-line declarations nicely.

是否有一个程序,可以做这个工作?越简单越好。

编辑:尝试编译两个C程序,奖励积分使用的东西后{Perl,Python和红宝石}

after trying to compile two C programs, bonus points for something that uses {perl, python, ruby}.

推荐答案

工具 cproto 你想要做什么并允许调整输出到您的要求。

The tool cproto does what you want and allows to tune the output to your requirements.

注意:此工具还仅适用于C文件

Note: This tool also only works for C files.

这篇关于提取C / C ++函数原型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆