#include #include #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); bbs_motd( &ts, "art/motd.txt" ); print_build_info(); while ( 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': { bbs_motd( &ts, "art/motd.txt" ); } break; case 's': { bbs_sysinfo( &ts ); } break; case 'a': { bbs_article( &ts, "article/post1.txt" ); } break; case 'q': break; default: printf("Unknow command\n"); } } } return 0; }