?login_element?

Subversion Repositories NedoOS

Rev

Rev 2130 | Blame | Compare with Previous | Last modification | View Log | Download

  1. void putdec(int c)
  2. {
  3.   int div;
  4.   int hassent = 0;
  5.   for (div = 100; div > 0; div /= 10)
  6.   {
  7.     int disp = c / div;
  8.     c %= div;
  9.     if ((disp != 0) || (hassent) || (div == 1))
  10.     {
  11.       hassent = 1;
  12.       putchar('0' + disp);
  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 CLS(void)
  28. {
  29.   char count;
  30.   putchar('\r');
  31.   for (count = 0; count < 26; count++)
  32.   {
  33.     putchar(27);
  34.     putchar('[');
  35.     putchar('K');
  36.     putchar(0x0d);
  37.     putchar(0x0a);
  38.   }
  39.   AT(1, 1);
  40. }
  41.  
  42. void ATRIB(int color)
  43. {
  44.   putchar(27);
  45.   putchar('[');
  46.   putdec(color);
  47.   putchar('m');
  48. }
  49.  
  50. void BOX(unsigned char Xbox, unsigned char Ybox, unsigned char Wbox, unsigned char Hbox, unsigned char Cbox, unsigned char character)
  51. {
  52.   unsigned char x, y;
  53.   ATRIB(Cbox);
  54.   for (y = 0; y < Hbox; y++)
  55.   {
  56.     AT(Xbox, Ybox + y);
  57.     for (x = 0; x < Wbox; x++)
  58.     {
  59.       putchar(character);
  60.     }
  61.   }
  62. }
  63.  
  64. void BDBOX(unsigned char Xbox, unsigned char Ybox, unsigned char Wbox, unsigned char Hbox, unsigned char Cbox, unsigned char character)
  65. {
  66.   unsigned char x, y;
  67.   OS_SETCOLOR(Cbox);
  68.   for (y = 0; y < Hbox; y++)
  69.   {
  70.     OS_SETXY(Xbox, Ybox + y);
  71.     for (x = 0; x < Wbox; x++)
  72.     {
  73.       putchar(character);
  74.     }
  75.   }
  76. }