/[LeafOK_CVS]/lbbs/src/screen.c
ViewVC logotype

Diff of /lbbs/src/screen.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.1 by sysadm, Fri Oct 22 15:21:28 2004 UTC Revision 1.4 by sysadm, Fri Oct 22 19:51:01 2004 UTC
# Line 28  moveto (int row, int col) Line 28  moveto (int row, int col)
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
# Line 98  str_input (char *buffer, int buffer_leng Line 108  str_input (char *buffer, int buffer_leng
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      }      }
# Line 127  show_bottom() Line 145  show_bottom()
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    }


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1