Exemplo n.º 1
1
Arquivo: main.c Projeto: taysom/tau
int main (int argc, char *argv[])
{
	int	c;

	setprogname(argv[0]);
	debugoff();
	init_shell(NULL);
	my_commands();

	while ((c = getopt(argc, argv, "dv?")) != -1) {
		switch (c) {
		case 'd':
			debugon();
			fdebugon();
			break;
		case 'v':
			Zerofill = TRUE;
			break;
		case '?':
		default:
			usage();
			exit(1);
			break;
		}
	}
	if (init_msg_tau(getprogname())) {
		fatal("Couldn't connect to messaging system");
	}
	switchboard();
	tag_loop();

	return 0;
}
Exemplo n.º 2
0
void importfromworld(displaymethod * mydisplay, ZZTworld * myworld)
{
	char* filename = filedialog(".", "zzt", "Load World", FTYPE_ALL, mydisplay);
	ZZTworld* inworld;
	
	if (filename == NULL)
		return;

	inworld = zztWorldLoad(filename);

	if (inworld != NULL) {
		ZZTboard* brd;

		/* Select a board from the new world */
		switchboard(inworld, mydisplay);

		brd = zztBoardGetCurPtr(inworld);

		/* Insert after current board and advance */
		if (zztWorldInsertBoard(myworld, brd, zztBoardGetCurrent(myworld) + 1, 1))
			zztBoardSelect(myworld, zztBoardGetCurrent(myworld) + 1);

		/* Fix links over the top */
		zztBoardValidateLinks(myworld);

		zztWorldFree(inworld);
	}

	free(filename);
}