Demonstrates binary input stream access to an OPC container.
#include <stdio.h>
#ifdef WIN32
#include <io.h>
#include <fcntl.h>
#endif
#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
#ifdef WIN32
_setmode( _fileno( stdout ), _O_BINARY );
#endif
}
} else {
fprintf(stderr, "ERROR: part \"%s\" could not be opened for reading.\n", argv[2]);
}
} else {
fprintf(stderr, "ERROR: part \"%s\" could not be opened in \"%s\".\n", argv[2], argv[1]);
}
} else {
fprintf(stderr, "ERROR: file \"%s\" could not be opened.\n", argv[1]);
}
} else if (2==argc) {
fprintf(stderr, "ERROR: initialization of libopc failed.\n");
} else {
fprintf(stderr, "opc_extract FILENAME PART\n\n");
fprintf(stderr, "Sample: opc_extract test.docx word/document.xml\n");
}
#ifdef WIN32
#endif
return 0;
}