コード例 #1
0
ファイル: UI.c プロジェクト: celadonsoftware/PCHex
u8 do2(struct sockaddr_in servaddr, struct hostent *hp, int sock_id, u8 upDown, int slot, t_stinf *state, u8 *dest, u8 timeout)
{
	memcpy((char *)&servaddr.sin_addr.s_addr, (char *)hp->h_addr, hp->h_length);
	servaddr.sin_port = htons(80); 
	servaddr.sin_family = AF_INET;
        u8 connected = connect(sock_id, (struct sockaddr *)&servaddr, sizeof(servaddr));
	if(connected != 0) {
            return 0;
	}
	else {
            u8 do3(int sock_id, u8 upDown, int slot, t_stinf *state, u8 *dest, u8 timeout);
        return do3(sock_id, upDown, slot, state, dest, timeout);
	}
}
コード例 #2
0
ファイル: cOS.c プロジェクト: jiangeZh/myOS
cDo()
{
	printf(str3,0x0b14,41);
	while (buffer1 < 9)
	{	
		getch(&order[buffer1]);
		if (order[buffer1] == '1' || order[buffer1] == '2' || order[buffer1] == '3' || order[buffer1] == '4'|| order[buffer1] == '5'|| order[buffer1] == '6'|| order[buffer1] == '7'|| order[buffer1] == '8' || order[buffer1] == '9')
		{
			putch(order[buffer1]);
			buffer1++;	
		}
		else if (order[buffer1] == '\r') break;
	}

	for (; j < buffer1; j++)
	{
		if (order[j] == '1')
		{
			cls();
			load(0x1000,1,12);
			do1();
		}
		
		else if (order[j] == '2')
		{
			cls();
			load(0x2000,1,13);
			do2();
		}
		else if (order[j] == '3')
		{
			cls();
			load(0x3000,1,14);
			do3();
		}
		else if (order[j] == '4')
		{
			cls();
			load(0x4000,1,15);
			do4();
		}
		else if (order[j] == '5')
		{
			cls();
			load(0x5000,1,16);
			do5();
		}
		else if (order[j] == '6')
		{
			cls();
			load(0x6000,2,17);
			do6();
		}
		else if (order[j] == '7')
		{
			cls();
			load(0x7000,1,19);
			do7();
		}
		else if (order[j] == '8')
		{
			cls();
			load(0x8000,1,20);
			do8();
		}
		else if (order[j] == '9')
		{
			cls();
			freeAll();
			Program_Num = 1;
			CurrentPCBno = 1;
			load(0x9000,2,21);
			init(&pcb_list[0],0,0x7e00);
			init(&pcb_list[1],0x9000,0x100);
			setClock();
			do9();
			Program_Num = 0;
		}
	}
	cls();
	printf(str4,0x0a20,17);
	printf("Press any key to return...",0x0c15,26);
	buffer1 = 0;
	getch(&ret);
	return;
}