Ejemplo n.º 1
0
Archivo: menu.c Proyecto: wtj/formosa
static void
menu_title()
{
	title_func(cmenus[n_cmenus - 1].chelp, BBSTITLE);

#ifdef USE_MENUSHOW
	if (redraw && !(curuser.flags[0] & PICTURE_FLAG))
	{
		if (msshm == NULL)
			msshm = (struct MenuShowShm *) attach_shm(MENUSHOW_KEY, sizeof(struct MenuShowShm));
		if (msshm && msshm->number)
		{
			int j;
			char *p1, *p2;
			unsigned char chs;
			static long randomseed = 1;

			/*  
			 * This is a simple linear congruential random number
			 * generator.  Hence, it is a bad random number
			 * generator, but good enough for most randomized
			 * geometric algorithms. modify by lthuang
			 */
			randomseed = (randomseed * 1366l + 150889l) % 714025l;
			pict_no = randomseed / (714025l / msshm->number + 1);

/*
 * j = n_cmenus + 2;
 * if (j < 13)
 * j = 13;
 */
			move(10, 69 - strlen(msshm->list[pict_no].owner));
			prints("《提供》%s ", msshm->list[pict_no].owner);
			j = 2;
			move(j, 0);
/*                      
 * prints("《作者》%35.35s  《標題》%27.27s",
 * msshm->list[pict_no].owner, msshm->list[pict_no].title);
 */
			p1 = msshm->list[pict_no].body;

/*
 * while (j++ < b_line)
 */
			while (++j < 11)
			{
				if ((p2 = strchr(p1, '\n')) != NULL)
					p1 = ++p2;
				else
					break;
			}
			/* 
			 * Direct output the content in shared memory,
			 * for better performance. by lthuang
			 */
			j = p1 - msshm->list[pict_no].body;
			p1 = msshm->list[pict_no].body;
			while (j-- > 0 && (chs = *p1++) != '\0')
				outc(chs);
			outs("");

			redraw = FALSE;
		}
/*              
 * move(b_line, 0); 
 */
	}
#endif /* USE_MENUSHOW */
}
Ejemplo n.º 2
0
static void board_title()
{
	title_func(BBSTITLE, (in_board ? _msg_board_normal : _msg_board_treasure));
	prints(_msg_board_1, (show_numposts) ? "篇數" : "編號");
}