Best Practice: Where to store static function declarations

c, header

Solution

Put the declaration of your static function inside the .c source file, in which it is defined and used. No other module will use it, so no other module needs to include the declaration, so there is no need to have it in a header file.

Problem

I was searching for a while and couldn't find any hints. I am wondering right now: what is a common way of dealing with static function declarations in C? Because static functions aren't accessible from any other module than that which defines the function. I am not sure where to declare it. My thoughts so far reached the following possibilities, where I could declare a static function: - Put them in the public header, that acts as an interface to that module. - Put them inside the .c source file, in which it is used. - Put them in a separate header file, which is only used by that specific module. Are there any suggestions on that out there?

Original source