Let's suppose I am making a library in C, that contains functions api1(), api2(), and api3(). However, those functions are very complicated, so I need other functions to make them. Let's call those functions subfunc1(), subfunc2(), and subfunc3(). What I want is that the users of this library can only use api1,2,3() and not subfunc1,2,3(). I can't just declare them static, because I want to place api1,2,3() into api.c file, and subfunc1,2,3() into subfunc.c file.
So my questions are:
- Is there any way to achieve this, besides including subfunc.c file into api.c file and declare subfunc1,2,3() as static?
- If including subfunc.c file into api.c file is the only way to achieve this, is it recommended? Is it widely used in practice? If not, why?