[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gomd-devel] <LIBGOMD>: "pure" C bindings (for libgomd) and an example o
From: |
Gian Paolo Ghilardi |
Subject: |
[gomd-devel] <LIBGOMD>: "pure" C bindings (for libgomd) and an example of use |
Date: |
Tue, 2 Sep 2003 13:14:23 +0200 |
Hi all.
I've started cleaning up libgomd.
Before playing with info-parsing, I've added bindings for "pure" C clients:
these functions are only wrappers to functions of libgomd C++ class (because
C++ string-handling is better and safer than "pure" C one).
So libgomd can be used by both C (via exported functions) and C++ (via
exported functions or an handy class) users. I've also added an example of
use in new contrib/c directory.
Checkout the notes below for more infos.
Byez.
<rejected>
<< CVS NOTES >>
### "PURE" C BINDINGS IN LIBGOMD ###
NOTE: from this release we provide _also_ standard "pure" C functions for
clients wanting to use the standard C.
- Check out new cbinding.h/cbindings.cpp files and libiface.h file for more
infos.
- Checkout the (new) "pure" C example included in "contrib/c" directory.
IN libiface.h
(+) added 6 entries for external "pure" C functions.
- extern "C" unsigned int openConn(char* remoteGomdIP, int port);
- extern "C" const char* closeConn();
- extern "C" const char* getInfo(const char* infoToRequest);
- extern "C" const char* getMultilineInfo(const char* infoToRequest,
const char* endMsg);
- extern "C" const char* getInfoAndCloseConn(const char* remoteGomdIP,
int port, const char* infoToRequest);
- extern "C" const char* getMultilineInfoAndCloseConn(const char*
remoteGomdIP, int port, const char* infoToRequest, const char* endMsg);
NOTE: please notice these functions have the same name of the functions of
libgomd class (used by C++ clients) => the only difference is the use of
standard C string (const char*) instead of the standard C++ string (STL
string).
So a user (wanting to use libgomd) now can choose between C approach and C++
one.
IN cbinding.h/cbindings.cpp
(+) here the exported "pure" C functions are defined => please notice they
are only wrappers to the functions of libgomd C++ class (because C++
string-handling mechanisms are safer than "pure" C ones).
IN libgomd.h/libgomd.cpp
(+) removed "pure" C functions (moved to new cbindings.h/cbindings.cpp
files).
IN Makefile
(+) added cbinding files to compilation line
### "PURE" C CLIENT EXAMPLE ###
NOTE: simple "pure" C client example. Uses "exported" C functions of libgomd
librray to get the infos.
IN cclient.cpp
(N) code based cppclient.cpp (removed the dynamic link => library is dynamic
but statically loaded)
IN Makefile
(+) first import
IN INFO
(+) first import
- [gomd-devel] <LIBGOMD>: "pure" C bindings (for libgomd) and an example of use,
Gian Paolo Ghilardi <=