?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. void putdec(int c)
  2. {
  3.   int div;
  4.   int hassent = 0;
  5.   for (div = 100; div > 0; div /= 10) {
  6.     int disp = c / div;
  7.     c %= div;
  8.     if ((disp != 0) || (hassent) || (div == 1)) {
  9.       hassent = 1;
  10.       putchar('0' + disp);
  11.     }
  12.   }
  13. }
  14.  
  15.  
  16.  
  17. void AT(int X, int Y)
  18. {
  19.   putchar(27);
  20.   putchar('[');
  21.   putdec(Y);
  22.   putchar(';');
  23.   putdec(X);
  24.   putchar('H');
  25. }
  26.  
  27. void ATRIB( int color)
  28. {
  29.   putchar(27);
  30.   putchar('[');
  31.   putdec(color);
  32.   putchar('m');
  33. }
  34.  
  35.  
  36.  
  37. void BOX(unsigned char Xbox, unsigned char Ybox, unsigned char Wbox, unsigned char Hbox, unsigned char Cbox,unsigned char character )
  38. {
  39. unsigned char x,y;
  40.   ATRIB(Cbox);
  41.   for (y = 0; y < Hbox;y++)
  42.   {
  43.           AT (Xbox,Ybox + y);
  44.           for (x = 0; x < Wbox;x++)
  45.           {
  46.                 putchar(character);  
  47.           }
  48.   }
  49. }
  50.