コード例 #1
0
ファイル: mudGameView.cpp プロジェクト: tmud/tortilla
void MudGameView::onStart()
{
    if (!loadModules())
        msgBox(m_hWnd, IDS_ERROR_MODULES, MB_OK | MB_ICONSTOP);
   updateProps();
   loadPlugins();
}
コード例 #2
0
ファイル: main.cpp プロジェクト: EvgenyNechayev/programming
//-----------------------------------------------------------------
int main(int argc, char *argv[])
{
    QApplication    app(argc, argv);

    QSharedMemory global("your_unique_key");
    if (!global.create(1))
        return 1;

    cool_tsmfb       tsmfbWin;
    QSplashScreen   *splash = new QSplashScreen;

    QObject::connect(&tsmfbWin, SIGNAL(quit()), &app, SLOT(quit()));

    splash->setPixmap(QPixmap(":/images/TSMFB.png"));
    splash->show();
    loadModules(splash);

    tsmfbWin.setMinimumSize(minWinWidth, minWinHeight);
    QRect rect = QApplication::desktop()->availableGeometry(&tsmfbWin);
    tsmfbWin.move(rect.center() - tsmfbWin.rect().center());

    tsmfbWin.show();
    splash->finish(&tsmfbWin);
    delete splash;

    return app.exec();
}
コード例 #3
0
ファイル: main.cpp プロジェクト: Harak/irc-mind
Mind::Mind()
{
  std::string	admin, modload;
  
  try 
    {
      _run = true;
      _conf.mapFile();
      if (!_conf.check())
	{
	  std::cerr << "Unable to start. Please check the configuration file" << std::endl;
	  exit(1);
	}
      _logger = new Logger(_conf.get("logFile"));

      admin = _conf.get("admin");
      initAdmin(admin);

      modload = _conf.get("loadModule");
      loadModules(modload);
    }
  catch (Exception &e)
    {
      std::cerr << "Error: " << e.what() << std::endl;
      exit(1);
    }
}
コード例 #4
0
ファイル: jawasd.c プロジェクト: cthulhuology/Jawas2
int setup() {
	logging();
	handleSignals();
	monitor();
	iobuffer();
	loadModules();
	kq = kqueue();
}
コード例 #5
0
ファイル: kernel.c プロジェクト: matiasgualino/tp-arqui
void load_kernel_modules() {

	void * moduleAddresses[] = {
		shellCodeModuleAddress,
		shellDataModuleAddress
	};

	loadModules(&endOfKernelBinary, moduleAddresses);

}
コード例 #6
0
ModulesManagementWidget::ModulesManagementWidget(ModulesManagement *nmodulesMgmt, QWidget *parent) :
    QWidget(parent)
{
    ui = new(std::nothrow) Ui::ModulesManagementWidget();
    if (ui == NULL) {
        qFatal("Cannot allocate memory for Ui::ModulesManagementWidget X{");
    }
    modulesMgmt = nmodulesMgmt;
    moduleTitle = modulesMgmt->getLangName();

    ui->setupUi(this);
    ui->infoLabel->setText(modulesMgmt->getInfos());
    connect(modulesMgmt,SIGNAL(modulesUpdated()), this, SLOT(loadModules()));
    connect(modulesMgmt,SIGNAL(pathsUpdated()), this, SLOT(loadPaths()));
    connect(ui->modulesListWidget, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(onModuleSelected(QListWidgetItem*)));
    connect(ui->loadPushButton, SIGNAL(clicked()), this, SLOT(onManualClicked()));

    loadPaths();
    loadModules();
    qDebug() << this << "created";
}
コード例 #7
0
void * initializeKernelBinary()
{
	void * moduleAddresses[] = {
		sampleCodeModuleAddress,
		sampleDataModuleAddress
	};
	loadModules(&endOfKernelBinary, moduleAddresses);
	clearBSS(&bss, &endOfKernel - &bss);

	clearFullScreen();
	klog("Modules loaded.\n");
	return getStackBase();
}
コード例 #8
0
ファイル: ipu_create.cpp プロジェクト: trmmy/zenisynth
void IPU::create() {

    _wfreopen_s(
        &m_hLogFile,
        L"stdout.txt" ,
        L"w+t" ,
        stdout);

    m_logThreadExitSign=false;
    _beginthread(&updateLog,0,NULL);

    out("create");

    m_L=lua_open();
    if(m_L==NULL) {
        out("lua_open failed");
    } else {
        out("lua_open succeeded");
    }

    loadModules();

    if(luaL_dofile(m_L,"main.lua")!=0) {
        out("An error detected when loading main.lua");
        out("////////////////Error detail////////////////");
        out(lua_tostring(m_L,-1));
        out("////////////////////////////////////////////");
    } else {
        out("lua ok");
        m_isLuaOK=true;
    }

    m_hAccelTable
        = LoadAccelerators(
            GetModuleHandle(NULL),
            MAKEINTRESOURCE(IDC_IPU));
	
    createWindow();

#ifdef _x64
    out("starting x86 ime hook layer");
    PROCESS_INFORMATION pi;
    STARTUPINFO si;
    ZeroMemory(&si,sizeof(si));
    si.cb=sizeof(si);

    CreateProcess(_T("zs_x86layer.exe"),NULL,NULL,NULL,FALSE,NORMAL_PRIORITY_CLASS,NULL,NULL,&si,&pi);

#endif
}
コード例 #9
0
ファイル: MainWindow.cpp プロジェクト: cguebert/SofaViewer
MainWindow::MainWindow(QWidget *parent)
	: QMainWindow(parent)
{
	// Buttons
	auto buttonsDock = new QDockWidget(tr("Buttons"));
	m_buttonsDockWidget = new QWidget(this);
	auto buttonsLayout = new QGridLayout;
	m_buttonsDockWidget->setLayout(buttonsLayout);
	buttonsDock->setObjectName("ButtonsDock");
	buttonsDock->setWidget(m_buttonsDockWidget);
	buttonsDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
	addDockWidget(Qt::LeftDockWidgetArea, buttonsDock);

	// Graph tree
	m_graphView = new GraphView(this);
	auto graphDock = new QDockWidget(tr("Graph"), this);
	graphDock->setObjectName("GraphDock");
	graphDock->setWidget(m_graphView->view());
	graphDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
	addDockWidget(Qt::LeftDockWidgetArea, graphDock);

	m_openGLView = new OpenGLView(this);
	setCentralWidget(m_openGLView);

	createActions();
	createMenus();

	statusBar();
	
	std::vector<QMenu*> menus = { m_fileMenu, m_toolsMenu, m_viewMenu, m_helpMenu };
	m_simpleGUI = std::make_shared<SimpleGUIImpl>(this, m_openGLView, m_buttonsDockWidget, menus);

	connect(m_graphView, &GraphView::itemOpened, [this](void* item) {
		m_simpleGUI->openPropertiesDialog(static_cast<GraphNode*>(item));
	});

	setWindowIcon(QIcon(":/share/icons/icon.png"));
	setCurrentFile("");
	setAcceptDrops(true);

	readSettings();

	loadModules();

	auto& factory = DocumentFactory::instance();
	if (factory.creatableDocuments().empty())
		m_newAction->setEnabled(false);
	if (factory.loadFilesFilter().empty())
		m_openAction->setEnabled(false);
}
コード例 #10
0
ファイル: kernel.c プロジェクト: jcaracciolo/Arqui2016
void * initializeKernelBinary()
{
	char buffer[10];

	ncPrint("[x64BareBones]");
	ncNewline();

	ncPrint("CPU Vendor:");
	ncPrint(cpuVendor(buffer));
	ncNewline();

	ncPrint("[Loading modules]");
	ncNewline();
	void * moduleAddresses[] = {
			sampleCodeModuleAddress,
			sampleDataModuleAddress
	};

	loadModules(&endOfKernelBinary, moduleAddresses);
	ncPrint("[Done]");
	ncNewline();
	ncNewline();

	ncPrint("[Initializing kernel's binary]");
	ncNewline();

	clearBSS(&bss, &endOfKernel - &bss);

	ncPrint("  text: 0x");
	ncPrintHex((uint64_t)&text);
	ncNewline();
	ncPrint("  rodata: 0x");
	ncPrintHex((uint64_t)&rodata);
	ncNewline();
	ncPrint("  data: 0x");
	ncPrintHex((uint64_t)&data);
	ncNewline();
	ncPrint("  bss: 0x");
	ncPrintHex((uint64_t)&bss);
	ncNewline();

	ncPrint("[Done]");
	ncNewline();
	ncNewline();
	return getStackBase();
}
コード例 #11
0
ファイル: kernel.c プロジェクト: foviedoITBA/TPE-Arqui
void * initializeKernelBinary()
{
	void * moduleAddresses[] = {
		consoleAddress,
		dataAddress
	};
	clear_screen();
	print_msg("KERNEL\n\n", GREEN, BLUE);
	
	print_msg("Loading modules... \n", GREEN, BLUE);
	loadModules(&endOfKernelBinary, moduleAddresses);
	print_msg("Done\n", GREEN, BLUE);
	print_msg("Clearing Kernel's bss... ", GREEN, BLUE);
	clearBSS(&bss, &endOfKernel - &bss);
	print_msg("Done loading modules\n", GREEN, BLUE);

	print_msg("Setting up stack...\n", GREEN, BLUE);

	return getStackBase();
}
コード例 #12
0
ファイル: main.cpp プロジェクト: anatoliy17/text_viewer
int main(int argc, char *argv[])
{
    QApplication  app(argc, argv);
    QPixmap pixmap("/home/dev/temp/temp_text_viewer/text_viewer/src/temp.png");

    QSplashScreen *splash = new QSplashScreen(pixmap);

    QTextCodec *utfcodec = QTextCodec::codecForName("UTF-8");
    QTextCodec::setCodecForTr(utfcodec);

    QTextCodec::setCodecForCStrings(utfcodec);

    splash->show();
    loadModules(splash);
    splash->hide();

    MainWindow window;
    window.showMaximized();

    return app.exec();
}
コード例 #13
0
ファイル: main.c プロジェクト: shorti006/CN-Cheat
void initalise(void)
{
	int ret;
	
	// load all modules
	loadModules();
	// init pad
	padInit(0);
	if((ret = padPortOpen(0, 0, padBuf)) == 0) {
		#if defined DEBUG
			scr_printf("padOpenPort failed: %d\n", ret);
		#endif
		SleepThread();
	}

	if(!initializePad(0, 0)) {
		#if defined DEBUG
			scr_printf("pad initalization failed!\n");
		#endif
		SleepThread();
	}
}
コード例 #14
0
ファイル: JMP3.cpp プロジェクト: 173210/w-menu
void JMP3::init() {
  if (!init_done) {
    init_done = loadModules();
  }
}
コード例 #15
0
TEST_F(ExtensionsTest, test_extension_module_search) {
  createMockFileStructure();
  EXPECT_FALSE(loadModules(kFakeDirectory + "/root.txt"));
  EXPECT_FALSE(loadModules("/dir/does/not/exist"));
  tearDownMockFileStructure();
}
コード例 #16
0
ファイル: main.c プロジェクト: AzagraMac/PS2_SDK
int main()
{
    int whichdrawbuf = 0;
    int s;
    char *buffer;
	int i;
	int size;
	int rc;
	int fd;
    // Initialise RPC system.

    sif_rpc_init(0);
    
    // Setup the Video.

    DmaReset();
    initGraph(3);
    SetVideoMode();
    //install_VRstart_handler();

    // Setup the double buffers.

   // SetDrawFrameBuffer(1);
   // SetDrawFrameBuffer(0);
   // SetCrtFrameBuffer(1);

    // Load the modules!

    loadModules();


    // Loaded the modules.. now try ps2ip now..
    if(ps2ip_init()<0)
	{
		printf("ERROR: ps2ip_init failed2");
		k_SleepThread();
	}
	//put here your file path 
    fd=fio_open("ps2vfs:\\primer\\segun\\mio.txt",O_RDONLY);
	if (fd>0)
	{
		printf("file id kernel is %d \n");
		size=fio_lseek(fd,0,SEEK_END);
		i=fio_lseek(fd,0,SEEK_SET);
		buffer=(char *)malloc(sizeof(char)*size);
		i=fio_read(fd,buffer,size);
		
		printf("receive size:  %d \n",i);
		printf("receive: buffer= %s \n",buffer);
		fio_close(fd);
			
	}
           
	
	

	
	
	while ( 1 )
	{
        //WaitForNextVRstart(1);

        //ClearVRcount();
        //SetCrtFrameBuffer(whichdrawbuf);
        //whichdrawbuf ^= 1;
        //SetDrawFrameBuffer(whichdrawbuf);
//        scr_printf( "t" );
    } 

    // We shouldn't get here.. but just in case.

    k_SleepThread();

}
コード例 #17
0
ファイル: meta_api.cpp プロジェクト: souvikdas95/amxmodx
// Very	first point	at map load
// Load	AMX	modules	for	new	native functions
// Initialize AMX stuff	and	load it's plugins from plugins.ini list
// Call	precache forward function from plugins
int	C_Spawn(edict_t *pent)
{
	if (g_initialized)
	{
		RETURN_META_VALUE(MRES_IGNORED, 0);
	}

	g_activated = false;
	g_initialized = true;
	g_forcedmodules = false;
	g_forcedsounds = false;

	g_srvindex = IS_DEDICATED_SERVER() ? 0 : 1;

	hostname = CVAR_GET_POINTER("hostname");
	mp_timelimit = CVAR_GET_POINTER("mp_timelimit");

	// Fix for crashing on mods that do not have mp_timelimit
	if (mp_timelimit == NULL)
	{
		static cvar_t timelimit_holder;

		timelimit_holder.name = "mp_timelimit";
		timelimit_holder.string = "0";
		timelimit_holder.flags = 0;
		timelimit_holder.value = 0.0;

		CVAR_REGISTER(&timelimit_holder);

		mp_timelimit = &timelimit_holder;

	}

	g_forwards.clear();

	g_log.MapChange();

	// ###### Initialize task manager
	g_tasksMngr.registerTimers(&gpGlobals->time, &mp_timelimit->value, &g_game_timeleft);

	// ###### Initialize commands prefixes
	g_commands.registerPrefix("amx");
	g_commands.registerPrefix("amxx");
	g_commands.registerPrefix("say");
	g_commands.registerPrefix("admin_");
	g_commands.registerPrefix("sm_");
	g_commands.registerPrefix("cm_");

	// make sure localinfos are set
	get_localinfo("amxx_basedir", "addons/amxmodx");
	get_localinfo("amxx_pluginsdir", "addons/amxmodx/plugins");
	get_localinfo("amxx_modulesdir", "addons/amxmodx/modules");
	get_localinfo("amxx_configsdir", "addons/amxmodx/configs");
	get_localinfo("amxx_customdir", "addons/amxmodx/custom");

	// make sure bcompat localinfos are set
	get_localinfo("amx_basedir", "addons/amxmodx");
	get_localinfo("amx_configdir", "addons/amxmodx/configs");
	get_localinfo("amx_langdir", "addons/amxmodx/data/amxmod-lang");
	get_localinfo("amx_modulesdir", "addons/amxmodx/modules");
	get_localinfo("amx_pluginsdir", "addons/amxmodx/plugins");
	get_localinfo("amx_logdir", "addons/amxmodx/logs");

	FlagMan.LoadFile();

	ArrayHandles.clear();
	TrieHandles.clear();
	TrieSnapshotHandles.clear();
	DataPackHandles.clear();
	TextParsersHandles.clear();
	GameConfigHandle.clear();

	char map_pluginsfile_path[256];
	char prefixed_map_pluginsfile[256];
	char configs_dir[256];

	// ###### Load modules
	loadModules(get_localinfo("amxx_modules", "addons/amxmodx/configs/modules.ini"), PT_ANYTIME);

	get_localinfo_r("amxx_configsdir", "addons/amxmodx/configs", configs_dir, sizeof(configs_dir)-1);
	g_plugins.CALMFromFile(get_localinfo("amxx_plugins", "addons/amxmodx/configs/plugins.ini"));
	LoadExtraPluginsToPCALM(configs_dir);
	char temporaryMap[64], *tmap_ptr;

	ke::SafeSprintf(temporaryMap, sizeof(temporaryMap), "%s", STRING(gpGlobals->mapname));

	prefixed_map_pluginsfile[0] = '\0';
	if ((tmap_ptr = strchr(temporaryMap, '_')) != NULL)
	{
		// this map has a prefix

		*tmap_ptr = '\0';
		ke::SafeSprintf(prefixed_map_pluginsfile,
			sizeof(prefixed_map_pluginsfile),
			"%s/maps/plugins-%s.ini",
			configs_dir,
			temporaryMap);
		g_plugins.CALMFromFile(prefixed_map_pluginsfile);
	}

	ke::SafeSprintf(map_pluginsfile_path,
		sizeof(map_pluginsfile_path),
		"%s/maps/plugins-%s.ini",
		configs_dir,
		STRING(gpGlobals->mapname));
	g_plugins.CALMFromFile(map_pluginsfile_path);

	int loaded = countModules(CountModules_Running); // Call after attachModules so all modules don't have pending stat
	
	// Set some info about amx version and modules
	CVAR_SET_STRING(init_amxmodx_version.name, AMXX_VERSION);
	char buffer[32];
	sprintf(buffer, "%d", loaded);
	CVAR_SET_STRING(init_amxmodx_modules.name, buffer);

	// ###### Load Vault
	char file[255];
	g_vault.setSource(build_pathname_r(file, sizeof(file) - 1, "%s", get_localinfo("amxx_vault", "addons/amxmodx/configs/vault.ini")));
	g_vault.loadVault();

	// ###### Init time and freeze tasks
	g_game_timeleft = g_bmod_dod ? 1.0f : 0.0f;
	g_task_time = gpGlobals->time + 99999.0f;
	g_auth_time = gpGlobals->time + 99999.0f;
#ifdef MEMORY_TEST
	g_next_memreport_time = gpGlobals->time + 99999.0f;
#endif
	g_players_num = 0;

	// Set server flags
	memset(g_players[0].flags, -1, sizeof(g_players[0].flags));

	g_opt_level = atoi(get_localinfo("optimizer", "7"));
	if (!g_opt_level)
		g_opt_level = 7;

	// ###### Load AMX Mod X plugins
	g_plugins.loadPluginsFromFile(get_localinfo("amxx_plugins", "addons/amxmodx/configs/plugins.ini"));
	LoadExtraPluginsFromDir(configs_dir);
	g_plugins.loadPluginsFromFile(map_pluginsfile_path, false);
	if (prefixed_map_pluginsfile[0] != '\0')
	{
		g_plugins.loadPluginsFromFile(prefixed_map_pluginsfile, false);
	}

	g_plugins.Finalize();
	g_plugins.InvalidateCache();

	// Register forwards
	FF_PluginInit = registerForward("plugin_init", ET_IGNORE, FP_DONE);
	FF_ClientCommand = registerForward("client_command", ET_STOP, FP_CELL, FP_DONE);
	FF_ClientConnect = registerForward("client_connect", ET_IGNORE, FP_CELL, FP_DONE);
	FF_ClientDisconnect = registerForward("client_disconnect", ET_IGNORE, FP_CELL, FP_DONE);
	FF_ClientDisconnected = registerForward("client_disconnected", ET_IGNORE, FP_CELL, FP_CELL, FP_ARRAY, FP_CELL, FP_DONE);
	FF_ClientRemove = registerForward("client_remove", ET_IGNORE, FP_CELL, FP_CELL, FP_STRING, FP_DONE);
	FF_ClientInfoChanged = registerForward("client_infochanged", ET_IGNORE, FP_CELL, FP_DONE);
	FF_ClientPutInServer = registerForward("client_putinserver", ET_IGNORE, FP_CELL, FP_DONE);
	FF_PluginCfg = registerForward("plugin_cfg", ET_IGNORE, FP_DONE);
	FF_PluginPrecache = registerForward("plugin_precache", ET_IGNORE, FP_DONE);
	FF_PluginLog = registerForward("plugin_log", ET_STOP, FP_DONE);
	FF_PluginEnd = registerForward("plugin_end", ET_IGNORE, FP_DONE);
	FF_InconsistentFile = registerForward("inconsistent_file", ET_STOP, FP_CELL, FP_STRING, FP_STRINGEX, FP_DONE);
	FF_ClientAuthorized = registerForward("client_authorized", ET_IGNORE, FP_CELL, FP_STRING, FP_DONE);
	FF_ChangeLevel = registerForward("server_changelevel", ET_STOP, FP_STRING, FP_DONE);
	FF_ClientConnectEx = registerForward("client_connectex", ET_STOP, FP_CELL, FP_STRING, FP_STRING, FP_ARRAY, FP_DONE);

	CoreCfg.OnAmxxInitialized();

#if defined BINLOG_ENABLED
	if (!g_BinLog.Open())
	{
		LOG_ERROR(PLID, "Binary log failed to open.");
	}
	g_binlog_level = atoi(get_localinfo("bin_logging", "17"));
	g_binlog_maxsize = atoi(get_localinfo("max_binlog_size", "20"));
#endif

	modules_callPluginsLoaded();

	TypeConversion.init();

	// ###### Call precache forward function
	g_dontprecache = false;
	executeForwards(FF_PluginPrecache);
	g_dontprecache = true;

	for (CList<ForceObject>::iterator a = g_forcegeneric.begin(); a; ++a)
	{
		PRECACHE_GENERIC((char*)(*a).getFilename());
		ENGINE_FORCE_UNMODIFIED((*a).getForceType(),
		(*a).getMin(), (*a).getMax(), (*a).getFilename());
	}

	RETURN_META_VALUE(MRES_IGNORED, 0);
}