void ko_initialize(void) { load_translations(); g_untranslated_file = fopen(UNTRANSLATED_FILENAME, "w"); if(g_untranslated_file) fclose(g_untranslated_file); g_untranslated_file=NULL; for(int i=0; i<NUM_PRETRANS; i++) { g_PreTranslationIn[i][0] = 0; g_PreTranslationOut[i][0] = 0; g_PreTransIndex = 0; } }
//------------------------------------------------------------------------------ // Name: main // Desc: entry point //------------------------------------------------------------------------------ int main(int argc, char *argv[]) { QT_REQUIRE_VERSION(argc, argv, "4.6.0"); QApplication app(argc, argv); QApplication::setWindowIcon(QIcon(":/debugger/images/edb48-logo.png")); qsrand(std::time(0)); // setup organization info so settings go in right place QApplication::setOrganizationName("codef00.com"); QApplication::setOrganizationDomain("codef00.com"); QApplication::setApplicationName("edb"); load_translations(); // look for some plugins.. load_plugins(edb::v1::config().plugin_path); QStringList args = app.arguments(); edb::pid_t attach_pid = 0; QList<QByteArray> run_args; QString run_app; // call the init function for each plugin, this is done after // ALL plugins are loaded in case there are inter-plugin dependencies for(QObject *plugin: edb::v1::plugin_list()) { if(auto p = qobject_cast<IPlugin *>(plugin)) { const IPlugin::ArgumentStatus r = p->parse_argments(args); switch(r) { case IPlugin::ARG_ERROR: usage(); break; case IPlugin::ARG_EXIT: std::exit(0); break; default: break; } } } if(args.size() > 1) { if(args.size() == 3 && args[1] == "--attach") { attach_pid = args[2].toUInt(); } else if(args.size() >= 3 && args[1] == "--run") { run_app = args[2]; for(int i = 3; i < args.size(); ++i) { run_args.push_back(argv[i]); } } else if(args.size() == 2 && args[1] == "--version") { std::cout << "edb version: " << edb::version << std::endl; return 0; } else if(args.size() == 2 && args[1] == "--dump-version") { std::cout << edb::version << std::endl; return 0; } else { usage(); } } return start_debugger(attach_pid, run_app, run_args); }