Example #1
0
File: mail.c Project: wtj/formosa
/*****************************************************
 *  Syntax: MAILNUM
 *				取得信件數目
 *****************************************************/
DoGetMailNumber()
{
	int num;

	num = get_num_records(maildirect, FH_SIZE);

	inet_printf("%d\t%d\r\n", MAIL_NUM_IS, num);
}
Example #2
0
/***********************************************************
*		CHKANNOUNCE
*			取得公告最後修改日期
************************************************************/
DoChkAnnounce()
{
	struct stat st;

	if (stat(WELCOME, &st) < 0)
		RespondProtocol(NO_ANNOUNCE);
	else
		inet_printf("%d\t%ld\r\n", ANN_TIME, st.st_mtime);
}
Example #3
0
/************************************************************
*		BBSINFO
*			取得BBS name,Terminal及Client的人數
*************************************************************/
static void
DoAskBBSInformation()
{
	int t_user, c_user, w_user;

	num_ulist(&t_user, &c_user, &w_user);
	RespondProtocol(OK_CMD);
	inet_printf("BBSNAME:\t%s\r\nT-USER:\t%d\r\nC-USER:\t%d\r\nW-USER:\t%d\r\n.\r\n",
	            BBSNAME, t_user, c_user, w_user);
}
Example #4
0
void vTestKernel(void *pvAddress)
{
    char line[BUF_SIZE];
    long type, id;
    while (1) {
        inet_printf("Input type and id for sensor reading.\r\n");
        inet_gets(line, BUF_SIZE);
        sscanf(line, "%d %d", &type, &id);
        term_printf("sensor reading is: %d\r\n", sensor_read(type, id));
    }
}
Example #5
0
void
msq_request(int s)
{
	signal(SIGUSR2, msq_request);

	memset(&mymsq, 0, sizeof(mymsq));
	msq_rcv(cutmp, &mymsq);
	inet_printf("%d\t%s\t%s\t%s\t%s\r\n",
            MSG_REQUEST, mymsq.fromid,
               (mymsq.username[0] == '\0') ? "#" : mymsq.username,
            mymsq.mtext, mymsq.stimestr);
}
Example #6
0
static void
DoBBSName()
{
	inet_printf("%d %s\r\n", BBSNAME_IS, BBSNAME);
}