Does anyone know of a C library that implements the same functionality as the standard wire library or a solution to this problem? Thanks!
C++ is subset of C so if you know C then your code will work in C++ files.
If you use the Arduino IDE and its libraries it is pretty much impossible not to use C++
Basically, you have two choices.
Put your C code in C++ files (rename them .cpp) so it can call the C++ functions,
or write C++ wrappers that use C linkage for the C++ routines you want to call.
Personally, i'd just move the C code into C++ files and be done with it, but you could
write wrappers for all the C++ routines that can be called from C.
You will have to put all the wrappers in a C++ file then put your wrappers
in that file.
void WirebeginTransmission(uint8_t addr)
This creates a C callable function called WirebeginTransmission()
You would have to create a wrapper C linkage function for every C++ function you
want to call. For the Wire library, many of the functions are overloaded so you will have come
up with unique names for each of overloaded functions.
It could be done, but I'd think it would be a lot easier to just move the C code
to a C++ file so that it could call the C++ routines directly.