You should have a public header, mylib.h
, that only contains the definitions a user of the library needs to know.
You then have a private header, mylib-internal.h
, that is used within your project. You should not try to keep the two "in sync", but rather have mylib-internal.h
contain #include "mylib.h"
.
You should also name all your interface functions like mylib_initialize()
etc., and ensure that all private, internal functions are either declared static
, or else named _mylib_internal_whatever()
, so that users don't get namespace clashes with other libraries.