/[grub]/grub/stage2/char_io.c
ViewVC logotype

Diff of /grub/stage2/char_io.c

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

revision 1.49 by okuji, Fri Nov 29 20:39:24 2002 UTC revision 1.50 by okuji, Tue Dec 3 00:02:53 2002 UTC
# Line 43  struct term_entry term_table[] = Line 43  struct term_entry term_table[] =
43        console_cls,        console_cls,
44        console_setcolorstate,        console_setcolorstate,
45        console_setcolor,        console_setcolor,
46        console_nocursor        console_setcursor
47      },      },
48  #ifdef SUPPORT_SERIAL  #ifdef SUPPORT_SERIAL
49      {      {
# Line 73  struct term_entry term_table[] = Line 73  struct term_entry term_table[] =
73        hercules_cls,        hercules_cls,
74        hercules_setcolorstate,        hercules_setcolorstate,
75        hercules_setcolor,        hercules_setcolor,
76        hercules_nocursor        hercules_setcursor
77      },            },      
78  #endif /* SUPPORT_HERCULES */  #endif /* SUPPORT_HERCULES */
79      /* This must be the last entry.  */      /* This must be the last entry.  */
# Line 790  int Line 790  int
790  get_cmdline (char *prompt, char *cmdline, int maxlen,  get_cmdline (char *prompt, char *cmdline, int maxlen,
791               int echo_char, int readline)               int echo_char, int readline)
792  {  {
793      int old_cursor;
794      int ret;
795    
796      old_cursor = setcursor (1);
797      
798    /* Because it is hard to deal with different conditions simultaneously,    /* Because it is hard to deal with different conditions simultaneously,
799       less functional cases are handled here. Assume that TERM_NO_ECHO       less functional cases are handled here. Assume that TERM_NO_ECHO
800       implies TERM_NO_EDIT.  */       implies TERM_NO_EDIT.  */
# Line 811  get_cmdline (char *prompt, char *cmdline Line 816  get_cmdline (char *prompt, char *cmdline
816          {          {
817            /* Return immediately if ESC is pressed.  */            /* Return immediately if ESC is pressed.  */
818            if (c == 27)            if (c == 27)
819              return 1;              {
820                  setcursor (old_cursor);
821                  return 1;
822                }
823    
824            /* Printable characters are added into CMDLINE.  */            /* Printable characters are added into CMDLINE.  */
825            if (c >= ' ' && c <= '~')            if (c >= ' ' && c <= '~')
# Line 829  get_cmdline (char *prompt, char *cmdline Line 837  get_cmdline (char *prompt, char *cmdline
837    
838        if (! (current_term->flags & TERM_NO_ECHO))        if (! (current_term->flags & TERM_NO_ECHO))
839          grub_putchar ('\n');          grub_putchar ('\n');
840          
841          setcursor (old_cursor);
842        return 0;        return 0;
843      }      }
844    
845    /* Complicated features are left to real_get_cmdline.  */    /* Complicated features are left to real_get_cmdline.  */
846    return real_get_cmdline (prompt, cmdline, maxlen, echo_char, readline);    ret = real_get_cmdline (prompt, cmdline, maxlen, echo_char, readline);
847      setcursor (old_cursor);
848      return ret;
849  }  }
850  #endif /* STAGE1_5 */  #endif /* STAGE1_5 */
851    
# Line 1078  cls (void) Line 1089  cls (void)
1089      current_term->cls ();      current_term->cls ();
1090  }  }
1091    
1092  void  int
1093  nocursor (void)  setcursor (int on)
1094  {  {
1095    if (current_term->nocursor)    if (current_term->setcursor)
1096      current_term->nocursor ();      return current_term->setcursor (on);
1097    
1098      return 1;
1099  }  }
1100  #endif /* ! STAGE1_5 */  #endif /* ! STAGE1_5 */
1101    

Legend:
Removed from v.1.49  
changed lines
  Added in v.1.50

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26