int main() { // library initialisation g_lib = new vpu::AssemblerLib("libASM.dll"); if (g_lib->isOk()) { // run examples example00(); example01(); example02(); example03(); example04(); example05(); example06(); example07(); example08(); example09(); example10(); example11(); example12(); } // free library delete g_lib; return 0; }
int main(int argc, char **argv) { int num; int i; char retval = 0; u_error_t *error = NULL; u_option_entry_t opt[] = { {"debug", 'd', U_OPTION_ARG_INT, &debug_level, "Set the verbosity of debugging output.", "1-6"} }; u_option_context_t *opt_ctx; opt_ctx = u_option_context_new(""); u_option_context_set_ignore_unknown_options(opt_ctx, FALSE); u_option_context_add_main_entries(opt_ctx, opt, "wsmid_identify"); retval = u_option_context_parse(opt_ctx, &argc, &argv, &error); u_option_context_free(opt_ctx); if (error) { if (error->message) printf("%s\n", error->message); u_error_free(error); return 1; } u_error_free(error); if (debug_level) { initialize_logging(); wsman_debug_set_level(debug_level); } if (argc == 1) { // execute all example1(); example2(); example3(); example4(); example5(); example6(); example7(); example8(); example9(); example10(); example11(); example12(); example13(); example14(); return 0; } for (i = 1; i < argc; i++) { num = atoi(argv[i]); switch (num) { case 1: example1(); break; case 2: example2(); break; case 3: example3(); break; case 4: example4(); break; case 5: example5(); break; case 6: example6(); break; case 7: example7(); break; case 8: example8(); break; case 9: example9(); break; case 10: example10(); break; case 11: example11(); break; case 12: example12(); break; case 13: example13(); break; case 14: example14(); break; default: printf("\n No example%d()\n", num); break; } } return 0; }