- Put everything in the C file.
- If you need a function visible outside, put it's _prototype_ in the .h file.
- If you want to have a variable visible outside, also make a extern declaration inside the .h file.
- If you want to have anything else visible to the outside, just move it to the .h file.
The reason I say that putting functions inside a .h file is a pain is because of the way the preprocessor works. It takes the contents of the included file and pastes it at the place of the include. So doing a function inside a .h file and using it inside multiple .c files will mean you have the same function multiple times and it will throw a linker error if the function is not static. At link time the linker will be confused because it will not know about witch of the functions you're talking about when you call it. So then you declare it static, but then you _actually_ have 2x functions inside your executable, that do the same thing.
This is even worse with variables declared static inside .h files since here you will think you're changing your variable, but you actually have separate variables inside each compiled file.
Of course, my observation is also based on taste. I like when I have everything inside one file, instead of spread over multiple files( of course, as long as this is reasonable). This program here might have had one single .c file and it would have been just file. I actually would have considered it easier to read, but as I said, it's a matter of taste at this point.