예제 #1
0
int main ()
{
	WINDOW **win;			//Окна
	char content[2][512][128];	//Содержимое окон
	char patch[2][512];		//Директории в которых мы находимся
	unsigned count[2];
	unsigned active;		//Индекс активного окна
	unsigned print;
	unsigned select;
	int key = 0;

	init_manager(&win, content, count, patch, &active, &print, &select);
	refresh_manager(win, content, active, print, select);
		
	while((key = getch()) != 27)
	{
		switch(key)
		{
			case KEY_DOWN:
				if(print + select >= count[active] - 1)
					continue;
				if(select >= LINES - 3)
					print++;
				else
					select++;
			break;
			case KEY_UP:
				if(print <= 0 && select <= 0)
					continue;
				if(select <= 0)
					print--;
				else
					select--;
			break;
			case KEY_LEFT:
				if(active == LEFT)
					continue;
				active = LEFT;
				print = 0;
				select = 0;
				chdir(patch[active]);
			break;
			case KEY_RIGHT:
				if(active == RIGHT)
					continue;
				active = RIGHT;
				print = 0;
				select = 0;
				chdir(patch[active]);
			break;
			case '\n':
				open_dir(content[active][select + print], patch, content[active], &(count[active]), active);
				print = 0;
				select = 0;
			break;
		}
		refresh_manager(win, content, active, print, select);
	}
	destroy_manager();
}
예제 #2
0
// main loop
int main( int argc, char **argv )
{
	printf("Hello world\n");

	Management manager = new_manager();

	// add actions to the manager
	action_add_to_manager( manager );
	
	// add rooms to manager
	room_add_to_manager( manager );

	Server server = new_server();
	if( start_server( server, 5555 ) < 0 ){
		return 1;
	}

	environment_loop( server, manager );
	
	
	/* ---------------------------------------
	 * Clean up 
	 */
	
	close_server( server );
	destroy_server( server );


	destroy_manager( manager );

	return 0;
}
예제 #3
0
void event_queue_destroy(event_queue_t *queue){
    for(int i=0;i<(*queue)->pending;i++){
        MPI_Cancel(&(*queue)->request[i]);
    }
    destroy_manager ((*queue)->man);
    RTfree(*queue);
    *queue=NULL;
}
예제 #4
0
VISIBLE void
dynamic_driver_destroy(void)
{
	/* Only unregister the implementation if it was registered by us. */
	if (ldapdb_imp != NULL)
		dns_db_unregister(&ldapdb_imp);

	destroy_manager();
}