| 1 |
/*************************************************************************** |
/*************************************************************************** |
| 2 |
screen.c - description |
screen.c - description |
| 3 |
------------------- |
------------------- |
| 4 |
begin : Mon Oct 18 2004 |
Copyright : (C) 2004-2025 by Leaflet |
| 5 |
copyright : (C) 2004 by Leaflet |
Email : leaflet@leafok.com |
|
email : leaflet@leafok.com |
|
| 6 |
***************************************************************************/ |
***************************************************************************/ |
| 7 |
|
|
| 8 |
/*************************************************************************** |
/*************************************************************************** |
| 9 |
* * |
* * |
| 10 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
| 11 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
| 12 |
* the Free Software Foundation; either version 2 of the License, or * |
* the Free Software Foundation; either version 3 of the License, or * |
| 13 |
* (at your option) any later version. * |
* (at your option) any later version. * |
| 14 |
* * |
* * |
| 15 |
***************************************************************************/ |
***************************************************************************/ |
| 201 |
{ |
{ |
| 202 |
int len; |
int len; |
| 203 |
|
|
| 204 |
|
igetch(1); // Cleanup input buffer |
| 205 |
|
|
| 206 |
moveto(row, col); |
moveto(row, col); |
| 207 |
prints(prompt); |
prints(prompt); |
| 208 |
prints(buffer); |
prints(buffer); |
| 217 |
{ |
{ |
| 218 |
char buffer[LINE_BUFFER_LEN]; |
char buffer[LINE_BUFFER_LEN]; |
| 219 |
FILE *fin; |
FILE *fin; |
| 220 |
int i; |
size_t i; |
| 221 |
|
|
| 222 |
if ((fin = fopen(filename, "r")) == NULL) |
if ((fin = fopen(filename, "r")) == NULL) |
| 223 |
{ |
{ |
| 246 |
char buffer[LINE_BUFFER_LEN]; |
char buffer[LINE_BUFFER_LEN]; |
| 247 |
int ch = 0; |
int ch = 0; |
| 248 |
int input_ok, line, max_lines; |
int input_ok, line, max_lines; |
| 249 |
long int c_line_current = 0, c_line_total = 0; |
long int c_line_current = 0; |
| 250 |
|
long int c_line_total = 0; |
| 251 |
FILE *fin; |
FILE *fin; |
| 252 |
long *p_line_offsets; |
long *p_line_offsets; |
| 253 |
int len; |
long int len; |
| 254 |
int percentile; |
long int percentile; |
| 255 |
int loop = 1; |
int loop = 1; |
| 256 |
|
|
| 257 |
if ((fin = fopen(filename, "r")) == NULL) |
if ((fin = fopen(filename, "r")) == NULL) |
| 400 |
log_error("Error length exceeds buffer size: %d\n", len); |
log_error("Error length exceeds buffer size: %d\n", len); |
| 401 |
len = LINE_BUFFER_LEN - 1; |
len = LINE_BUFFER_LEN - 1; |
| 402 |
} |
} |
| 403 |
if (fgets(buffer, len + 1, fin) == NULL) |
if (fgets(buffer, (int)len + 1, fin) == NULL) |
| 404 |
{ |
{ |
| 405 |
log_error("Reach EOF\n"); |
log_error("Reach EOF\n"); |
| 406 |
break; |
break; |
| 422 |
{ |
{ |
| 423 |
char buffer[LINE_BUFFER_LEN]; |
char buffer[LINE_BUFFER_LEN]; |
| 424 |
|
|
| 425 |
str_space(buffer, 20 - strlen(BBS_current_section_name)); |
str_space(buffer, 20 - (int)strnlen(BBS_current_section_name, sizeof(BBS_current_section_name))); |
| 426 |
|
|
| 427 |
moveto(1, 0); |
moveto(1, 0); |
| 428 |
clrtoeol(); |
clrtoeol(); |
| 442 |
struct tm *tm_online; |
struct tm *tm_online; |
| 443 |
|
|
| 444 |
get_time_str(str_time, sizeof(str_time)); |
get_time_str(str_time, sizeof(str_time)); |
| 445 |
str_space(buffer, 33 - strlen(BBS_username)); |
str_space(buffer, 33 - (int)strnlen(BBS_username, sizeof(BBS_username))); |
| 446 |
|
|
| 447 |
time_online = time(0) - BBS_login_tm; |
time_online = time(0) - BBS_login_tm; |
| 448 |
tm_online = gmtime(&time_online); |
tm_online = gmtime(&time_online); |
| 465 |
char buffer[LINE_BUFFER_LEN]; |
char buffer[LINE_BUFFER_LEN]; |
| 466 |
FILE *fin; |
FILE *fin; |
| 467 |
static int line; |
static int line; |
| 468 |
int len; |
unsigned int len; |
| 469 |
int end_of_line; |
int end_of_line; |
| 470 |
|
|
| 471 |
clrline(3, 2 + ACTIVE_BOARD_HEIGHT); |
clrline(3, 2 + ACTIVE_BOARD_HEIGHT); |