/* change the filename extension. */ void forceExtension( struct pgpfileBones *filebPtr, char *filename, char *extension ) { dropExtension( filebPtr, filename ); /* out with the old */ truncateName( filebPtr, filename, strlen(extension) ); strcat(filename, extension); /* in with the new */ } /* force_extension */
int main( int argc, char* argv[]) { if(argc < 2) { return usage(); } std::cerr << "Converting " << argv[1] << " ..." << std::endl; try { Matlab2EcslDP matlab2EcslDP( argv[ 1], (argc == 3 ? argv[ 2] : dropExtension( argv[ 1])+ ".mga")); std::cerr << "Calling matlab2EcslDP()" << std::endl; matlab2EcslDP(); } catch(const udm_exception &e) { std::cerr << "Exception: " << e.what() << std::endl; return 1; } std::cerr << "Done." << std::endl; return 0; }