/************************************************************************** * NAME: send_stack_variables * * ARGS: s : the connected socket * * where: level in the stack where the current feature is located * *------------------------------------------------------------------------* * Dump the arguments and the locals of the 'where-th' feature down the * * stack. where=1 means dumping the locals of the feature located on top * * of the stack * **************************************************************************/ rt_public void send_stack_variables(EIF_PSTREAM s, int where) { /* This is the main routine. It send a whole stack dump to the remote * process through the connected socket and via XDR. The end of the dump * is indicated by a positive acknowledgment. */ struct dump *dp; /* Pointer to static data where dump is */ uint32 start; /* start of the frozen operational stack */ save_stacks(); /* preserve stacks */ /* go to the specified level */ start = go_ith_stack_level(where); /* then dump the variables */ if (start != EIF_NO_ITEM) { dp = get_next_variable (start); while (dp) { /* While still some data to send */ if (dp != (struct dump *) EIF_IGNORE) { send_dump(s, dp); } dp = get_next_variable (start); } } restore_stacks(); /* restore stacks */ send_ack(s, AK_OK); /* End of list -- you got everything */ }
/************************************************************************** * NAME: send_stack * * ARGS: s : the connected socket * *------------------------------------------------------------------------* * This is the main routine. It send at most elem_nb elements to the remote* * process through the connected socket and via XDR. The end of the dump * * is indicated by a positive acknowledgment. * **************************************************************************/ rt_public void send_stack(EIF_PSTREAM s, uint32 elem_nb) { struct dump *dp; /* Pointer to static data where dump is */ uint32 sent = 0; save_stacks(); /* Initialize processing */ dp = get_next_execution_vector(); while (dp && (sent < elem_nb)) { /* While still some data to send */ if (dp != (struct dump *) EIF_IGNORE) { send_dump(s, dp); sent++; } dp = get_next_execution_vector(); } restore_stacks(); send_ack(s, AK_OK); /* End of list -- you got everything */ }
int _tmain(int argc, wchar_t* argv[]) { if (argc > 1) { if (wcsicmp(argv[1], _T("restart"))==0 && argc > 2) { return restart(argv[2]); } else if (wcsicmp(argv[1], _T("archive"))==0 && argc > 6) { return archive_dump(argv[2], argv[3], argv[4], argv[5], argv[6]); } else if (wcsicmp(argv[1], _T("send"))==0 && argc > 6) { return send_dump(argv[2], argv[3], argv[4], argv[5], argv[6]); } else if (wcsicmp(argv[1], _T("send-gui"))==0 && argc > 6) { return send_dump_ui(argv[2], argv[3], argv[4], argv[5], argv[6]); } } std::wcout << _T("Usage: ") << argv[0] << _T("archive|send|send-gui [options]") << std::endl; std::wcout << _T(" archive <file> <archive path>") << std::endl; std::wcout << _T(" send <file> <product> <version> <date>") << std::endl; std::wcout << _T(" send-gui <file> <product> <version> <date>") << std::endl; std::wcout << _T(" restart <service>") << std::endl; return -1; }
int main(int argc, char* argv[]) { if (argc > 1) { std::string command = argv[1]; if (command == "restart" && argc > 2) { return restart(argv[2]); } else if (command == "archive" && argc > 6) { return archive_dump(argv[2], argv[3], argv[4], argv[5], argv[6]); } else if (command == "send" && argc > 6) { return send_dump(argv[2], argv[3], argv[4], argv[5], argv[6]); } else if (command == "send-gui" && argc > 6) { return send_dump_ui(argv[2], argv[3], argv[4], argv[5], argv[6]); } } std::cout << "Usage: " << argv[0] << L"archive|send|send-gui [options]" << std::endl; std::cout << " archive <file> <archive path>" << std::endl; std::cout << " send <file> <product> <version> <date>" << std::endl; std::cout << " send-gui <file> <product> <version> <date>" << std::endl; std::cout << " restart <service>" << std::endl; return -1; }
int nscp_main(int argc, wchar_t* argv[]) { if (argc > 1) { std::string command = utf8::cvt<std::string>(argv[1]); if (command == "restart" && argc > 2) { return restart(argv[2]); } else if (command == "archive" && argc > 6) { return archive_dump(argv[2], argv[3], argv[4], argv[5], argv[6]); } else if (command == "send" && argc > 6) { return send_dump(argv[2], argv[3], argv[4], argv[5], argv[6]); } else if (command == "send-gui" && argc > 6) { return send_dump_ui(argv[2], argv[3], argv[4], argv[5], argv[6]); } } std::wcout << _T("Usage: ") << argv[0] << _T("archive|send|send-gui [options]") << std::endl; std::wcout << _T(" archive <file> <archive path>") << std::endl; std::wcout << _T(" send <file> <product> <version> <date>") << std::endl; std::wcout << _T(" send-gui <file> <product> <version> <date>") << std::endl; std::wcout << _T(" restart <service>") << std::endl; return -1; }