libopc
opc_helloworld.c

Demonstrates the the use of opcInitLibrary and opcFreeLibrary.

/*
Simple demonstration program of how to initialize the library.
Ussage:
opc_helloworld
Sample:
opc_helloworld
*/
#include <opc/opc.h>
#include <stdio.h>
#ifdef WIN32
#include <crtdbg.h>
#endif
int main( int argc, const char* argv[] )
{
#ifdef WIN32
_CrtSetDbgFlag (_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
#endif
if (OPC_ERROR_NONE==opcInitLibrary()) {
printf("libopc as well as zlib and libxml2 are ready to use.\n");
#ifdef WIN32
OPC_ASSERT(!_CrtDumpMemoryLeaks());
#endif
return 0;
} else {
printf("error initializing libopc.\n ");
return 1;
}
}