File: sadisp.c

package info (click to toggle)
trn4 4.0-test77-18
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid, trixie
  • size: 4,016 kB
  • sloc: ansic: 48,332; sh: 6,795; tcl: 1,696; yacc: 662; perl: 108; makefile: 26
file content (109 lines) | stat: -rw-r--r-- 2,052 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/* This file Copyright 1992 by Clifford A. Adams */
/* sadisp.c
 *
 * display stuff
 */

#include "EXTERN.h"
#include "common.h"
#ifdef SCAN_ART
#include "hash.h"
#include "cache.h"
/* for absfirst declaration */
#include "bits.h"
/* for mailcall */
#include "ng.h"
/* for ngname */
#include "trn.h"
#include "term.h"
#include "util.h"
#include "scanart.h"
#include "samain.h"
#include "sadesc.h"
#include "samisc.h"
#include "sathread.h"	/* for fold mode flag */
#ifdef SCORE
#include "score.h"
#endif
#include "scan.h"
#include "sdisp.h"
#include "color.h"
#include "INTERN.h"
#include "sadisp.h"

void
sa_refresh_top()
{
    color_object(COLOR_SCORE, 1);
    printf("%s |",ngname);
/* # of articles might be optional later */
    printf(" %d",sa_number_arts());

    if (sa_mode_read_elig)
	printf(" unread+read");
    else
	printf(" unread");
    if (sa_mode_zoom)
	printf(" zoom");
    if (sa_mode_fold)
	printf(" Fold");
    if (sa_follow)
	printf(" follow");
    color_pop();	/* of COLOR_SCORE */
    erase_eol();
    printf("\n") FLUSH;
}

void
sa_refresh_bot()
{
    char* s;

    color_object(COLOR_SCORE, 1);
    s_mail_and_place();
    printf("(");
    switch (sa_mode_order) {
      case 1:
	s = "arrival";
	break;
#ifdef SCORE
      case 2:
	if (score_newfirst)
	    s = "score (new>old)";
	else
	    s = "score (old>new)";
	break;
#endif
      default:
	s = "unknown";
	break;
    }
    printf("%s order",s);
#ifdef SCORE
    printf(", %d%% scored",sc_percent_scored());
#endif
    printf(")");
    color_pop();	/* of COLOR_SCORE */
    fflush(stdout);
}

/* set up various screen dimensions */
void
sa_set_screen()
{
    /* One size fits all for now. */
    /* these things here because they may vary by screen size later */
    s_top_lines = 1;
    s_bot_lines = 1;
    s_status_cols = 3;
    s_cursor_cols = 2;

    if (s_itemnum)
	s_itemnum_cols = 3;
    else
	s_itemnum_cols = 0;

    /* (scr_width-1) keeps last character blank. */
    s_desc_cols = (scr_width-1) -s_status_cols -s_cursor_cols -s_itemnum_cols;
}
#endif /* SCAN */