| 28 |
{ |
{ |
| 29 |
prints ("\r"); |
prints ("\r"); |
| 30 |
} |
} |
| 31 |
|
iflush(); |
| 32 |
} |
} |
| 33 |
|
|
| 34 |
void |
void |
| 35 |
clrtoeol () |
clrtoeol () |
| 36 |
{ |
{ |
| 37 |
prints ("\033[K"); |
prints ("\033[K"); |
| 38 |
|
iflush(); |
| 39 |
|
} |
| 40 |
|
|
| 41 |
|
void |
| 42 |
|
clearscr() |
| 43 |
|
{ |
| 44 |
|
prints ("\33[2J"); |
| 45 |
|
moveto (0,0); |
| 46 |
|
iflush(); |
| 47 |
} |
} |
| 48 |
|
|
| 49 |
int |
int |
| 108 |
int |
int |
| 109 |
display_file(const char* filename) |
display_file(const char* filename) |
| 110 |
{ |
{ |
| 111 |
char buffer[256]; |
char buffer[260]; |
| 112 |
FILE *fin; |
FILE *fin; |
| 113 |
|
int i; |
| 114 |
|
|
| 115 |
if ((fin = fopen(filename, "r")) != NULL) |
if ((fin = fopen(filename, "r")) != NULL) |
| 116 |
{ |
{ |
| 117 |
while (fgets(buffer, 255, fin)) |
while (fgets(buffer, 255, fin)) |
| 118 |
{ |
{ |
| 119 |
|
i = strlen(buffer); |
| 120 |
|
if (buffer[i-1] == '\n' && buffer[i-2] != '\r') |
| 121 |
|
{ |
| 122 |
|
buffer[i-1] = '\r'; |
| 123 |
|
buffer[i] = '\n'; |
| 124 |
|
buffer[i+1] = '\0'; |
| 125 |
|
} |
| 126 |
prints (buffer); |
prints (buffer); |
| 127 |
iflush (); |
iflush (); |
| 128 |
} |
} |
| 145 |
{ |
{ |
| 146 |
return 0; |
return 0; |
| 147 |
} |
} |
| 148 |
|
|
| 149 |
|
int |
| 150 |
|
press_any_key() |
| 151 |
|
{ |
| 152 |
|
prints (" \033[1;33m°´ÈÎÒâ¼üÅ̼ÌÐø...\033[0;37m"); |
| 153 |
|
iflush(); |
| 154 |
|
|
| 155 |
|
return igetch (); |
| 156 |
|
} |