Online c function prototype header generator tool

Really simple concept: scan an input c file, find the functions that need prototype declarations, and then output the prototype declarations for you to copy and paste into a header or at the top of your file.

I use this simple tool when quickly prototyping microcontroller c code. Just write your code without worrying about declaring function prototypes, then copy and paste the code into this tool and it will create the declarations for all functions that have not been declared yet. No rocket science going on, just saves you some time.

You can also use this tool to merge additions to your header file if you have a number of functions that you forgot to declare. Just paste the header and source files together in here and let the script spit out the missing declarations to add to the header.

Keep in mind that this tool is intended for quick prototyping. If you are making something complicated, best plan out your headers. Don't blame me for helping you be lazy :)

pre load brushes

not empty

not empty

NOTE! this script is a proof of concept hacked together with a bunch of large regex patterns so be realistic with what you expect from it! Performance could be drastically improved if javascript had possessive quantifiers (sad face).

OPTIONS:
Sort by:
then by:
then by:
show logobserve strings/comments? Better detection. SLOW! Only use with firefox.
include guard:
append:
wtf?

Related

Comments

Hi Adam,
I just used your function prototype tool, and it saved me a ton of time!!. Thank you for sharing. If you are looking for suggestions, I have one. My C project has about 20 source files, so I had to cut/paste 20 times. It would unbelievably great if, instead of using the source as input, a list of C filenames could be used as input. Then your script could upload the files create prototypes for the entire project at once. Just a suggestion. Thanks again for your effort in developing this. Tony

I'm hesitant to upload files because I don't want to handle people's code or have them question the security of it. This current generator doesn't send your code anywhere. All the processing is done right in your browser with no transmission anywhere.

That said, I am slowing working away on an offline tool that we can use to take care of things like this. It will be like a code assistant. Generate prototypes, create "toString" methods for enums, create validators/iterators for enums, all the monotonous things that are simple but time consuming and error prone to maintain.

The tool will also be written in Typescript (a form of Javascript) to make customization and editing easier.

Hey, thank you so much for your tool! I think you don't really have to upload it to your server just into the browsers memory using the javscript filereader api. The code would stay on the client machine and you could either generate the h files and print the extracted functions or trigger a download (to avoid pasting of 20 .h files)