static int InitNettcl2d(Tcl_Interp* const interp) { initCommands(interp); if (TCL_ERROR == ::Tcl_Init(interp)) { return TCL_ERROR; } return TCL_OK; }
/** * Start the dim server. * * If the commands have not yet been initialized, call initCommands. */ void NA62DimServer::start(){ //Check if the commands have already been initialized. If not initialize them. if(!fDimCommand || !fDimFileContent || !fDimRequestConfig) initCommands(fDimCommand, fDimFileContent, fDimRequestConfig); //Start the dim server with fDimServerName DimServer::start(fDimServerName.c_str()); println(fDimServerName + " is starting."); fIsStarted = true; }
void DefaultGdbServerProviderConfigWidget::setFromProvider() { const auto p = static_cast<DefaultGdbServerProvider *>(provider()); Q_ASSERT(p); QSignalBlocker blocker(this); m_hostWidget->setHost(p->m_host); m_hostWidget->setPort(p->m_port); m_initCommandsTextEdit->setPlainText(p->initCommands()); m_resetCommandsTextEdit->setPlainText(p->resetCommands()); }
int main(int argc, char** argv) { initCommands(); addCommand("newkey", &vault_newkey); addCommand("pubkey", &vault_pubkey); addCommand("addr", &vault_addr); addCommand("newwallet", &vault_newwallet); addCommand("importkeys", &vault_importkeys); addCommand("dumpkeys", &vault_dumpkeys); addCommand("walletkey", &vault_walletkey); addCommand("walletsign", &vault_walletsign); return startInterpreter(argc, argv); }
void OpenOcdGdbServerProviderConfigWidget::setFromProvider() { const auto p = static_cast<OpenOcdGdbServerProvider *>(provider()); Q_ASSERT(p); QSignalBlocker blocker(this); startupModeChanged(); m_hostWidget->setHost(p->m_host); m_hostWidget->setPort(p->m_port); m_executableFileChooser->setFileName(Utils::FileName::fromString(p->m_executableFile)); m_rootScriptsDirChooser->setFileName(Utils::FileName::fromString(p->m_rootScriptsDir)); m_configurationFileChooser->setFileName(Utils::FileName::fromString(p->m_configurationFile)); m_additionalArgumentsLineEdit->setText(p->m_additionalArguments); m_initCommandsTextEdit->setPlainText(p->initCommands()); m_resetCommandsTextEdit->setPlainText(p->resetCommands()); }
NetworkDB::NetworkDB(const std::string &path) : SQLiteDataBase(path), myInitialized(false) { initCommands(); }
namespace Impl { StringVector & initCommands(); String CMD_STEGANIFY = "steganify"; String COMMANDS[] = {CMD_STEGANIFY}; static const String & STR_MODULE_ID ="STEGANIFYER-"; static const StringVector & LST_COMMANDS = initCommands(); ///------------------------------------------------------------------------------------------------- /// @fn StringVector & initCommands() /// /// @brief Initializes the commands. /// /// @author Yacine Haoues /// @date 1/18/2018 /// /// @return A reference to a StringVector. ///------------------------------------------------------------------------------------------------- StringVector & initCommands() { StringVector * cmds = new StringVector(); for( unsigned int a = 0; a < sizeof(COMMANDS)/sizeof(COMMANDS[0]); a = a + 1 ) cmds->push_back(COMMANDS[a]); return *cmds; } ///------------------------------------------------------------------------------------------------- /// @fn Steganifyer::Steganifyer() /// /// @brief Default constructor. /// /// @author Yacine Haoues /// @date 1/18/2018 ///------------------------------------------------------------------------------------------------- Steganifyer::Steganifyer() { } ///------------------------------------------------------------------------------------------------- /// @fn Steganifyer::~Steganifyer() /// /// @brief Destructor. /// /// @author Yacine Haoues /// @date 1/18/2018 ///------------------------------------------------------------------------------------------------- Steganifyer::~Steganifyer() { } ///------------------------------------------------------------------------------------------------- /// @fn const String & Steganifyer::getID() const /// /// @brief Gets the identifier. /// /// @author Yacine Haoues /// @date 1/18/2018 /// /// @return The identifier. ///------------------------------------------------------------------------------------------------- const String & Steganifyer::getID() const { return STR_MODULE_ID; } ///------------------------------------------------------------------------------------------------- /// @fn const StringVector& Steganifyer::getCommands() const /// /// @brief Gets the commands. /// /// @author Yacine Haoues /// @date 1/18/2018 /// /// @return The commands. ///------------------------------------------------------------------------------------------------- const StringVector& Steganifyer::getCommands() const { return LST_COMMANDS; } // call number bool called = false; ///------------------------------------------------------------------------------------------------- /// @fn void Steganifyer::handle(const API::Command *const cmd, API::CommandContext *const cmdCtx) /// /// @brief Handles. /// /// @author Yacine Haoues /// @date 1/18/2018 /// /// @param cmd The command. /// @param [in,out] cmdCtx If non-null, context for the command. ///------------------------------------------------------------------------------------------------- void Steganifyer::handle(const API::Command *const cmd, API::CommandContext *const cmdCtx) { // Getting command chain API::CommandChain *const chain = cmdCtx->getChain(); // read input data // Here read input data file(s) (Format TBD) // Searching for available data API::DataDescriptor * dDesc = cmdCtx->get("IMAGE_DATA_ITERATOR"); if(dDesc == NULL && !called) { Info << "No Data Found, Asking to read and input file " << * cmd << " ..."; chain->addCommand(new API::Command("read")); chain->addCommand(new API::Command(CMD_STEGANIFY)); called = true; // limit tries to one call (no infinite loops) return; } // Processing found Data Info << "Processing data."; // Compressing // Crypting // Writing input data } }