Hello,
I am writing a program in C++ that uses also C sources. As this program is pretty big project and I work on it with different people I would like to hide thousands of internal functions that are defined in C source files and leave to other programmers only interfaces or wrappers written by me to those functions. Making long story short, the example defining this is given below, and a quiestion is: how to make g() and h() functions invisible to Cpp programs but to leave them visible to other C sources.
Cheader.h: defines one "usable" function for which I write a c++ wrapper
int F(int x);
Csource.c:
#include "Cheader.h"
/* helper functions */
int h(int x)
{
return x*x;
}
int g(int x)
{
return -x/x;
}
/*exported function*/
int F(int x)
{
return h(x)+g(x);
}
My Cpp wrapper:
header:
extern "C"{
#include "Cheader.h"
}
int Fpp(int x)
{
return F(x);
}