~ubuntu-branches/ubuntu/dapper/newt/dapper-security

« back to all changes in this revision

Viewing changes to showchars.c

  • Committer: Bazaar Package Importer
  • Author(s): Junichi Uekawa
  • Date: 2002-03-31 09:38:18 UTC
  • Revision ID: james.westby@ubuntu.com-20020331093818-t3cla7103r07qnyw
Tags: upstream-0.50.17
ImportĀ upstreamĀ versionĀ 0.50.17

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <slang.h>
 
2
 
 
3
void printall(int offset) {
 
4
    int n = 0;
 
5
    int i, j;
 
6
 
 
7
    SLsmg_gotorc(0, offset);
 
8
    SLsmg_write_string("  0 1 2 3 4 5 6 7 8 9 A B C D E F");
 
9
    for (i = 0; i < 16; i++) {
 
10
        SLsmg_gotorc(i + 1, offset);
 
11
        SLsmg_printf("%x", i);
 
12
        for (j = 0; j < 16; j++) {
 
13
            SLsmg_gotorc(i + 1, (j + 1) * 2 + offset);
 
14
            SLsmg_write_char(n++);
 
15
        }
 
16
    }
 
17
}
 
18
 
 
19
int main(void) {
 
20
    char n = 0;
 
21
 
 
22
    SLtt_get_terminfo();
 
23
 
 
24
    SLtt_Use_Ansi_Colors = 1;
 
25
 
 
26
    SLsmg_init_smg();
 
27
    SLang_init_tty(4, 0, 0);
 
28
 
 
29
    SLsmg_cls();
 
30
 
 
31
    printall(0);
 
32
    SLsmg_set_char_set(1);
 
33
    printall(40);
 
34
 
 
35
    SLsmg_refresh();
 
36
    SLang_getkey();
 
37
 
 
38
    SLsmg_gotorc(SLtt_Screen_Rows - 1, 0);
 
39
    SLsmg_refresh();
 
40
    SLsmg_reset_smg();
 
41
    SLang_reset_tty();
 
42
 
 
43
    return 0;
 
44
}