Example #1
0
static int
show_switch (CT ct, int serial, int alternate)
{
    switch (ct->c_type) {
	case CT_MULTIPART:
	    return show_multi (ct, serial, alternate);

	case CT_MESSAGE:
	    switch (ct->c_subtype) {
		case MESSAGE_PARTIAL:
		    return show_partial (ct, serial, alternate);

		case MESSAGE_EXTERNAL:
		    return show_external (ct, serial, alternate);

		case MESSAGE_RFC822:
		default:
		    return show_message_rfc822 (ct, serial, alternate);
	    }

	case CT_TEXT:
	    return show_text (ct, serial, alternate);

	case CT_AUDIO:
	case CT_IMAGE:
	case CT_VIDEO:
	case CT_APPLICATION:
	    return show_content (ct, serial, alternate);

	default:
	    adios (NULL, "unknown content type %d", ct->c_type);
    }

    return 0;	/* NOT REACHED */
}
Example #2
0
// function that refreshes grid of screen
void update(int header) {
    if (cmd_multiplier > 1) return;
    if (atoi(get_conf_value("nocurses"))) return;

    // Limpio desde comienzo hacia to bottom
    if (header) {
        wmove(main_win, 0, rescol);
        wclrtobot(main_win);
    }

    // calculo las filas y columnas que quedan ocultas
    //   mxcol-1 es el numero de la ultima sc_col que se ve en pantalla
    //   mxrow-1 es el numero de la ultima sc_row que se ve en pantalla
    int off_cols = calc_offscr_sc_cols();
    int off_rows = calc_offscr_sc_rows();
    int mxcol = offscr_sc_cols + off_cols - 1;
    int mxrow = offscr_sc_rows + off_rows - 1;

    /* You can't hide the last row or col */
    while (row_hidden[currow])
        currow++;
    while (col_hidden[curcol])
        curcol++;

    // Muestro en pantalla el contenido de las celdas
    // Valores numericos, strings justificados, centrados y expresiones.
    show_content(main_win, mxrow, mxcol);

    // Show sc_col headings: A, B, C, D..
    show_sc_col_headings(main_win, mxcol, mxrow);

    // Show sc_row headings: 0, 1, 2, 3..
    show_sc_row_headings(main_win, mxrow);

    // Refresco ventanas de curses
    wrefresh(main_win);

    // Muestro detalle de celda en header (primera fila)
    if (header)
        show_celldetails(input_win);

    // print mode
    (void) print_mode(input_win);

    return;
}
Example #3
0
int
bbsboa_main()
{
	struct boardmem *(data[MAXBOARD]), *x;
	int i, total = 0;
	char *secstr; //, session_name[STRLEN], pname[STRLEN], *p;
	const struct sectree *sec;
	//int show_Commend();
	int hasintro = 0, len;

	secstr = getparm("secstr");
	sec = getsectree(secstr);
	//if (secstr[0] != '*') {   暂时去掉缓存 by IronBlood@bmy 20120329
	////get_session_string(session_name);
	////if (secstr[0] != '*' && !no_cache_header) {
	//	    if (cache_header
	//	    (max(thisversion, file_time(MY_BBS_HOME "/wwwtmp")), 120))
	//		return 0;
	//}
	/*
	if (no_cache_header) {
		p = strchr(session_name, '.');
		if (NULL != p) {
			*p = '\0';
		}
		
		sprintf(pname, "/%s%s/", SMAGIC, session_name);
		print_session_string(pname);
	}
	*/

	html_header(1);
	check_msg();
	//printf("<style type=text/css>A {color: #0000f0}</style>");
	changemode(SELECT);
	if (secstr[0] == '*') {
		readmybrd(currentuser.userid);
		for (i = 0; i < MAXBOARD && i < shm_bcache->number; i++) {
			x = &(shm_bcache->bcache[i]);
			if (x->header.filename[0] <= 32
			    || x->header.filename[0] > 'z')
				continue;
			if (!has_read_perm_x(&currentuser, x))
				continue;
			if (!ismybrd(x->header.filename))
				continue;
			data[total] = x;
			total++;
		}
		printf("<body><center>\n");
		printf("<div class=rhead>%s --<span class=h11> 预定讨论区总览</span></div><hr>", BBSNAME);
		if (total)
			showboardlist(data, total, "*", sec);
		printf("<hr>");
		return 0;
	}
	if(!strcmp(secstr,"?")){
		printf("<script src=\"/inc/tog.js\"></script></head><body leftmargin=0 topmargin=0>\n");
		show_banner();
		show_content();
		goto out;
	}
	len = strlen(secstr);
	if (sec->introstr[0])
		hasintro = 1; 
	for (i = 0; i < MAXBOARD && i < shm_bcache->number; i++) {
		x = &(shm_bcache->bcache[i]);
		if (x->header.filename[0] <= 32 || x->header.filename[0] > 'z')
			continue;
		if (hasintro) {
			if (strcmp(secstr, x->header.sec1) &&
			    strcmp(secstr, x->header.sec2)) continue;
		} else {
			if (strncmp(secstr, x->header.sec1, len) &&
			    strncmp(secstr, x->header.sec2, len))
				continue;
		}
		if (!has_read_perm_x(&currentuser, x))
			continue;
		data[total] = x;
		total++;
	}
	printf("<body topmargin=0 leftMargin=1 MARGINWIDTH=1 MARGINHEIGHT=0>"); 
	showsecpage(sec, data, total, secstr); 
out:
	printf("</body></html>");
	return 0;
}