What is the meaning of the following code ? What is it doing?
#ifdef __cplusplus
extern "C" {
#endif
...some code...
#ifdef __cplusplus
}
#endif
It is a linkage convention used for C++, not C. Try the C++ forum (or better yet, a good C++ reference) for a more detailed explanation.
C++ compiler comes sometimes with the library compiled with c compiler. The header files of such functions have above lines to indicate the c++ compiler that these functions were originaly compiled under c.