blob: 3624671127dfc82735160baa2b2bd1827bc76722 (
plain) (
blame)
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
|
#include <stdio.h>
#include <stdlib.h>
#include "logs.h"
#include "motd.h"
#include "libterm/term.h"
int main( int argc, char **argv )
{
int ret_len;
size_t str_size=128;
char *str=malloc(str_size);
term_screen ts;
term_init_data( &ts );
//printf("%d %d\n", ts.term_col, ts.term_row);
//write to log that some user have accesed bbs
bbs_log( NULL ); //write to default place
bbs_motd( &ts, "art/motd.txt" );
print_build_info();
while ( strncmp( str, "q", 1 ) && strncmp( str, "Q", 1 ) )
{
printf("(M)otd (Q)uit (S)ysinfo (A)rticles: ");
ret_len = getline( &str, &str_size, stdin );
if ( ret_len > 0)
{
switch ( str[0] )
{
case 'm':
case 'M':
{
bbs_motd( &ts, "art/motd.txt" );
}
break;
case 's':
case 'S':
{
bbs_sysinfo( &ts );
}
break;
case 'a':
case 'A':
{
bbs_article( &ts, "article/post1.txt" );
}
break;
case 'q':
case 'Q':
bbs_log_quit( NULL );
break;
default:
printf("Unknow command\n");
}
}
}
return 0;
}
|