summaryrefslogtreecommitdiffstats
path: root/articles.c
diff options
context:
space:
mode:
Diffstat (limited to 'articles.c')
-rw-r--r--articles.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/articles.c b/articles.c
index a5c196b..08f115a 100644
--- a/articles.c
+++ b/articles.c
@@ -24,7 +24,7 @@ int bbs_article( term_screen *ts, const char *fname )
f = fopen( fname, "r" );
if ( f == NULL )
{
- printf("Cannot open article file\n");
+ term_printf( ts, "Cannot open article file\n");
return -1;
}
@@ -47,7 +47,7 @@ int bbs_article( term_screen *ts, const char *fname )
{
term_cur_set_c( ts, 0 );
term_cur_set_r( ts, max_row );
- printf("(N)ext,(D)ump,(Q)uit:"); fflush( stdout );
+ term_printf( ts, "(N)ext,(D)ump,(Q)uit:");
menu_input = term_getc( ts );
//if something whent wrong dont know why, need to get some test case
@@ -76,7 +76,7 @@ int bbs_article( term_screen *ts, const char *fname )
while( (tmp_size = getline(&dump_line, &dump_line_size, f)) != -1 )
{
term_cur_set_c( ts, 0 );
- printf("%s", dump_line);
+ term_printf( ts, "%s", dump_line);
}
FREE( dump_line );
term_getc( ts );
@@ -84,7 +84,7 @@ int bbs_article( term_screen *ts, const char *fname )
i = 0;
break;
default:
- printf("Try more\n");
+ term_printf( ts, "Try more\n");
}
}
@@ -160,7 +160,7 @@ int bbs_article_list( term_screen *ts, const char *dir_name )
free( eps );
} else
{
- printf("Err\n");
+ term_printf( ts, "Err\n");
ERROR("Cannot open article directory\n");
}
ret = 0;
@@ -172,12 +172,12 @@ int bbs_article_list( term_screen *ts, const char *dir_name )
{
term_clr_scr( ts );
term_cur_set_c( ts, 0 );
- printf("(L)ist articles,(R)read article,(Q)uit");
+ term_printf( ts, "(L)ist articles,(R)read article,(Q)uit");
fflush( stdout );
term_cur_set_c( ts, 0 );
term_cur_set_r( ts, term_get_maxrow( ts ) );
- printf(":"); fflush( stdout );
+ term_printf( ts, ":");
menu_input = term_getc( ts );
//if something whent wrong dont know why, need to get some test case
@@ -206,7 +206,7 @@ int bbs_article_list( term_screen *ts, const char *dir_name )
//get stat structure and get filesize
stat( iter->val, &art_stat );//no err check
- printf( "[%02d] %s ( %ld bytes)\n", cnt, (char *)iter->val, art_stat.st_size );
+ term_printf( ts, "[%02d] %s ( %ld bytes)\n", cnt, (char *)iter->val, art_stat.st_size );
cnt += 1;
iter = iter->next;
}
@@ -219,7 +219,7 @@ int bbs_article_list( term_screen *ts, const char *dir_name )
//while there is no more 10 articles use only 1 number
//TODO fix that
term_cur_set_c( ts, 0 );
- printf("Input article number 1-9:"); fflush( stdout );
+ term_printf( ts, "Input article number 1-9:");
int article_input = term_getc( ts );
//if something whent wrong dont know why, need to get some test case
char article_number = (char)article_input-'0';
@@ -242,7 +242,7 @@ int bbs_article_list( term_screen *ts, const char *dir_name )
}
break;
default:
- printf("Try more\n");
+ term_printf( ts, "Try more\n");
}
}
//needed special care to free sds strings