automaticaly generating header files

Posted on 2002-06-26
Last Modified: 2010-04-22
Does any one know how I can automaticaly generate header files with prototypes for all functions with external linkage (e.g. not static). I am using gcc.

Also it would be a bonus it I could generate the headers for c++ files as well.
Question by:bearware
  • 2

Expert Comment

ID: 7111363
I have not tried this, but:

I'm sure you could use sed and awk to do it too.

Author Comment

ID: 7112965
I tryed to write a regular expression to find all function definitions once before, It was mind bogalingly hard and only found 90%. If it worked I would use it as you suggested. If you know where I can get regexps for the job that work, ill give it a go.

Accepted Solution

garboua earned 50 total points
ID: 7119142
there is a program out there called cextract, which will do exactly what you want.  it is not easy to find so here is a shortcut.

Author Comment

ID: 7166992
I tryed it it worked.
Had to grep its output a bit though.

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
script 11 138
Need bundled ATFTP tool for use with ESXi 4 85
How to ssh into my virtual box linux machine 4 142
Problem to start Neon 20 89
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: (…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now