This doesn't directly answers your question but I would suggest defining a geter function in provider.h:
const int *getConfigProvider(void);
and in provider.c
const int *getConfigProvider(void){ static const int config_provider = 1; return &config_provider;}
This somehow encapsulates the implementation to the consumer and achieves what you are looking for eventually.
Note:
In case of int
the return type of getConfigProvider
may be just int
. In case of a more complex type (struct), it is better to use const
pointer to it.