You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

wininit.c 632B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #include <stddef.h>
  2. #include <curses.h>
  3. /** @file
  4. *
  5. * MuCurses initialisation functions
  6. *
  7. */
  8. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  9. /**
  10. * Initialise console environment
  11. *
  12. * @ret *win return pointer to stdscr
  13. */
  14. WINDOW *initscr ( void ) {
  15. /* determine console size */
  16. /* initialise screen */
  17. stdscr->scr->init( stdscr->scr );
  18. stdscr->height = LINES;
  19. stdscr->width = COLS;
  20. move ( 0, 0 );
  21. return stdscr;
  22. }
  23. /**
  24. * Finalise console environment
  25. *
  26. */
  27. int endwin ( void ) {
  28. attrset ( 0 );
  29. color_set ( 0, NULL );
  30. curs_set ( 1 );
  31. mvprintw ( ( LINES - 1 ), 0, "\n" );
  32. stdscr->scr->exit( stdscr->scr );
  33. return OK;
  34. }