To access a function written in C from C++, you just have to put extern "C" around the function. That's it basically.
Code:
extern "C" void function() {}
You can use extern "C" with curly braces to enclose a number of functions.
If the code was written to support C++, it might have something like this in the header file(s):
Code:
/* at the beginning of the file */
#ifdef __cplusplus
extern "C" {
#endif
/* ... the function declarations ... */
#ifdef __cplusplus
}
#endif
If not, you can add that yourself, or do it in your C++ code where you include the header file.
Code:
extern "C" {
#include "header.h"
}
You should then be able to include the .c files in your project and compile them normally. (A C++ compiler will likely be able to compile the C code.)