If you were to declare TreeItemCountInternal
without designating it as static:
bool TreeItemCountInternal(const Tree *ptree);
then you could put the forward declaration in the header file, and #include
that header in you .c
files. You might consider doing that if your project spans multiple .c
files and you need to share a function across them. The static
declaration, when applied to a function, limits it's scope to the translation unit in which it was declared (see this answer for an excellent explanation of what that means from a practical perspective).
Remember that one of the first steps your compiler takes when building a program is to take all of your #include
directives, find the file in quesetion, and paste it's contents in place of the #include
statement.
There is no dogmatic rule that says you should always put the declaration in the header (although it's often good practice), and the act of doing so-- in and of itself-- does not confer any particular benefit or status (but it could make a lot of difference, depending on how the rest of the program is structured).